Token¶
- class cordy.auth.Token(token: str, bot: bool = False)[source]¶
Represents an API token.
Only Bot and Bearer Tokens are supported. User tokens are not supported
- get_auth() str [source]¶
Return the authorization header for the token
- Returns
The authorization header value.
- Return type
- property bearer: bool¶
Whether the token is an oauth bearer token. This is always the negation of
Token.bot
- Type
- classmethod from_auth(auth: str) cordy.auth.Token [source]¶
Build a
Token
from an auth header format.- Parameters
auth (
str
) – The authorization header format string.- Returns
The token built from the auth header value.
- Return type
- Raises
ValueError – Format of the auth parameter is incorrect.