You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/10/02 09:19:33 UTC

[PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

hussein-awala opened a new pull request, #34712:
URL: https://github.com/apache/airflow/pull/34712

   (no comment)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #34712:
URL: https://github.com/apache/airflow/pull/34712#discussion_r1349384221


##########
airflow/api_connexion/endpoints/config_endpoint.py:
##########
@@ -123,7 +123,7 @@ def get_value(section: str, option: str) -> Response:
                 "Config not found.", detail=f"The option [{section}/{option}] is not found in config."
             )
 
-        if (section, option) in conf.sensitive_config_values:
+        if (section.lower(), option.lower()) in conf.sensitive_config_values:

Review Comment:
   Agree with @hussein-awala . I think the proposed way is right. The "www/views.py" code displays all the sections/options from the config and then then from sensitive_config_values. What we are preventing here is that differently cased section/option is passed by the user, so the source of section/key are not the config itself, but external to it. We can safely assume that the config has the right sections/keys (that's why the code in views.py works).  But we cannot make the same assumption about the values passed by the user so we have to lowercase them.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #34712:
URL: https://github.com/apache/airflow/pull/34712#issuecomment-1744320533

   We don’t currently normalise entries in `sensitive_config_values` to lowercase. Should we do that to ensure things are compared correctly?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #34712:
URL: https://github.com/apache/airflow/pull/34712#discussion_r1343679602


##########
airflow/api_connexion/endpoints/config_endpoint.py:
##########
@@ -123,7 +123,7 @@ def get_value(section: str, option: str) -> Response:
                 "Config not found.", detail=f"The option [{section}/{option}] is not found in config."
             )
 
-        if (section, option) in conf.sensitive_config_values:
+        if (section.lower(), option.lower()) in conf.sensitive_config_values:

Review Comment:
   Instead of this, I think we should do what we do in the webserver https://github.com/apache/airflow/blob/f349fda125c2251ac4129c2c28fbf6f7dbb69294/airflow/www/views.py#L3840-L3845.
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #34712:
URL: https://github.com/apache/airflow/pull/34712


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Check if the lower of provided values are sensitives in config endpoint [airflow]

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on code in PR #34712:
URL: https://github.com/apache/airflow/pull/34712#discussion_r1346370939


##########
airflow/api_connexion/endpoints/config_endpoint.py:
##########
@@ -123,7 +123,7 @@ def get_value(section: str, option: str) -> Response:
                 "Config not found.", detail=f"The option [{section}/{option}] is not found in config."
             )
 
-        if (section, option) in conf.sensitive_config_values:
+        if (section.lower(), option.lower()) in conf.sensitive_config_values:

Review Comment:
   I cannot fix the problem, because it checks if the value exists in the configuration as it is. But since we don't read any configuration from the user in this view, it's safe because all the configuration in both side (sensitive dict and configuration dict) are in low format.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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