fix(rest-proxy): let registry credentials coexist with forwarded auth header #1372
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 289 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.339
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #1372"
general
weight: 0.35
muralibasani
1. Let
registry_user/registry_passwordcoexist with a forwardedAuthorizationheader. Previously, whenever OIDC token forwarding was on, these had to be unset —
otherwise the forwarded bearer/basic header collided with the proxy's session-level
basic auth and aiohttp raised
Cannot combine AUTHORIZATION header with AUTH argument,surfacing as a 500.
2. Surface SR auth failures as real 401/403 instead of the generic
40801("Error when registering schema"), which masked whether a failure was auth, schema
incompatibility, or the registry being down.
## What changed
Per-request auth (fix 1)
-
core/client.py: no longer bakessession_authinto the aiohttpClientSession. A new_resolve_authpicks credentials per request — a forwardedAuthorizationheader wins;otherwise fall back to
session_auth(registry_user/registry_password).Auth error propagation (fix 2)
-
kafka_rest_apis/error_codes.py: addHTTP_UNAUTHORIZED(401),HTTP_FORBIDDEN(403).-
core/serialization.py:SchemaRetrievalErrorcarries the registry's HTTPstatus_code.-
kafka_rest_apis/__init__.py: map SR 401/403 to a matching proxy response; theconsume-by-id path no longer masks an auth failure as an invalid schema.
## Behavior matrix (SR OIDC + authfile)
| Client → proxy | Sent to SR | Result |
|---|---|---|
|
Bearer <token>| forwarded token | OIDC-validated ||
Basic <creds>| forwarded basic | authfile-validated || nothing |
registry_user/registry_password| service-credential fallback || invalid/expired token or creds | (as above) |
401/403|Tests
- Unit:
tests/unit/core/test_client.py(_resolve_auth+ on-the-wire selection);tests/unit/kafka_rest_apis/test_registry_auth_error.py(status propagation + 401/403 mapping).- E2E (
tests/e2e/kafka_rest_apis/test_oidc_forwarding.py): coexistence (bearer + configuredcreds), forwarded-basic to an OIDC+authfile SR, and updated auth-rejection cases now
asserting 401. Two new compose proxy services (
-oidc-with-creds,-oidc-basic).## Docs
-
website/docs/authentication.mdandREADME.rst: coexistence and the 401/403 vs 40801/42205error behavior.