diff options
author | Jonathan Huot <JonathanHuot@users.noreply.github.com> | 2019-08-30 11:56:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-30 11:56:43 +0200 |
commit | ca57b0bcae835493d9db8f9bf1f1228b71b8e3f8 (patch) | |
tree | 71f3d2ecee2ffd32da6f030558d0eed91d953895 /oauthlib/oauth2/rfc6749/grant_types | |
parent | 1f3fc4bfd4fd51711798186591bf3e3ba5a894be (diff) | |
parent | 11bf0eca2857f5330237e574630dd916d53cd573 (diff) | |
download | oauthlib-ca57b0bcae835493d9db8f9bf1f1228b71b8e3f8.tar.gz |
Merge pull request #700 from hugovk/rm-2.7
Drop support for Python 2.7
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types')
7 files changed, 4 insertions, 18 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/__init__.py b/oauthlib/oauth2/rfc6749/grant_types/__init__.py index 2ec8e4f..30c90d7 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/__init__.py +++ b/oauthlib/oauth2/rfc6749/grant_types/__init__.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import unicode_literals, absolute_import - from .authorization_code import AuthorizationCodeGrant from .implicit import ImplicitGrant from .resource_owner_password_credentials import ResourceOwnerPasswordCredentialsGrant diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py index 9b84c4c..f4bde86 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py +++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import base64 import hashlib import json diff --git a/oauthlib/oauth2/rfc6749/grant_types/base.py b/oauthlib/oauth2/rfc6749/grant_types/base.py index f0772e2..66e1fd1 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/base.py +++ b/oauthlib/oauth2/rfc6749/grant_types/base.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import logging from itertools import chain @@ -17,7 +15,7 @@ from ..request_validator import RequestValidator log = logging.getLogger(__name__) -class ValidatorsContainer(object): +class ValidatorsContainer: """ Container object for holding custom validator callables to be invoked as part of the grant type `validate_authorization_request()` or @@ -74,7 +72,7 @@ class ValidatorsContainer(object): return chain(self.post_auth, self.post_token) -class GrantTypeBase(object): +class GrantTypeBase: error_uri = None request_validator = None default_response_mode = 'fragment' diff --git a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py index 7e50857..fdb0bf6 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py +++ b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import json import logging diff --git a/oauthlib/oauth2/rfc6749/grant_types/implicit.py b/oauthlib/oauth2/rfc6749/grant_types/implicit.py index 48bae7a..335e58c 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/implicit.py +++ b/oauthlib/oauth2/rfc6749/grant_types/implicit.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import logging from oauthlib import common diff --git a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py index fc61d65..e7405d2 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py +++ b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import json import logging @@ -25,7 +23,7 @@ class RefreshTokenGrant(GrantTypeBase): def __init__(self, request_validator=None, issue_new_refresh_tokens=True, **kwargs): - super(RefreshTokenGrant, self).__init__( + super().__init__( request_validator, issue_new_refresh_tokens=issue_new_refresh_tokens, **kwargs) @@ -126,7 +124,7 @@ class RefreshTokenGrant(GrantTypeBase): if request.scope: request.scopes = utils.scope_to_list(request.scope) - if (not all((s in original_scopes for s in request.scopes)) + if (not all(s in original_scopes for s in request.scopes) and not self.request_validator.is_within_original_scope( request.scopes, request.refresh_token, request)): log.debug('Refresh token %s lack requested scopes, %r.', diff --git a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py index 5929afb..9c8ee1d 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py +++ b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py @@ -3,8 +3,6 @@ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import, unicode_literals - import json import logging |