weirdnet_presence/lib.rs
1//! A presence directory for Weirdnet.
2//!
3//! A node signs a short-lived [`Record`] (who it is, whether it is online, away or busy) and
4//! publishes it to a directory; anyone can page the list of who is online. The directory keeps
5//! records in memory only, drops each one when it expires, and checks every publish: the
6//! signature, the time window, a ban list and a rate limit per identity. Readers verify every
7//! signature themselves ([`client::list`]), so a directory can drop or hide records but never
8//! forge one.
9//!
10//! The crate is app-neutral: a record carries a free `app` tag, so one directory can serve
11//! several apps, and nothing else about an app lives here. Detail fields (a status line, a
12//! project name, last seen) are not part of a record; they travel between trusted nodes only.
13//!
14//! The wire is a [`weirdnet_service`] service ([`service::DirService`], protocol
15//! [`service::PROTOCOL`] version [`service::VERSION`]). The signed bytes of a record are a fixed
16//! binary layout, not the wire encoding ([`Record::signing_bytes`]), so a change of wire codec
17//! never changes a signature.
18
19pub mod client;
20pub mod directory;
21pub mod record;
22pub mod service;
23
24pub use client::{list, open_session, publish};
25pub use directory::{Config, Directory, Stats};
26pub use record::{Record, RecordError, Signed, Status};
27pub use service::{DirService, Req, Resp, serve};