Skip to content

Commit

Permalink
fix docstrings indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-pujol committed Aug 18, 2024
1 parent e72a8ae commit a316e4e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
32 changes: 16 additions & 16 deletions requests_oauth2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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"`.
"""
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions requests_oauth2client/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down

0 comments on commit a316e4e

Please sign in to comment.