Skip to content

Commit 76ad6f0

Browse files
ashbkaxil
authored andcommitted
[AIRFLOW-3173] Add _cmd options for password config options (#4024)
There were a few more "password" config options added over the last few months that didn't have _cmd options. Any config option that is a password should be able to be provided via a _cmd version.
1 parent fbf04e9 commit 76ad6f0

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

airflow/configuration.py

+4
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ class AirflowConfigParser(ConfigParser):
130130
('celery', 'result_backend'),
131131
# Todo: remove this in Airflow 1.11
132132
('celery', 'celery_result_backend'),
133+
('atlas', 'password'),
134+
('smtp', 'smtp_password'),
135+
('ldap', 'bind_password'),
136+
('kubernetes', 'git_password'),
133137
}
134138

135139
# A two-level mapping of (section -> new_name -> old_name). When reading

docs/howto/set-config.rst

+17-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,30 @@ or by creating a corresponding environment variable:
2020
2121
AIRFLOW__CORE__SQL_ALCHEMY_CONN=my_conn_string
2222
23-
You can also derive the connection string at run time by appending ``_cmd`` to the key like this:
23+
You can also derive the connection string at run time by appending ``_cmd`` to
24+
the key like this:
2425

2526
.. code-block:: bash
2627
2728
[core]
2829
sql_alchemy_conn_cmd = bash_command_to_run
2930
30-
-But only three such configuration elements namely sql_alchemy_conn, broker_url and result_backend can be fetched as a command. The idea behind this is to not store passwords on boxes in plain text files. The order of precedence is as follows -
31+
The following config options support this ``_cmd`` version:
32+
33+
* ``sql_alchemy_conn`` in ``[core]`` section
34+
* ``fernet_key`` in ``[core]`` section
35+
* ``broker_url`` in ``[celery]`` section
36+
* ``result_backend`` in ``[celery]`` section
37+
* ``password`` in ``[atlas]`` section
38+
* ``smtp_password`` in ``[smtp]`` section
39+
* ``bind_password`` in ``[ldap]`` section
40+
* ``git_password`` in ``[kubernetes]`` section
41+
42+
The idea behind this is to not store passwords on boxes in plain text files.
43+
44+
The order of precedence for all connfig options is as follows -
3145

3246
1. environment variable
3347
2. configuration in airflow.cfg
3448
3. command in airflow.cfg
35-
4. default
49+
4. Airflow's built in defaults

0 commit comments

Comments
 (0)