Add log to blacklist / reduce free calls (#713)

This commit is contained in:
Pascal Vizeli 2018-09-24 17:03:21 +02:00 committed by GitHub
parent 52da7605f5
commit c91bac2527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,9 +33,7 @@ NO_SECURITY_CHECK = re.compile(
# Can called by every add-on
ADDONS_API_BYPASS = re.compile(
r"^(?:"
r"|/homeassistant/info"
r"|/supervisor/info"
r"|/addons(?:/self/(?!security)[^/]+)?"
r"|/addons/self/(?!security)[^/]+)?"
r")$"
)
@ -44,6 +42,7 @@ ADDONS_ROLE_ACCESS = {
ROLE_DEFAULT: re.compile(
r"^(?:"
r"|/[^/]+/info"
r"|addons"
r")$"
),
ROLE_HOMEASSISTANT: re.compile(
@ -84,6 +83,7 @@ class SecurityMiddleware(CoreSysAttributes):
# Blacklist
if BLACKLIST.match(request.path):
_LOGGER.warning("%s is blacklisted!", request.path)
raise HTTPForbidden()
# Ignore security check