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

Merged
merged 2 commits into from Mar 10, 2018

Conversation

Projects
None yet
2 participants
@spack971
Contributor

spack971 commented Mar 6, 2018

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Other, please describe:

  • You consent that the copyright of your pull request source code belongs to Authlib's author.

Implementation of RFC7662 (#33).

self._client = None
self._token = None
def authenticate_revocation_endpoint_client(self):

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

method name should be authenticate_ introspection_endpoint_client

@@ -14,3 +14,4 @@
from .parameters import prepare_revoke_token_request
from .errors import UnsupportedTokenTypeError
from .revocation import RevocationEndpoint
from .registry import *

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner
from .registry import OAUTH_TOKEN_TYPE_HINTS

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

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.

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

remove blank line

:returns: (status_code, body, headers)
"""

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

remove blank line

"""Constructor for
:class:`authlib.specs.rfc7662.IntrospectionEndpoint`.
"""

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

no doc string in __init__

:class:`~authlib.specs.rfc6749.ClientMixin`.
.. _RFC7662: https://tools.ietf.org/html/rfc7662

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

remove blank line

@spack971 spack971 force-pushed the spack971:feature/RFC7662-oauth2-token-introspection branch from a497ddf to 1ad9084 Mar 6, 2018

"""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):

This comment has been minimized.

@lepture

lepture Mar 6, 2018

Owner

example doesn't match the method interface.

@lepture

This comment has been minimized.

Owner

lepture commented Mar 6, 2018

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.

@spack971 spack971 force-pushed the spack971:feature/RFC7662-oauth2-token-introspection branch 2 times, most recently from 6164516 to 044d2e5 Mar 6, 2018

self._token = self.query_token(
params['token'],
{k: v for k, v in params.items() if k != 'token'}

This comment has been minimized.

@lepture

lepture Mar 7, 2018

Owner

It seems that query_token need a client parameter.

rfc7662: Implement token introspection endpoint
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 <jimmy@thrasibule.mx>

@spack971 spack971 force-pushed the spack971:feature/RFC7662-oauth2-token-introspection branch from 044d2e5 to b0b37ed Mar 7, 2018

@lepture lepture added this to the Version 0.6 milestone Mar 8, 2018

@lepture lepture added spec feature and removed spec labels Mar 8, 2018

@lepture

This comment has been minimized.

Owner

lepture commented Mar 8, 2018

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.

@spack971

This comment has been minimized.

Contributor

spack971 commented Mar 8, 2018

OK. Anything else I can do?

@lepture lepture merged commit 5d8c417 into lepture:master Mar 10, 2018

2 checks passed

codecov/project 83.47% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment