improvement(api): harden application route boundaries - #6451
improvement(api): harden application route boundaries#6451TheodoreSpeaks wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview For v2 JSON routes, typed workspace/resource authorization failures are concealed as 404 via Folder materialization for workflows and tables is bounded with Internal list/sort typing is aligned on Reviewed by Cursor Bugbot for commit e787cbb. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR moves audit authorization and querying into application-layer boundaries, centralizes active resource/workspace resolution, and adds typed v2 authorization concealment and folder-materialization limits.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains in the eligible follow-up scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/api/server/routes/v2-resource-concealment.ts | Introduces typed, reusable concealment for selected resource authorization errors while preserving other policy failures. |
| apps/sim/lib/workflows/application/context.ts | Consolidates canonical active workflow, run, and workspace loading with workspace-containment checks. |
| apps/sim/lib/table/application/context.ts | Resolves active tables through their canonical workspace and rejects asserted workspace mismatches. |
| apps/sim/lib/knowledge/application/contexts.ts | Centralizes active knowledge-base and document context resolution with workspace binding. |
| apps/sim/lib/folders/queries.ts | Adds bounded folder materialization with limit-plus-one overflow detection and typed failures. |
| apps/sim/lib/folders/cascade.ts | Applies bounded folder loading before computing cascade descendants. |
| apps/sim/lib/audit-logs/authorization.ts | Moves enterprise audit authorization into a transport-neutral application module. |
| packages/testing/src/mocks/v2-route.mock.ts | Provides shared v2 authentication, gating, and rate-limit fixtures for route tests. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Request[V1 or V2 request] --> Admission[Authentication and admission]
Admission --> Policy[Route error policy]
Admission --> UseCase[Application use case]
UseCase --> Context[Canonical active resource and workspace context]
Context --> Authorization[Workspace and resource authorization]
Authorization --> Query[Transport-neutral query or operation]
Authorization -->|Typed resource denial| Policy
Authorization -->|Personal API-key policy denial| Forbidden[403 Forbidden]
Policy -->|Concealed denial| NotFound[404 Not Found]
Query --> Response[Existing API envelope]
Reviews (3): Last reviewed commit: "fix(folders): reject creates at workspac..." | Re-trigger Greptile
aaeb817 to
470d350
Compare
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e787cbb. Configure here.
Summary
Type of Change
Testing
Checklist