-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Don't print MQTT credentials to log #37364
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with an integration ( |
tmp_data.pop(CONF_PASSWORD, None) | ||
tmp_data.pop(CONF_USERNAME, 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.
Instead of popping it, should we replace it with ********
? And maybe only password ?
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.
Also wonder if we can actually specify which keys are going to be overridden, not just show all the data ?
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.
OK, improved to replace the password with ********
.
It will now print all keys present in both the config entry, and in configuration.yaml
, including those which are implicitly present because they have default values.
It could print only keys which actually differ?
Clearing from current milestone, as I am prepping it now. Will target 112.2. |
tmp_data = dict(entry.data) | ||
tmp_data.pop(CONF_PASSWORD, None) | ||
tmp_data.pop(CONF_USERNAME, None) | ||
shared_keys = conf.keys() & entry.data.keys() |
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.
I didn't know this was a thing. Nice.
Maybe somethings like: https://github.com/home-assistant/core/blob/dev/homeassistant/util/logging.py#L15 ? |
Proposed change
Don't print MQTT credentials to log
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: