feat(ketch): add Ketch privacy consent integration#3794
feat(ketch): add Ketch privacy consent integration#3794waleedlatif1 merged 4 commits intostagingfrom
Conversation
PR SummaryMedium Risk Overview Implements five new Ketch tools that call Ketch’s public Web API endpoints and normalizes responses/errors, plus shared Updates docs and UI plumbing: introduces Written by Cursor Bugbot for commit 166f53b. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds a Ketch privacy consent integration with 5 tools covering the full Ketch Web API surface: get/set consent, get/set subscriptions, and invoke data subject rights. The implementation follows all established patterns in the codebase — block config, tool files, type definitions, icon registration, docs, and registry entries are all present and correctly wired. Key changes:
Minor issues found:
Confidence Score: 4/5Safe to merge; the integration is well-structured and follows all codebase conventions with only minor P2 issues. All 5 tools are correctly implemented and registered. Error handling, 204 responses, and JSON body construction are handled properly throughout. The two flagged issues (unexposed get_consent filter and error-output type mismatch) are non-blocking and don't affect the primary user path. apps/sim/blocks/blocks/ketch.ts (purposes filter wiring) and the error response shapes across the tool files. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant KetchBlock as Ketch Block (UI)
participant Params as params()
participant Tool as Tool Handler
participant API as Ketch Web API (global.ketchcdn.com)
User->>KetchBlock: Select operation + fill fields
KetchBlock->>Params: Resolve tool name (ketch_${operation})
Params->>Params: Merge jurisdictionCode / jurisdictionCodeOptional
Params->>Params: Parse JSON fields (identities, purposes, topics, etc.)
Params->>Tool: Dispatch to ketch_get_consent / set_consent / get_subscriptions / set_subscriptions / invoke_right
alt get_consent
Tool->>API: POST /web/v2/consent/{org}/get
API-->>Tool: 200 { purposes, vendors }
else set_consent
Tool->>API: POST /web/v2/consent/{org}/update
API-->>Tool: 200 { purposes } or 204 No Content
else get_subscriptions
Tool->>API: POST /web/v2/subscriptions/{org}/get
API-->>Tool: 200 { topics, controls }
else set_subscriptions
Tool->>API: POST /web/v2/subscriptions/{org}/update
API-->>Tool: 200
else invoke_right
Tool->>API: POST /web/v2/rights/{org}/invoke
API-->>Tool: 200 { message } or 204 No Content
end
Tool-->>User: Structured output (purposes / topics / success / message)
|
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
All greptile findings addressed:
|
Summary
Type of Change
Testing
Tested manually
Checklist