airflow filesystem secret backend using fernet
Project description
airflow-fernet-secrets
how to install
pip install airflow-fernet-secrets
# or
# pip install airflow-fernet-secrets[asyncio]
how to use
config
AIRFLOW__SECRETS__BACKEND=airflow.providers.fernet_secrets.secrets.secret_manager.FernetLocalSecretsBackend
# or
# AIRFLOW__SECRETS__BACKEND=airflow_fernet_secrets.secrets.server.ServerFernetLocalSecretsBackend
#
AIRFLOW__PROVIDERS_FERNET_SECRETS__SECRET_KEY=# some fernet key
# ex: 2eu7W6ULuYxnUB4Uz31IYddkdgboa5kLP24bYtegll0=
# or
# AIRFLOW__PROVIDERS_FERNET_SECRETS__SECRET_KEY_CMD=# some fernet key command
# ex: cat /dev/run/secret_key
# or
# AIRFLOW__PROVIDERS_FERNET_SECRETS__SECRET_KEY_SECRET=# some fernet key file
# ex: /dev/run/secret_key
AIRFLOW__PROVIDERS_FERNET_SECRETS__BACKEND_FILE=# some sqlite file path
# ex: /tmp/backend
# or
# AIRFLOW__PROVIDERS_FERNET_SECRETS__BACKEND_FILE_CMD=# some sqlite file path command
# ex: cat /tmp/where_is_backend
# or
# AIRFLOW__PROVIDERS_FERNET_SECRETS__BACKEND_FILE_SECRET=# some sqlite file path file
# ex: /tmp/where_is_backend
example dag
from __future__ import annotations
from typing import Any
from pendulum import datetime
from airflow.decorators import dag, task
from airflow.providers.fernet_secrets.operators.sync import DumpSecretsOperator
@dag(start_date=datetime(2024, 1, 1), catchup=False, schedule=None)
def dump_connection():
@task.load_fernet()
def load_connection() -> dict[str, Any]:
return {"conn_ids": "some_conn_id"}
dump = DumpSecretsOperator(task_id="dump", fernet_secrets_conn_ids="some_conn_id")
load = load_connection()
_ = dump >> load
dump_connection()
TODO
- exceptions
- mysql
- mssql(
pymssql
) - more tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file airflow_fernet_secrets-0.1.0.tar.gz
.
File metadata
- Download URL: airflow_fernet_secrets-0.1.0.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3bd934147fb9781052615a0962e8f48a5d8dba91f9a1c54753add1e44b48cf2 |
|
MD5 | c17d072d0c1f04ea19dd7f41ce7f42b9 |
|
BLAKE2b-256 | f54b01f83ff7a83d936c8c32e3e720d84e0d13dd2b1c077bd3f99bb2c54a9dd2 |
File details
Details for the file airflow_fernet_secrets-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: airflow_fernet_secrets-0.1.0-py3-none-any.whl
- Upload date:
- Size: 54.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60134ec59f36fc4eaba8bc259adcb6e5449ec4b772ea950a7bda81d212a2baba |
|
MD5 | 45e7f8450dd42471928a825bbb559f21 |
|
BLAKE2b-256 | 3372f22a4652c9deeca9a1847c17db9d88585c98b31b2b884439ecdefddc3a57 |