summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749
diff options
context:
space:
mode:
Diffstat (limited to 'oauthlib/oauth2/rfc6749')
-rw-r--r--oauthlib/oauth2/rfc6749/__init__.py9
-rw-r--r--oauthlib/oauth2/rfc6749/clients/__init__.py8
-rw-r--r--oauthlib/oauth2/rfc6749/clients/backend_application.py2
-rw-r--r--oauthlib/oauth2/rfc6749/clients/base.py12
-rw-r--r--oauthlib/oauth2/rfc6749/clients/legacy_application.py2
-rw-r--r--oauthlib/oauth2/rfc6749/clients/service_application.py2
-rw-r--r--oauthlib/oauth2/rfc6749/clients/web_application.py7
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/__init__.py11
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/base.py9
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/introspect.py2
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/metadata.py7
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/pre_configured.py9
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/revocation.py2
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/__init__.py6
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/base.py2
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/client_credentials.py1
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/refresh_token.py1
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py1
-rw-r--r--oauthlib/oauth2/rfc6749/parameters.py9
-rw-r--r--oauthlib/oauth2/rfc6749/tokens.py5
-rw-r--r--oauthlib/oauth2/rfc6749/utils.py3
21 files changed, 53 insertions, 57 deletions
diff --git a/oauthlib/oauth2/rfc6749/__init__.py b/oauthlib/oauth2/rfc6749/__init__.py
index 1c11234..1823e9e 100644
--- a/oauthlib/oauth2/rfc6749/__init__.py
+++ b/oauthlib/oauth2/rfc6749/__init__.py
@@ -9,10 +9,9 @@ for consuming and providing OAuth 2.0 RFC6749.
import functools
import logging
-from .endpoints.base import BaseEndpoint
-from .endpoints.base import catch_errors_and_unavailability
-from .errors import TemporarilyUnavailableError, ServerError
-from .errors import FatalClientError, OAuth2Error
-
+from .endpoints.base import BaseEndpoint, catch_errors_and_unavailability
+from .errors import (
+ FatalClientError, OAuth2Error, ServerError, TemporarilyUnavailableError,
+)
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/clients/__init__.py b/oauthlib/oauth2/rfc6749/clients/__init__.py
index 6fef738..8fc6c95 100644
--- a/oauthlib/oauth2/rfc6749/clients/__init__.py
+++ b/oauthlib/oauth2/rfc6749/clients/__init__.py
@@ -6,9 +6,9 @@ oauthlib.oauth2.rfc6749
This module is an implementation of various logic needed
for consuming OAuth 2.0 RFC6749.
"""
-from .base import Client, AUTH_HEADER, URI_QUERY, BODY
-from .web_application import WebApplicationClient
-from .mobile_application import MobileApplicationClient
-from .legacy_application import LegacyApplicationClient
from .backend_application import BackendApplicationClient
+from .base import AUTH_HEADER, BODY, URI_QUERY, Client
+from .legacy_application import LegacyApplicationClient
+from .mobile_application import MobileApplicationClient
from .service_application import ServiceApplicationClient
+from .web_application import WebApplicationClient
diff --git a/oauthlib/oauth2/rfc6749/clients/backend_application.py b/oauthlib/oauth2/rfc6749/clients/backend_application.py
index 5ffe6ae..0e2a829 100644
--- a/oauthlib/oauth2/rfc6749/clients/backend_application.py
+++ b/oauthlib/oauth2/rfc6749/clients/backend_application.py
@@ -6,7 +6,7 @@ oauthlib.oauth2.rfc6749
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
-from ..parameters import parse_token_response, prepare_token_request
+from ..parameters import prepare_token_request
from .base import Client
diff --git a/oauthlib/oauth2/rfc6749/clients/base.py b/oauthlib/oauth2/rfc6749/clients/base.py
index 04dabe6..4147140 100644
--- a/oauthlib/oauth2/rfc6749/clients/base.py
+++ b/oauthlib/oauth2/rfc6749/clients/base.py
@@ -11,11 +11,13 @@ import warnings
from oauthlib.common import generate_token
from oauthlib.oauth2.rfc6749 import tokens
-from oauthlib.oauth2.rfc6749.errors import (InsecureTransportError,
- TokenExpiredError)
-from oauthlib.oauth2.rfc6749.parameters import (parse_token_response,
- prepare_token_request,
- prepare_token_revocation_request)
+from oauthlib.oauth2.rfc6749.errors import (
+ InsecureTransportError, TokenExpiredError,
+)
+from oauthlib.oauth2.rfc6749.parameters import (
+ parse_token_response, prepare_token_request,
+ prepare_token_revocation_request,
+)
from oauthlib.oauth2.rfc6749.utils import is_secure_transport
AUTH_HEADER = 'auth_header'
diff --git a/oauthlib/oauth2/rfc6749/clients/legacy_application.py b/oauthlib/oauth2/rfc6749/clients/legacy_application.py
index 1bb0e14..51ba28c 100644
--- a/oauthlib/oauth2/rfc6749/clients/legacy_application.py
+++ b/oauthlib/oauth2/rfc6749/clients/legacy_application.py
@@ -6,7 +6,7 @@ oauthlib.oauth2.rfc6749
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
-from ..parameters import parse_token_response, prepare_token_request
+from ..parameters import prepare_token_request
from .base import Client
diff --git a/oauthlib/oauth2/rfc6749/clients/service_application.py b/oauthlib/oauth2/rfc6749/clients/service_application.py
index 09fc7ba..79ac48d 100644
--- a/oauthlib/oauth2/rfc6749/clients/service_application.py
+++ b/oauthlib/oauth2/rfc6749/clients/service_application.py
@@ -10,7 +10,7 @@ import time
from oauthlib.common import to_unicode
-from ..parameters import parse_token_response, prepare_token_request
+from ..parameters import prepare_token_request
from .base import Client
diff --git a/oauthlib/oauth2/rfc6749/clients/web_application.py b/oauthlib/oauth2/rfc6749/clients/web_application.py
index aedc9d1..14026e3 100644
--- a/oauthlib/oauth2/rfc6749/clients/web_application.py
+++ b/oauthlib/oauth2/rfc6749/clients/web_application.py
@@ -8,9 +8,10 @@ for consuming and providing OAuth 2.0 RFC6749.
"""
import warnings
-from ..parameters import (parse_authorization_code_response,
- parse_token_response, prepare_grant_uri,
- prepare_token_request)
+from ..parameters import (
+ parse_authorization_code_response, prepare_grant_uri,
+ prepare_token_request,
+)
from .base import Client
diff --git a/oauthlib/oauth2/rfc6749/endpoints/__init__.py b/oauthlib/oauth2/rfc6749/endpoints/__init__.py
index 49e7ee9..851853f 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/__init__.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/__init__.py
@@ -9,11 +9,10 @@ for consuming and providing OAuth 2.0 RFC6749.
from .authorization import AuthorizationEndpoint
from .introspect import IntrospectEndpoint
from .metadata import MetadataEndpoint
-from .token import TokenEndpoint
+from .pre_configured import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ Server, WebApplicationServer,
+)
from .resource import ResourceEndpoint
from .revocation import RevocationEndpoint
-from .pre_configured import Server
-from .pre_configured import WebApplicationServer
-from .pre_configured import MobileApplicationServer
-from .pre_configured import LegacyApplicationServer
-from .pre_configured import BackendApplicationServer
+from .token import TokenEndpoint
diff --git a/oauthlib/oauth2/rfc6749/endpoints/base.py b/oauthlib/oauth2/rfc6749/endpoints/base.py
index 5169517..e59d401 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/base.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/base.py
@@ -9,11 +9,10 @@ for consuming and providing OAuth 2.0 RFC6749.
import functools
import logging
-from ..errors import (FatalClientError, OAuth2Error, ServerError,
- TemporarilyUnavailableError, InvalidRequestError,
- InvalidClientError, UnsupportedTokenTypeError)
-
-from oauthlib.common import CaseInsensitiveDict, urldecode
+from ..errors import (
+ FatalClientError, InvalidClientError, InvalidRequestError, OAuth2Error,
+ ServerError, TemporarilyUnavailableError, UnsupportedTokenTypeError,
+)
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/endpoints/introspect.py b/oauthlib/oauth2/rfc6749/endpoints/introspect.py
index bad8950..1199031 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/introspect.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/introspect.py
@@ -12,7 +12,7 @@ import logging
from oauthlib.common import Request
-from ..errors import OAuth2Error, UnsupportedTokenTypeError
+from ..errors import OAuth2Error
from .base import BaseEndpoint, catch_errors_and_unavailability
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/endpoints/metadata.py b/oauthlib/oauth2/rfc6749/endpoints/metadata.py
index 6bc078d..815f4b0 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/metadata.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/metadata.py
@@ -11,13 +11,12 @@ import copy
import json
import logging
-from .base import BaseEndpoint, catch_errors_and_unavailability
+from .. import grant_types
from .authorization import AuthorizationEndpoint
+from .base import BaseEndpoint, catch_errors_and_unavailability
from .introspect import IntrospectEndpoint
-from .token import TokenEndpoint
from .revocation import RevocationEndpoint
-from .. import grant_types
-
+from .token import TokenEndpoint
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py b/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
index 7b17dc4..0130f9e 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
@@ -6,11 +6,10 @@ oauthlib.oauth2.rfc6749.endpoints.pre_configured
This module is an implementation of various endpoints needed
for providing OAuth 2.0 RFC6749 servers.
"""
-from ..grant_types import (AuthorizationCodeGrant,
- ClientCredentialsGrant,
- ImplicitGrant,
- RefreshTokenGrant,
- ResourceOwnerPasswordCredentialsGrant)
+from ..grant_types import (
+ AuthorizationCodeGrant, ClientCredentialsGrant, ImplicitGrant,
+ RefreshTokenGrant, ResourceOwnerPasswordCredentialsGrant,
+)
from ..tokens import BearerToken
from .authorization import AuthorizationEndpoint
from .introspect import IntrospectEndpoint
diff --git a/oauthlib/oauth2/rfc6749/endpoints/revocation.py b/oauthlib/oauth2/rfc6749/endpoints/revocation.py
index ed245f3..0eb25d3 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/revocation.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/revocation.py
@@ -11,7 +11,7 @@ import logging
from oauthlib.common import Request
-from ..errors import OAuth2Error, UnsupportedTokenTypeError
+from ..errors import OAuth2Error
from .base import BaseEndpoint, catch_errors_and_unavailability
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/grant_types/__init__.py b/oauthlib/oauth2/rfc6749/grant_types/__init__.py
index 30c90d7..195cd09 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/__init__.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/__init__.py
@@ -4,7 +4,9 @@ oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from .authorization_code import AuthorizationCodeGrant
-from .implicit import ImplicitGrant
-from .resource_owner_password_credentials import ResourceOwnerPasswordCredentialsGrant
from .client_credentials import ClientCredentialsGrant
+from .implicit import ImplicitGrant
from .refresh_token import RefreshTokenGrant
+from .resource_owner_password_credentials import (
+ ResourceOwnerPasswordCredentialsGrant,
+)
diff --git a/oauthlib/oauth2/rfc6749/grant_types/base.py b/oauthlib/oauth2/rfc6749/grant_types/base.py
index 66e1fd1..51ba81b 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/base.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/base.py
@@ -7,8 +7,8 @@ import logging
from itertools import chain
from oauthlib.common import add_params_to_uri
-from oauthlib.uri_validate import is_absolute_uri
from oauthlib.oauth2.rfc6749 import errors, utils
+from oauthlib.uri_validate import is_absolute_uri
from ..request_validator import RequestValidator
diff --git a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
index 05f13af..d2c0ea4 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
@@ -7,7 +7,6 @@ import json
import logging
from .. import errors
-from ..request_validator import RequestValidator
from .base import GrantTypeBase
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
index e7405d2..cc0ad0d 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
@@ -7,7 +7,6 @@ import json
import logging
from .. import errors, utils
-from ..request_validator import RequestValidator
from .base import GrantTypeBase
log = logging.getLogger(__name__)
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 9c8ee1d..b65b3e7 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
@@ -7,7 +7,6 @@ import json
import logging
from .. import errors
-from ..request_validator import RequestValidator
from .base import GrantTypeBase
log = logging.getLogger(__name__)
diff --git a/oauthlib/oauth2/rfc6749/parameters.py b/oauthlib/oauth2/rfc6749/parameters.py
index 54c8d24..b5d5f41 100644
--- a/oauthlib/oauth2/rfc6749/parameters.py
+++ b/oauthlib/oauth2/rfc6749/parameters.py
@@ -10,14 +10,15 @@ This module contains methods related to `Section 4`_ of the OAuth 2 RFC.
import json
import os
import time
+import urllib.parse as urlparse
from oauthlib.common import add_params_to_qs, add_params_to_uri
from oauthlib.signals import scope_changed
-import urllib.parse as urlparse
-from .errors import (InsecureTransportError, MismatchingStateError,
- MissingCodeError, MissingTokenError,
- MissingTokenTypeError, raise_from_error)
+from .errors import (
+ InsecureTransportError, MismatchingStateError, MissingCodeError,
+ MissingTokenError, MissingTokenTypeError, raise_from_error,
+)
from .tokens import OAuth2Token
from .utils import is_secure_transport, list_to_scope, scope_to_list
diff --git a/oauthlib/oauth2/rfc6749/tokens.py b/oauthlib/oauth2/rfc6749/tokens.py
index 6f6b1f6..6284248 100644
--- a/oauthlib/oauth2/rfc6749/tokens.py
+++ b/oauthlib/oauth2/rfc6749/tokens.py
@@ -9,17 +9,16 @@ This module contains methods for adding two types of access tokens to requests.
"""
import hashlib
import hmac
-from binascii import b2a_base64
import warnings
+from binascii import b2a_base64
+from urllib.parse import urlparse
from oauthlib import common
from oauthlib.common import add_params_to_qs, add_params_to_uri
-from urllib.parse import urlparse
from . import utils
-
class OAuth2Token(dict):
def __init__(self, params, old_scope=None):
diff --git a/oauthlib/oauth2/rfc6749/utils.py b/oauthlib/oauth2/rfc6749/utils.py
index 3117d4b..f7f2ab4 100644
--- a/oauthlib/oauth2/rfc6749/utils.py
+++ b/oauthlib/oauth2/rfc6749/utils.py
@@ -7,10 +7,9 @@ This module contains utility methods used by various parts of the OAuth 2 spec.
"""
import datetime
import os
+from urllib.parse import quote, urlparse
from oauthlib.common import urldecode
-from urllib.parse import quote
-from urllib.parse import urlparse
def list_to_scope(scope):