-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Mask secrets when retrieving variables from secrets backend #50895
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
base: main
Are you sure you want to change the base?
Mask secrets when retrieving variables from secrets backend #50895
Conversation
Does this mask ALL |
@jroachgolf84 not all. Only the ones that are deemed sensitive. |
@@ -180,6 +181,7 @@ def _get_variable(key: str, deserialize_json: bool) -> Any: | |||
import json | |||
|
|||
var_val = json.loads(var_val) | |||
mask_secret(var_val, key) # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably not type-ignore this but actually check the type? var_val
can technically be a number or even None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid that it can be a number but the "None" type is covered above on line 179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handled it for the case of "str" because secrets_backend.get_variable(key=key)
returns str | None.
@uranusjr could you take a look at this when you get some time? |
Follow up to this: #50880 (comment)
^ 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 airflow-core/newsfragments.