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 TYPE_CHECKING
from pendulum import datetime
from airflow.decorators import dag, task
from airflow.providers.fernet_secrets.operators.sync import DumpSecretsOperator
if TYPE_CHECKING:
from airflow_fernet_secrets.typings import SecretsParameter
@dag(start_date=datetime(2024, 1, 1), catchup=False, schedule=None)
def dump_connection():
@task.load_fernet()
def load_connection() -> SecretsParameter:
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.2.1.tar.gz
.
File metadata
- Download URL: airflow_fernet_secrets-0.2.1.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.22
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c8829d220dffa0dd12661072dff21be97a5ecc3527e0798ab5dadf5b48db521 |
|
MD5 | 09c21caebaddf4605d1c0fbd5b226216 |
|
BLAKE2b-256 | 586a7a2252a6a7612fb9202ce9c2fca7cef848a48db4c3c1f21cdf5479849b5c |
File details
Details for the file airflow_fernet_secrets-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: airflow_fernet_secrets-0.2.1-py3-none-any.whl
- Upload date:
- Size: 55.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.22
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39e2ddef501397d4f6dfd75e7c0bcd9cb9671ce28cf1aa2cbabac764a5d75cc |
|
MD5 | c61fafa708bf456d8badc5f0b4dba5e5 |
|
BLAKE2b-256 | 9bb3ef846d9461ca694bfd48442dd0367505fc6a731cd0b7cff2d8f8845052af |