Skip to content

Commit e358984

Browse files
committed
Don't leak internal verifier errors to RPC clients
The _DashboardAuthInterceptor was passing raw ValueError messages (e.g. "Invalid token: Not enough segments") to ConnectError. Use a generic "Authentication failed" message for invalid tokens (matching AuthInterceptor behavior) and log the detail server-side.
1 parent 9de31b1 commit e358984

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/iris/src/iris/cluster/controller/dashboard.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ def intercept_unary_sync(self, call_next, request, ctx):
199199
from connectrpc.code import Code
200200
from connectrpc.errors import ConnectError
201201

202-
raise ConnectError(Code.UNAUTHENTICATED, str(exc)) from exc
202+
if token is None:
203+
raise ConnectError(Code.UNAUTHENTICATED, str(exc)) from exc
204+
logger.warning("Authentication failed: %s", exc)
205+
raise ConnectError(Code.UNAUTHENTICATED, "Authentication failed") from exc
203206

204207
if identity is None:
205208
# Optional mode, no token — anonymous fallback.

0 commit comments

Comments
 (0)