Phase 3: companion OAuth native/public client (PKCE + loopback redirect)
Pure, I/O-free protocol core + token custody for the companion's native/public OAuth client (RFC 7636 PKCE S256-only, RFC 8252 loopback redirect, RFC 9207 iss optional-but-validated). No socket bound, no network, no real keychain I/O — all deferred to the Phase 5 shared bind gate (mirrors Phase 1/2 pure-then-bind).
- lib/companion-oauth-pkce.mjs: createPkcePair, computeCodeChallenge (Appendix B vector), createOAuthState/createNonce, buildAuthorizationUrl, validateRedirectUri, validateAuthorizationResponse (constant-time state + iss), buildTokenRequest/ buildRefreshRequest, validateTokenResponse, decideTokenRefresh. Provider-agnostic (endpoints/client_id/scopes injected): registers no client, alters no scopes. - lib/companion-token-custody.mjs: pure custody over an injected keychain adapter; JWT/refresh rotation + Phase 2 per-session loopback-token lifecycle. No real keychain calls; never logs a secret. - 7-tier suites for both modules (237 companion tests green); security tier is the centerpiece (S256 binding, no plain downgrade, constant-time state, RFC 8252 redirect allowlist, no client secret, code_verifier present, oversized/replay fail-closed, no secret in any output/reason/error). - docs/COMPANION-APP-PHASE-3-OAUTH-PKCE.md: threat model -> control map, RFC citations, custody/rotation rules, Phase 5 safe-bind checklist, and the separate server-side OAuth gate (web-session-equivalent scopes, hosted PKCE, iss emission).
Semantic Changes
57 symbols
0 comments
muse hub commit comment sha256:c7e4193ed8fb8402ba382ccddde1f7f55974111a5c17d40dc94d0fd26802a378 --body "your comment"
No comments yet. Be the first to start the discussion.