snip.token.storage¶
Token storage module.
This module provides different solutions for tokens.
Functions
|
Get all tokens from all sources. |
|
Get the token for a specific deployment_url. |
|
Get all tokens for a specific book_id and deployment_url. |
Modules
Functionalities to save and retrieve tokens from ini files. |
|
Functionalities to save and retrieve tokens from a keyring. |
Module Functions
- snip.token.storage.get_all_tokens(keyring: KeyringBackend | None = None, files: str | PathLike | Sequence[str | PathLike] | None = None) tuple[list[Token], Iterable[str | PathLike]]¶
Get all tokens from all sources.
- Parameters:
keyring (KeyringBackend, optional) – The keyring to use. Supply to override the default keyring. Defaults to None.
files (Files, optional) – The files to read the tokens from. Supply to override the default files. Defaults to None.
- Returns:
tokens, sources – List of all tokens and their sources.
- Return type:
- snip.token.storage.get_token_by_deployment(deployment_url: str | None, keyring: KeyringBackend | None = None, files: str | PathLike | Sequence[str | PathLike] | None = None) tuple[list[Token], list[str | PathLike]]¶
Get the token for a specific deployment_url.
- Parameters:
deployment_url (str) – The deployment_url to get the token for.
keyring (KeyringBackend, optional) – The keyring to use. Defaults to None.
files (Files, optional) – The files to read the tokens from. Defaults to None.
- Returns:
tokens, sources – List of all tokens and their sources.
- Return type:
- snip.token.storage.get_tokens_by_book_and_deployment(book_id: str | int, deployment_url: str | None, keyring: KeyringBackend | None = None, files: str | PathLike | Sequence[str | PathLike] | None = None) tuple[list[BookToken], list[str | PathLike]]¶
Get all tokens for a specific book_id and deployment_url.
- Parameters:
- Returns:
tokens, sources – List of all tokens and their sources.
- Return type: