class documentation

Bearer that provides file-backed Receiver instances.

The bearer accepts either a string path or a pathlib.Path and expands the user's home directory. It does not validate the existence of the file at construction time.

Example

Construct a bearer and use it to initialize the SDK:

from nebius.sdk import SDK
from nebius.aio.token.file import Bearer

sdk = SDK(credentials=Bearer("~/nebius.token"))
Parameters
fileFilesystem path (string or pathlib.Path) to the token file. Tilde expansion is performed.
Method __init__ Create a bearer for the given token file.
Method receiver Return a Receiver that reads tokens from the file.
Instance Variable _file Undocumented

Inherited from Bearer:

Async Method close Close the bearer and any wrapped resources.
Property name Optional human-readable name for the bearer.
Property wrapped Return the wrapped bearer or None if not wrapping.
def __init__(self, file: str | Path): (source)

Create a bearer for the given token file.

def receiver(self) -> Receiver: (source)

Return a Receiver that reads tokens from the file.

Returns
ReceiverA new Receiver bound to the configured file.

Undocumented