module documentation

Static token bearer and receiver implementations.

This module contains simple bearer and receiver implementations useful for local testing or when a fixed access token is made available (for example via an environment variable). The EnvBearer reads the token from an environment variable (by default nebius.base.constants.TOKEN_ENV) and Bearer accepts a pre-configured Token instance or raw token string.

Examples

Create a bearer from an explicit token string:

from nebius.aio.token.static import Bearer

bearer = Bearer("my-static-token")
receiver = bearer.receiver()
token = await receiver.fetch()

Use an environment variable:

import os
os.environ["NEBIUS_IAM_TOKEN"] = "token-from-env"
from nebius.aio.token.static import EnvBearer

bearer = EnvBearer()  # reads NEBIUS_IAM_TOKEN by default
receiver = bearer.receiver()
token = await receiver.fetch()
Class Bearer Bearer that supplies a static token to authenticators.
Class EnvBearer Bearer that reads the token from an environment variable.
Class Receiver A receiver that returns a pre-configured static token.
Exception NoTokenInEnvError Raised when an expected environment variable does not contain a token.
Variable log Undocumented

Undocumented