Expand description
The operator (kernel spec §3): the one owner, their password, the
public_url setting, and the one-time setup link that sets them up.
- One owner. It exists from the first start (the kernel’s
migrations create it, plan 3b-iii decision 1); setup sets it up, once,
and a second setup is refused. Every query names that owner (kernel
spec §1), bound when the operator opens (
db::kernel_owner). - The setup token lives in memory only. A restart before setup issues a new one, and the old one is dead by construction (kernel spec §3.1). Only its SHA-256 is kept.
- Passwords are Argon2id PHC strings (
password-auth). Hashing and verifying are CPU- and memory-heavy (about 19 MiB each), so they run on a blocking thread and at mostMAX_CONCURRENT_HASHESat once. - Recovery (the admin socket, kernel spec §4.2): a password reset
and a
public_urlreset each end every session, and so its streams.
Every time is seconds since the Unix epoch, passed in by the caller.
Structs§
- Auth
Session - One signed-in session, as Settings lists them (kernel spec §3.2).
- Authenticated
- A request’s session, once its cookie checks out.
- Operator
- Public
Url - Where browsers reach the collector (umbrella spec §7.5):
https://, orhttp://to a loopback address, with no path, query or credentials. Kept as its origin exactly as a browser serialises it inOrigin(lowercase scheme and host, no default port, no trailing slash), so the two compare as plain strings. - Setup
Link - Where the setup link was written (
Operator::announce_setup).Debugleaves the token out: a failing assertion or a log line must not show it.
Enums§
- Public
UrlChange - The outcome of
Operator::change_public_url. - Reset
- The outcome of
Operator::reset_passwordandreset_public_url. - Setup
Outcome - The outcome of
Operator::set_up.
Constants§
- MAX_
CONCURRENT_ HASHES - Argon2 runs at most this many at once, whatever the number of clients.
- MAX_
PASSWORD_ BYTES - The longest password accepted, in bytes: hashing is bounded by it.
- MAX_
SESSION_ COOKIES - At most this many
hennery_sessioncookies of a request are tried, so one request cannot cost many session lookups. - MIN_
PASSWORD_ CHARS - The shortest password setup accepts, in characters.
- SESSION_
COOKIE - The session cookie’s name (kernel spec §3.2).
- SESSION_
SLIDE_ SECS - A session’s expiry slides at most this often, so a busy client does not write to the database on every request.
- SESSION_
TTL_ SECS - A signed-in session lives this long past its last use (kernel spec §3.2).
- SETUP_
TOKEN_ TTL_ SECS - A setup link is valid this long (kernel spec §3.1).
- SETUP_
URL_ FILE - The file in the data directory that holds the setup link until setup (kernel spec §1, §3.1).
- STEP_
UP_ SECS - A password check is fresh enough for step-up this long (kernel spec §3.4).
Functions§
- cleared_
cookie Set-Cookiethat removes the session cookie.- session_
cookie Set-Cookiefor a session (kernel spec §3.2):HttpOnly,SameSite=Strict,Path=/, forSESSION_TTL_SECS, andSecureunlesspublic_urlis loopbackhttp://.- session_
tokens - Every session token in a request’s
Cookieheaders, in order, at mostMAX_SESSION_COOKIES. There can be more than one: a sibling subdomain can set a cookie of the same name for the parent domain, and the browser may send it first. Taking only the first would let it sign the owner out.