Repository navigation
Conversation
This was referenced Oct 24, 2026
AlxcBTW
added a commit
that referenced
this pull request
Oct 24, 2026
Implements network ADR 0016 (network PR 20). Access, relay and appeal tokens are v2 (kid, aud, iat, domain-separated signature; v1 still read). Refresh tokens are bound to a device key and need a proof; a replaced token signs the device out; sign out everywhere sets a not-before time per account. The cloud serves the account web under /web (sign in, create account, account page, ban statement and appeal), the one-time hand-off to the net service loopback address with PKCE, the link to the account page, and passkeys with webauthn-rs. Migration 0008. Age and terms version are recorded. Banned addresses are checked with the keyed hash of moderation.
AlxcBTW
force-pushed
the
feat/passkeys
branch
from
October 24, 2026 15:41
3b81970 to
e69cde6
Compare
Member
Author
|
Superseded by the rebased branch feat/account-web (new PR), because force-pushing this branch is not allowed here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes account takeover hard: refresh tokens are bound to a key on the device, and sign-in, account creation and account management move to web pages the cloud serves. Design: network ADR 0016.
Waits for anyplaynet/network#20. Cloud CI builds against network
main, which does not have the new API types until that PR is merged. (Networkmainalso already has the moderation API that this repository does not use yet: amissing field statementerror in CI comes from that, not from this change.)What it does
crates/ticket):kid,aud,iat, signature over a domain separator; v1 still read. Test vectors, extended fuzz target.AnyPlay-Proofsigned by it (60 seconds, once; nonces in the store, so every node refuses a replay). A copied refresh token alone fails and does not sign the device out. A replaced token that comes back signs the device out (the family ends). "Sign out everywhere" signs out every device and browser and sets a per-account not-before time, which is checked on every request and sent to the other nodes.crates/cloud/src/web, needspublic_url): sign in by e-mail code or passkey, create account (address, code, handle, age, terms), account page (e-mail, passkeys, devices, sign out everywhere, export, delete). Server-rendered, one small script for WebAuthn, strict CSP, Inter served from the binary, own session cookie (HttpOnly,SameSite=Strict,__Host-/Secureon https), CSRF token and origin check on every POST, a recent sign-in for sensitive actions. Dark first, light follows the system; launcher tokens./web/authorize(loopback redirect only, PKCE S256,state) ends with a 60-second one-time code to127.0.0.1;POST /v1/auth/browser/tokentrades code and verifier for tokens bound to the device key.POST /v1/auth/browser/link(proof required) gives a one-time link to the account page that asks before it signs in.age_confirmed_at,terms_version,terms_accepted_aton the account (compliance gap G9);terms_versionsetting; a changed version is asked again at the next web sign-in.0008_passkeys.sql(SQLite and Postgres). Settings:public_url,terms_version,legacy_device_days. Docs: configuration, ARCHITECTURE (threat model), compliance inventory.Migration of existing devices
Devices signed in before this version get
legacy_until= 30 days after the migration. Until then they refresh as before; the net service of the matching version binds them on its first refresh. After that they must sign in again.legacy_device_days = 0requires a key from every new sign-in. Access tokens change format: replace the nodes of a cluster together.Build note
webauthn-rs links OpenSSL. The crate enables
openssl'svendoredfeature, so the container needs no libssl; building needs Perl and a C compiler (the Dockerfile's builder image has both, and so do the CI runners, I expect; if the Windows job cannot build it, that is the thing to look at).Checked locally
cargo fmt(CI's list),cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspaceon SQLite and on Postgres with NATS,cargo deny check,rules.mjs. New tests:tests/binding.rs(stolen refresh token, replayed proof, family revocation, sign out everywhere, legacy devices),tests/web.rs(sign-in and create account in a cookie-jar browser, PKCE mismatch, used and expired codes, non-loopback redirects, CSRF and origin, terms, account page, link, passkeys with a software authenticator),crates/e2e/tests/browser_sign_in.rs(real net service: browser flow, refresh with a proof, account link). The fuzz target builds only on Linux with nightly; its logic was run locally with a shim.Not tested: a real browser with a real authenticator (WebAuthn in the browser is the one thing the software authenticator cannot cover), and the Windows CI build of OpenSSL.