airflow.models.crypto

Module Contents

airflow.models.crypto.log[source]
class airflow.models.crypto.FernetProtocol[source]

Bases: airflow.typing_compat.Protocol

This class is only used for TypeChecking (for IDEs, mypy, etc)

decrypt(self, b)[source]

Decrypt with Fernet

encrypt(self, b)[source]

Encrypt with Fernet

class airflow.models.crypto.NullFernet[source]

A “Null” encryptor class that doesn’t encrypt or decrypt but that presents a similar interface to Fernet.

The purpose of this is to make the rest of the code not have to know the difference, and to only display the message once, not 20 times when airflow db init is ran.

is_encrypted = False[source]
decrypt(self, b)[source]

Decrypt with Fernet.

encrypt(self, b)[source]

Encrypt with Fernet.

airflow.models.crypto._fernet :Optional[FernetProtocol][source]
airflow.models.crypto.get_fernet()[source]
Deferred load of Fernet key.

This function could fail either because Cryptography is not installed or because the Fernet key is invalid.

Returns

Fernet object

Raises

airflow.exceptions.AirflowException if there’s a problem trying to load Fernet

Was this entry helpful?