Change WHITELIST to ALLOWLIST for websockets (#44766)
parent
0cff069c98
commit
5b67030c26
|
@ -58,11 +58,11 @@ def handle_subscribe_events(hass, connection, msg):
|
|||
"""Handle subscribe events command."""
|
||||
# Circular dep
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from .permissions import SUBSCRIBE_WHITELIST
|
||||
from .permissions import SUBSCRIBE_ALLOWLIST
|
||||
|
||||
event_type = msg["event_type"]
|
||||
|
||||
if event_type not in SUBSCRIBE_WHITELIST and not connection.user.is_admin:
|
||||
if event_type not in SUBSCRIBE_ALLOWLIST and not connection.user.is_admin:
|
||||
raise Unauthorized
|
||||
|
||||
if event_type == EVENT_STATE_CHANGED:
|
||||
|
|
|
@ -22,7 +22,7 @@ from homeassistant.helpers.entity_registry import EVENT_ENTITY_REGISTRY_UPDATED
|
|||
|
||||
# These are events that do not contain any sensitive data
|
||||
# Except for state_changed, which is handled accordingly.
|
||||
SUBSCRIBE_WHITELIST = {
|
||||
SUBSCRIBE_ALLOWLIST = {
|
||||
EVENT_AREA_REGISTRY_UPDATED,
|
||||
EVENT_COMPONENT_LOADED,
|
||||
EVENT_CORE_CONFIG_UPDATE,
|
||||
|
|
Loading…
Reference in New Issue