Skip to content

docs: vault relay-server spec (Postgres + /api/vault)#5

Merged
guohai merged 1 commit into
mainfrom
docs/vault-relay-server-spec
May 29, 2026
Merged

docs: vault relay-server spec (Postgres + /api/vault)#5
guohai merged 1 commit into
mainfrom
docs/vault-relay-server-spec

Conversation

@guohai

@guohai guohai commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Server-side design for the vault feature — the relay-server half that the atem atem vault CLI (Atem repo PR #10, already merged) calls. Self-contained so a coding agent on the Astation machine can start from it without the Atem repo.

docs/specs/2026-05-29-vault-relay-server-design.md:

  • Postgres schemavaults + append-only versioned vault_entries. This is the relay-server's first persistent store (everything is RwLock<HashMap> today), so the bulk of the work is adding Postgres + a migration + a pool in AppState.
  • The 5 /api/vault endpoints, matching the fixed atem client contract (field names must match Atem/src/vault_client.rs or deserialization breaks).
  • Auth + work-session resolutionsession_id authenticates, client_id/writer_list authorizes; can_read/can_write predicates. The one real design decision (how a session maps to a work_session_id) is laid out with three options + a recommendation (bind sessions to astation_id).
  • atem_id sanitizer change (relay.rs:303-308) — percent-decode + keep non-ASCII (CJK), restrict ASCII to [A-Za-z0-9-]. Can land as its own small commit.
  • File-by-file implementation tasks grounded in the existing relay-server conventions (routes.rs/rtc_session.rs handler patterns, AppState, inline #[tokio::test] + oneshot), plus acceptance test, build/deploy (docker-compose Postgres + DATABASE_URL), and open questions.

Cross-repo contract: Atem/designs/vault.md (data + auth model) and Atem/designs/vault-implementation-plan.md (the merged client). This spec is the authoritative server contract.

Docs only — no code.

Generated with SMT smt@agora.build

Server-side design for the vault feature — the relay-server half that the
atem 'atem vault' CLI (Atem repo PR #10) already calls.

- Postgres schema (vaults + append-only versioned vault_entries); the
  relay-server's first persistent store (everything is in-memory today).
- The 5 /api/vault endpoints matching the fixed atem client contract.
- Auth + work-session resolution (session authenticates, client_id/
  writer_list authorizes) with three options and a recommendation.
- Required atem_id sanitizer change (percent-decode + keep non-ASCII).
- File-by-file implementation tasks grounded in the existing relay-server
  conventions (routes.rs / rtc_session.rs patterns, AppState, tests).

Self-contained; coding agent on the Astation machine can start from this.

🤖 Built with SMT <smt@agora.build>
@guohai guohai merged commit 4266075 into main May 29, 2026
3 checks passed
@guohai guohai deleted the docs/vault-relay-server-spec branch May 29, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant