콘텐츠로 이동

spakky-oauth

OAuth 2.0 client 플러그인 API입니다. Authorization code + PKCE, confidential client 인증, token 갱신과 폐기를 제공합니다.

spakky.plugins.oauth

OAuth 2.0 client plugin identity.

PLUGIN_NAME = Plugin(name='spakky-oauth') module-attribute

Plugin identifier for the OAuth 2.0 client package.

spakky.plugins.oauth.main

Plugin initialization for the OAuth 2.0 client.

initialize(app)

Register the OAuth configuration and client service.

Token and authorization-state stores are application-owned: register one IOAuthTokenStore and one IOAuthAuthorizationStateStore Pod.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/main.py
def initialize(app: SpakkyApplication) -> None:
    """Register the OAuth configuration and client service.

    Token and authorization-state stores are application-owned: register one
    ``IOAuthTokenStore`` and one ``IOAuthAuthorizationStateStore`` Pod.
    """
    app.add(OAuthConfig)
    app.add(OAuthClient)

spakky.plugins.oauth.client

OAuth 2.0 client: authorization code with PKCE, refresh, and revocation.

OAuthClient(config, token_store, state_store, clock=None)

Obtain, refresh, and revoke tokens for application subjects.

Registrations may be public clients or confidential clients that authenticate with client_secret_basic or client_secret_post.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
def __init__(
    self,
    config: OAuthConfig,
    token_store: IOAuthTokenStore,
    state_store: IOAuthAuthorizationStateStore,
    clock: IOAuthClock | None = None,
) -> None:
    self.__config = config
    self.__tokens = token_store
    self.__states = state_store
    self.__clock = clock if clock is not None else SystemOAuthClock()
    self.__locks = WeakValueDictionary()

begin_authorization(client, subject, redirect_uri, *, client_id=None, parameters=None) async

Start an authorization-code flow and return the redirect target.

Parameters:

Name Type Description Default
client OAuthClientName

Name of the configured registration.

required
subject OAuthSubject

Application identity the resulting tokens belong to.

required
redirect_uri OAuthRedirectUri

Callback URL registered for this flow.

required
client_id OAuthClientId | None

Overrides the registered client id, for servers that issue a client id per sign-in.

None
parameters Mapping[str, str] | None

Extra authorization parameters for this request only.

None

Returns:

Type Description
OAuthAuthorizationRequest

The authorization URL and the state value the callback must echo.

Raises:

Type Description
OAuthAuthorizationRequestError

A request parameter overrides a protocol field or the client id override is blank.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def begin_authorization(
    self,
    client: OAuthClientName,
    subject: OAuthSubject,
    redirect_uri: OAuthRedirectUri,
    *,
    client_id: OAuthClientId | None = None,
    parameters: Mapping[str, str] | None = None,
) -> OAuthAuthorizationRequest:
    """Start an authorization-code flow and return the redirect target.

    Args:
        client: Name of the configured registration.
        subject: Application identity the resulting tokens belong to.
        redirect_uri: Callback URL registered for this flow.
        client_id: Overrides the registered client id, for servers that
            issue a client id per sign-in.
        parameters: Extra authorization parameters for this request only.

    Returns:
        The authorization URL and the state value the callback must echo.

    Raises:
        OAuthAuthorizationRequestError: A request parameter overrides a
            protocol field or the client id override is blank.
    """
    registration = self._registration(client)
    extra = dict(parameters or {})
    if not RESERVED_AUTHORIZATION_PARAMETERS.isdisjoint(extra):
        raise OAuthAuthorizationRequestError
    if client_id is not None and client_id.strip() == "":
        raise OAuthAuthorizationRequestError
    state = token_urlsafe(OAUTH_STATE_BYTES)
    code_verifier = token_urlsafe(OAUTH_CODE_VERIFIER_BYTES)
    nonce = (
        token_urlsafe(OAUTH_NONCE_BYTES)
        if OAUTH_OPENID_SCOPE in registration.scopes
        else None
    )
    effective_client_id = (
        client_id if client_id is not None else registration.client_id
    )
    query: dict[str, str] = {
        **registration.authorization_parameters,
        **extra,
        "response_type": "code",
        "client_id": effective_client_id,
        "redirect_uri": redirect_uri,
        "state": state,
        "code_challenge": self._code_challenge(code_verifier),
        "code_challenge_method": OAUTH_CODE_CHALLENGE_METHOD,
    }
    if len(registration.scopes) > 0:
        query["scope"] = " ".join(registration.scopes)
    if nonce is not None:
        query["nonce"] = nonce
    await self.__states.save(
        state,
        OAuthPendingAuthorization(
            key=OAuthTokenKey(client=client, subject=subject),
            client_id=effective_client_id,
            redirect_uri=redirect_uri,
            code_verifier=SecretStr(code_verifier),
            nonce=nonce,
            expires_at=self.__clock.now()
            + timedelta(seconds=self.__config.authorization_ttl_seconds),
        ),
    )
    separator = "&" if "?" in registration.authorization_endpoint else "?"
    return OAuthAuthorizationRequest(
        url=f"{registration.authorization_endpoint}{separator}{urlencode(query)}",
        state=state,
    )

