Skip to main content

Module server_id

Module server_id 

Source
Expand description

A server’s id: its name for app passkeys, apart from its key.

The endpoint key is what a client pins and proves on every connect, and it may be replaced (a lost state directory, a rotated key). A passkey is made for a relying party and synced with it to the user’s other devices, so the server needs a name that outlives its key: the server id. It is made once, from 80 random bits, and kept in the state directory beside the key.

It is written as lowercase RFC 4648 base32: 16 characters of a-z and 2-7, with no padding (80 bits are 16 characters exactly), a DNS label as it is. It is short because a password manager shows it in the passkey’s domain, and it says nothing about the server: it goes wherever its passkeys go.

Structs§

InvalidServerId
Why a string is not a server id.
ServerId
A server’s id, as ServerId::parse checked it.

Constants§

APP_RP_DOMAIN
The domain every server’s app passkeys are made under: a server’s relying party is <server id>.spoolframe.app. Every client and the admin API use this one value.
SERVER_ID_BYTES
Random bytes in a server id.
SERVER_ID_LEN
Characters in a server id: 80 bits in 5-bit characters.