saltext.vault.utils.vault.cache

Vault-specific cache classes

class saltext.vault.utils.vault.cache.CommonCache(context, cbank, cache_backend=None, ttl=None, flush_exception=None)[source]

Base class that unifies context and other cache backends.

class saltext.vault.utils.vault.cache.VaultCache(context, cbank, ckey, cache_backend=None, ttl=None, flush_exception=None)[source]

Encapsulates session and other cache backends for a single domain like secret path metadata. Uses a single cache key.

exists(flush=True)[source]

Check whether data for this domain exists

get(flush=True)[source]

Return the cached data for this domain or None

flush(cbank=False)[source]

Flush the cache for this domain

store(value)[source]

Store data for this domain

class saltext.vault.utils.vault.cache.VaultConfigCache(context, cbank, ckey, opts, cache_backend_factory=<function _get_cache_backend>, init_config=None, flush_exception=None)[source]

Handles caching of received configuration

exists(flush=True)[source]

Check if a configuration has been loaded and cached

get(flush=True)[source]

Return the current cached configuration

flush(cbank=True)[source]

Flush all connection-scoped data

store(value)[source]

Reload cache configuration, then store the new Vault configuration, overwriting the existing one.

class saltext.vault.utils.vault.cache.LeaseCacheMixin(*args, **kwargs)[source]

Mixin for auth and lease cache that checks validity and acts with hydrated objects

class saltext.vault.utils.vault.cache.VaultLeaseCache(*args, **kwargs)[source]

Handles caching of Vault leases. Supports multiple cache keys. Checks whether cached leases are still valid before returning. Does not enforce for per-lease min_ttl.

get(ckey, valid_for=0, flush=True)[source]

Returns valid cached lease data or None. Flushes cache if invalid by default.

store(ckey, value)[source]

Store a lease in cache

exists(ckey, flush=True)[source]

Check whether a named lease exists in cache. Does not filter invalid ones, so fetching a reported one might still return None.

flush(ckey=None)[source]

Flush the lease cache or a single lease from the lease cache

list()[source]

List all cached leases. Does not filter invalid ones, so fetching a reported one might still return None.

class saltext.vault.utils.vault.cache.VaultAuthCache(context, cbank, ckey, auth_cls, cache_backend=None, ttl=None, flush_exception=None)[source]

Implements authentication secret-specific caches. Checks whether the cached secrets are still valid before returning.

exists(flush=True)[source]

Check whether data for this domain exists

get(valid_for=0, flush=True)[source]

Returns valid cached auth data or None. Flushes cache if invalid by default.

store(value)[source]

Store an auth credential in cache. Will overwrite possibly existing one.

flush(cbank=None)[source]

Flush the cached auth credentials. If this is a token cache, flushing it will delete the whole session-scoped cache bank.