class documentation

A simple file-based token cache.

Method __init__ Undocumented
Async Method get Get a token from the cache by name.
Async Method remove Remove a token from the cache by name.
Async Method remove_if_equal Remove a token from the cache by name if it matches the provided token.
Async Method set Set a token in the cache by name.
Instance Variable cache_file Undocumented
Instance Variable file_create_mode Undocumented
Instance Variable flock_timeout Undocumented
Instance Variable path_create_mode Undocumented
Method _yaml_dump Dump tokens to a YAML string.
Method _yaml_parse Parse YAML data from a string.
def __init__(self, cache_file: str | Path = Path(DEFAULT_CONFIG_DIR) / DEFAULT_CREDENTIALS_FILE, path_create_mode: int = 488, file_create_mode: int = 384, flock_timeout: float | None = 5.0): (source)

Undocumented

async def get(self, name: str) -> Token | None: (source)

Get a token from the cache by name.

async def remove(self, name: str): (source)

Remove a token from the cache by name.

async def remove_if_equal(self, name: str, token: Token): (source)

Remove a token from the cache by name if it matches the provided token.

async def set(self, name: str, token: Token): (source)

Set a token in the cache by name.

cache_file = (source)

Undocumented

file_create_mode = (source)

Undocumented

flock_timeout = (source)

Undocumented

path_create_mode = (source)

Undocumented

def _yaml_dump(self, tokens: dict[str, Token]) -> str: (source)

Dump tokens to a YAML string.

def _yaml_parse(self, data: str) -> dict[str, Token]: (source)

Parse YAML data from a string.