mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Redact emails and names in Bring! diagnostics (#140746)
This commit is contained in:
parent
735c98cb86
commit
46973f0446
@ -4,10 +4,14 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics import async_redact_data
|
||||
from homeassistant.const import CONF_EMAIL, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .coordinator import BringConfigEntry
|
||||
|
||||
TO_REDACT = {CONF_NAME, CONF_EMAIL}
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, config_entry: BringConfigEntry
|
||||
@ -15,7 +19,10 @@ async def async_get_config_entry_diagnostics(
|
||||
"""Return diagnostics for a config entry."""
|
||||
|
||||
return {
|
||||
"data": {k: v.to_dict() for k, v in config_entry.runtime_data.data.items()},
|
||||
"data": {
|
||||
k: async_redact_data(v.to_dict(), TO_REDACT)
|
||||
for k, v in config_entry.runtime_data.data.items()
|
||||
},
|
||||
"lists": [lst.to_dict() for lst in config_entry.runtime_data.lists],
|
||||
"user_settings": config_entry.runtime_data.user_settings.to_dict(),
|
||||
}
|
||||
|
@ -128,16 +128,16 @@
|
||||
}),
|
||||
'lst': dict({
|
||||
'listUuid': 'b4776778-7f6c-496e-951b-92a35d3db0dd',
|
||||
'name': 'Baumarkt',
|
||||
'name': '**REDACTED**',
|
||||
'theme': 'ch.publisheria.bring.theme.home',
|
||||
}),
|
||||
'users': dict({
|
||||
'users': list([
|
||||
dict({
|
||||
'country': 'DE',
|
||||
'email': 'test-email',
|
||||
'email': '**REDACTED**',
|
||||
'language': 'de',
|
||||
'name': 'Bring',
|
||||
'name': '**REDACTED**',
|
||||
'photoPath': '',
|
||||
'plusTryOut': False,
|
||||
'publicUuid': '9a21fdfc-63a4-441a-afc1-ef3030605a9d',
|
||||
@ -145,9 +145,9 @@
|
||||
}),
|
||||
dict({
|
||||
'country': 'US',
|
||||
'email': 'EMAIL',
|
||||
'email': '**REDACTED**',
|
||||
'language': 'en',
|
||||
'name': 'NAME',
|
||||
'name': '**REDACTED**',
|
||||
'photoPath': '',
|
||||
'plusTryOut': False,
|
||||
'publicUuid': '73af455f-c158-4004-a5e0-79f4f8a6d4bd',
|
||||
@ -292,16 +292,16 @@
|
||||
}),
|
||||
'lst': dict({
|
||||
'listUuid': 'e542eef6-dba7-4c31-a52c-29e6ab9d83a5',
|
||||
'name': 'Einkauf',
|
||||
'name': '**REDACTED**',
|
||||
'theme': 'ch.publisheria.bring.theme.home',
|
||||
}),
|
||||
'users': dict({
|
||||
'users': list([
|
||||
dict({
|
||||
'country': 'DE',
|
||||
'email': 'test-email',
|
||||
'email': '**REDACTED**',
|
||||
'language': 'de',
|
||||
'name': 'Bring',
|
||||
'name': '**REDACTED**',
|
||||
'photoPath': '',
|
||||
'plusTryOut': False,
|
||||
'publicUuid': '9a21fdfc-63a4-441a-afc1-ef3030605a9d',
|
||||
@ -309,9 +309,9 @@
|
||||
}),
|
||||
dict({
|
||||
'country': 'US',
|
||||
'email': 'EMAIL',
|
||||
'email': '**REDACTED**',
|
||||
'language': 'en',
|
||||
'name': 'NAME',
|
||||
'name': '**REDACTED**',
|
||||
'photoPath': '',
|
||||
'plusTryOut': False,
|
||||
'publicUuid': '73af455f-c158-4004-a5e0-79f4f8a6d4bd',
|
||||
|
Loading…
x
Reference in New Issue
Block a user