complete_authorization(state, code, *, client_id=None) async

Exchange a callback code for tokens and store them for the subject.

Parameters:

Name Type Description Default
state OAuthState

State value echoed by the authorization server.

required
code OAuthAuthorizationCode

Authorization code from the callback.

required
client_id OAuthClientId | None

Client id the server issued in the callback, when it differs from the one the flow started with.

None

Returns:

Type Description
OAuthAuthorizationResult

The stored tokens and the nonce an ID token must carry.

Raises:

Type Description
OAuthAuthorizationStateError

The state is unknown, used, or expired.

OAuthAuthorizationRequestError

The client id override is blank.

OAuthAuthorizationRequiredError

The server rejected the code.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def complete_authorization(
    self,
    state: OAuthState,
    code: OAuthAuthorizationCode,
    *,
    client_id: OAuthClientId | None = None,
) -> OAuthAuthorizationResult:
    """Exchange a callback code for tokens and store them for the subject.

    Args:
        state: State value echoed by the authorization server.
        code: Authorization code from the callback.
        client_id: Client id the server issued in the callback, when it
            differs from the one the flow started with.

    Returns:
        The stored tokens and the nonce an ID token must carry.

    Raises:
        OAuthAuthorizationStateError: The state is unknown, used, or expired.
        OAuthAuthorizationRequestError: The client id override is blank.
        OAuthAuthorizationRequiredError: The server rejected the code.
    """
    if client_id is not None and client_id.strip() == "":
        raise OAuthAuthorizationRequestError
    pending = await self.__states.take(state)
    if pending is None or pending.expires_at <= self.__clock.now():
        raise OAuthAuthorizationStateError
    registration = self._registration(pending.key.client)
    effective_client_id = client_id if client_id is not None else pending.client_id
    response = await self._post(
        registration,
        registration.token_endpoint,
        {
            **registration.token_parameters,
            "grant_type": "authorization_code",
            "code": code,
            "code_verifier": pending.code_verifier.get_secret_value(),
            "redirect_uri": pending.redirect_uri,
        },
        client_id=effective_client_id,
    )
    if self._grant_rejected(response):
        raise OAuthAuthorizationRequiredError
    tokens = self._token_set(
        response,
        client_id=effective_client_id,
        default_scopes=registration.scopes,
        previous_refresh_token=None,
        previous_id_token=None,
    )
    async with self._lock(pending.key):
        await self.__tokens.save(pending.key, tokens)
    return OAuthAuthorizationResult(
        key=pending.key,
        tokens=tokens,
        nonce=pending.nonce,
    )

access_token(client, subject, *, rejected_token=None) async

Return a usable access token, refreshing it when needed.

Parameters:

Name Type Description Default
client OAuthClientName

Name of the configured registration.

required
subject OAuthSubject

Application identity that signed in.

required
rejected_token OAuthAccessToken | None

A token the resource server just rejected; the stored token is refreshed only if it is still that token.

None

Returns:

Type Description
OAuthAccessToken

