class documentation
Bearer that reads the token from an environment variable.
Example
Construct a bearer and use it to initialize the SDK:
import os from nebius.sdk import SDK from nebius.aio.token.static import EnvBearer os.environ["NEBIUS_IAM_TOKEN"] = "token-from-env" sdk = SDK(credentials=EnvBearer())
| Parameters | |
| env | Environment variable name to read the token from.
Defaults to nebius.base.constants.TOKEN_ENV. |
| Raises | |
NoTokenInEnvError | When the environment variable is not set or empty. |
| Method | __init__ |
Initialize the environment-variable based bearer. |
Inherited from Bearer:
| Method | receiver |
Return a Receiver that yields the configured token. |
| Instance Variable | _tok |
Undocumented |
Inherited from Bearer (via 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. |