class documentation

TTL cache of the configured credentials that falls back to the last fetched value, up to max_staleness old, when a refresh fails.

Method __init__ Create a cache for the given secret IDs.
Async Method get Get an entry's value, fetching it if needed.
Instance Variable api_key Undocumented
Instance Variable client_cert Undocumented
Instance Variable fetch_timeout Undocumented
Instance Variable fetcher Undocumented
Instance Variable max_staleness Undocumented
Instance Variable now Undocumented
Instance Variable refresh_interval Undocumented
Instance Variable server_ca_cert Undocumented
Method _fetch Fetch all of an entry's secrets and parse them. Returns the parsed value and the version IDs in refs order.
Method _record_failure Undocumented
Method _record_success Undocumented
Method _refresh Fetch an entry's secrets and record the outcome in the cache.
def __init__(self, fetcher: Fetcher, ids: SecretIDs, refresh_interval: timedelta, max_staleness: timedelta): (source)

Create a cache for the given secret IDs.

async def get(self, entry: CacheEntry[_T], tel: Telemetry) -> _T: (source)

Get an entry's value, fetching it if needed.

Returned values are shared across callers and must not be mutated.

Undocumented

Undocumented

fetch_timeout = (source)

Undocumented

Undocumented

max_staleness = (source)

Undocumented

Undocumented

refresh_interval = (source)

Undocumented

server_ca_cert: CacheEntry[bytes] | None = (source)

Undocumented

def _fetch(self, entry: CacheEntry[_T]) -> tuple[_T, list[str]]: (source)

Fetch all of an entry's secrets and parse them. Returns the parsed value and the version IDs in refs order.

def _record_failure(self, entry: CacheEntry[_T], err: SecretFetchError, latency: timedelta, age: float, can_use_stale: bool, tel: Telemetry, base_attrs: dict[str, str]): (source)

Undocumented

def _record_success(self, entry: CacheEntry[_T], version_ids: list[str], prev_version_ids: list[str] | None, prev_failed: bool, latency: timedelta, tel: Telemetry, base_attrs: dict[str, str]): (source)

Undocumented

def _refresh(self, entry: CacheEntry[_T], fut: concurrent.futures.Future[_T], start: float, can_use_stale: bool, tel: Telemetry, base_attrs: dict[str, str]): (source)

Fetch an entry's secrets and record the outcome in the cache.