An access token valid beyond the configured refresh leeway.

Raises:

Type Description
OAuthAuthorizationRequiredError

The subject has no tokens, no refresh token, or the refresh grant was rejected. Stored tokens are kept; call revoke to clear them.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def access_token(
    self,
    client: OAuthClientName,
    subject: OAuthSubject,
    *,
    rejected_token: OAuthAccessToken | None = None,
) -> OAuthAccessToken:
    """Return a usable access token, refreshing it when needed.

    Args:
        client: Name of the configured registration.
        subject: Application identity that signed in.
        rejected_token: A token the resource server just rejected; the
            stored token is refreshed only if it is still that token.

    Returns:
        An access token valid beyond the configured refresh leeway.

    Raises:
        OAuthAuthorizationRequiredError: The subject has no tokens, no
            refresh token, or the refresh grant was rejected. Stored
            tokens are kept; call ``revoke`` to clear them.
    """
    registration = self._registration(client)
    key = OAuthTokenKey(client=client, subject=subject)
    async with self._lock(key):
        tokens = await self.__tokens.load(key)
        if tokens is None:
            raise OAuthAuthorizationRequiredError
        rejected = rejected_token is not None and compare_digest(
            tokens.access_token.get_secret_value().encode(),
            rejected_token.encode(),
        )
        if not rejected and self._usable(tokens):
            return tokens.access_token.get_secret_value()
        if tokens.refresh_token is None:
            raise OAuthAuthorizationRequiredError
        response = await self._post(
            registration,
            registration.token_endpoint,
            {
                **registration.token_parameters,
                "grant_type": "refresh_token",
                "refresh_token": tokens.refresh_token.get_secret_value(),
            },
            client_id=tokens.client_id,
        )
        latest = await self.__tokens.load(key)
        if self._grant_rejected(response):
            return self._rotated_elsewhere(tokens, latest)
        refreshed = self._token_set(
            response,
            client_id=tokens.client_id,
            default_scopes=tokens.scopes,
            previous_refresh_token=tokens.refresh_token,
            previous_id_token=tokens.id_token,
        )
        if latest is None:
            raise OAuthAuthorizationRequiredError
        await self.__tokens.save(key, refreshed)
        return refreshed.access_token.get_secret_value()

revoke(client, subject) async

Remove the subject's tokens and revoke them at the server.

Local tokens are removed first, so the subject is signed out here even when the server cannot confirm revocation.

Raises:

Type Description
OAuthRevocationError

The server was unreachable or did not confirm revocation.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def revoke(self, client: OAuthClientName, subject: OAuthSubject) -> None:
    """Remove the subject's tokens and revoke them at the server.

    Local tokens are removed first, so the subject is signed out here even
    when the server cannot confirm revocation.

    Raises:
        OAuthRevocationError: The server was unreachable or did not confirm
            revocation.
    """
    registration = self._registration(client)
    key = OAuthTokenKey(client=client, subject=subject)
    async with self._lock(key):
        tokens = await self.__tokens.load(key)
        if tokens is None:
            return
        await self.__tokens.delete(key)
        if registration.revocation_endpoint is None:
            return
        if tokens.refresh_token is not None:
            token = tokens.refresh_token
            hint = OAuthTokenTypeHint.REFRESH_TOKEN
        else:
            token = tokens.access_token
            hint = OAuthTokenTypeHint.ACCESS_TOKEN
        await self._revoke_at(
            registration,
            registration.revocation_endpoint,
            token,
            hint,
            client_id=tokens.client_id,
        )

refresh_tokens(client, refresh_token, *, client_id=None) async

Run a refresh grant for a refresh token the caller stores itself.

The plugin's token store is neither read nor written, so an application that keeps tokens in its own storage can refresh them with the registration's client authentication.

Parameters:

Name Type Description Default
client OAuthClientName

Name of the configured registration.

required
refresh_token SecretStr

The refresh token to exchange.

required
client_id OAuthClientId | None

Client id the tokens were issued to, when it differs from the registered one.

None

Returns:

Type Description
OAuthTokenSet

