Capability-scoped plugin API endpoints #74
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#74
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Plugin data access runs through viewer-scoped API endpoints — a plugin can never read more than the person looking at it (ADR 0008).
Scope
Implement the plugin API surface behind
/api/v1/plugin/:listPages,getPageOutline,getPageContent(markdown),getBlock(cross-page block content), each executing with the requesting user's session and standard permission guards; host-side bridge wiring these to RPC capabilities (readCurrentPage,readPond,readBlock); block-data read/write (blockData) routed through the editor document (write requires page write permission).Acceptance criteria
listPagesresults (permission matrix test)getBlockreturns content only from readable pagesTechnical notes
Dependencies
Depends on #52, #73.
Size: ~1.5 days
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Done in
48798d4. Pipeline fully green (8 contexts + the warm-up gate; the fidelity flake stayed fixed, passing first-try).Viewer-scoped plugin data API behind
/api/v1/plugin/, backing the SDKreadCurrentPageandreadPondcapabilities:GET plugin/ponds/:id/pages(listPages),plugin/pages/:id/{outline,content,meta}— each reuses the existing@RequiresPondRole/@RequiresPagePermissionguards andPagesService, so there is no parallel permission logic (grep-provable) and a plugin sees exactly what its viewer could.host-capabilitiesbuilds the handlers from a per-surface context (the host holds the current page/pond ids — a plugin can only ask about the current page or this pond); wired into the sandbox runtime +PluginFrame, withui.openPage/toastrouted to host callbacks.Acceptance criteria:
listPagesresults and 404 on the hidden page (api db test)getBlockfrom readable pages / [ ] read-onlyblockDatawrite rejection — deferred to #76, where theplugin_blocknode introduces block addressing (the current schema has no block ids). Agreed with the maintainer.Tests: api db test (owner sees all, label-restricted reader filtered + 404, non-member 404, anonymous 401); web unit test pins the endpoint mapping, id-encoding, and missing-context rejection.