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 | |
| token | Token instance to be returned by _fetch. |
| Method | __init__ |
Create a static receiver using the token. |
| Method | can |
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. |
async def _fetch(self, timeout:
float | None = None, options: dict[ str, str] | None = None) -> Token:
(source)
¶
overrides
nebius.aio.token.token.Receiver._fetchReturn 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 | None | Ignored for static receiver but accepted for API compatibility. |
options:dict[ | Ignored. Present for API compatibility. |
| Returns | |
Token | The configured Token. |
| Raises | |
SDKError | If the internal token is None (should not happen when used
correctly). |
overrides
nebius.aio.token.token.Receiver._latestThe most recently fetched token, or None if no token has been
fetched yet. Implementations may update this to support inspection or
caching by callers.