The new token set. When the server does not rotate the refresh

OAuthTokenSet

token, the given one is kept; when it reports no scope, the

OAuthTokenSet

registration's scopes are used.

Raises:

Type Description
OAuthAuthorizationRequestError

The refresh token or client id override is blank.

OAuthAuthorizationRequiredError

The server rejected the grant (invalid_grant); the subject must sign in again.

OAuthTokenEndpointError

The server rejected the request for any other reason; it carries the HTTP status and error code.

OAuthTokenResponseError

The response is not a usable token set.

OAuthTransportError

The server could not be reached.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def refresh_tokens(
    self,
    client: OAuthClientName,
    refresh_token: SecretStr,
    *,
    client_id: OAuthClientId | None = None,
) -> OAuthTokenSet:
    """Run a refresh grant for a refresh token the caller stores itself.

    The plugin's token store is neither read nor written, so an
    application that keeps tokens in its own storage can refresh them with
    the registration's client authentication.

    Args:
        client: Name of the configured registration.
        refresh_token: The refresh token to exchange.
        client_id: Client id the tokens were issued to, when it differs
            from the registered one.

    Returns:
        The new token set. When the server does not rotate the refresh
        token, the given one is kept; when it reports no scope, the
        registration's scopes are used.

    Raises:
        OAuthAuthorizationRequestError: The refresh token or client id
            override is blank.
        OAuthAuthorizationRequiredError: The server rejected the grant
            (``invalid_grant``); the subject must sign in again.
        OAuthTokenEndpointError: The server rejected the request for any
            other reason; it carries the HTTP status and ``error`` code.
        OAuthTokenResponseError: The response is not a usable token set.
        OAuthTransportError: The server could not be reached.
    """
    registration = self._registration(client)
    if refresh_token.get_secret_value().strip() == "":
        raise OAuthAuthorizationRequestError
    if client_id is not None and client_id.strip() == "":
        raise OAuthAuthorizationRequestError
    effective_client_id = (
        client_id if client_id is not None else registration.client_id
    )
    response = await self._post(
        registration,
        registration.token_endpoint,
        {
            **registration.token_parameters,
            "grant_type": "refresh_token",
            "refresh_token": refresh_token.get_secret_value(),
        },
        client_id=effective_client_id,
    )
    if self._grant_rejected(response):
        raise OAuthAuthorizationRequiredError
    return self._token_set(
        response,
        client_id=effective_client_id,
        default_scopes=registration.scopes,
        previous_refresh_token=refresh_token,
        previous_id_token=None,
    )

revoke_token(client, token, *, token_type_hint=None, client_id=None) async

Revoke a token the caller stores itself (RFC 7009).

The plugin's token store is neither read nor written.

Parameters:

Name Type Description Default
client OAuthClientName

Name of the configured registration.

required
token SecretStr

The access or refresh token to revoke.

required
token_type_hint OAuthTokenTypeHint | None

Which kind of token token is; None sends no hint and lets the server search all token types.

None
client_id OAuthClientId | None

Client id the token was issued to, when it differs from the registered one.

None

Raises:

Type Description
OAuthAuthorizationRequestError

The token or client id override is blank.

OAuthRevocationNotSupportedError

The registration has no revocation endpoint.

OAuthRevocationError

The server was unreachable or did not answer 200; it carries the HTTP status and error code.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/client.py
async def revoke_token(
    self,
    client: OAuthClientName,
    token: SecretStr,
    *,
    token_type_hint: OAuthTokenTypeHint | None = None,
    client_id: OAuthClientId | None = None,
) -> None:
    """Revoke a token the caller stores itself (RFC 7009).

    The plugin's token store is neither read nor written.

    Args:
        client: Name of the configured registration.
        token: The access or refresh token to revoke.
        token_type_hint: Which kind of token ``token`` is; None sends no
            hint and lets the server search all token types.
        client_id: Client id the token was issued to, when it differs
            from the registered one.

    Raises:
        OAuthAuthorizationRequestError: The token or client id override
            is blank.
        OAuthRevocationNotSupportedError: The registration has no
            revocation endpoint.
        OAuthRevocationError: The server was unreachable or did not
            answer 200; it carries the HTTP status and ``error`` code.
    """
    registration = self._registration(client)
    if token.get_secret_value().strip() == "":
        raise OAuthAuthorizationRequestError
    if client_id is not None and client_id.strip() == "":
        raise OAuthAuthorizationRequestError
    if registration.revocation_endpoint is None:
        raise OAuthRevocationNotSupportedError
    await self._revoke_at(
        registration,
        registration.revocation_endpoint,
        token,
        token_type_hint,
        client_id=client_id if client_id is not None else registration.client_id,
    )

spakky.plugins.oauth.config

Configuration for operator-owned OAuth 2.0 client registrations.

OAuthClientAuthMethod

Bases: StrEnum

How the client authenticates to the token and revocation endpoints.

Values follow the RFC 7591 token_endpoint_auth_method names.

NONE = 'none' class-attribute instance-attribute

Public client: only client_id is sent (RFC 6749 section 2.1).

CLIENT_SECRET_BASIC = 'client_secret_basic' class-attribute instance-attribute

HTTP Basic authentication with the client secret (RFC 6749 section 2.3.1).

CLIENT_SECRET_POST = 'client_secret_post' class-attribute instance-attribute

client_id and client_secret in the form body (RFC 6749 section 2.3.1).

OAuthClientRegistration

Bases: BaseModel

One client registration at an OAuth 2.0 authorization server.

A public client leaves token_endpoint_auth_method at none. A confidential client sets it to client_secret_basic or client_secret_post together with client_secret.

OAuthConfig()

Bases: BaseSettings

Named OAuth 2.0 client registrations and token lifetime policy.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/config.py
def __init__(self) -> None:
    super().__init__()

clients = Field(default_factory=dict) class-attribute instance-attribute

Registrations keyed by the name callers pass to OAuthClient.

http_timeout_seconds = Field(default=DEFAULT_OAUTH_HTTP_TIMEOUT_SECONDS, gt=0) class-attribute instance-attribute

Timeout for each token and revocation endpoint request.

refresh_leeway_seconds = Field(default=DEFAULT_OAUTH_REFRESH_LEEWAY_SECONDS, ge=0) class-attribute instance-attribute

Refresh an access token this long before it expires.

authorization_ttl_seconds = Field(default=DEFAULT_OAUTH_AUTHORIZATION_TTL_SECONDS, gt=0) class-attribute instance-attribute

How long a started authorization waits for its callback.

spakky.plugins.oauth.token

Value types exchanged with the OAuth 2.0 client and its stores.

OAuthTokenTypeHint

Bases: StrEnum

RFC 7009 token_type_hint values for a revocation request.

OAuthTokenKey(client, subject) dataclass

Identify the tokens one application subject holds for one registration.

OAuthTokenSet

Bases: BaseModel

Tokens issued to one subject; secrets stay wrapped until they are sent.

OAuthPendingAuthorization

Bases: BaseModel

PKCE and binding data kept between the authorization redirect and callback.

OAuthAuthorizationRequest

Bases: BaseModel

Redirect target that starts one authorization-code flow.

OAuthAuthorizationResult

Bases: BaseModel

Tokens stored by a completed flow plus the nonce to check an ID token.

spakky.plugins.oauth.store

Storage and clock ports for the OAuth 2.0 client, with in-memory defaults.

IOAuthTokenStore

Bases: ABC

Persist the token set each subject holds for each registration.

load(key) abstractmethod async

Return the stored tokens, or None when the subject never signed in.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
async def load(self, key: OAuthTokenKey) -> OAuthTokenSet | None:
    """Return the stored tokens, or None when the subject never signed in."""
    ...

save(key, tokens) abstractmethod async

Replace the stored tokens for the subject.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
async def save(self, key: OAuthTokenKey, tokens: OAuthTokenSet) -> None:
    """Replace the stored tokens for the subject."""
    ...

delete(key) abstractmethod async

Remove the stored tokens; removing absent tokens is not an error.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
async def delete(self, key: OAuthTokenKey) -> None:
    """Remove the stored tokens; removing absent tokens is not an error."""
    ...

