fix(auth): validate credential proxy payloads (Fixes #2197) - #3371
fix(auth): validate credential proxy payloads (Fixes #2197)#3371acoliver wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe auth proxy now validates IPC and HTTP payloads with shared Zod schemas. Token sanitization preserves extension fields while removing ChangesValidation contracts
Socket frame validation
Auth payload consumers
Provider boundary parsing
Boundary regression coverage
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to The change adds credential-proxy payload validation while preserving existing protocol, sandbox, correlation, and token-isolation behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation The implementation and tests remain focused on credential-proxy payload validation, trust-boundary parsing, error preservation, token isolation, and related regression coverage. No unrelated changes are shown. Full details: Description checkExplanation The description covers the required TLDR, technical details, reviewer test plan, testing results, testing matrix, and linked issue. The testing matrix is incomplete for platforms and tools not tested, but the description is otherwise detailed and directly related to the changes.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
WalkthroughThis PR changes 20 file(s).
Changes
Magnitude🎯 3 (L) RelatedNo related items found. Pre-merge Checks
Walkthrough generated by LLxprt PR Review. Planner issue: #2256 |
OpenCodeReview — automatic reviews suspendedAutomatic OCR reviews are suspended for this PR after 2 of 2 automatic reviews. To get more reviews you can:
OpenCodeReview — PR #3371
Inline overflow (exceeds inline comment cap)
Findings without a resolvable position
|
Review feedback classificationI recorded every OCR and CodeRabbit item in the plan ledger.
Follow-up verification passed: 45 focused server tests, |
Second OCR feedback classificationCommit
No production or test change was warranted. The branch remains clean and conflict-free against current |
TLDR
Validates credential-proxy response frames, operation payloads, requests, and provider-returned OAuth tokens with Zod before they become trusted values. Existing protocol errors, sandbox ordering, request correlation, and refresh-token isolation remain unchanged.
Dive Deeper
The proxy transport is framed JSON over Unix sockets or Windows named pipes. This change adds shared schemas for response envelopes, OAuth token data, sanitized tokens, bucket statistics, provider lists, bucket lists, and API-key responses. Client stores parse successful operation data and now reject malformed values with
PROXY_PAYLOAD_ERRORinstead of returning cast values or fabricated statistics.Provider-side request schemas validate credential and OAuth fields before store, flow, or session use. Exchange, poll, and refresh results are parsed before persistence and cooldown mutation. Provider extension fields survive parsing and merging, while
refresh_tokenstays host-side and is removed from proxy responses.Behavioral coverage uses real framed clients and servers for malformed envelopes, wrong-typed request fields, token persistence, extension preservation, stable operation errors, sandbox behavior, and refresh cooldown handling.
Reviewer Test Plan
npm run test,npm run lint,npm run typecheck,npm run format:check, andnpm run build.proxy-socket-client.test.tsfor malformed handshake, correlated-frame rejection, connection reset, and ignored uncorrelated frames.Local results on macOS:
npm run test, lint, typecheck, format check, and build passed.origin/mainand this branch, with zero scanner errors and an empty diff.bun scripts/start.ts --profile-load stepfun-37 "write me a haiku and nothing else"reached the configured provider but exited 1 with HTTP 400:you have no active step plan subscription. This is an external account limitation.Testing Matrix
Linked issues / bugs
Fixes #2197
Summary by CodeRabbit