Repository navigation
feat(syntropy-mcp): B2 T2.1 TokenExchangeClient (RFC 8693, Option B signer) — inert/disabled-by-default - #60
Conversation
… B, mock-STS) — RFC 8693 per-user token exchange. Verifier security kernel (devex condition openclaw#2931): RS256 hard-pin rejected before any JWKS fetch (alg-confusion defense), iss+nbf+aud+exp validation, JWKS keyset cache 300s max-age, unknown-kid FAIL-CLOSED (no fetch-and-trust). Tier-1 (subject_token=Clerk JWT) + Tier-2 (requested_subject=<channel>:<external_id>, consent-hardened openclaw#2937, bare-user path removed). Validate-before-cache (sub/act.sub/aud/exp/iss), per-subjectId cache + single-flight + invalidate-retry-once-on-401, dynamic TTL from expires_in (no hardcoded 1800), token/PII hygiene. Wired into the m2m-exchange server getToken (replaces the B1 fail-closed placeholder); fail-closed on missing machine secret / issuer / channel / externalId. 157 tests green Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
… verified sound, these harden). SEC-HTTPS baseUrl https-floor red-first (baseUrl is the JWKS trust-root — cleartext MITM would poison keyset + forge; localhost dev-exempt, m2m fail-closed) + DESIGN-GENGUARD generation-guard (invalidate racing in-flight exchange no longer resurrects, mirrors ServiceAuthProvider) + SEC-EXPCLAMP (cache TTL clamped to signed exp, unsigned expires_in can't extend past it) + DESIGN-MACHINESUB (blank machineSub disables server) + CODE-CACHE-EVICT (sweepExpired on refresh tick) + DECODE-GUARD/EMPTY-JWKS/JWKS-single-flight + 18 coverage locks (401-retry-once wiring, issuer/actor disable, exp/expires_in branches, no-kid, aud-array, single-flight-fail). Tier-1 seam typed accessor. 190 tests green QGR-Finding: SEC-HTTPS Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
…hange client (security-critical) Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesM2M Exchange
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant SyntropyMcpPlugin
participant TokenExchangeClient
participant ExchangeEndpoint
participant McpServer
Agent->>SyntropyMcpPlugin: invoke tool with identity and channel context
SyntropyMcpPlugin->>TokenExchangeClient: request subject-scoped token
TokenExchangeClient->>ExchangeEndpoint: exchange actor token
ExchangeEndpoint-->>TokenExchangeClient: minted user token
TokenExchangeClient-->>SyntropyMcpPlugin: verified bearer token
SyntropyMcpPlugin->>McpServer: execute tool
McpServer-->>SyntropyMcpPlugin: result or 401
SyntropyMcpPlugin->>TokenExchangeClient: invalidate and retry once
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
…A7 pin caught it; would fail every live Tier-2 turn) — bind byte/type-exact to SJ's VERBATIM mint (openclaw#2961). checkClaims branches on tier: Tier-2 binds channel-claim===requested + tier===2 (JSON number) + sub present-non-empty recorded as user_scope (NOT the composed value — SJ resolves it to the bare Clerk id via passcode linkage) + act.sub===machineSub; Tier-1 sub===externalId + tier===1 (number, no channel — absent on Tier-1). Cache still keyed on request identity (cross-user isolation intact). Red-first + exact-type tests (tier:'2' string REJECTED, tier-confusion REJECTED, Tier-1 no-channel ACCEPTED). 202 tests green QGR-Finding: A7-tier2-binding Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
…rity re-review SOUND, no CRIT/HIGH/MED) — explicit else-if(tier===2) + unreachable-default fail (a malformed subject can't skip the tier guards) + cache-key-must-include-externalId invariant comment (Tier-2 per-user binding). 202 tests green Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
…ier-2 binding, re-QG sound; supersedes 1c78286) Generated-With: Claude Code Co-Authored-By: cto <[email protected]> Co-Authored-By: Claude <[email protected]>
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
…github-hosted-fallback, CTO pre-auth openclaw#3106) Config-only workflow diff: remap 10 runs-on lines in ci.yml off the Blacksmith runners (9x → ubuntu-latest, 1x → windows-latest; macos untouched) — restores reliable openclaw CI after the Blacksmith outage that forced substituted-verification on #60/#61. NO gate-strictness change (grep blacksmith=0, exactly 10 runs-on lines, YAML valid, all prod-critical gates stay fail-loud — only WHERE they run changed). CTO diff-verified; proportionate gating for a runner remap (no 4-reviewer QG). Path-B SSH (workflow file). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
openclaw B2 per-user auth, client half (dispatch 2947). RFC 8693 TokenExchangeClient against the CTO-ruled Option B signer (SJ-minted RS256 + own JWKS). Tier-1 (subject_token=Clerk JWT, dormant) + Tier-2 (requested_subject=:<external_id>, consent-hardened) live. Validate-before-cache, per-subjectId cache + generation-guard + single-flight + invalidate-retry-once-on-401, dynamic TTL clamped to signed exp.
SECURITY (devex condition openclaw#2931 MET + test-locked): verifier hard-pins alg=RS256 as a hardcoded literal (rejected BEFORE any JWKS fetch — alg-confusion defense), validates iss+aud+exp+nbf, JWKS cache 300s, unknown-kid FAIL-CLOSED. Headline QG fix SEC-HTTPS HIGH: baseUrl (the JWKS trust-root fetch) now https-required (localhost dev-exempt) — a cleartext/MITM'd JWKS would poison the keyset + forge a matching-kid token. 16 QG findings all fixed; crypto kernel verified sound by 2 reviewers. tsgo 0, 190 tests, sealed 60/60.
INERT: disabled-by-default plugin, mock-STS, NO live network dep; fail-closed on missing machine secret/issuer/machineSub/channel/externalId/non-https baseUrl. Live wire-up waits on SJ's endpoint deploy + verbatim per-env aud. Safe to land ahead.
🤖 Generated with Claude Code
Summary by CodeRabbit