class documentation

A receiver that returns a pre-configured static token.

This receiver is useful when the token is known in advance (for example embedded in configuration or provided via an environment variable). The receiver simply returns the supplied Token and never indicates that a retry would be useful.

Parameters
tokenToken instance to be returned by _fetch.
Method __init__ Create a static receiver using the token.
Method can_retry Static tokens are immutable and cannot be refreshed; never retry.
Async Method _fetch Return the configured token.
Instance Variable _latest The most recently fetched token, or None if no token has been fetched yet. Implementations may update this to support inspection or caching by callers.

Inherited from Receiver:

Async Method fetch Fetch a token and record it as the latest value.
Property latest Return the latest fetched token or None.
def __init__(self, token: Token): (source)

Create a static receiver using the token.

def can_retry(self, err: Exception, options: dict[str, str] | None = None) -> bool: (source)

Static tokens are immutable and cannot be refreshed; never retry.

Parameters
err:ExceptionThe exception that caused a previous authentication failure (ignored).
options:dict[str, str] | NoneIgnored; present for API compatibility.
Returns
boolAlways False.
async def _fetch(self, timeout: float | None = None, options: dict[str, str] | None = None) -> Token: (source)

Return the configured token.

The receiver returns the pre-configured token. If no token is configured SDKError is raised since the class invariant is that a static receiver must be constructed with a token instance.

Parameters
timeout:float | NoneIgnored for static receiver but accepted for API compatibility.
options:dict[str, str] | NoneIgnored. Present for API compatibility.
Returns
TokenThe configured Token.
Raises
SDKErrorIf the internal token is None (should not happen when used correctly).

The most recently fetched token, or None if no token has been fetched yet. Implementations may update this to support inspection or caching by callers.