Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register several endpoints of a kind #576

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

azmeuk
Copy link
Collaborator

@azmeuk azmeuk commented Sep 5, 2023

I am currently tackling #427 and I realize it would be easier for me if one could register several endpoints of a kind. For instance one JWTAccessTokenIntrospectionEndpoint that would read the introspection data from the JWT access token, and a regular IntrospectionEndpoint for the other kind of tokens.

With this patch, if JWTAccessTokenIntrospectionEndpoint would meet a plain-text access token, it would raise a ContinueIteration exception and pass to the IntrospectionEndpoint. Same if the token_hint is a refresh token for instance (RFC9068 is only about access tokens).

This would also help for the revokation endpoint.

What do you think?

AuthorizationServer.register_endpoint can be called several times for
one kind of endpoint.
@azmeuk azmeuk force-pushed the multiple-endpoints branch 4 times, most recently from 019e97a to 555197f Compare September 5, 2023 16:45
@azmeuk
Copy link
Collaborator Author

azmeuk commented Sep 7, 2023

An alternative to this would be to implement register_introspection_endpoint and register_revokation_endpoint with an optional token_type parameter, in the fashion of register_token_generator. However that would be a breaking change.
What do you think @lepture?

@lepture
Copy link
Owner

lepture commented Sep 13, 2023

@azmeuk I think your implementation looks good. Would you like to add endpoints in this branch, or let me merge it at first?

@azmeuk
Copy link
Collaborator Author

azmeuk commented Sep 13, 2023

We can merge this now so the branch diff will be easier to read.

@lepture lepture merged commit e853408 into lepture:master Sep 13, 2023
6 checks passed
@lepture
Copy link
Owner

lepture commented Sep 13, 2023

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants