c53f699714
- go plugin backends ship as release tarballs (per-platform binaries, checksums) that kandev installs from url/upload or filesystem sideload+sync, then spawns and supervises via hashicorp/go-plugin (unix socket / loopback tcp+automtls) - strict typed grpc contract (kandev.plugin.v1): DeliverEvent/InvokeTool/HandleWebhook plus a capability-gated host service (state, secrets, emit); author sdk in pkg/pluginsdk; packaging cli in cmd/plugin-pack - native frontend bundles: window.registerKandevPlugin + registry/host loader with dynamic routes, nav items, slots and ws handlers; plugins settings page with install dialog, sync button and enable/disable/uninstall - gated behind the plugins feature flag (prod off, dev/e2e on); covered by unit and integration tests plus playwright e2e against a real packaged fixture plugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2.0 KiB
2.0 KiB
id, title, status, wave, depends_on, plan
| id | title | status | wave | depends_on | plan |
|---|---|---|---|---|---|
| task-04 | Fixture plugin binary | done | 1 | docs/plans/plugins/plan.md |
Fixture plugin binary
Title
Standalone Go HTTP server implementing the plugin contract, for Go integration tests and Playwright e2e.
Inputs
- Spec
docs/specs/plugins/spec.md→ event delivery headers/HMAC, tool invocation, webhook proxy, UI page contract. - Must be self-contained: only stdlib +
crypto/hmac,crypto/sha256. NO imports frominternal/plugins(proves the contract is decoupled).
Acceptance
apps/backend/cmd/plugin-fixture/main.gostarts an HTTP server on a port from-addr/PLUGIN_FIXTURE_ADDR(default127.0.0.1:0→ print chosen addr on stdout asLISTENING <addr>so tests can capture it).- Endpoints:
GET /health→ 200{"status":"ok"}.POST /events→ verifiesX-Kandev-Signature: sha256=<hmac>againstHMAC-SHA256(secret, rawBody)using secret from-secret/PLUGIN_FIXTURE_SECRET; records delivery (event_type + event_id) in memory; returns 200. Bad sig → 401.POST /tools/echo→ returns{"output": <input>}.POST /webhooks/test-hook→ records the call; returns 200.GET /ui/dashboard→ returns a small HTML page with<h1 id="plugin-dashboard">Fixture Plugin</h1>and a<script>that reads theme via postMessage (enough for e2e to assert render).GET /_debug/deliveries→ JSON list of recorded event_types (test-only introspection).
- Graceful shutdown on SIGINT/SIGTERM.
Files
apps/backend/cmd/plugin-fixture/main.goapps/backend/cmd/plugin-fixture/main_test.go(spins the server, asserts health + HMAC accept/reject + echo)
Verification
go test ./cmd/plugin-fixture/...fromapps/backendgo build ./cmd/plugin-fixturefromapps/backendmake -C apps/backend lint
Output contract
Report: chosen flags/env, the LISTENING <addr> handshake, endpoints implemented,
how HMAC is verified. Stay within apps/backend/cmd/plugin-fixture/.
Dependencies
None.