-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIRFLOW-45: Support Hidden Airflow Variables #1530
Conversation
|
@@ -372,6 +375,9 @@ def run_command(command): | |||
# default_principal = admin | |||
# default_secret = admin | |||
|
|||
[admin] | |||
hide_confidential_ui_fields = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be True
just to be more Python-esque, e.g.
# statsd_on = False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, why True as default and not False as default? False preserves backward compatibility with respect to UI experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is if we default to false, then passwords are visible by default.
|
Wondering whether we want to include extras in the filtering. It's annoying, and I don't think that there is any secret stuff in there for existing connections. Thoughts? |
Note: installed locally, and this did appear to work. |
Actually, I take that back. It worked for the hooks. For variables, it only works for very specific fields:
I would have expected either all to be encrypted, or anything with 'password'/'secret' in it. |
}, | ||
'admin': { | ||
'hide_confidential_ui_fields': True, | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you have specified the config value everywhere it is needed. I recall there are at least 3 places where new config needs to be specified.
For example, look at dags_are_paused_at_creation
:
(venv) Sid-As-MacBook-Pro:airflow siddharth$ grep -ri dags_are_paused_at_creation . | grep -v Binary | grep -v static
./configuration.py: 'dags_are_paused_at_creation': True,
./configuration.py:dags_are_paused_at_creation = True
./configuration.py:dags_are_paused_at_creation = False
./models.py: is_paused_at_creation = configuration.getboolean('core', 'dags_are_paused_at_creation')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@criccomini updated the logic, it should check if any of the key_name
contains any words in the confidential_fields list that models after sentry's list
|
Thx for providing a screen shot.. generally a requirement for all UI-changing PRs, though you can attach the screen shot here or in the JIRA. Both work. |
@mattuuh7, this is looking good.
|
|
When running this off of master, I get:
This can be reproduced by going to a fresh airflow install, running |
Removing
Made the exception go away. The patch appears to work without it, but |
I've determined the issue was with some rows that somehow persisted even after I ran |
Ready to merge. Could you change the commit message to: AIRFLOW-45: Support Hidden Airflow Variables |
@criccomini done with the change. please review again. thx |
|
thanks @criccomini |
Dear Airflow Maintainers,
Please accept this PR that addresses the following issues:
Reminders for contributors: