class documentation
class SecretCache: (source)
Constructor: SecretCache(fetcher, ids, refresh_interval, max_staleness)
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 |
Undocumented |
| Instance Variable | client |
Undocumented |
| Instance Variable | fetch |
Undocumented |
| Instance Variable | fetcher |
Undocumented |
| Instance Variable | max |
Undocumented |
| Instance Variable | now |
Undocumented |
| Instance Variable | refresh |
Undocumented |
| Instance Variable | server |
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 |
Undocumented |
| Method | _record |
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.
Get an entry's value, fetching it if needed.
Returned values are shared across callers and must not be mutated.
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