Events 3.0: auto-connect, demo people in Accounts, e2e; import.finish checks the subs

- contracts 1.8.0 / Accounts 1.1.0: import.finish lists the subs the product
  relies on; Accounts checks each is held, not deleted and known to it (the
  count+hash failed a second move after Undo once someone had joined
  through Accounts).
- Events: connects to the church's Accounts once the Hub lists it;
  moveNewPeople (demo data, people added after the move); set-demo moves
  demo people; e2e/sign-in-accounts.spec.ts with Accounts in memory and an
  e2e-only /api rewrite. test:accounts 14/14; Jest auto-connect tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 14:28:54 +02:00
co-authored by Claude Opus 5.5
parent c627c61de1
commit 63d36c3ecf
24 changed files with 466 additions and 63 deletions
@@ -1,5 +1,5 @@
import { identityRequestSchema, importPersonSchema, sealedValueSchema } from "../src";
import { importIdsHash, newLinkSecret, openLinkValue, sealLinkValue } from "../src/signing";
import { newLinkSecret, openLinkValue, sealLinkValue } from "../src/signing";
import { sample } from "./helpers";
describe("crosscode.identity-request/1", () => {
@@ -15,11 +15,10 @@ describe("crosscode.identity-request/1", () => {
expect(() => openLinkValue(secret, tampered)).toThrow();
});
test("the ids hash doesn't depend on order", () => {
const a = ["b8f1c2d3-0000-4000-8000-000000000002", "a7e0b1c2-0000-4000-8000-000000000001"];
expect(importIdsHash(a)).toBe(importIdsHash([...a].reverse()));
expect(importIdsHash(a)).toMatch(/^[0-9a-f]{64}$/);
expect(importIdsHash(a)).not.toBe(importIdsHash(a.slice(0, 1)));
test("import.finish lists the subs (uuids)", () => {
const finish = sample<{ subs: string[] }>("import-finish.json");
expect(identityRequestSchema.safeParse(finish).success).toBe(true);
expect(identityRequestSchema.safeParse({ ...finish, subs: ["not-a-uuid"] }).success).toBe(false);
});
test("an unsealed password hash is refused", () => {