fix(jwt): overwrite converted claim headers and drop absent claims #7967
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.62) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 248 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.330
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #7967"
general
weight: 0.35
Aias00
What
DefaultJwtConvertStrategyconverts JWT claims into request headers. Three behaviors in that conversion are corrected:HttpHeaders.add, which appends. If the request already carried a header with the configuredheaderVal, upstream received multiple values andgetFirst()could return the pre-existing one instead of the claim."null".user.idagainst{"user":"admin"}resolved to"admin".Changes
headers.set, so the configured header always carries exactly the claim value. Header names match case-insensitively, and multi-value headers are replaced by the single claim value.null, remove the header instead of writing"null".parseto walk the claim path once. It returnsnullwhen any node is missing or is not a map. This also removes the per-level entry iteration and theAtomicIntegerallocation.Behavior change
headerValis now overwritten by the claim value, or removed when the claim is absent.Tests
New cases in
DefaultJwtConvertStrategyTest:user.id,multi.web.name) removes the headerMake sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.