You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/20 10:37:55 UTC

[GitHub] [airflow] Marloxo commented on a change in pull request #9397: Add sensitive_variable_fields option to extend `DEFAULT_SENSITIVE_VARIABLE_FIELDS`

Marloxo commented on a change in pull request #9397:
URL: https://github.com/apache/airflow/pull/9397#discussion_r443120846



##########
File path: airflow/www/utils.py
##########
@@ -39,23 +39,28 @@
 from airflow.www.forms import DateTimeWithTimezoneField
 from airflow.www.widgets import AirflowDateTimePickerWidget
 
-DEFAULT_SENSITIVE_VARIABLE_FIELDS = (
+DEFAULT_SENSITIVE_VARIABLE_FIELDS = {
     'password',
     'secret',
     'passwd',
     'authorization',
     'api_key',
     'apikey',
     'access_token',
-)
+}
 
 
 def should_hide_value_for_key(key_name):
     # It is possible via importing variables from file that a key is empty.
     if key_name:
-        config_set = conf.getboolean('admin',
-                                     'hide_sensitive_variable_fields')
-        field_comp = any(s in key_name.lower() for s in DEFAULT_SENSITIVE_VARIABLE_FIELDS)
+        config_set = conf.getboolean('admin', 'hide_sensitive_variable_fields')
+
+        sensitive_variable_fields = conf.get('admin', 'sensitive_variable_fields')
+
+        if sensitive_variable_fields:
+            DEFAULT_SENSITIVE_VARIABLE_FIELDS.update(sensitive_variable_fields.split(','))

Review comment:
       Good point




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org