add missing exempt path

This commit is contained in:
Josh Hawkins 2025-11-26 10:21:31 -06:00
parent d96169eb47
commit dce47642ef

View File

@ -86,7 +86,8 @@ def require_admin_by_default():
# Path prefixes that should be exempt (for paths with parameters) # Path prefixes that should be exempt (for paths with parameters)
EXEMPT_PREFIXES = ( EXEMPT_PREFIXES = (
"/logs/", # /logs/{service} "/logs/", # /logs/{service}
"/review", # /review, /review/{id}, /review_ids, etc. "/review", # /review, /review/{id}, /review_ids, /review/summary, etc.
"/reviews/", # /reviews/viewed, /reviews/delete
"/events/", # /events/{id}/thumbnail, etc. (camera-scoped) "/events/", # /events/{id}/thumbnail, etc. (camera-scoped)
"/go2rtc/streams/", # /go2rtc/streams/{camera} "/go2rtc/streams/", # /go2rtc/streams/{camera}
"/users/", # /users/{username}/password (has own auth) "/users/", # /users/{username}/password (has own auth)
@ -166,7 +167,7 @@ def allow_any_authenticated():
role = request.headers.get("remote-role") role = request.headers.get("remote-role")
if role == "admin": if role == "admin":
return return
# Otherwise require a real authenticated user (not anonymous) # Otherwise require a real authenticated user (not anonymous)
if not _is_authenticated(request): if not _is_authenticated(request):
raise HTTPException(status_code=401, detail="Authentication required") raise HTTPException(status_code=401, detail="Authentication required")