Skip to content
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

Fix password masking in CLI action_logging #15143

Merged
merged 3 commits into from
Apr 1, 2021
Merged

Conversation

XD-DENG
Copy link
Member

@XD-DENG XD-DENG commented Apr 1, 2021

closes: #15131

Currently as long as argument '-p' if present, code tries to mask it.
However, '-p' may mean something else (not password), like a boolean flag. Such cases may result in exception.

More detailed analysis can be found in issue #15131 (comment)

The solution here is to only try masking the next arg when we are sure -p means "password".


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Worth adding tests do you think?

@XD-DENG
Copy link
Member Author

XD-DENG commented Apr 1, 2021

@ashb yep, I agree it's worth adding test(s). I was thinking about it when I was preparing the PR, but still trying figure out how to do it in the most proper way.

@XD-DENG
Copy link
Member Author

XD-DENG commented Apr 1, 2021

Ha, I think the adding more cases to test_cli_create_user_supplied_password_is_masked would be sufficient. I overlooked it just now.

Currently as long as argument '-p' if present, code tries to mask it.

However, '-p' may mean something else (not password), like a boolean flag. Such cases may result in exception
@XD-DENG
Copy link
Member Author

XD-DENG commented Apr 1, 2021

Worth adding tests do you think?

Added in 6b1f641

@XD-DENG XD-DENG merged commit 486b764 into apache:master Apr 1, 2021
@XD-DENG XD-DENG deleted the issue-15131 branch April 1, 2021 21:03
ashb pushed a commit that referenced this pull request Apr 15, 2021
Currently as long as argument '-p' if present, code tries to mask it.

However, '-p' may mean something else (not password), like a boolean flag. Such cases may result in exception

(cherry picked from commit 486b764)
kaxil pushed a commit to astronomer/airflow that referenced this pull request Apr 19, 2021
Currently as long as argument '-p' if present, code tries to mask it.

However, '-p' may mean something else (not password), like a boolean flag. Such cases may result in exception

(cherry picked from commit 486b764)
(cherry picked from commit 317f76a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

airflow scheduler -p command not working in airflow 2.0.1
3 participants