IOAuthAuthorizationStateStore

Bases: ABC

Hold started authorizations until their one callback arrives.

save(state, pending) abstractmethod async

Remember one started authorization under its state value.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
async def save(self, state: OAuthState, pending: OAuthPendingAuthorization) -> None:
    """Remember one started authorization under its state value."""
    ...

take(state) abstractmethod async

Remove and return the authorization, or None when it is unknown or used.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
async def take(self, state: OAuthState) -> OAuthPendingAuthorization | None:
    """Remove and return the authorization, or None when it is unknown or used."""
    ...

IOAuthClock

Bases: ABC

Replaceable wall clock for deterministic expiry decisions.

now() abstractmethod

Return the current timezone-aware UTC time.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
@abstractmethod
def now(self) -> datetime:
    """Return the current timezone-aware UTC time."""
    ...

SystemOAuthClock

Bases: IOAuthClock

Default clock backed by the system UTC time.

InMemoryOAuthTokenStore()

Bases: IOAuthTokenStore

Process-local token store for development and tests; tokens die on restart.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
def __init__(self) -> None:
    self.__tokens = {}

InMemoryOAuthAuthorizationStateStore(clock=None)

Bases: IOAuthAuthorizationStateStore

Process-local state store; callbacks must reach the process that started them.

Authorizations whose expires_at has passed are dropped on every save and take, so sign-ins abandoned before their callback do not accumulate for the life of the process.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/store.py
def __init__(self, clock: IOAuthClock | None = None) -> None:
    self.__pending = {}
    self.__clock = clock if clock is not None else SystemOAuthClock()

spakky.plugins.oauth.error

Errors raised by the OAuth 2.0 client plugin.

AbstractSpakkyOAuthError

Bases: AbstractSpakkyFrameworkError, ABC

Base class for spakky-oauth client errors.

OAuthClientNotConfiguredError

Bases: AbstractSpakkyOAuthError

Raised when a caller names a client registration that does not exist.

OAuthAuthorizationRequestError

Bases: AbstractSpakkyOAuthError

Raised when a caller's per-request authorization arguments are invalid.

OAuthAuthorizationStateError

Bases: AbstractSpakkyOAuthError

Raised when a callback state is unknown, already used, or expired.

OAuthAuthorizationRequiredError

Bases: AbstractSpakkyOAuthError

Raised when the subject must sign in again to obtain a usable token.

OAuthTokenEndpointError(status_code, error=None)

Bases: AbstractSpakkyOAuthError

Raised when the token endpoint rejects a request for a non-grant reason.

Carries only the HTTP status and the RFC 6749 section 5.2 error code so callers can tell configuration errors from transient server failures. The response body and request secrets are never kept.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/error.py
def __init__(
    self,
    status_code: OAuthHttpStatus,
    error: OAuthErrorCode | None = None,
) -> None:
    # Passed on so pickle and copy can rebuild the error from its args.
    super().__init__(status_code, error)
    self.status_code = status_code
    self.error = error

OAuthTokenResponseError

Bases: AbstractSpakkyOAuthError

Raised when a token endpoint response is not a usable bearer token set.

OAuthTransportError

Bases: AbstractSpakkyOAuthError

Raised when the authorization server cannot be reached.

OAuthRevocationError(status_code=None, error=None)

Bases: AbstractSpakkyOAuthError

Raised when the revocation endpoint did not confirm a revocation.

status_code is None when the server could not be reached; error is None when the response carried no RFC 6749 section 5.2 error code.

Source code in plugins/spakky-oauth/src/spakky/plugins/oauth/error.py
def __init__(
    self,
    status_code: OAuthHttpStatus | None = None,
    error: OAuthErrorCode | None = None,
) -> None:
    # Passed on so pickle and copy can rebuild the error from its args.
    super().__init__(status_code, error)
    self.status_code = status_code
    self.error = error

OAuthRevocationNotSupportedError

Bases: AbstractSpakkyOAuthError

Raised when a token is revoked through a registration without an endpoint.