class documentation
class Bearer(ParentBearer): (source)
Known subclasses: nebius.aio.token.static.EnvBearer
Constructor: Bearer(token)
Bearer that supplies a static token to authenticators.
The bearer may be constructed with either a Token instance or a
raw token string. When a string is provided it is converted into a
Token. Empty token strings are rejected.
Example
Construct a bearer and use it to initialize the SDK:
from nebius.sdk import SDK
from nebius.aio.token.static import Bearer
sdk = SDK(credentials=Bearer("my-static-token"))
| Parameters | |
| token | Token instance or raw token string. |
| Raises | |
SDKError | When an empty token string is provided. |
| Method | __init__ |
Initialize the static token bearer. |
| Method | receiver |
Return a Receiver that yields the configured token. |
| Instance Variable | _tok |
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. |