mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-07 17:26:32 +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
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user