Skip to content

fix(api_connexion): handle the cases that webserver.expose_config is set to "non-sensitive-only" instead of boolean value#32261

Merged
potiuk merged 1 commit into
apache:mainfrom
astronomer:fix-config-api-failure-when-expose-config-set-to-non-sensitive-only
Jun 29, 2023
Merged

fix(api_connexion): handle the cases that webserver.expose_config is set to "non-sensitive-only" instead of boolean value#32261
potiuk merged 1 commit into
apache:mainfrom
astronomer:fix-config-api-failure-when-expose-config-set-to-non-sensitive-only

Conversation

@Lee-W

@Lee-W Lee-W commented Jun 29, 2023

Copy link
Copy Markdown
Member

What's the issue

In airflow/airflow/api_connexion/endpoints/config_endpoint.py, conf.getboolean("webserver", "expose_config") only handle the boolean cases without handling "non-sensitive-only" which is a valid value according to doc

elif conf.getboolean("webserver", "expose_config"):
,
elif conf.getboolean("webserver", "expose_config"):

How to reproduce

  1. add the following value to files/airflow-breeze-config/variables.env
AIRFLOW__WEBSERVER__EXPOSE_CONFIG=NON-SENSITIVE-ONLY
AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.default
  1. breeze --python 3.9 --backend sqlite start-airflow
  2. log in through Airflow UI
  3. Go to http://127.0.0.1:28080/api/v1/config and http://127.0.0.1:28080/api/v1/config/section/database/option/sql_alchemy_conn. both of them fail

What's changed

"non-sensitive-only" is handled in the code section mentioned in ## What's the issue. Sensitive data will be replace as < hidden > like how it's implemented elsewhere


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

…set to non-sensitive-only instead of boolean value
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Jun 29, 2023

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nce. Seems it was only implemented for the "/configuration" endpoint.

@potiuk
potiuk merged commit 4a525e8 into apache:main Jun 29, 2023
@ephraimbuddy ephraimbuddy added this to the Airlfow 2.6.3 milestone Jul 6, 2023
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jul 6, 2023
pankajkoti added a commit to astronomer/airflow that referenced this pull request Sep 1, 2023
potiuk pushed a commit that referenced this pull request Sep 1, 2023
ephraimbuddy pushed a commit that referenced this pull request Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants