feat(kilo-mcp): adopt @cloudflare/workers-oauth-provider and zod-validate untrusted input (part 1/1) - #6093
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous Review Summaries (2 snapshots, latest commit a980e20)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit a980e20)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (14 files)
Fix these issues in Kilo Cloud Previous review (commit b4c7ee6)Status: 7 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (33 files)
Removed hand-rolled auth modules and their tests were reviewed as deletions (intentional). No memory leaks were identified: the DO alarm is a single self-rescheduling purge, the Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
…date untrusted input (part 1/1) #6093
b4c7ee6 to
a980e20
Compare
…date untrusted input (part 1/1) #6093
a980e20 to
843c375
Compare
Changelog for users
/mcpendpoint, now served by the OAuth provider library.invalid_grant, instead of being accepted once./mcpanswers a revoked, tampered, or foreign bearer with the library 401 challenge and makes no upstream request.Changelog for maintainers
@cloudflare/workers-oauth-providerpinned to 0.10.3 plus zod; the library owns the token, registration, and discovery endpoints, client/code/refresh-token/revoked-jti state, and the/mcpaudience check.MCP_TOKEN_SECRETsecret and adds the requiredOAUTH_KVbinding. The production KV namespace id is a 32-zero placeholder that must be replaced before deploy — review this first.oauth_pending_authorizationsand drop the old client, code, refresh-token, and revoked-jti tables. Existing clients and live grants are dropped, so expect client re-registration and user reconnects.cloudflare:workersto a stub and inline the provider; OAuth sign-in and error analytics now come from the provider hooks.E2E proof — log excerpts
/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e2-refresh-reuse.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e1-consent-happy.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e2-loading-pending.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e4-denied.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e5-empty-orgs.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e6-expired.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e7-unauth-mcp.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e8-happy-tool-call.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e9-invalid-token.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e11-invalid-request.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e12-oauth-happy-org.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e13-unregistered-client.log/home/igor_kilocode_ai/.local/share/kwf/sections/use-6066-as-the-base-implement-the-following-06e3/e2e-backend/e14-retryable-loading.logOwner request for the stack
PR stack (merge bottom to top)
kwf/use-6066-as-the-base-implement-the-following-06e3-l1) ← this PR