mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
UniFi redact WLAN password (#142767)
* Recact password key word in WLAN diagnostic data * Fix testdata
This commit is contained in:
parent
3efb009e82
commit
c18d96e2f5
@ -27,7 +27,7 @@ REDACT_DEVICES = {
|
||||
"x_ssh_hostkey_fingerprint",
|
||||
"x_vwirekey",
|
||||
}
|
||||
REDACT_WLANS = {"bc_filter_list", "x_passphrase"}
|
||||
REDACT_WLANS = {"bc_filter_list", "password", "x_passphrase"}
|
||||
|
||||
|
||||
@callback
|
||||
|
@ -1,5 +1,5 @@
|
||||
# serializer version: 1
|
||||
# name: test_entry_diagnostics[dpi_group_payload0-dpi_app_payload0-device_payload0-client_payload0-config_entry_options0]
|
||||
# name: test_entry_diagnostics[wlan_payload0-dpi_group_payload0-dpi_app_payload0-device_payload0-client_payload0-config_entry_options0]
|
||||
dict({
|
||||
'clients': dict({
|
||||
'00:00:00:00:00:00': dict({
|
||||
@ -128,6 +128,82 @@
|
||||
}),
|
||||
'role_is_admin': True,
|
||||
'wlans': dict({
|
||||
'67f2eaec026b2c2893c41b2a': dict({
|
||||
'_id': '67f2eaec026b2c2893c41b2a',
|
||||
'ap_group_ids': list([
|
||||
'67f2e03f7c572754fa1a249e',
|
||||
]),
|
||||
'ap_group_mode': 'all',
|
||||
'bc_filter_list': '**REDACTED**',
|
||||
'bss_transition': True,
|
||||
'dtim_6e': 3,
|
||||
'dtim_mode': 'default',
|
||||
'dtim_na': 3,
|
||||
'dtim_ng': 1,
|
||||
'enabled': True,
|
||||
'enhanced_iot': False,
|
||||
'fast_roaming_enabled': False,
|
||||
'group_rekey': 3600,
|
||||
'hide_ssid': False,
|
||||
'hotspot2conf_enabled': False,
|
||||
'iapp_enabled': True,
|
||||
'is_guest': False,
|
||||
'l2_isolation': False,
|
||||
'mac_filter_enabled': False,
|
||||
'mac_filter_list': list([
|
||||
]),
|
||||
'mac_filter_policy': 'allow',
|
||||
'mcastenhance_enabled': False,
|
||||
'minrate_na_advertising_rates': False,
|
||||
'minrate_na_data_rate_kbps': 6000,
|
||||
'minrate_na_enabled': False,
|
||||
'minrate_ng_advertising_rates': False,
|
||||
'minrate_ng_data_rate_kbps': 1000,
|
||||
'minrate_ng_enabled': True,
|
||||
'minrate_setting_preference': 'auto',
|
||||
'mlo_enabled': False,
|
||||
'name': 'devices',
|
||||
'networkconf_id': '67f2e03f7c572754fa1a2498',
|
||||
'no2ghz_oui': True,
|
||||
'passphrase_autogenerated': True,
|
||||
'pmf_mode': 'disabled',
|
||||
'private_preshared_keys': list([
|
||||
dict({
|
||||
'networkconf_id': '67f2e03f7c572754fa1a2498',
|
||||
'password': '**REDACTED**',
|
||||
}),
|
||||
]),
|
||||
'private_preshared_keys_enabled': True,
|
||||
'proxy_arp': False,
|
||||
'radius_das_enabled': False,
|
||||
'radius_mac_auth_enabled': False,
|
||||
'radius_macacl_format': 'none_lower',
|
||||
'sae_anti_clogging': 5,
|
||||
'sae_groups': list([
|
||||
]),
|
||||
'sae_psk': list([
|
||||
]),
|
||||
'sae_sync': 5,
|
||||
'schedule': list([
|
||||
]),
|
||||
'schedule_with_duration': list([
|
||||
]),
|
||||
'security': 'wpapsk',
|
||||
'setting_preference': 'manual',
|
||||
'site_id': '67f2e00e7c572754fa1a247e',
|
||||
'uapsd_enabled': False,
|
||||
'usergroup_id': '67f2e03f7c572754fa1a2499',
|
||||
'wlan_band': '2g',
|
||||
'wlan_bands': list([
|
||||
'2g',
|
||||
]),
|
||||
'wpa3_fast_roaming': False,
|
||||
'wpa3_support': False,
|
||||
'wpa3_transition': False,
|
||||
'wpa_enc': 'ccmp',
|
||||
'wpa_mode': 'wpa2',
|
||||
'x_passphrase': '**REDACTED**',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
# ---
|
||||
|
@ -103,6 +103,75 @@ DPI_GROUP_DATA = [
|
||||
"dpiapp_ids": ["5f976f62e3c58f018ec7e17d"],
|
||||
}
|
||||
]
|
||||
WLAN_DATA = [
|
||||
{
|
||||
"setting_preference": "manual",
|
||||
"wpa3_support": False,
|
||||
"dtim_6e": 3,
|
||||
"minrate_na_advertising_rates": False,
|
||||
"wpa_mode": "wpa2",
|
||||
"minrate_setting_preference": "auto",
|
||||
"minrate_ng_advertising_rates": False,
|
||||
"hotspot2conf_enabled": False,
|
||||
"radius_das_enabled": False,
|
||||
"mlo_enabled": False,
|
||||
"group_rekey": 3600,
|
||||
"radius_macacl_format": "none_lower",
|
||||
"pmf_mode": "disabled",
|
||||
"wpa3_transition": False,
|
||||
"passphrase_autogenerated": True,
|
||||
"private_preshared_keys": [
|
||||
{
|
||||
"password": "should be redacted",
|
||||
"networkconf_id": "67f2e03f7c572754fa1a2498",
|
||||
}
|
||||
],
|
||||
"mcastenhance_enabled": False,
|
||||
"usergroup_id": "67f2e03f7c572754fa1a2499",
|
||||
"proxy_arp": False,
|
||||
"sae_sync": 5,
|
||||
"iapp_enabled": True,
|
||||
"uapsd_enabled": False,
|
||||
"enhanced_iot": False,
|
||||
"name": "devices",
|
||||
"site_id": "67f2e00e7c572754fa1a247e",
|
||||
"hide_ssid": False,
|
||||
"wlan_band": "2g",
|
||||
"_id": "67f2eaec026b2c2893c41b2a",
|
||||
"private_preshared_keys_enabled": True,
|
||||
"no2ghz_oui": True,
|
||||
"networkconf_id": "67f2e03f7c572754fa1a2498",
|
||||
"is_guest": False,
|
||||
"dtim_na": 3,
|
||||
"minrate_na_enabled": False,
|
||||
"sae_groups": [],
|
||||
"enabled": True,
|
||||
"sae_psk": [],
|
||||
"wlan_bands": ["2g"],
|
||||
"mac_filter_policy": "allow",
|
||||
"security": "wpapsk",
|
||||
"ap_group_ids": ["67f2e03f7c572754fa1a249e"],
|
||||
"l2_isolation": False,
|
||||
"minrate_ng_enabled": True,
|
||||
"bss_transition": True,
|
||||
"minrate_ng_data_rate_kbps": 1000,
|
||||
"radius_mac_auth_enabled": False,
|
||||
"schedule_with_duration": [],
|
||||
"wpa3_fast_roaming": False,
|
||||
"ap_group_mode": "all",
|
||||
"fast_roaming_enabled": False,
|
||||
"wpa_enc": "ccmp",
|
||||
"mac_filter_list": [],
|
||||
"dtim_mode": "default",
|
||||
"schedule": [],
|
||||
"bc_filter_list": "should be redacted",
|
||||
"minrate_na_data_rate_kbps": 6000,
|
||||
"mac_filter_enabled": False,
|
||||
"sae_anti_clogging": 5,
|
||||
"dtim_ng": 1,
|
||||
"x_passphrase": "should be redacted",
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@ -119,6 +188,7 @@ DPI_GROUP_DATA = [
|
||||
@pytest.mark.parametrize("device_payload", [DEVICE_DATA])
|
||||
@pytest.mark.parametrize("dpi_app_payload", [DPI_APP_DATA])
|
||||
@pytest.mark.parametrize("dpi_group_payload", [DPI_GROUP_DATA])
|
||||
@pytest.mark.parametrize("wlan_payload", [WLAN_DATA])
|
||||
async def test_entry_diagnostics(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
|
Loading…
x
Reference in New Issue
Block a user