Closed tdg5 closed 1 year ago
Merging #75 (871f762) into master (48896f2) will increase coverage by
0.00%
. The diff coverage is100.00%
.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@ Coverage Diff @@
## master #75 +/- ##
=======================================
Coverage 98.78% 98.78%
=======================================
Files 14 14
Lines 658 659 +1
Branches 99 99
=======================================
+ Hits 650 651 +1
Misses 4 4
Partials 4 4
Impacted Files | Coverage Δ | |
---|---|---|
aioauth/requests.py | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
This PR currently reflects the bare minimum needed to make this library play nicely with the prompt query parameter, but I'd be happy to add some validation of the prompt query parameter to AuthorizationCodeGrantType.validate_request if you are open to aioauth including some basic support for the prompt query param.
sure, approved. you can add the implementation within this or next PR.
I'm still evaluating how I want to extend this. I'm fine to keep this PR open if it's all the same to you.
I've been thinking this over a bit today and I'm inclined to say that the way that authlib
and oauthlib
handle the different standards they support is what I'd recommend for this library as well: handle concerns specific to one standard in a standard specific class. A feature flag for OIDC
begets a feature flag for RFC6750
and so on. We'd be falling into the trap that this refactoring aims to remedy: Replace conditional with polymorphism. It also would make tests more annoying by increasing the number of standard specific configuration standards that need to be tested.
So, though what I've suggested in this PR is simple, I'd argue that it moves this library a small step in the wrong direction. What I would instead propose is beginning to migrate the OIDC specific behaviors into OIDC specific subclasses. I get the impression that creating a new subclass of Query
and a new subclass of BaseRequest
would do the trick, however it runs into a problem at the level of aioauth-fastapi
which is fixed on using the standard Request
, Query
, and Post
classes. But that's a problem for that repo.
@aliev, I've updated this PR in such a way as to begin the road toward handling standard specific behaviors in standard specific subclasses for various components. Let me know what you think. If you're happy with what's here, I'd request that you merge this PR and I can use it as a base for migrating some of the id_token
work I have open in #76.
I'm still trying to figure out what needs to happen in EDIT: I think I've resolved how this would work with aioauth-fastapi
to make it better able to work with standard specific subclasses, but I don't think that's something that needs to block this PR.aioauth-fastapi
via https://github.com/aliev/aioauth-fastapi/pull/10
@aliev , I think this is ready for your review whenever you have the opportunity.
@aliev, I don't mean to rush you on this, but I want to make sure we're aligned on what's possible here.
I know that you granted me some kind of permissions for this repo, but I'm not able to move this code forward without a review from a code owner.
If you intend to get to this PR and haven't had a chance, that is totally cool, but I just want to make sure you're not expecting me to take care of this on my own.
@aliev, I don't mean to rush you on this, but I want to make sure we're aligned on what's possible here.
I know that you granted me some kind of permissions for this repo, but I'm not able to move this code forward without a review from a code owner.
I have added you as a collaborator so that the pipelines can run automatically without my approval.
If you intend to get to this PR and haven't had a chance, that is totally cool, but I just want to make sure you're not expecting me to take care of this on my own.
Sorry for the delay. Please give me some time, I will double-check the entire changes.
@aliev , thanks for clarifying! There's really no rush, I just wanted to make sure you didn't expect me to take action on my own.
I approved this PR and will merge it. Overall, everything looks good. The only thing I would suggest is to add a docstring to the prompt
field and the Query
class in the aioauth/oidc/core/requests.py
file, with a reference to the specification.
However, I think this can be done in your next PR, so as not to delay your progress.
The OpenID Connect Core spec defines an extension to the authorization code grant type that allows that grant type to take an optional
prompt
query parameter that allows the client to have more control over how the auth server handles an authorization code request in scenarios where the user is not signed in or has not consented to all the scopes.I think the handling of the
prompt
query argument is the responsibility of whomever is using this library, but I wonder if you'd be open to adding some support for theprompt
query argument to this library. I tried to handleprompt
without getting this library involved, butstarlette
'sQueryParams
class is immutable, so I don't have a good means of removing theprompt
query argument from the request before passing the request on to this library.This PR currently reflects the bare minimum needed to make this library play nicely with the
prompt
query parameter, but I'd be happy to add some validation of theprompt
query parameter toAuthorizationCodeGrantType.validate_request
if you are open toaioauth
including some basic support for theprompt
query param.Here's what the OIDC Core spec has to say about
prompt
: