airflow.secrets.cache

Module Contents

Classes

SecretCache

A static class to manage the global secret cache.

class airflow.secrets.cache.SecretCache[source]

A static class to manage the global secret cache.

classmethod init()[source]

Initializes the cache, provided the configuration allows it. Safe to call several times.

classmethod reset()[source]

For test purposes only.

classmethod get_variable(key)[source]

Tries to get the value associated with the key from the cache.

Returns

The saved value (which can be None) if present in cache and not expired, a NotPresent exception otherwise.

Return type

str | None

classmethod get_connection_uri(conn_id)[source]

Tries to get the uri associated with the conn_id from the cache.

Returns

The saved uri if present in cache and not expired, a NotPresent exception otherwise.

Return type

str

classmethod save_variable(key, value)[source]

Saves the value for that key in the cache, if initialized.

classmethod save_connection_uri(conn_id, uri)[source]

Saves the uri representation for that connection in the cache, if initialized.

classmethod invalidate_variable(key)[source]

Invalidates (actually removes) the value stored in the cache for that Variable.

Was this entry helpful?