NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Auth role bugfixes (#17066)
Josh Hawkinscb25bd4a882e
diff --git a/frigate/api/auth.py b/frigate/api/auth.pyindex 1752b19c9a..2be26cc8a4 100644--- a/frigate/api/auth.py+++ b/frigate/api/auth.py@@ -259,7 +259,7 @@ def auth(request: Request):# pass the user header value from the upstream proxy if a mapping is specified# or use anonymous if none are specifieduser_header = proxy_config.header_map.user- role_header = proxy_config.header_map.get("role", "Remote-Role")+ role_header = proxy_config.header_map.rolesuccess_response.headers["remote-user"] = (request.headers.get(user_header, default="anonymous")if user_header@@ -359,14 +359,14 @@ def auth(request: Request):@router.get("/profile")def profile(request: Request):username = request.headers.get("remote-user", "anonymous")- if username != "anonymous":+ role = request.headers.get("remote-role")++ if role is None and username != "anonymous":try:user = User.get_by_id(username)role = getattr(user, "role", "viewer")except DoesNotExist:role = "viewer" # Fallback if user deleted- else:- role = Nonereturn JSONResponse(content={"username": username, "role": role})