mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 01:36:29 +00:00
Add log to blacklist / reduce free calls (#713)
This commit is contained in:
parent
52da7605f5
commit
c91bac2527
@ -33,9 +33,7 @@ NO_SECURITY_CHECK = re.compile(
|
|||||||
# Can called by every add-on
|
# Can called by every add-on
|
||||||
ADDONS_API_BYPASS = re.compile(
|
ADDONS_API_BYPASS = re.compile(
|
||||||
r"^(?:"
|
r"^(?:"
|
||||||
r"|/homeassistant/info"
|
r"|/addons/self/(?!security)[^/]+)?"
|
||||||
r"|/supervisor/info"
|
|
||||||
r"|/addons(?:/self/(?!security)[^/]+)?"
|
|
||||||
r")$"
|
r")$"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -44,6 +42,7 @@ ADDONS_ROLE_ACCESS = {
|
|||||||
ROLE_DEFAULT: re.compile(
|
ROLE_DEFAULT: re.compile(
|
||||||
r"^(?:"
|
r"^(?:"
|
||||||
r"|/[^/]+/info"
|
r"|/[^/]+/info"
|
||||||
|
r"|addons"
|
||||||
r")$"
|
r")$"
|
||||||
),
|
),
|
||||||
ROLE_HOMEASSISTANT: re.compile(
|
ROLE_HOMEASSISTANT: re.compile(
|
||||||
@ -84,6 +83,7 @@ class SecurityMiddleware(CoreSysAttributes):
|
|||||||
|
|
||||||
# Blacklist
|
# Blacklist
|
||||||
if BLACKLIST.match(request.path):
|
if BLACKLIST.match(request.path):
|
||||||
|
_LOGGER.warning("%s is blacklisted!", request.path)
|
||||||
raise HTTPForbidden()
|
raise HTTPForbidden()
|
||||||
|
|
||||||
# Ignore security check
|
# Ignore security check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user