aneesh-joseph commented on a change in pull request #9645:
URL: https://github.com/apache/airflow/pull/9645#discussion_r450685848



##########
File path: airflow/configuration.py
##########
@@ -267,17 +278,32 @@ def _get_env_var_option(self, section, key):
         env_var_cmd = env_var + '_CMD'
         if env_var_cmd in os.environ:
             # if this is a valid command key...
-            if (section, key) in self.as_command_stdout:
+            if (section, key) in self.sensitive_config_values:
                 return run_command(os.environ[env_var_cmd])
+        # alternatively AIRFLOW__{SECTION}__{KEY}_SECRET (to get from Secrets 
Backend)
+        env_var_cmd = env_var + '_SECRET'
+        if env_var_cmd in os.environ:
+            # if this is a valid command key...
+            if (section, key) in self.sensitive_config_values:
+                return 
_get_config_value_from_secret_backend(os.environ[env_var_cmd])

Review comment:
       ```suggestion
           env_var_secret_path = env_var + '_SECRET'
           if env_var_secret_path in os.environ:
               # if this is a valid secret key...
               if (section, key) in self.sensitive_config_values:
                   return 
_get_config_value_from_secret_backend(os.environ[env_var_secret_path])
   ```




----------------------------------------------------------------
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:
[email protected]


Reply via email to