diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2018-09-11 14:34:21 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2018-09-11 14:34:21 -0400 |
commit | 0e963d8e55cabbd9b50fe2d6ec6659f01c1a2e00 (patch) | |
tree | f7f216abfd0f946d8cc09fc73460c61584513774 | |
parent | 5a9d8d92d3453355de86d614337affe69543207d (diff) | |
download | oauthlib-0e963d8e55cabbd9b50fe2d6ec6659f01c1a2e00.tar.gz |
cleanup on docs fixes
-rw-r--r-- | oauthlib/oauth2/rfc6749/clients/service_application.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/errors.py | 37 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/authorization_code.py | 4 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/base.py | 6 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/client_credentials.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/implicit.py | 4 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/refresh_token.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/parameters.py | 23 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/request_validator.py | 14 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/tokens.py | 1 |
11 files changed, 53 insertions, 44 deletions
diff --git a/oauthlib/oauth2/rfc6749/clients/service_application.py b/oauthlib/oauth2/rfc6749/clients/service_application.py index 7f336bb..3045676 100644 --- a/oauthlib/oauth2/rfc6749/clients/service_application.py +++ b/oauthlib/oauth2/rfc6749/clients/service_application.py @@ -54,7 +54,7 @@ class ServiceApplicationClient(Client): ``https://provider.com/oauth2/token``. :param kwargs: Additional arguments to pass to base client, such as - state and token. See Client.__init__.__doc__ for + state and token. See ``Client.__init__.__doc__`` for details. """ super(ServiceApplicationClient, self).__init__(client_id, **kwargs) diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py index 5a0cca2..3f0bfc0 100644 --- a/oauthlib/oauth2/rfc6749/errors.py +++ b/oauthlib/oauth2/rfc6749/errors.py @@ -21,23 +21,26 @@ class OAuth2Error(Exception): def __init__(self, description=None, uri=None, state=None, status_code=None, request=None): """ - description: A human-readable ASCII [USASCII] text providing - additional information, used to assist the client - developer in understanding the error that occurred. - Values for the "error_description" parameter MUST NOT - include characters outside the set - x20-21 / x23-5B / x5D-7E. - - uri: A URI identifying a human-readable web page with information - about the error, used to provide the client developer with - additional information about the error. Values for the - "error_uri" parameter MUST conform to the URI- Reference - syntax, and thus MUST NOT include characters outside the set - x21 / x23-5B / x5D-7E. - - state: A CSRF protection value received from the client. - - request: Oauthlib Request object + :param description: A human-readable ASCII [USASCII] text providing + additional information, used to assist the client + developer in understanding the error that occurred. + Values for the "error_description" parameter + MUST NOT include characters outside the set + x20-21 / x23-5B / x5D-7E. + + :param uri: A URI identifying a human-readable web page with information + about the error, used to provide the client developer with + additional information about the error. Values for the + "error_uri" parameter MUST conform to the URI- Reference + syntax, and thus MUST NOT include characters outside the set + x21 / x23-5B / x5D-7E. + + :param state: A CSRF protection value received from the client. + + :param status_code: + + :param request: OAuthlib request. + :type request: oauthlib.common.Request """ if description is not None: self.description = description diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py index 59366b1..8ebae49 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py +++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py @@ -142,7 +142,7 @@ class AuthorizationCodeGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. :returns: headers, body, status :raises: FatalClientError on invalid redirect URI or client id. @@ -229,7 +229,7 @@ class AuthorizationCodeGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. """ diff --git a/oauthlib/oauth2/rfc6749/grant_types/base.py b/oauthlib/oauth2/rfc6749/grant_types/base.py index 4d9381c..43f9db4 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/base.py +++ b/oauthlib/oauth2/rfc6749/grant_types/base.py @@ -120,7 +120,7 @@ class GrantTypeBase(object): """ :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. """ raise NotImplementedError('Subclasses must implement this method.') @@ -129,7 +129,7 @@ class GrantTypeBase(object): """ :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. """ raise NotImplementedError('Subclasses must implement this method.') @@ -137,7 +137,7 @@ class GrantTypeBase(object): def add_token(self, token, token_handler, request): """ :param token: - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. :param request: OAuthlib request. :type request: oauthlib.common.Request diff --git a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py index 884363f..7d4f74c 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py +++ b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py @@ -55,7 +55,7 @@ class ClientCredentialsGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. If the access token request is valid and authorized, the diff --git a/oauthlib/oauth2/rfc6749/grant_types/implicit.py b/oauthlib/oauth2/rfc6749/grant_types/implicit.py index 600c0a5..b29953b 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/implicit.py +++ b/oauthlib/oauth2/rfc6749/grant_types/implicit.py @@ -124,7 +124,7 @@ class ImplicitGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. The client constructs the request URI by adding the following @@ -171,7 +171,7 @@ class ImplicitGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. If the resource owner grants the access request, the authorization diff --git a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py index 55ddbb2..5f7382a 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py +++ b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py @@ -35,7 +35,7 @@ class RefreshTokenGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. If valid and authorized, the authorization server issues an access 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 25fb1f1..87e8015 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py +++ b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py @@ -75,7 +75,7 @@ class ResourceOwnerPasswordCredentialsGrant(GrantTypeBase): :param request: OAuthlib request. :type request: oauthlib.common.Request - :param token_handler: A token handler instace, for example of type + :param token_handler: A token handler instance, for example of type oauthlib.oauth2.BearerToken. If the access token request is valid and authorized, the diff --git a/oauthlib/oauth2/rfc6749/parameters.py b/oauthlib/oauth2/rfc6749/parameters.py index 3f18733..e1780f8 100644 --- a/oauthlib/oauth2/rfc6749/parameters.py +++ b/oauthlib/oauth2/rfc6749/parameters.py @@ -37,6 +37,7 @@ def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None, using the ``application/x-www-form-urlencoded`` format as defined by [`W3C.REC-html401-19991224`_]: + :param uri: :param client_id: The client identifier as described in `Section 2.2`_. :param response_type: To indicate which OAuth 2 grant/flow is required, "code" and "token". @@ -134,15 +135,15 @@ def prepare_token_revocation_request(url, token, token_type_hint="access_token", :param token: REQUIRED. The token that the client wants to get revoked. - param:token_type_hint: OPTIONAL. A hint about the type of the token - submitted for revocation. Clients MAY pass this - parameter in order to help the authorization server - to optimize the token lookup. If the server is - unable to locate the token using the given hint, it - MUST extend its search across all of its supported - token types. An authorization server MAY ignore this - parameter, particularly if it is able to detect the - token type automatically. + :param token_type_hint: OPTIONAL. A hint about the type of the token + submitted for revocation. Clients MAY pass this + parameter in order to help the authorization server + to optimize the token lookup. If the server is + unable to locate the token using the given hint, it + MUST extend its search across all of its supported + token types. An authorization server MAY ignore + this parameter, particularly if it is able to detect + the token type automatically. This specification defines two values for `token_type_hint`: @@ -267,6 +268,10 @@ def parse_implicit_response(uri, state=None, scope=None): authorization request. The exact value received from the client. + :param uri: + :param state: + :param scope: + Similar to the authorization code response, but with a full token provided in the URL fragment: diff --git a/oauthlib/oauth2/rfc6749/request_validator.py b/oauthlib/oauth2/rfc6749/request_validator.py index 6ce7910..2cf1b82 100644 --- a/oauthlib/oauth2/rfc6749/request_validator.py +++ b/oauthlib/oauth2/rfc6749/request_validator.py @@ -100,7 +100,7 @@ class RequestValidator(object): :param client_id: Unicode client identifier. :param code: Unicode authorization_code. :param redirect_uri: Unicode absolute URI. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -566,7 +566,7 @@ class RequestValidator(object): :param client_id: Unicode client identifier. :param code: Unicode authorization code. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -581,7 +581,7 @@ class RequestValidator(object): :param client_id: Unicode client identifier. :param grant_type: Unicode grant type, i.e. authorization_code, password. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -619,7 +619,7 @@ class RequestValidator(object): associated with this refresh token. :param refresh_token: Unicode refresh token. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -636,7 +636,7 @@ class RequestValidator(object): :param client_id: Unicode client identifier. :param response_type: Unicode response type, i.e. code, token. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -652,7 +652,7 @@ class RequestValidator(object): :param client_id: Unicode client identifier. :param scopes: List of scopes (defined by you). - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False @@ -713,7 +713,7 @@ class RequestValidator(object): :param username: Unicode username. :param password: Unicode password. - :param client: Client object set by you, see authenticate_client. + :param client: Client object set by you, see ``.authenticate_client``. :param request: OAuthlib request. :type request: oauthlib.common.Request :rtype: True or False diff --git a/oauthlib/oauth2/rfc6749/tokens.py b/oauthlib/oauth2/rfc6749/tokens.py index 765251e..d78df09 100644 --- a/oauthlib/oauth2/rfc6749/tokens.py +++ b/oauthlib/oauth2/rfc6749/tokens.py @@ -244,6 +244,7 @@ def signed_token_generator(private_pem, **kwargs): def get_token_from_header(request): """ Helper function to extract a token from the request header. + :param request: OAuthlib request. :type request: oauthlib.common.Request :return: Return the token or None if the Authorization header is malformed. |