Match token providers on WWW-Authenticate challenges #55
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 260 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.333
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #55"
general
weight: 0.35
jeswr
Providers now decide whether to react to a 401 from its
WWW-Authenticatechallenges instead of matching every response (DPoP, client credentials) or a hard-coded host (Bearer). This lets several providers coexist, each reacting only to challenges it can answer.Changes
parseChallenges: RFC 9110 §11.6.1 challenge parser adapted from oauth4webapi v3.8.7 (parseWwwAuthenticateChallengesis internal there). Other npm parsers (auth-header, www-authenticate, http-auth-utils) fail on multi-challenge headers. MIT notice in the file header.TokenProvider.matches(request, challenges): both managers parse the challenges once per 401 and pass them to each provider.| Provider | Matches a challenge with scheme |
|---|---|
|
DPoPTokenProvider|DPoPorBearer||
ClientCredentialsTokenProvider|DPoPorBearer||
BearerTokenProvider|Bearer(still excludes.solidweb.org, now TODO) |Why Bearer counts for DPoP
Observed unauthenticated 401 challenges:
| Server |
WWW-Authenticate||---|---|
| CSS 7, NSS (solidcommunity.net, teamid.live) |
Bearer scope="openid webid"|| solidweb.org, datapod.igrant.io |
Bearer realm="…", scope="openid webid"|| ESS (storage.inrupt.com) |
UMA as_uri="https://uma.inrupt.com", ticket="…",Bearer,DPoP algs="ES256 RS256"|Only ESS advertises DPoP, yet all accept DPoP-bound tokens, which RFC 9449 §7.1 permits after a Bearer challenge.
Behaviour change
Without challenges (header missing, malformed, or not exposed by CORS
Access-Control-Expose-Headers) no provider matches. Before, DPoP and client credentials matched every 401. CSS and ESS expose the header.Not in scope
algs,error(use_dpop_nonce,invalid_token),resource_metadata(LWS / RFC 9728) and UMA are not used for matching. With several matching providers, list order decides; the README documents this.