fix(auth): match the Bearer auth-scheme case-insensitively #280
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 125 lines diff across 1 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.289
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.060
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #280"
general
weight: 0.35
rozzilla
Problem
The auth prehandlers checked
authHeader.startsWith('Bearer '). The auth-scheme is case-insensitive (RFC 7235 §2.1, RFC 6750 §2.1), so a valid token sent asbearer <token>orBEARER <token>was rejected with401 invalid_token("Authorization header must use Bearer scheme").Fix
BEARER_SCHEMEregex (/^bearer +(.*)$/i) insrc/auth/prehandler.ts.createAuthPreHandler,createSessionAuthPreHandler, and the/oauth/statusand/oauth/logoutroutes, which had the same check.Tests
test/auth-prehandler.test.ts: a valid JWT is accepted withBearer,bearerandBEARER.test/session-auth.test.ts: same for the session-aware prehandler.test/oauth-routes.test.ts:/oauth/logoutacceptsbearer <token>.Fixes #261
🤖 Generated with Claude Code
https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM