module documentation
Static token bearer and receiver implementations.
Use these bearer and receiver implementations for tests or fixed access
tokens. EnvBearer reads an environment variable. By default, it reads
nebius.base.constants.TOKEN_ENV. Bearer accepts a configured
Token or a 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 that supplies a static token to authenticators. |
| Class | |
Bearer that reads the token from an environment variable. |
| Class | |
A receiver that returns a pre-configured static token. |
| Exception | |
Raised when an expected environment variable does not contain a token. |
| Variable | log |
Undocumented |