Accounts 1.1.0: moving Events' users in, people.* requests, new recovery codes

POST /api/accounts/v1/requests (crosscode.identity-request/1): import.* keeps
each person's Events id as sub, password hash and authenticator secret
(sealed in transit), consent, notices and lockout; linked when the email
already has an account. people.* for product admins, limited to people the
product knows. New recovery codes after the first 2FA sign-in for people
moved in with 2FA. screen=signup. auth-client: request(), seal(), signUp.
8 new tests (47 in all).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 13:40:15 +02:00
co-authored by Claude Opus 5.5
parent 08fef930c1
commit 733992e917
19 changed files with 834 additions and 39 deletions
+29
View File
@@ -1,5 +1,34 @@
# Changelog — Accounts
## [1.1.0] - unreleased
For Cross Events 3.0 (docs/EVENTS-3.0-PLAN.md §8), with contracts 1.8.0.
### Added
- **`POST /api/accounts/v1/requests`** (`crosscode.identity-request/1`), signed with the link's
secret: what a linked product asks of Accounts. A request id seen before gets its first answer.
- **Moving a product's users in** (`import.begin` / `batch` / `finish` / `abort`, Cross Events
only): each person keeps their Events id as their `sub`, their bcrypt or Argon2id password hash,
2FA method and authenticator secret (sealed with the link's secret on the way, encrypted with
Accounts' key at rest), lockout, news consent and its history, notice acceptance, last sign-in
and status; ticked Events admins become Accounts admins. An email that already has an account is
**linked** (that account and its password stay). A check (`check: true`) writes nothing.
`import.finish` compares the count and a hash of the subs. Events' privacy notice versions are
taken when Accounts has published none; an empty church name and colour are filled from Events.
- **New recovery codes after the first sign-in** for people moved in with 2FA (their Events codes
can't move): shown once after the second step, whatever step comes next.
- **`people.*`**: `ensure` (find or make an account; a new one gets a "choose your password" email
whose link ends on the product), `update`, `resetTwoFactor`, `unlock`, `setActive`, `newsOff`.
Only for people the product knows (moved in, added, or signed in through it), never an Accounts
admin's 2FA or status, and audited with the product and the product admin's `sub`.
- **`screen=signup`** on an authorization request opens the sign-in page on "Create an account"
(`startSignIn(…, { signUp: true })` in `@crosscode/auth-client`).
### Changed
- Setting a password from an emailed link also confirms the email address.
## [1.0.1] - 2026-11-19
### Fixed