Skip to content

capability-declaration-lifecycle: no shipped resource enforces a package capability server-side (no REST action-invoke route on this build) #7680

Description

@huangyiirene

Symptom

No shipped resource enforces a package capability server-side. The three showcase actions carrying requiredPermissions have no REST execution route on this build: /api/v1/actions/<n>, /api/v1/action/<n>, /api/v1/objects/<o>/actions/<n>, and /api/v1/data/<o>/actions/<n> all 404, and rest-route-ledger.ts registers no action-invoke route. So the requiredPermissions gate for these actions is client-side only; there is no server surface on which to exercise the grant/deny contrast.

The three-way grant/deny/regrant resolves by name, but only demonstrable with a platform capability (manage_metadata). The remainder of the item passes: declaration → sys_capability seeding is exact (both documented fallbacks — humanize(name) label, generated description); platform-capability hijack is refused (a package declaring manage_users gets a WARN, skippedPlatform:1, the platform row unchanged — though the refusal is a WARN and boot proceeds); malformed declarations abort boot at Zod parse before any sys_capability write, so #5961 does not hold.

Root cause

Located by the run at packages/rest/src/rest-route-ledger.ts: the ledger's data-actions family registers clone/import/export routes but no action-invoke route for declared object/record actions. Confirmed on origin/main — the data-actions block lists only clone / import / import-jobs / export, no …/actions/<name> invoke route.

Related prior art (closed, different framing): #3923 reported Action.requiredPermissions as client-side fail-open in Console for type:'api' actions on 17.0.0-rc.0, and noted the server-side actionPermissionError covers only the platform ql.executeAction / MCP paths. This card records the coverage gap as observed on build 92f26f7: for the shipped showcase actions there is no REST invoke route at all, so capability-declaration-lifecycle clause 1 can only be exercised against a platform capability.

Reproduction

  1. Stock showcase boot; enumerate the REST route ledger and probe the four action-invoke shapes above for a showcase action declaring requiredPermissions → all 404.
  2. Confirm the grant/deny/regrant contrast is only demonstrable via a platform capability (manage_metadata).

Suggested fix

Either ship a server-side action-invoke route that enforces requiredPermissions for package-declared actions (so the gate is not client-side only), or record explicitly that package capability enforcement is not yet a server surface and adjust the checklist item's expectation. Route owner: packages/rest route ledger unless the action-invoke owner is located elsewhere.

Source

Extracted from the QA run #7637 (framework 92f26f7, console 09987b680).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions