- tsc-gateway-proto: versioned JSON envelope (tsgw.v1+json), client and server messages, identity-challenge auth (ECDSA P-256 over a signed challenge), unique ids for TS3 (SHA-1) and TS6 (SHA-256, verified on 6.0.0-beta13.1), hash-cash level. - tsc-gateway (tsgw): axum WebSocket server; hub with one observer, a relay pool and a lookup query session; login by signature or token; permission mirroring via permoverview (server group/client/channel group/channel-client levels, skip and negate); per-user filtered presence (snapshot + diff deltas); channel/server chat relay with server-known nicknames, rate limit, idle relay teardown, pinned channels; SQLite tokens, history and audit; Dockerfile; admin guide. - tsctl gateway client; smoke test covers gateway presence, chat both ways and refusal of unknown identities on TS3 and TS6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
27 lines
1007 B
Rust
27 lines
1007 B
Rust
//! Wire protocol of `tsgw`, the companion gateway that gives app users
|
|
//! invisible presence and channel chat without joining voice.
|
|
//!
|
|
//! Transport: WebSocket, subprotocol [`SUBPROTOCOL`], one JSON [`Envelope`]
|
|
//! per text frame. Within version 1 changes are additive only: new message
|
|
//! types and optional fields. Unknown fields must be ignored.
|
|
//!
|
|
//! Authentication proves ownership of a TeamSpeak identity: the gateway sends
|
|
//! a nonce in [`ServerMsg::Hello`], the client answers with
|
|
//! [`ClientMsg::Auth`], an ECDSA P-256 signature over [`challenge`] made with
|
|
//! the identity's private key. The unique id is derived from the public key,
|
|
//! exactly as the TeamSpeak server does.
|
|
|
|
mod auth;
|
|
mod messages;
|
|
|
|
pub use auth::{
|
|
AuthError, MAX_CLOCK_SKEW_SECS, UniqueIds, challenge, identity_level, sign_challenge,
|
|
verify_auth,
|
|
};
|
|
pub use messages::*;
|
|
|
|
/// WebSocket subprotocol.
|
|
pub const SUBPROTOCOL: &str = "tsgw.v1+json";
|
|
/// Protocol version in every envelope.
|
|
pub const VERSION: u32 = 1;
|