class documentation
Fetch a token from one IMDS HTTP endpoint for a single SDK request.
| Method | __init__ |
Undocumented |
| Method | can |
Decide whether a failed authentication attempt should be retried. |
| Async Method | _fetch |
Low-level asynchronous fetch implementation. |
| Async Method | _fetch |
Undocumented |
| Instance Variable | _endpoint |
Undocumented |
| Instance Variable | _fetches |
Undocumented |
| Instance Variable | _invalid |
Undocumented |
| Instance Variable | _metric |
Undocumented |
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. |
| 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. |
Decide whether a failed authentication attempt should be retried.
Inspect err and optional options. Return whether a new
fetch call is likely to succeed, for example after credential
refresh.
Default implementations should return False.
| Parameters | |
err:Exception | The exception that triggered the retry decision. |
options:dict[str, str] or None | Optional implementation-specific options. |
| Returns | |
bool | True when a retry is advisable, otherwise False. |
async def _fetch(self, timeout:
float | None = None, options: dict[ str, str] | None = None) -> Token:
(source)
¶
overrides
nebius.aio.token.token.Receiver._fetchLow-level asynchronous fetch implementation.
Subclasses must implement this token-retrieval method. Call
fetch instead of this internal method. fetch records
the result in _latest.
| Parameters | |
timeout:optional float | Optional timeout in seconds for the fetch operation. |
| options:optional dict[str, str] | Optional implementation-specific options forwarded by the request layer. |
| Returns | |
Token | A freshly fetched Token. |