class documentation
A receiver that reads a token from a filesystem path.
Each call to _fetch opens and reads the configured file, so
the token may change between fetches if the file is updated by an
external process.
| Parameters | |
| file | pathlib.Path pointing to a file containing a
raw access token (UTF-8 text). The file is read on each fetch
and must contain a non-empty token string. |
| Method | __init__ |
Create a file-backed receiver. |
| Method | can |
Indicate that file-backed tokens are not retryable. |
| Async Method | _fetch |
Read the token file and return a Token. |
| Instance Variable | _file |
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. |
Indicate that file-backed tokens are not retryable.
The token is static from the perspective of this receiver; retries are not useful because there is no remote call to repeat.
async def _fetch(self, timeout:
float | None = None, options: dict[ str, str] | None = None) -> Token:
(source)
¶
overrides
nebius.aio.token.token.Receiver._fetchRead the token file and return a Token.
| Parameters | |
timeout:float | None | Ignored for file-backed receivers but accepted for API compatibility. |
options:dict[ | Ignored; present for API compatibility. |
| Returns | |
Token | A Token constructed from the file contents. |
| Raises | |
SDKError | If the file contains an empty string. |
OSError | If the file cannot be opened. |