Skip to content

Commit ca765a0

Browse files
authored
Fix redaction of username and password in logs (#132)
1 parent 549f665 commit ca765a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: custom_components/zaptec/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
6969
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
7070
"""Set up zaptec as config entry."""
7171

72+
redacted_data = {**entry.data}
73+
for key in ("password", "username"):
74+
if key in redacted_data:
75+
redacted_data[key] = "********"
76+
7277
_LOGGER.info(STARTUP)
73-
_LOGGER.debug("Setting up entry %s: %s", entry.entry_id, entry.data)
78+
_LOGGER.debug("Setting up entry %s: %s", entry.entry_id, redacted_data)
7479

7580
coordinator = ZaptecUpdateCoordinator(
7681
hass,

0 commit comments

Comments
 (0)