mirror of
https://github.com/home-assistant/core.git
synced 2026-07-09 07:45:11 +01:00
Fix ProxmoxVE missing unused token data (#172782)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.const import CONF_USERNAME
|
||||
from homeassistant.const import CONF_TOKEN, CONF_USERNAME
|
||||
|
||||
from .const import AUTH_OTHER, CONF_AUTH_METHOD, CONF_REALM, CONF_TOKEN_ID
|
||||
|
||||
@@ -21,7 +21,7 @@ def sanitize_config_entry(input_data: Mapping[str, Any]) -> dict[str, Any]:
|
||||
data[CONF_REALM] = realm
|
||||
data[CONF_USERNAME] = f"{username}@{realm}"
|
||||
|
||||
if CONF_TOKEN_ID in data and "!" in data[CONF_TOKEN_ID]:
|
||||
if data.get(CONF_TOKEN) and data.get(CONF_TOKEN_ID) and "!" in data[CONF_TOKEN_ID]:
|
||||
data[CONF_TOKEN_ID] = data[CONF_TOKEN_ID].split("!")[1]
|
||||
|
||||
return data
|
||||
|
||||
@@ -496,6 +496,11 @@ def sanitize_config_entry(data: dict[str, Any]) -> dict[str, Any]:
|
||||
MOCK_USER_AUTH_STEP_OTHER_TOKEN,
|
||||
MOCK_TEST_TOKEN_OTHER_CONFIG,
|
||||
),
|
||||
(
|
||||
MOCK_USER_STEP_TOKEN,
|
||||
MOCK_USER_AUTH_STEP_TOKEN_FULL_ID,
|
||||
MOCK_TEST_TOKEN_CONFIG,
|
||||
),
|
||||
],
|
||||
)
|
||||
@pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
Reference in New Issue
Block a user