From a316e4eef73fb6a48044d29ec6b129bedf567394 Mon Sep 17 00:00:00 2001 From: Guillaume Pujol Date: Sun, 18 Aug 2024 10:31:08 +0200 Subject: [PATCH] fix docstrings indentation --- requests_oauth2client/client.py | 32 ++++++++++++++++---------------- requests_oauth2client/tokens.py | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/requests_oauth2client/client.py b/requests_oauth2client/client.py index 931a316..e9cca21 100644 --- a/requests_oauth2client/client.py +++ b/requests_oauth2client/client.py @@ -271,13 +271,14 @@ class OAuth2Client: Raises: MissingIDTokenEncryptedResponseAlgParam: if an `id_token_decryption_key` is provided - but no decryption alg is provided, either: - - using `id_token_encrypted_response_alg`, - - or in the `alg` parameter of the `Jwk` key + but no decryption alg is provided, either: + + - using `id_token_encrypted_response_alg`, + - or in the `alg` parameter of the `Jwk` key MissingIssuerParam: if `authorization_response_iss_parameter_supported` is set to `True` - but the `issuer` is not provided. + but the `issuer` is not provided. InvalidEndpointUri: if a provided endpoint uri is not considered valid. For the rare cases - where those checks must be disabled, you can use `testing=True`. + where those checks must be disabled, you can use `testing=True`. InvalidIssuer: if the `issuer` value is not considered valid. """ @@ -586,7 +587,7 @@ def on_token_error(self, response: requests.Response) -> BearerToken: Raises: InvalidTokenResponse: if the error response does not contain an OAuth 2.0 standard - error response. + error response. """ try: @@ -694,7 +695,7 @@ def refresh_token( Raises: MissingRefreshToken: if `refresh_token` is a BearerToken instance but does not - contain a `refresh_token` + contain a `refresh_token` """ if isinstance(refresh_token, BearerToken): @@ -727,7 +728,7 @@ def device_code( Raises: MissingDeviceCode: if `device_code` is a DeviceAuthorizationResponse but does not - contain a `device_code`. + contain a `device_code`. """ if isinstance(device_code, DeviceAuthorizationResponse): @@ -763,7 +764,7 @@ def ciba( Raises: MissingAuthRequestId: if `auth_req_id` is a BackChannelAuthenticationResponse but does not contain - an `auth_req_id`. + an `auth_req_id`. """ if isinstance(auth_req_id, BackChannelAuthenticationResponse): @@ -1011,7 +1012,7 @@ def on_pushed_authorization_request_error( Raises: EndpointError: a subclass of this error depending on the error returned by the AS InvalidPushedAuthorizationResponse: if the returned response is not following the - specifications + specifications UnknownTokenEndpointError: for unknown/unhandled errors """ @@ -1191,7 +1192,7 @@ def revoke_refresh_token( Raises: MissingRefreshToken: when `refresh_token` is a [BearerToken][requests_oauth2client.tokens.BearerToken] - but does not contain a `refresh_token`. + but does not contain a `refresh_token`. """ if isinstance(refresh_token, BearerToken): @@ -1230,7 +1231,7 @@ def revoke_token( Raises: MissingEndpointUri: if the Revocation Endpoint URI is not configured. MissingRefreshToken: if `token_type_hint` is `"refresh_token"` and `token` is a BearerToken - but does not contain a `refresh_token`. + but does not contain a `refresh_token`. """ requests_kwargs = requests_kwargs or {} @@ -1321,7 +1322,7 @@ def introspect_token( Raises: MissingRefreshToken: if `token_type_hint` is `"refresh_token"` and `token` is a BearerToken - but does not contain a `refresh_token`. + but does not contain a `refresh_token`. UnknownTokenType: if `token_type_hint` is neither `None`, `"access_token"` or `"refresh_token"`. """ @@ -1445,8 +1446,7 @@ def backchannel_authentication_request( # noqa: PLR0913 Raises: InvalidBackchannelAuthenticationRequestHintParam: if none of `login_hint`, `login_hint_token` - or `id_token_hint` is provided, or more than one of them is provided. - + or `id_token_hint` is provided, or more than one of them is provided. InvalidScopeParam: if the `scope` parameter is invalid. InvalidAcrValuesParam: if the `acr_values` parameter is invalid. @@ -1516,7 +1516,7 @@ def parse_backchannel_authentication_response( Raises: InvalidBackChannelAuthenticationResponse: if the response does not contain a standard - BackChannel Authentication response. + BackChannel Authentication response. """ try: diff --git a/requests_oauth2client/tokens.py b/requests_oauth2client/tokens.py index 30ffe00..d737609 100644 --- a/requests_oauth2client/tokens.py +++ b/requests_oauth2client/tokens.py @@ -321,15 +321,15 @@ def validate_id_token(self, client: OAuth2Client, azr: AuthorizationResponse) -> - if token is encrypted but client does not have a decryption key - if the token does not contain an `alg` header MismatchingIdTokenAlg: if the `alg` header from the ID Token does not match - the expected `client.id_token_signed_response_alg`. + the expected `client.id_token_signed_response_alg`. MismatchingIdTokenIssuer: if the `iss` claim from the ID Token does not match - the expected `self.issuer`. + the expected `self.issuer`. MismatchingIdTokenAudience: if the `aud` claim from the ID Token does not match - the expected `client.client_id`. + the expected `client.client_id`. MismatchingIdTokenAzp: if the `azp` claim from the ID Token does not match - the expected `client.client_id`. + the expected `client.client_id`. MismatchingIdTokenNonce: if the `nonce` claim from the ID Token does not match - the expected `azr.nonce`. + the expected `azr.nonce`. ExpiredIdToken: if the ID Token is expired at the time of the check. """