Expand description
What a peering session enforces after the handshake, and what guards the handshake itself.
DirectoryVersionsis the persisted anti-rollback floor: the highestdirectory_versionthis device has verified. Persistence is local state, so it lives behind this seam;MemoryDirectoryVersionsis the in-process adapter.HandshakeLimitercaps handshake attempts per source address, so the LAN cannot probe a device for membership. Time is passed in, so every rule is a deterministic unit test.PeerSessionre-checks the peer’s revocation on every request, not only at the handshake, and remembers what the peer delivered and when, so everything delivered after its revocation took effect can be quarantined.TrustSourceis where the serving side reads the trust each request is checked against;SharedTrustis the in-process adapter a refreshing owner replaces.
Structs§
- Handshake
Limiter - A sliding-window handshake rate limit per source address.
- Memory
Directory Versions - An in-memory
DirectoryVersions: monotonic for the life of the process. - Peer
Session - One established peering session, as the serving side tracks it: the verified peer, whether it has been cut off, and what it delivered when.
- Shared
Trust - Trust held in memory that its owner replaces as the directory refreshes: a session reading it sees each replacement at its next request.
Constants§
- DEFAULT_
HANDSHAKES_ PER_ WINDOW - Handshake attempts admitted per source address within one window, by default.
- DEFAULT_
HANDSHAKE_ WINDOW - The default rate-limit window.
- MAX_
TRACKED_ SOURCES - The most source addresses the limiter tracks at once, bounding its memory. When a new source finds the table full, idle sources are pruned, and if it is still full of live ones the least recently active source is evicted: a full table never refuses a new source.
Traits§
- Directory
Versions - The persisted anti-rollback floor: the highest device-directory version this device has
verified. Implementations must be monotonic —
recordnever lowers it — and durable across restarts, or a reboot readmits a stale directory. - Trust
Source - Where the serving side of a channel reads the trust it authorizes each request against: the account’s directory as this device pins it now, so a peer revoked mid-session is refused at its next request. An implementation that cannot produce current trust returns an error, and the request is refused (fail closed) rather than served under trust that may be stale.