-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
Feature/rfc7662 oauth2 token introspection #36
Feature/rfc7662 oauth2 token introspection #36
Conversation
self._client = None | ||
self._token = None | ||
|
||
def authenticate_revocation_endpoint_client(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method name should be authenticate_ introspection_endpoint_client
authlib/specs/rfc7009/__init__.py
Outdated
@@ -14,3 +14,4 @@ | |||
from .parameters import prepare_revoke_token_request | |||
from .errors import UnsupportedTokenTypeError | |||
from .revocation import RevocationEndpoint | |||
from .registry import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from .registry import OAUTH_TOKEN_TYPE_HINTS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not make any changes in revocation spec. You can add a SUPPORTED_TOKEN_TYPES
in IntrospectionEndpoint itself. In this way, people can custom the SUPPORTED_TOKEN_TYPES
with a subclass.
def introspect_token(self, token): | ||
"""Read given token and return its introspection metadata as a | ||
dictionary following RFC7662 keys. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove blank line
|
||
:returns: (status_code, body, headers) | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove blank line
"""Constructor for | ||
:class:`authlib.specs.rfc7662.IntrospectionEndpoint`. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no doc string in __init__
:class:`~authlib.specs.rfc6749.ClientMixin`. | ||
|
||
.. _RFC7662: https://tools.ietf.org/html/rfc7662 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove blank line
"""Get the token from database/storage by the given token string. | ||
Developers should implement this method:: | ||
|
||
def query_token(self, token, token_type_hint, client): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example doesn't match the method interface.
I'd rather not make any changes in revocation spec. You can add a SUPPORTED_TOKEN_TYPES in IntrospectionEndpoint itself. In this way, people can custom the SUPPORTED_TOKEN_TYPES with a subclass. |
|
||
self._token = self.query_token( | ||
params['token'], | ||
{k: v for k, v in params.items() if k != 'token'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that query_token
need a client parameter.
First implementation of the token introspection endpoint as defined in RFC7662. The implementation is mostly a copy paste of the implementation of RFC7009. Signed-off-by: Jimmy Thrasibule <[email protected]>
This will hold on for a while. I'm planning a lot of things in v0.6. It will get merged when I get things ready. Thank you. |
OK. Anything else I can do? |
What kind of change does this PR introduce? (check at least one)
Implementation of RFC7662 (#33).