pub struct ActiveSession {
pub peer: String,
pub service: String,
pub opened_at: i64,
pub principal: Option<String>,
}Expand description
One live mesh session, in a StreamFrame::Snapshot. Surface-clean: peer is the
user_id-or-nickname the audit records carry, never an endpoint-id. opened_at is epoch seconds.
Fields§
§peer: String§service: String§opened_at: i64§principal: Option<String>The caller’s STABLE device principal, eid:<hex> (#73).
peer is a display nickname and collides: two devices under one nickname, or two contacts
sharing a display name, are indistinguishable in the live-session view. So “who is using my
service right now”, per-peer session counts, and any UI that lets a user act on a live
session (revoke, disconnect, inspect) were all keyed on a collidable string.
Same argument and same shape as PeerInfo (#41) and PeerReachability (#42).
Nicknames NEVER authorize; this is the value to key on.
Snapshot only, for now. ActiveSession appears in StreamFrame::Snapshot — there is
no active_sessions on StatusResult. A client that keeps its view current by applying
subsequent session_open/session_close events still has a collision problem: those are
AuditRecords and carry no principal (#57, unmerged). So the snapshot distinguishes two
same-nickname devices and the next session_close for that nickname does not say which row
to drop. Re-subscribe for an authoritative view until #57 lands.
Always present for a real row — Option only so an older client round-trips. Additive.
Trait Implementations§
Source§impl Clone for ActiveSession
impl Clone for ActiveSession
Source§fn clone(&self) -> ActiveSession
fn clone(&self) -> ActiveSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more