005 End-to-end encryption and app hooks in the HTTP routes
Summary: why the HTTP routes carry encryption envelopes, recovery by key only, and hooks where an application adds its rules and rows.
Key terms: e2ee mode, envelope, recovery verifier, decoy, hook, Refusal, By, mount path.
Related: Interfaces · spec 12 · e2ee recipe
Date: 2026-11-26. State: in force, built. The first application with end-to-end encryption moved onto these routes.
Decided
- E2EE mode (
Auth::with_e2ee): signup, passkey add, recovery-key set and recovery finish carry envelopes; login returns the passkey’s envelope; passkey removal deletes it. - Recovery with a key only. In e2ee mode, email, link and owner recovery are refused, because they cannot open the encryption key. Recovery start returns the envelope, or a decoy for an unknown user, after the same work, so an answer does not show which accounts exist.
- Undo of a recovery deletes the envelopes made since the recovery; the
commit_undohook lets the application treat the removed devices as revoked. - Hooks for the application’s rules and rows: names, invite data, device requests, who may approve, the device kind, and commit hooks for signup, approve, revoke and undo.
- Refusals from hooks keep the application’s own codes (
Refusal::App), and commit hooks get the request’s address (By { who, ip }) for the application’s audit. - One error format (
{"error": code}) and base64url IDs. No compatibility mode for older client formats. - A configurable mount path (
mounted_at), with/authas the default. - One client crate for CLIs and wasm, with a
browserfeature, instead of a client in each application.
Why
An application with end-to-end encryption needs the encryption secret to travel with every credential change, in the same commit. Doing it in the library once is safer than doing it in every application.