Plugin API v0 #59

Closed
opened 2026-09-21 18:05:10 +01:00 by cruelacid · 1 comment
Owner

Part of #37.

What Relay does

Plugin API v0 — internal in 0.8.9, public in 0.8.12. getUsers(),
getCurrentUser(), registerTextView()/unregisterTextView(), plus workspace
events system3-relay:api-ready, :v0:users, :v0:current-user, typed in a
shipped relay-plugin-api.d.ts.

What we do today

Nothing. No API surface for other plugins at all.

What changes

api.ts plus a published .d.ts. getUsers() reads awareness,
getCurrentUser() reads the session — both already exist internally. View
registration is the larger half and overlaps with what Kanban multiplayer needs.

Why it belongs after comments, not before

Relay built comments on their API. We can build ours first and extract the
API from what it needed, which yields a smaller and more honest surface than
designing one speculatively.

What must not leak

The API runs inside the trust boundary. docs/security-model.md already records
that secret ids are global to the app and any installed plugin can read our keys
— that is Obsidian's design and no storage choice changes it. This API must not
make it easier: no key material, no passphrase, no document ids paired with
paths (that pairing is the one thing that would undo the HMAC).

Risk

risk:none to sync; a real surface-area decision for the security model.

Verification

docs/security-model.md is updated to describe what the API exposes, and the
claim is checked against the code as that document is written to be.

Part of #37. ## What Relay does Plugin API v0 — internal in 0.8.9, public in 0.8.12. `getUsers()`, `getCurrentUser()`, `registerTextView()`/`unregisterTextView()`, plus workspace events `system3-relay:api-ready`, `:v0:users`, `:v0:current-user`, typed in a shipped `relay-plugin-api.d.ts`. ## What we do today Nothing. No API surface for other plugins at all. ## What changes `api.ts` plus a published `.d.ts`. `getUsers()` reads awareness, `getCurrentUser()` reads the session — both already exist internally. View registration is the larger half and overlaps with what Kanban multiplayer needs. ## Why it belongs after comments, not before Relay built comments **on** their API. We can build ours first and extract the API from what it needed, which yields a smaller and more honest surface than designing one speculatively. ## What must not leak The API runs inside the trust boundary. `docs/security-model.md` already records that secret ids are global to the app and any installed plugin can read our keys — that is Obsidian's design and no storage choice changes it. This API must not make it *easier*: no key material, no passphrase, no document ids paired with paths (that pairing is the one thing that would undo the HMAC). ## Risk `risk:none` to sync; a real surface-area decision for the security model. ## Verification `docs/security-model.md` is updated to describe what the API exposes, and the claim is checked against the code as that document is written to be.
Author
Owner

Moved to the Vikunja board as NEC-36: https://projectron.nerchure.com/tasks/36

Moved to the Vikunja board as **NEC-36**: https://projectron.nerchure.com/tasks/36
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda#59
No description provided.