You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): only hard-deny revocation/disabled 401s, not all auth failures
The auth middleware was hard-denying ALL 401/403 HTTPExceptions, which
broke registration scripts and other callers using minimal JWT claims
(no user/teams/token_use). These previously fell through to route-level
auth handlers.
Narrow the hard-deny to only security-critical rejections: "Token has
been revoked", "Account disabled", and "Token validation failed". All
other 401/403s continue as anonymous for route-level handling.
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
patch("mcpgateway.middleware.auth_middleware.get_current_user", AsyncMock(side_effect=HTTPException(status_code=401, detail="Token has been revoked"))):
patch("mcpgateway.middleware.auth_middleware.get_current_user", AsyncMock(side_effect=HTTPException(status_code=401, detail="Token has been revoked"))):
patch("mcpgateway.middleware.auth_middleware.get_current_user", AsyncMock(side_effect=HTTPException(status_code=401, detail="Token has been revoked"))):
0 commit comments