1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-10 17:09:17 +00:00

Change WHITELIST to ALLOWLIST for websockets ()

This commit is contained in:
Kendell R 2021-01-04 03:40:03 -08:00 committed by GitHub
parent 0cff069c98
commit 5b67030c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions
homeassistant/components/websocket_api

@ -58,11 +58,11 @@ def handle_subscribe_events(hass, connection, msg):
"""Handle subscribe events command.""" """Handle subscribe events command."""
# Circular dep # Circular dep
# pylint: disable=import-outside-toplevel # pylint: disable=import-outside-toplevel
from .permissions import SUBSCRIBE_WHITELIST from .permissions import SUBSCRIBE_ALLOWLIST
event_type = msg["event_type"] 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 raise Unauthorized
if event_type == EVENT_STATE_CHANGED: 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 # These are events that do not contain any sensitive data
# Except for state_changed, which is handled accordingly. # Except for state_changed, which is handled accordingly.
SUBSCRIBE_WHITELIST = { SUBSCRIBE_ALLOWLIST = {
EVENT_AREA_REGISTRY_UPDATED, EVENT_AREA_REGISTRY_UPDATED,
EVENT_COMPONENT_LOADED, EVENT_COMPONENT_LOADED,
EVENT_CORE_CONFIG_UPDATE, EVENT_CORE_CONFIG_UPDATE,