Enable Security API (#710)

* Enable Security API

* Update addons.py

* Update proxy.py

* Update __init__.py

* Update security.py

* Fix lint
This commit is contained in:
Pascal Vizeli
2018-09-24 15:11:33 +02:00
committed by GitHub
parent 267791833e
commit 52da7605f5
4 changed files with 12 additions and 27 deletions

View File

@@ -25,10 +25,6 @@ class APIProxy(CoreSysAttributes):
hassio_token = request.headers.get(HEADER_HA_ACCESS)
addon = self.sys_addons.from_token(hassio_token)
# REMOVE 132
if not addon:
addon = self.sys_addons.from_uuid(hassio_token)
if not addon:
_LOGGER.warning("Unknown Home Assistant API access!")
elif not addon.access_homeassistant_api:
@@ -184,10 +180,6 @@ class APIProxy(CoreSysAttributes):
response.get('access_token'))
addon = self.sys_addons.from_token(hassio_token)
# REMOVE 132
if not addon:
addon = self.sys_addons.from_uuid(hassio_token)
if not addon or not addon.access_homeassistant_api:
_LOGGER.warning("Unauthorized WebSocket access!")
await server.send_json({