From 87f4a574e64dcf2e34b22125f5099ab0e7769523 Mon Sep 17 00:00:00 2001 From: faumaray Date: Tue, 20 Oct 2026 05:52:00 +0300 Subject: [PATCH] Document the identity store in architecture.md and the changelog A new Identities section says what the identities table holds now (the kinds, the binding, the two schema versions and whose SQL they are), what Store and SqliteKeyStore each do with it, what the TeamSpeak level and the sign-out mean on this table, and that the engine and the UI do not use the key store yet. The voelin-store row of the workspace table names the new content, and the changelog notes the migration and the new access requirement for the private protocol repository. Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 8 ++++++++ docs/architecture.md | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0255379..e79177b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,14 @@ User-visible changes of the apps and the `tsgw` gateway. The format follows ### Changed +- The identity store keeps identities of more than one kind (TeamSpeak, a Voelin + key, the signed-in account) with the account each belongs to, as a + `voelin-identity` key store, in two database migrations. Existing + databases migrate on first start and every identity stays what it was (kind + TeamSpeak, no account, same key, name, origin and default); nothing changes + on screen yet. The build now fetches `voelin-identity` from the private + VoelinProtocol repository, so a fresh checkout needs read access to it + (see docs/building.md). - Selecting a server observes it through its gateway at once; the Observe button is gone. The server dialog asks only for the address, password, name and nickname: the gateway is found from the address. diff --git a/docs/architecture.md b/docs/architecture.md index 58daaef..4a326d8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -69,7 +69,7 @@ fuzz/ cargo-fuzz targets | `voelin-query` | ServerQuery codec and transports: raw TCP, SSH (russh), HTTP WebQuery | done | | `voelin-observer` | Presence tracker + chat relay pool over `voelin-query` | done | | `voelin-gateway-proto`, `voelin-gateway` (`tsgw`) | Companion service for server admins: identity-challenge auth, permission-mirroring authorization, presence stream, chat relay, SQLite history, WebSocket + JSON (`tsgw.v1+json`) | done | -| `voelin-store` | Identities, bookmarks, settings, chat history (dedupe, paging, sync cursors, where each chat was read), contacts, secrets (keyring / Android Keystore); versioned schema | done | +| `voelin-store` | Identities (TeamSpeak, a Voelin key, the signed-in account, each with its account binding, as a `voelin-identity` `KeyStore`; see Identities), bookmarks, settings, chat history (dedupe, paging, sync cursors, where each chat was read), contacts, secrets (keyring / Android Keystore); versioned schema | done | | `voelin-audio` | Capture/playback, Opus, echo cancellation, resampling, jitter buffer, mixer, VAD/push-to-talk; the voice packet types (`TalkerId`, `VoicePacket`, `EncodedVoice`), so it depends on no voice transport | v0 (no AEC yet) | | `voelin-stream` | TS6 stream commands, JSON signalling, str0m peer connections, host/STUN candidates, streamer/viewer sessions, frame-source seam; its frame and simulcast layer types are `voelin-media`'s | sessions + transport | | `voelin-core` | Engine: runtime, per-server sessions, merge of voice/gateway/query sources, the `ServerLink` seam the voice source sits behind (`link.rs`; `TsLink` is the TeamSpeak implementation, for now in this crate), event bus, command API, chat history, the gateway's features, audio settings and volumes, streams on TS6, files, avatar and icon cache, pokes, offline messages, contacts; `media` module (capture → encoder → stream, stream → decoder); the stream types of its API are its own (`stream_types`, see Streams) | done | @@ -323,6 +323,39 @@ their private messages and pokes are dropped or flagged per `stream.permissions = friends` lets friends watch our stream without asking and asks for everyone else. +## Identities + +The `identities` table of `voelin-store` holds identities of more than one kind. +A row is a `voelin_identity::IdentityBlob` { `kind`, `uid`, `level`, `json` } +with an optional account binding: a `teamspeak` row is the JSON of a +`tsproto::Identity`, exactly as the client has always stored it; a `voelin` row +is an Ed25519 key; the `account` row (`account:`) says which +account the installation is signed in to and which key is its device key; a +kind this version does not know passes through untouched. `uid` is unique +across kinds, and the uid forms of the kinds do not overlap. The table got its +new columns from two schema versions, 6 (`kind`, defaulting to `teamspeak`) and +7 (`account`, `integration`, `integration_rev`, `synced`), the SQL of which is +`voelin-identity`'s (`migrate::ADD_KIND_COLUMN` and `ADD_ACCOUNT_COLUMNS`); +every identity that existed stays what it was: kind `teamspeak`, unbound, its +JSON untouched, its origin and default flag kept. + +`Store` keeps the TeamSpeak identity methods (`identities`, `identity`, +`add_identity`, ...), which act on `teamspeak` rows only, so nothing above the +store changed. `SqliteKeyStore` is the same table as a `KeyStore`, with the +binding: `put` replaces a row of the same `(kind, uid)` and keeps its name, +origin and default flag, a uid another kind holds is refused, a TeamSpeak blob +is stored only when its JSON is a tsproto identity whose key has the uid it +names, and the TeamSpeak security level is still computed from the key, never +stored. Signing out of an account is the trait's `sign_out`, run on this +table: it removes the account record and the synced copies, unbinds the +identities only this device holds, keeps the device key (unbound, byte for +byte) when the record says it predates the account, and deletes it when it +does not or when the caller asks to forget it. The engine and the UI do not use +the key store yet; accounts, sign-in and the integrations page are later steps. + +`voelin-identity` comes from the private VoelinProtocol repository as a git +dependency pinned by commit ([building.md](building.md#depending-on-voelinprotocol)). + ## Streams `voelin-stream::Streams` holds the stream state of one TS6 connection without