Skip to content

Commit

Permalink
Fix redaction of username and password in logs (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinse authored Oct 22, 2024
1 parent 549f665 commit ca765a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/zaptec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up zaptec as config entry."""

redacted_data = {**entry.data}
for key in ("password", "username"):
if key in redacted_data:
redacted_data[key] = "********"

_LOGGER.info(STARTUP)
_LOGGER.debug("Setting up entry %s: %s", entry.entry_id, entry.data)
_LOGGER.debug("Setting up entry %s: %s", entry.entry_id, redacted_data)

coordinator = ZaptecUpdateCoordinator(
hass,
Expand Down

0 comments on commit ca765a0

Please sign in to comment.