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]

Initialize the cache, provided the configuration allows it.

Safe to call several times.

classmethod reset()[source]

Use for test purposes only.

classmethod get_variable(key)[source]

Try 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]

Try 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]

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

classmethod save_connection_uri(conn_id, uri)[source]

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

classmethod invalidate_variable(key)[source]

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

Was this entry helpful?