diff options
Diffstat (limited to 'oauthlib/oauth2')
-rw-r--r-- | oauthlib/oauth2/draft25/__init__.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/draft25/exceptions.py | 4 | ||||
-rw-r--r-- | oauthlib/oauth2/draft25/utils.py | 1 | ||||
-rw-r--r-- | oauthlib/oauth2/ext/flask.py | 8 |
4 files changed, 8 insertions, 7 deletions
diff --git a/oauthlib/oauth2/draft25/__init__.py b/oauthlib/oauth2/draft25/__init__.py index 5987b3e..53370a7 100644 --- a/oauthlib/oauth2/draft25/__init__.py +++ b/oauthlib/oauth2/draft25/__init__.py @@ -1310,7 +1310,7 @@ class WebApplicationServer(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoin class MobileApplicationServer(AuthorizationEndpoint, ResourceEndpoint): """An all-in-one endpoint featuring Implicit code grant and Bearer tokens.""" - def __init__(self, request_validator, token_generator=None, + def __init__(self, request_validator, token_generator=None, token_expires_in=None, **kwargs): implicit_grant = grant_types.ImplicitGrant(request_validator) bearer = tokens.BearerToken(request_validator, token_generator, diff --git a/oauthlib/oauth2/draft25/exceptions.py b/oauthlib/oauth2/draft25/exceptions.py index 01a089d..81e1b9f 100644 --- a/oauthlib/oauth2/draft25/exceptions.py +++ b/oauthlib/oauth2/draft25/exceptions.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + class InvalidClientIdentifier(Exception): def __init__(self, client_identifier): self.client_identifier = client_identifier @@ -10,9 +11,10 @@ class InvalidClientIdentifier(Exception): def __str__(self): return unicode(self).encode('utf-8') + class MissingRedirectURI(Exception): pass + class InvalidRedirectURI(Exception): pass - diff --git a/oauthlib/oauth2/draft25/utils.py b/oauthlib/oauth2/draft25/utils.py index 4e17c17..0a8aab5 100644 --- a/oauthlib/oauth2/draft25/utils.py +++ b/oauthlib/oauth2/draft25/utils.py @@ -80,4 +80,3 @@ def generate_age(issue_time): td = datetime.datetime.now() - issue_time age = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 return unicode_type(age) - diff --git a/oauthlib/oauth2/ext/flask.py b/oauthlib/oauth2/ext/flask.py index 1c7734c..d6437a2 100644 --- a/oauthlib/oauth2/ext/flask.py +++ b/oauthlib/oauth2/ext/flask.py @@ -15,13 +15,13 @@ log = logging.getLogger('oauthlib') class OAuth2ProviderDecorator(object): - def __init__(self, error_uri,server=None,authorization_endpoint=None, - token_endpoint=None, resource_endpoint=None): + def __init__(self, error_uri, server=None, authorization_endpoint=None, + token_endpoint=None, resource_endpoint=None): self._authorization_endpoint = authorization_endpoint or server self._token_endpoint = token_endpoint or server self._resource_endpoint = resource_endpoint or server self._error_uri = error_uri - + def __getattr__(self, name): ctx = stack.top if ctx is not None: @@ -30,7 +30,7 @@ class OAuth2ProviderDecorator(object): return getattr(ctx, oauth_name) except AttributeError: return None - return None + return None def _set_ctx(self, name, value): ctx = stack.top |