fix: make RBAC dependencies properly chain _inject_user for OPC authorization

This commit is contained in:
Gan, Jimmy
2026-04-02 00:25:32 +08:00
parent 213d0e897c
commit e46003711b
3 changed files with 8 additions and 9 deletions
+2
View File
@@ -159,7 +159,9 @@ async def proxy_auth(request: Request, response: Response):
remote_groups_raw = request.headers.get("Remote-Groups", "")
groups = [g.strip() for g in remote_groups_raw.split(",") if g.strip()]
logger.info(f"Proxy auth: user={remote_user}, groups={groups}")
role = resolve_role(groups)
logger.info(f"Resolved role: {role}")
if role is None:
logger.warning(f"User {remote_user} has no dashboard role (groups: {groups})")
raise HTTPException(status_code=403, detail="User not authorized for dashboard")