Passkeys: device flow, settings and off switches (#334) #471

Merged
jcoffey-dev merged 1 commits from feat/334-passkey-policy into main 2026-11-19 04:01:34 +00:00
Owner

Part of #334. Step 4 of 4 in docs/spec/features/passkeys.md (PK-3, PK-5, PK-9, PK-12, PK-13, PK-18). The server side is done after this; the console and webmail pages remain.

  • Device flow: authDevice takes passkey; the login page offers passkeys on /device once the code is filled in.
  • x:Authentication: passkeysAllowed (default true), passkeyRpId (null = host of the public URL; a new value must be that host or a parent, never a public suffix, else invalidProperties), maxPasskeys (default 10, 1-100). x:Domain / x:Tenant: passkeysAllowed (default true) as off switches; all levels must allow. On the served forms.
  • PK-13: an account whose domain (or the server) signs in against an external directory gets no passkeys.
  • Off: create is forbidden, sign-in fails; off server-wide, POST /api/auth/passkey is 404 and the login page hides passkeys.
  • Stored formats: Authentication v1, Domain v3, Tenant v2, new fields last; older records read back allowed / limit 10.
  • New event auth.passkey-counter (664, warn); failed passkey sign-ins tagged type: passkey.

Tests: registry stored-version tests, RP-id check unit test, passkeys system test extended (device flow, maxPasskeys, domain switch off/on, server switch, RP-id values); full system::system_tests run locally; fmt, fork checks, schema check, workspace test build clean.

Part of #334. Step 4 of 4 in `docs/spec/features/passkeys.md` (PK-3, PK-5, PK-9, PK-12, PK-13, PK-18). The server side is done after this; the console and webmail pages remain. - Device flow: `authDevice` takes `passkey`; the login page offers passkeys on `/device` once the code is filled in. - `x:Authentication`: `passkeysAllowed` (default true), `passkeyRpId` (null = host of the public URL; a new value must be that host or a parent, never a public suffix, else `invalidProperties`), `maxPasskeys` (default 10, 1-100). `x:Domain` / `x:Tenant`: `passkeysAllowed` (default true) as off switches; all levels must allow. On the served forms. - PK-13: an account whose domain (or the server) signs in against an external directory gets no passkeys. - Off: create is `forbidden`, sign-in fails; off server-wide, `POST /api/auth/passkey` is 404 and the login page hides passkeys. - Stored formats: Authentication v1, Domain v3, Tenant v2, new fields last; older records read back allowed / limit 10. - New event `auth.passkey-counter` (664, warn); failed passkey sign-ins tagged `type: passkey`. Tests: registry stored-version tests, RP-id check unit test, passkeys system test extended (device flow, maxPasskeys, domain switch off/on, server switch, RP-id values); full `system::system_tests` run locally; fmt, fork checks, schema check, workspace test build clean.
jcoffey-dev added 1 commit 2026-11-19 03:50:20 +00:00
Passkeys: device flow, settings and off switches (#334)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 11m6s
85d49280f1
Last server part of passkeys (docs/spec/features/passkeys.md, PK-3,
PK-5, PK-9, PK-12, PK-13, PK-18).

The device flow (/device) takes a passkey like the authorization-code
flow: the login request's authDevice carries the assertion in place of
the name and password, and the page offers the button and autofill there
too once the device code is filled in.

New settings on x:Authentication: passkeysAllowed (default on),
passkeyRpId (null: the host of the public URL) and maxPasskeys (default
10, 1 to 100). x:Domain and x:Tenant get passkeysAllowed (default on)
as off switches: passkeys work for an account only when the server, its
tenant and its domain all allow them. An account whose domain, or the
server, signs in against an external directory gets none (PK-13). Off
for an account, adding one is forbidden and signing in with one fails;
off server-wide, POST /api/auth/passkey answers 404 and the login page
doesn't offer passkeys. A new or changed passkeyRpId must be the host of
the public URL or a parent of it, never a public suffix; otherwise
invalidProperties names it. The settings are on the Authentication,
domain and tenant forms of the served schema.

Stored formats: x:Authentication version 1, x:Domain version 3 and
x:Tenant version 2, with the new fields after every existing one;
records stored before read back with passkeys allowed and the limit at
10.

A passkey counter that didn't go up now raises auth.passkey-counter
(id 664, warn); failed passkey sign-ins carry type passkey.

Test: registry tests for the stored versions; unit tests for the
relying-party id check; the passkeys system test now signs in through
the device flow, hits maxPasskeys, the domain off switch (refused, then
working again), the server-wide switch (no challenge), and refused and
accepted passkeyRpId values.
jcoffey-dev merged commit bac7ebde09 into main 2026-11-19 04:01:34 +00:00
jcoffey-dev deleted branch feat/334-passkey-policy 2026-11-19 04:01:34 +00:00
Sign in to join this conversation.