@getcirrus/space-conformance 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-CGsQgOwR.d.ts +472 -0
- package/dist/base-CGsQgOwR.d.ts.map +1 -0
- package/dist/cli.js +26 -18
- package/dist/cli.js.map +1 -1
- package/dist/coverage-cK1NBo-P.js +2250 -0
- package/dist/coverage-cK1NBo-P.js.map +1 -0
- package/dist/descriptors-BUCV_BuG.js +4428 -0
- package/dist/descriptors-BUCV_BuG.js.map +1 -0
- package/dist/full-CKsHg6ox.js +852 -0
- package/dist/full-CKsHg6ox.js.map +1 -0
- package/dist/full.d.ts +44 -17
- package/dist/full.d.ts.map +1 -1
- package/dist/full.js +3 -3
- package/dist/index.d.ts +90 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -93
- package/dist/index.js.map +1 -1
- package/lexicons/MANIFEST.json +4 -4
- package/lexicons/managedspace/checkAccess.json +44 -0
- package/lexicons/managedspace/policy.json +22 -0
- package/lexicons/memberspace/defs.json +22 -0
- package/lexicons/{simplespace → memberspace}/listMembers.json +15 -17
- package/lexicons/memberspace/member.json +23 -0
- package/lexicons/memberspace/policy.json +40 -0
- package/lexicons/memberspace/putMembers.json +43 -0
- package/lexicons/memberspace/removeMembers.json +43 -0
- package/lexicons/personalspace/policy.json +11 -0
- package/lexicons/space/applyWrites.json +6 -11
- package/lexicons/space/authorizeSpaceSync.json +109 -0
- package/lexicons/space/clearRecords.json +34 -0
- package/lexicons/space/confirmRegistration.json +44 -0
- package/lexicons/space/createRecord.json +7 -14
- package/lexicons/space/createSpace.json +58 -0
- package/lexicons/space/defs.json +61 -16
- package/lexicons/space/deleteRecord.json +5 -9
- package/lexicons/space/deleteSpace.json +31 -0
- package/lexicons/space/exportSpaceMeta.json +31 -0
- package/lexicons/space/getBlob.json +4 -7
- package/lexicons/space/getDelegationToken.json +3 -5
- package/lexicons/space/getLatestCommit.json +8 -7
- package/lexicons/space/getRecord.json +9 -9
- package/lexicons/space/getRepo.json +8 -11
- package/lexicons/space/getSpace.json +43 -0
- package/lexicons/space/importRepo.json +27 -0
- package/lexicons/space/importSpaceMeta.json +25 -0
- package/lexicons/space/listBlobs.json +3 -10
- package/lexicons/space/listRecords.json +10 -16
- package/lexicons/space/listRepoOps.json +23 -23
- package/lexicons/space/listSpaces.json +30 -14
- package/lexicons/space/listWriters.json +66 -0
- package/lexicons/space/notifyCredentialsRevoked.json +30 -0
- package/lexicons/space/notifyRepoUpdate.json +44 -0
- package/lexicons/space/notifySpaceUpdate.json +53 -0
- package/lexicons/space/policy.json +26 -0
- package/lexicons/space/putRecord.json +7 -14
- package/lexicons/space/removeWriter.json +35 -0
- package/lexicons/space/updateSpace.json +43 -0
- package/package.json +11 -11
- package/dist/base-D8a-ZK57.d.ts +0 -249
- package/dist/base-D8a-ZK57.d.ts.map +0 -1
- package/dist/coverage-DhJZu8P8.js +0 -1914
- package/dist/coverage-DhJZu8P8.js.map +0 -1
- package/dist/full-D4ufJLcw.js +0 -409
- package/dist/full-D4ufJLcw.js.map +0 -1
- package/dist/operator-BErXCDow.js +0 -923
- package/dist/operator-BErXCDow.js.map +0 -1
- package/lexicons/simplespace/addMember.json +0 -37
- package/lexicons/simplespace/checkUserAccess.json +0 -43
- package/lexicons/simplespace/createSpace.json +0 -74
- package/lexicons/simplespace/defs.json +0 -47
- package/lexicons/simplespace/deleteSpace.json +0 -32
- package/lexicons/simplespace/getSpace.json +0 -53
- package/lexicons/simplespace/removeMember.json +0 -37
- package/lexicons/simplespace/updateSpace.json +0 -57
- package/lexicons/space/getSpaceCredential.json +0 -67
- package/lexicons/space/listRepos.json +0 -75
- package/lexicons/space/notifySpaceDeleted.json +0 -24
- package/lexicons/space/notifyWrite.json +0 -38
- package/lexicons/space/registerNotify.json +0 -49
- package/lexicons/space/unregisterNotify.json +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"full-CKsHg6ox.js","names":["parts: Uint8Array[]","cursor: string | undefined","last: ReturnType<typeof commitFromJson>","problems: string[]","credential: Credential","cryptoChecks: Check[]","didFor?: (\n\t\t\trole: string,\n\t\t\tdidKey: string,\n\t\t) => string | Promise<string>"],"sources":["../src/full/helpers.ts","../src/full/checks.ts","../src/identity.ts","../src/full.ts"],"sourcesContent":["/**\n * Crypto-bound helpers: tokens minted as harness-held identities\n * (delegation tokens as a reader, credentials as a foreign authority,\n * service auth as a writer's PDS) and the reference library's verifiers\n * for the MACs, commits and archives a target serves.\n *\n * Using the reference library to mint and verify is deliberate: \"correctly\n * formed\" is defined by the library every implementation must interoperate\n * with, so a token it mints is one the target must accept, and an artefact\n * it rejects is one no other implementation could consume.\n */\n\nimport {\n\tcreateDelegationToken,\n\tcreateSpaceCredential,\n\tspaceHostAud,\n\ttype SpaceCommit,\n} from \"@atproto/space\";\nimport type { CheckContext, HarnessIdentity } from \"../model.js\";\nimport { lexBytes, toBase64Url, utf8 } from \"../encoding.js\";\nimport {\n\trequestCredential,\n\tspaceAuthority,\n\ttype Credential,\n\ttype CredentialResult,\n} from \"../checks/probe.js\";\nimport type { XrpcResult } from \"../http.js\";\n\nexport {\n\tcreateProbeSpace,\n\tdeleteProbeSpace,\n\toperatorCreateRecord,\n\tobtainCredentialViaDelegation,\n\tobtainPublicCredential,\n\tcredentialGet,\n\tcredentialCall,\n\trequestCredential,\n} from \"../checks/probe.js\";\nexport type { Credential, ProbeSpace } from \"../checks/probe.js\";\n\ntype Did = `did:${string}:${string}`;\n\n/** Adapt a harness identity to the `Signer` surface token minting uses. */\nfunction keypairFor(identity: HarnessIdentity) {\n\treturn {\n\t\tjwtAlg: identity.jwtAlg,\n\t\tsign: (bytes: Uint8Array) => identity.sign(bytes),\n\t\tdid: () => identity.did,\n\t} as never;\n}\n\n/**\n * Mint a delegation token for `identity` against `space`, addressed (by\n * default) to the space authority's `#atproto_pds` — the space host.\n */\nexport function mintDelegation(\n\tidentity: HarnessIdentity,\n\tspace: string,\n\taudOverride?: string,\n): Promise<string> {\n\treturn createDelegationToken({\n\t\tiss: identity.did as Did,\n\t\tsub: space as never,\n\t\taud: audOverride ?? spaceHostAud(spaceAuthority(space) as Did),\n\t\tkeypair: keypairFor(identity),\n\t});\n}\n\n/**\n * The full obtain flow as a foreign user: mint a delegation token as\n * `identity` and exchange it for a credential bound to a fresh P-256 key.\n * Returns the raw result so callers can assert on refusals.\n */\nexport async function obtainCredential(\n\tctx: CheckContext,\n\tidentity: HarnessIdentity,\n\tspace: string,\n\topts: { audOverride?: string; clientAttestation?: string } = {},\n): Promise<{ result: XrpcResult; credential?: Credential }> {\n\treturn requestCredential(ctx, space, {\n\t\tdelegationToken: await mintDelegation(identity, space, opts.audOverride),\n\t\t...(opts.clientAttestation\n\t\t\t? { clientAttestation: opts.clientAttestation }\n\t\t\t: {}),\n\t});\n}\n\n/**\n * Mint a credential as the authority of `space` — a harness identity\n * playing a foreign space authority whose credentials a repo host must\n * honour for reads of its repos in that space.\n */\nexport function mintCredential(\n\tauthority: HarnessIdentity,\n\tspace: string,\n\tkeyDid: string,\n): Promise<string> {\n\treturn createSpaceCredential({\n\t\tiss: authority.did as Did,\n\t\tsub: space as never,\n\t\tkeyId: keyDid as Did,\n\t\tkeypair: keypairFor(authority),\n\t});\n}\n\n/** An inter-service auth JWT (`lxm`-scoped), signed as `identity`. */\nexport async function serviceJwt(\n\tidentity: HarnessIdentity,\n\topts: { aud: string; lxm: string; expiresInSec?: number },\n): Promise<string> {\n\tconst iat = Math.floor(Date.now() / 1000);\n\tconst header = { typ: \"JWT\", alg: identity.jwtAlg };\n\tconst payload = {\n\t\tiss: identity.did,\n\t\taud: opts.aud,\n\t\tiat,\n\t\texp: iat + (opts.expiresInSec ?? 60),\n\t\tlxm: opts.lxm,\n\t\tjti: toBase64Url(crypto.getRandomValues(new Uint8Array(16))),\n\t};\n\tconst input = `${toBase64Url(utf8(JSON.stringify(header)))}.${toBase64Url(utf8(JSON.stringify(payload)))}`;\n\tconst sig = await identity.sign(utf8(input));\n\treturn `${input}.${toBase64Url(sig)}`;\n}\n\n/** A commit as the wire JSON carries it, with `data` decoded. */\nexport function commitFromJson(value: unknown): SpaceCommit | undefined {\n\tif (!value || typeof value !== \"object\") return undefined;\n\tconst raw = value as Record<string, unknown>;\n\tconst data = lexBytes(raw.data);\n\tif (!data) return undefined;\n\treturn { ...(raw as Omit<SpaceCommit, \"data\">), data } as SpaceCommit;\n}\n\n/** What `verifyCommit` / `verifyRecord` / `verifyRepoStar` need from a MAC'd response. */\nexport function macParams(res: CredentialResult) {\n\tif (!res.keyShare || !res.sharedSecret) {\n\t\tthrow new Error(\"the response was not requested with a MAC\");\n\t}\n\treturn {\n\t\tkeyShare: res.keyShare as Did,\n\t\tsharedSecret: res.sharedSecret,\n\t\theaders: res.headers,\n\t};\n}\n\n/** Drain an async byte stream (an archive serializer) into one buffer. */\nexport async function collectBytes(\n\tchunks: AsyncIterable<Uint8Array>,\n): Promise<Uint8Array> {\n\tconst parts: Uint8Array[] = [];\n\tfor await (const chunk of chunks) parts.push(chunk);\n\tconst out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));\n\tlet offset = 0;\n\tfor (const part of parts) {\n\t\tout.set(part, offset);\n\t\toffset += part.length;\n\t}\n\treturn out;\n}\n","/**\n * The crypto-bound check catalog: the checks that genuinely need the\n * alpha libs or harness-held foreign identities, and nothing else — every\n * check an operator session can run with plain fetch + WebCrypto lives in\n * `../checks/` instead, browser included.\n *\n * What keeps a check here:\n * - verifying what a target serves — commit and record MACs, STAR\n * archives, token signatures — with the reference library;\n * - building archives (space meta, repo STARs) to import;\n * - `identities`: the harness plays a reader, a writer's PDS or a foreign\n * space authority, minting tokens the target must verify by resolving\n * that party's DID.\n *\n * Each check's metadata comes from `../descriptors.ts`, the dependency-free\n * list the browser catalog shows as \"not testable here\".\n */\n\nimport {\n\tRepoCommit,\n\treadRepoStar,\n\treadSpaceMetaStar,\n\tspaceHostAud,\n\tverifyCommit,\n\tverifyRecord,\n\tverifyRepoStarFull,\n\tverifySpaceToken,\n\twriteRepoStar,\n\twriteSpaceMetaStar,\n\ttype SpaceMetaArchive,\n} from \"@atproto/space\";\nimport { parseCid } from \"@atproto/lex-data\";\nimport { defineCheck } from \"../registry.js\";\nimport { descriptor } from \"../descriptors.js\";\nimport {\n\tasOperator,\n\toperatorFetch,\n\txrpcGet,\n\txrpcPost,\n\txrpcPostBytes,\n} from \"../http.js\";\nimport {\n\tfail,\n\tpass,\n\ttype Check,\n\ttype CheckContext,\n\ttype CheckOutcome,\n} from \"../model.js\";\nimport {\n\tbytesEqual,\n\tdecodeJwt,\n\tisTid,\n\tlexBytes,\n\ttidAt,\n\ttidNow,\n\ttoBase64,\n\tutf8,\n} from \"../encoding.js\";\nimport { resolveDidDocument, verificationMethodDidKey } from \"../did.js\";\nimport {\n\tCOMMIT_MAC_PROFILE,\n\tcreateCredentialKey,\n\tformatMacRequest,\n} from \"../space-auth.js\";\nimport {\n\tFOREIGN_DID,\n\tPOST,\n\tcreateProbeSpace,\n\tcredentialCall,\n\tcredentialGet,\n\tdeleteProbeSpace,\n\tdescribe,\n\tmanagedspace,\n\tmemberspace,\n\tmustCreateRecord,\n\tobtainPublicCredential,\n\toperatorCreateRecord,\n\tpersonalspace,\n\tprobeSkey,\n\tpublicRead,\n\tspaceRecordUri,\n\tspaceUri,\n\tunknownSpaceUri,\n\ttype Credential,\n} from \"../checks/probe.js\";\nimport { fakeDid, putMembers } from \"../checks/space.js\";\nimport { ACCOUNT_REFUSALS } from \"../checks/credential.js\";\nimport { listWriters } from \"../checks/host.js\";\nimport {\n\tcollectBytes,\n\tcommitFromJson,\n\tmacParams,\n\tmintCredential,\n\tmintDelegation,\n\tobtainCredential,\n\tserviceJwt,\n} from \"./helpers.js\";\n\ntype Did = `did:${string}:${string}`;\n\nconst crypto$ = (\n\tid: string,\n\trun: (ctx: CheckContext) => Promise<CheckOutcome>,\n): Check => defineCheck({ ...descriptor(id), run });\n\nconst errMsg = (err: unknown) =>\n\terr instanceof Error ? err.message : String(err);\n\n/**\n * A public-read space with two records and a credential for it. `fn` gets\n * the space-ref in the form the protocol fixes (`at:space/{did}/{type}/{skey}`),\n * built here rather than echoed from createSpace, so the MAC checks verify\n * the commit's and record's URIs against it, not against whatever the host\n * emitted.\n */\nasync function withPublicSpace<T>(\n\tctx: CheckContext,\n\tfn: (space: string, credential: Credential) => Promise<T>,\n): Promise<T> {\n\tconst space = await createProbeSpace(ctx, publicRead());\n\ttry {\n\t\tconst ref = spaceUri(ctx.target.did, space.skey);\n\t\tawait mustCreateRecord(ctx, ref, \"a\", \"one\");\n\t\tawait mustCreateRecord(ctx, ref, \"b\", \"two\");\n\t\treturn await fn(ref, await obtainPublicCredential(ctx, ref));\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n}\n\n// --- MAC verification ---------------------------------------------------\n\nconst macCommit = crypto$(\"mac.commit-verifies\", (ctx) =>\n\twithPublicSpace(ctx, async (space, credential) => {\n\t\t// A custom label, and a request for some other profile alongside: the\n\t\t// host must answer under the label asked for and ignore the stranger.\n\t\tconst res = await credentialCall(\n\t\t\tctx,\n\t\t\tcredential,\n\t\t\t\"com.atproto.space.getLatestCommit\",\n\t\t\t{\n\t\t\t\tparams: { space, repo: ctx.target.did },\n\t\t\t\tmac: {\n\t\t\t\t\tprofile: COMMIT_MAC_PROFILE,\n\t\t\t\t\theader: (k) =>\n\t\t\t\t\t\t`${formatMacRequest(COMMIT_MAC_PROFILE, k, { label: \"m1\" })}, other=(\"content-digest\");tag=\"someone-elses\"`,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\tif (res.status !== 200)\n\t\t\treturn fail(`getLatestCommit ${describe(res)}`, res.json);\n\t\tconst raw = (res.json as { commit?: Record<string, unknown> }).commit ?? {};\n\t\tconst keys = Object.keys(raw).sort().join(\",\");\n\t\tif (keys !== \"data,repo,rev,space,ver\")\n\t\t\treturn fail(\n\t\t\t\t`commit carries {${keys}}, expected exactly {data,repo,rev,space,ver}`,\n\t\t\t\traw,\n\t\t\t);\n\t\tconst commit = commitFromJson(raw);\n\t\tif (\n\t\t\t!commit ||\n\t\t\tcommit.ver !== 1 ||\n\t\t\t!isTid(commit.rev) ||\n\t\t\tcommit.data.length !== 32\n\t\t) {\n\t\t\treturn fail(\n\t\t\t\t\"commit fields malformed (ver 1, TID rev, 32-byte data)\",\n\t\t\t\traw,\n\t\t\t);\n\t\t}\n\t\tconst input = res.headers.get(\"signature-input\") ?? \"\";\n\t\tif (!/^m1=/.test(input))\n\t\t\treturn fail(`MAC not under the requested label: ${input}`);\n\t\tconst vary = (res.headers.get(\"vary\") ?? \"\").toLowerCase();\n\t\tif (\n\t\t\t!vary\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((v) => v.trim())\n\t\t\t\t.includes(\"accept-signature\")\n\t\t)\n\t\t\treturn fail(`Vary does not list Accept-Signature: ${vary}`);\n\t\ttry {\n\t\t\t// `space` is the at:space/ ref built from the skey: verifyCommit\n\t\t\t// requires the commit's space, and the space the MAC header covers,\n\t\t\t// to equal it exactly — an at:// form fails here.\n\t\t\tverifyCommit(commit, {\n\t\t\t\tspace: space as never,\n\t\t\t\trepo: ctx.target.did as Did,\n\t\t\t\t...macParams(res),\n\t\t\t});\n\t\t\treturn pass(\n\t\t\t\t\"commit shape as specified; commit and MAC name the at:space/ ref; MAC verifies under the requested label; Vary lists Accept-Signature\",\n\t\t\t);\n\t\t} catch (err) {\n\t\t\treturn fail(`verifyCommit rejected the response: ${errMsg(err)}`, raw);\n\t\t}\n\t}),\n);\n\nconst macRecord = crypto$(\"mac.record-verifies\", (ctx) =>\n\twithPublicSpace(ctx, async (space, credential) => {\n\t\tconst res = await credentialGet(\n\t\t\tctx,\n\t\t\tcredential,\n\t\t\t\"com.atproto.space.getRecord\",\n\t\t\t{\n\t\t\t\tspace,\n\t\t\t\trepo: ctx.target.did,\n\t\t\t\tcollection: POST,\n\t\t\t\trkey: \"a\",\n\t\t\t},\n\t\t);\n\t\tif (res.status !== 200) return fail(`getRecord ${describe(res)}`, res.json);\n\t\tconst record = res.json as {\n\t\t\turi: string;\n\t\t\tcid: string;\n\t\t\tvalue: Record<string, unknown>;\n\t\t};\n\t\t// The record's URI in the form the protocol fixes; the response's uri\n\t\t// and the uri the MAC header covers must both be exactly this.\n\t\tconst uri = spaceRecordUri(space, ctx.target.did, POST, \"a\");\n\t\tif (record.uri !== uri)\n\t\t\treturn fail(`getRecord uri was ${record.uri}, expected ${uri}`, record);\n\t\ttry {\n\t\t\tawait verifyRecord(record as never, {\n\t\t\t\turi: uri as never,\n\t\t\t\t...macParams(res),\n\t\t\t});\n\t\t\treturn pass(\n\t\t\t\t\"record uri is the at:space/ form; MAC verifies over that uri and the cid; value encodes to cid\",\n\t\t\t);\n\t\t} catch (err) {\n\t\t\treturn fail(`verifyRecord rejected the response: ${errMsg(err)}`, record);\n\t\t}\n\t}),\n);\n\nconst oplogFolds = crypto$(\"sync.oplog-folds-to-commit\", (ctx) =>\n\twithPublicSpace(ctx, async (space, credential) => {\n\t\t// One more op that replaces a record, so the fold exercises `prev`.\n\t\tawait xrpcPost(asOperator(ctx), \"com.atproto.space.putRecord\", {\n\t\t\tspace,\n\t\t\trepo: ctx.target.did,\n\t\t\tcollection: POST,\n\t\t\trkey: \"a\",\n\t\t\trecord: { $type: POST, text: \"one, again\" },\n\t\t});\n\t\t// One op per page: every page, not just the last, carries the commit.\n\t\tconst folded = new RepoCommit();\n\t\tlet cursor: string | undefined;\n\t\tlet pages = 0;\n\t\tlet last: ReturnType<typeof commitFromJson>;\n\t\tfor (; pages < 20; pages++) {\n\t\t\tconst res = await credentialGet(\n\t\t\t\tctx,\n\t\t\t\tcredential,\n\t\t\t\t\"com.atproto.space.listRepoOps\",\n\t\t\t\t{\n\t\t\t\t\tspace,\n\t\t\t\t\trepo: ctx.target.did,\n\t\t\t\t\tlimit: \"1\",\n\t\t\t\t\tcursor,\n\t\t\t\t},\n\t\t\t);\n\t\t\tif (res.status !== 200)\n\t\t\t\treturn fail(\n\t\t\t\t\t`listRepoOps page ${pages + 1}: ${describe(res)}`,\n\t\t\t\t\tres.json,\n\t\t\t\t);\n\t\t\tconst body = res.json as {\n\t\t\t\tops: Array<{\n\t\t\t\t\tcollection: string;\n\t\t\t\t\trkey: string;\n\t\t\t\t\tcid: string | null;\n\t\t\t\t\tprev: string | null;\n\t\t\t\t}>;\n\t\t\t\tcommit?: unknown;\n\t\t\t\tcursor?: string;\n\t\t\t};\n\t\t\tlast = commitFromJson(body.commit);\n\t\t\tif (!last) return fail(`page ${pages + 1} carried no commit`, body);\n\t\t\ttry {\n\t\t\t\tverifyCommit(last, {\n\t\t\t\t\tspace: space as never,\n\t\t\t\t\trepo: ctx.target.did as Did,\n\t\t\t\t\t...macParams(res),\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treturn fail(\n\t\t\t\t\t`page ${pages + 1}'s commit MAC does not verify: ${errMsg(err)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfolded.applyOps(\n\t\t\t\tbody.ops.map((op) => ({\n\t\t\t\t\tcollection: op.collection,\n\t\t\t\t\trkey: op.rkey,\n\t\t\t\t\tcid: op.cid ? parseCid(op.cid) : null,\n\t\t\t\t\tprev: op.prev ? parseCid(op.prev) : null,\n\t\t\t\t})) as never,\n\t\t\t);\n\t\t\tcursor = body.cursor;\n\t\t\tif (!cursor) break;\n\t\t}\n\t\tif (pages < 2) return fail(\"three ops at limit=1 did not paginate\");\n\t\treturn folded.matches(last!)\n\t\t\t? pass(\n\t\t\t\t\t`${pages + 1} pages, each with a MAC-verified commit; the ops fold to its data`,\n\t\t\t\t)\n\t\t\t: fail(\"the folded oplog does not match the commit data\");\n\t}),\n);\n\nconst getRepoStar = crypto$(\"sync.getrepo-star\", (ctx) =>\n\twithPublicSpace(ctx, async (space, credential) => {\n\t\tconst res = await credentialGet(\n\t\t\tctx,\n\t\t\tcredential,\n\t\t\t\"com.atproto.space.getRepo\",\n\t\t\t{ space, repo: ctx.target.did },\n\t\t);\n\t\tif (res.status !== 200) return fail(`getRepo ${describe(res)}`, res.json);\n\t\tconst type = res.headers.get(\"Content-Type\") ?? \"\";\n\t\tif (!type.includes(\"application/vnd.dasl.star\"))\n\t\t\treturn fail(`getRepo content-type was ${type}`);\n\t\tconst bytes = new Uint8Array(await res.response.arrayBuffer());\n\t\ttry {\n\t\t\tconst { records } = await verifyRepoStarFull([bytes], {\n\t\t\t\tspace: space as never,\n\t\t\t\trepo: ctx.target.did as Did,\n\t\t\t\t...macParams(res),\n\t\t\t});\n\t\t\tconst rkeys = records.map((r) => `${r.collection}/${r.rkey}`).sort();\n\t\t\treturn rkeys.join(\",\") === `${POST}/a,${POST}/b`\n\t\t\t\t? pass(\"STAR archive verified against its MAC; both records present\")\n\t\t\t\t: fail(`archive verified but held ${rkeys.join(\", \") || \"no records\"}`);\n\t\t} catch (err) {\n\t\t\treturn fail(`verifyRepoStarFull rejected the archive: ${errMsg(err)}`);\n\t\t}\n\t}),\n);\n\n// --- token signatures -------------------------------------------------\n\nasync function atprotoKey(ctx: CheckContext, did: string): Promise<string> {\n\tconst key = verificationMethodDidKey(\n\t\tawait resolveDidDocument(ctx, did),\n\t\t\"atproto\",\n\t);\n\tif (!key) throw new Error(`${did} publishes no #atproto key`);\n\treturn key;\n}\n\nconst credentialSigned = crypto$(\n\t\"credential.signed-by-authority\",\n\tasync (ctx) => {\n\t\tconst space = await createProbeSpace(ctx, publicRead());\n\t\ttry {\n\t\t\tconst credential = await obtainPublicCredential(ctx, space.uri);\n\t\t\ttry {\n\t\t\t\tawait verifySpaceToken(\"credential\", credential.credential, {\n\t\t\t\t\tgetSigningKey: (iss) => atprotoKey(ctx, iss),\n\t\t\t\t\tsub: space.uri,\n\t\t\t\t});\n\t\t\t\treturn pass(\"verifies against the authority's #atproto key\");\n\t\t\t} catch (err) {\n\t\t\t\treturn fail(`credential did not verify: ${errMsg(err)}`);\n\t\t\t}\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\nconst delegationSigned = crypto$(\"delegation.signed-by-user\", async (ctx) => {\n\tconst space = await createProbeSpace(ctx, memberspace());\n\ttry {\n\t\tconst res = await xrpcGet(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.getDelegationToken\",\n\t\t\t{ space: space.uri },\n\t\t);\n\t\tif (res.status !== 200)\n\t\t\treturn fail(`getDelegationToken ${describe(res)}`, res.json);\n\t\ttry {\n\t\t\tawait verifySpaceToken(\n\t\t\t\t\"delegation\",\n\t\t\t\t(res.json as { token: string }).token,\n\t\t\t\t{\n\t\t\t\t\tgetSigningKey: (iss) => atprotoKey(ctx, iss),\n\t\t\t\t\taud: spaceHostAud(ctx.target.did as Did),\n\t\t\t\t\tsub: space.uri,\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn pass(\"verifies against the user's #atproto key\");\n\t\t} catch (err) {\n\t\t\treturn fail(`delegation token did not verify: ${errMsg(err)}`);\n\t\t}\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\n// --- migration ----------------------------------------------------------\n\nasync function exportMeta(ctx: CheckContext, space: string) {\n\tconst res = await operatorFetch(ctx)(\n\t\t`${ctx.target.origin}/xrpc/com.atproto.space.exportSpaceMeta?space=${encodeURIComponent(space)}`,\n\t);\n\tif (res.status !== 200)\n\t\tthrow new Error(\n\t\t\t`exportSpaceMeta ${res.status} ${await res.text().catch(() => \"\")}`,\n\t\t);\n\treturn {\n\t\ttype: res.headers.get(\"Content-Type\") ?? \"\",\n\t\tarchive: await readSpaceMetaStar([new Uint8Array(await res.arrayBuffer())]),\n\t};\n}\n\nconst importMeta = async (ctx: CheckContext, archive: SpaceMetaArchive) =>\n\txrpcPostBytes(\n\t\tasOperator(ctx),\n\t\t\"com.atproto.space.importSpaceMeta\",\n\t\tawait collectBytes(writeSpaceMetaStar(archive)),\n\t);\n\nconst memberKey = (did: string) => `com.atproto.memberspace.member/${did}`;\n\nconst exportSpaceMeta = crypto$(\"migration.export-space-meta\", async (ctx) => {\n\tconst space = await createProbeSpace(ctx, memberspace({ publicWrite: true }));\n\tconst member = fakeDid();\n\ttry {\n\t\tawait putMembers(ctx, space.uri, [\n\t\t\t{ did: member, read: true, write: false },\n\t\t]);\n\t\tawait mustCreateRecord(ctx, space.uri, \"a\");\n\t\tconst { type, archive } = await exportMeta(ctx, space.uri);\n\t\tconst problems: string[] = [];\n\t\tif (!type.includes(\"application/vnd.dasl.star\"))\n\t\t\tproblems.push(`content-type ${type}`);\n\t\tif (archive.space !== space.uri) problems.push(`space ${archive.space}`);\n\t\tif (archive.policy.$type !== \"com.atproto.memberspace.policy\")\n\t\t\tproblems.push(`policy ${String(archive.policy.$type)}`);\n\t\tconst entry = archive.policyState.find((e) => e.key === memberKey(member));\n\t\tif (!entry || entry.value.read !== true || entry.value.write !== false)\n\t\t\tproblems.push(\"member entry missing or wrong\");\n\t\tconst writer = archive.writers.find((w) => w.did === ctx.target.did);\n\t\tif (!writer || !isTid(writer.repoRev))\n\t\t\tproblems.push(\"the authority is not in the writer set with a repoRev\");\n\t\tif (problems.length) return fail(problems.join(\"; \"), archive);\n\t\t// A removed writer is left out of the archive.\n\t\tawait xrpcPost(asOperator(ctx), \"com.atproto.space.removeWriter\", {\n\t\t\tspace: space.uri,\n\t\t\trepo: ctx.target.did,\n\t\t});\n\t\tconst after = await exportMeta(ctx, space.uri);\n\t\treturn after.archive.writers.some((w) => w.did === ctx.target.did)\n\t\t\t? fail(\"a removed writer is still in the exported writer set\")\n\t\t\t: pass(\n\t\t\t\t\t\"archive carries the policy, the member and live writers with repoRev; removed writers are left out\",\n\t\t\t\t);\n\t} catch (err) {\n\t\treturn fail(errMsg(err));\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\nconst importSpaceMeta = crypto$(\"migration.import-space-meta\", async (ctx) => {\n\tconst space = await createProbeSpace(ctx, memberspace());\n\tconst before = fakeDid();\n\tconst after = fakeDid();\n\ttry {\n\t\tawait putMembers(ctx, space.uri, [\n\t\t\t{ did: before, read: true, write: true },\n\t\t]);\n\t\tconst { archive } = await exportMeta(ctx, space.uri);\n\t\t// Import a changed configuration over the space: it replaces, not merges.\n\t\tconst imported = await importMeta(ctx, {\n\t\t\t...archive,\n\t\t\tpolicy: { $type: \"com.atproto.memberspace.policy\", publicRead: true },\n\t\t\tpolicyState: [\n\t\t\t\t{\n\t\t\t\t\tkey: memberKey(after),\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t$type: \"com.atproto.memberspace.member\",\n\t\t\t\t\t\tread: true,\n\t\t\t\t\t\twrite: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t\tif (imported.status !== 200)\n\t\t\treturn fail(`importSpaceMeta ${describe(imported)}`, imported.json);\n\t\tconst got = await xrpcGet(asOperator(ctx), \"com.atproto.space.getSpace\", {\n\t\t\tspace: space.uri,\n\t\t});\n\t\tconst policy = (\n\t\t\tgot.json as { policy?: { publicRead?: boolean } } | undefined\n\t\t)?.policy;\n\t\tconst list = await xrpcGet(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.memberspace.listMembers\",\n\t\t\t{ space: space.uri },\n\t\t);\n\t\tconst dids = (\n\t\t\t(list.json as { members?: Array<{ did: string }> } | undefined)\n\t\t\t\t?.members ?? []\n\t\t).map((m) => m.did);\n\t\tif (policy?.publicRead !== true)\n\t\t\treturn fail(\"getSpace does not reflect the imported policy\", got.json);\n\t\treturn dids.includes(after) && !dids.includes(before)\n\t\t\t? pass(\"imported policy and member list replaced the old ones\")\n\t\t\t: fail(`members after import: ${dids.join(\", \") || \"none\"}`, list.json);\n\t} catch (err) {\n\t\treturn fail(errMsg(err));\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\nconst importMetaNotAuthority = crypto$(\n\t\"migration.import-space-meta-not-authority\",\n\tasync (ctx) => {\n\t\tconst res = await importMeta(ctx, {\n\t\t\tspace: unknownSpaceUri(FOREIGN_DID) as never,\n\t\t\tpolicy: { $type: \"com.atproto.personalspace.policy\" },\n\t\t\tpolicyState: [],\n\t\t\twriters: [],\n\t\t});\n\t\treturn res.error === \"NotAuthorized\"\n\t\t\t? pass(\"answered NotAuthorized\")\n\t\t\t: fail(`answered ${describe(res)}, expected NotAuthorized`, res.json);\n\t},\n);\n\nconst importMetaUnsupported = crypto$(\n\t\"migration.import-space-meta-unsupported-policy\",\n\tasync (ctx) => {\n\t\tconst space = unknownSpaceUri(ctx.target.did);\n\t\tconst res = await importMeta(ctx, {\n\t\t\tspace: space as never,\n\t\t\tpolicy: { $type: \"com.example.mysteryPolicy\" },\n\t\t\tpolicyState: [],\n\t\t\twriters: [],\n\t\t});\n\t\tif (res.status === 200) await deleteProbeSpace(ctx, space);\n\t\treturn res.error === \"UnsupportedPolicy\"\n\t\t\t? pass(\"answered UnsupportedPolicy\")\n\t\t\t: fail(`answered ${describe(res)}, expected UnsupportedPolicy`, res.json);\n\t},\n);\n\nconst importMetaInvalid = crypto$(\n\t\"migration.import-space-meta-invalid\",\n\tasync (ctx) => {\n\t\tconst res = await xrpcPostBytes(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.importSpaceMeta\",\n\t\t\tutf8(\"not a STAR archive\"),\n\t\t);\n\t\treturn res.error === \"InvalidSpaceMeta\"\n\t\t\t? pass(\"answered InvalidSpaceMeta\")\n\t\t\t: fail(`answered ${describe(res)}, expected InvalidSpaceMeta`, res.json);\n\t},\n);\n\nasync function ownRepoArchive(\n\tctx: CheckContext,\n\tspace: string,\n): Promise<Uint8Array> {\n\tconst res = await operatorFetch(ctx)(\n\t\t`${ctx.target.origin}/xrpc/com.atproto.space.getRepo?space=${encodeURIComponent(space)}&repo=${encodeURIComponent(ctx.target.did)}`,\n\t);\n\tif (res.status !== 200) throw new Error(`getRepo ${res.status}`);\n\treturn new Uint8Array(await res.arrayBuffer());\n}\n\nconst importRepo = crypto$(\"migration.import-repo\", async (ctx) => {\n\tconst space = await createProbeSpace(ctx, personalspace());\n\ttry {\n\t\tawait mustCreateRecord(ctx, space.uri, \"a\", \"one\");\n\t\tawait mustCreateRecord(ctx, space.uri, \"b\", \"two\");\n\t\tconst bytes = await ownRepoArchive(ctx, space.uri);\n\t\tconst exported = await readRepoStar([bytes]);\n\t\tconst commit = exported.commit;\n\t\tawait exported[Symbol.asyncDispose]();\n\t\t// Change the repo after export, so the import visibly replaces it.\n\t\tawait mustCreateRecord(ctx, space.uri, \"c\", \"three\");\n\t\t// The lexicon's input encoding is application/vnd.dasl.star.\n\t\tconst wrongType = await xrpcPostBytes(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.importRepo\",\n\t\t\tbytes,\n\t\t\tundefined,\n\t\t\t\"application/octet-stream\",\n\t\t);\n\t\tif (wrongType.status === 200)\n\t\t\treturn fail(\"importRepo accepted an application/octet-stream body\");\n\t\tconst res = await xrpcPostBytes(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.importRepo\",\n\t\t\tbytes,\n\t\t);\n\t\tif (res.status !== 200)\n\t\t\treturn fail(`importRepo ${describe(res)}`, res.json);\n\t\tconst list = await xrpcGet(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.listRecords\",\n\t\t\t{ space: space.uri, repo: ctx.target.did },\n\t\t);\n\t\tconst rkeys = (\n\t\t\t(list.json as { records?: Array<{ rkey: string }> } | undefined)\n\t\t\t\t?.records ?? []\n\t\t)\n\t\t\t.map((r) => r.rkey)\n\t\t\t.sort();\n\t\tif (rkeys.join(\",\") !== \"a,b\")\n\t\t\treturn fail(`records after import: ${rkeys.join(\",\")}`, list.json);\n\t\tconst latest = await xrpcGet(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.getLatestCommit\",\n\t\t\t{ space: space.uri, repo: ctx.target.did },\n\t\t);\n\t\tconst now = commitFromJson(\n\t\t\t(latest.json as { commit?: unknown } | undefined)?.commit,\n\t\t);\n\t\tif (!now)\n\t\t\treturn fail(\n\t\t\t\t`getLatestCommit after import ${describe(latest)}`,\n\t\t\t\tlatest.json,\n\t\t\t);\n\t\tif (!bytesEqual(now.data, commit.data))\n\t\t\treturn fail(\"commit data changed across the import\");\n\t\treturn now.rev > commit.rev\n\t\t\t? pass(\n\t\t\t\t\t\"refused octet-stream; records replaced from the archive; same data, new rev\",\n\t\t\t\t)\n\t\t\t: fail(`rev ${now.rev} did not advance past the archive's ${commit.rev}`);\n\t} catch (err) {\n\t\treturn fail(errMsg(err));\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\nconst emptyRepoArchive = (space: string, repo: string) =>\n\tcollectBytes(\n\t\twriteRepoStar(\n\t\t\tnew RepoCommit().toCommit({\n\t\t\t\tspace: space as never,\n\t\t\t\trepo: repo as Did,\n\t\t\t\trev: tidNow() as never,\n\t\t\t}),\n\t\t\t[],\n\t\t),\n\t);\n\nconst importRepoNotFound = crypto$(\n\t\"migration.import-repo-space-not-found\",\n\tasync (ctx) => {\n\t\t// A well-formed archive of an empty repo in an own space this host has\n\t\t// never heard of: the authority's space must be imported first.\n\t\tconst space = spaceUri(ctx.target.did, probeSkey());\n\t\tconst res = await xrpcPostBytes(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.importRepo\",\n\t\t\tawait emptyRepoArchive(space, ctx.target.did),\n\t\t);\n\t\tif (res.status === 200) await deleteProbeSpace(ctx, space);\n\t\treturn res.error === \"SpaceNotFound\"\n\t\t\t? pass(\"answered SpaceNotFound\")\n\t\t\t: fail(`answered ${describe(res)}, expected SpaceNotFound`, res.json);\n\t},\n);\n\nconst importRepoInvalid = crypto$(\n\t\"migration.import-repo-invalid\",\n\tasync (ctx) => {\n\t\tconst res = await xrpcPostBytes(\n\t\t\tasOperator(ctx),\n\t\t\t\"com.atproto.space.importRepo\",\n\t\t\tutf8(\"not a STAR archive\"),\n\t\t);\n\t\treturn res.error === \"InvalidRepoFile\"\n\t\t\t? pass(\"answered InvalidRepoFile\")\n\t\t\t: fail(`answered ${describe(res)}, expected InvalidRepoFile`, res.json);\n\t},\n);\n\nconst importRepoMismatch = crypto$(\n\t\"migration.import-repo-mismatch\",\n\tasync (ctx) => {\n\t\tconst space = await createProbeSpace(ctx, personalspace());\n\t\ttry {\n\t\t\tconst res = await xrpcPostBytes(\n\t\t\t\tasOperator(ctx),\n\t\t\t\t\"com.atproto.space.importRepo\",\n\t\t\t\tawait emptyRepoArchive(space.uri, fakeDid()),\n\t\t\t);\n\t\t\treturn res.error === \"RepoMismatch\"\n\t\t\t\t? pass(\"answered RepoMismatch\")\n\t\t\t\t: fail(`answered ${describe(res)}, expected RepoMismatch`, res.json);\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\n// --- foreign identities --------------------------------------------------\n\nconst isAccountRefusal = (error?: string) =>\n\terror !== undefined && ACCOUNT_REFUSALS.includes(error);\n\nconst memberGate = crypto$(\"credential.member-gate\", async (ctx) => {\n\tconst reader = await ctx.identities!.identity(\"reader\");\n\tconst space = await createProbeSpace(ctx, memberspace());\n\tconst put = (read: boolean) =>\n\t\tputMembers(ctx, space.uri, [{ did: reader.did, read, write: false }]);\n\ttry {\n\t\tawait mustCreateRecord(ctx, space.uri, \"shared\", \"members only\");\n\t\tconst stranger = await obtainCredential(ctx, reader, space.uri);\n\t\tif (stranger.credential) return fail(\"a non-member obtained a credential\");\n\t\tif (!isAccountRefusal(stranger.result.error)) {\n\t\t\treturn fail(\n\t\t\t\t`non-member refused with ${describe(stranger.result)}; expected ${ACCOUNT_REFUSALS.join(\" / \")}`,\n\t\t\t);\n\t\t}\n\t\tawait put(false);\n\t\tconst writeOnly = await obtainCredential(ctx, reader, space.uri);\n\t\tif (writeOnly.credential)\n\t\t\treturn fail(\"a member with read: false obtained a credential\");\n\t\tawait put(true);\n\t\tconst member = await obtainCredential(ctx, reader, space.uri);\n\t\tif (!member.credential)\n\t\t\treturn fail(\n\t\t\t\t`a reader was refused: ${describe(member.result)}`,\n\t\t\t\tmember.result.json,\n\t\t\t);\n\t\tconst read = await credentialGet(\n\t\t\tctx,\n\t\t\tmember.credential,\n\t\t\t\"com.atproto.space.getRecord\",\n\t\t\t{\n\t\t\t\tspace: space.uri,\n\t\t\t\trepo: ctx.target.did,\n\t\t\t\tcollection: POST,\n\t\t\t\trkey: \"shared\",\n\t\t\t},\n\t\t);\n\t\treturn read.status === 200\n\t\t\t? pass(\n\t\t\t\t\t`non-member refused (${stranger.result.error}), read:false refused, reader admitted and read`,\n\t\t\t\t)\n\t\t\t: fail(\n\t\t\t\t\t`the reader's credential could not read: ${describe(read)}`,\n\t\t\t\t\tread.json,\n\t\t\t\t);\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\nconst personalOnly = crypto$(\"policy.personalspace-owner-only\", async (ctx) => {\n\tconst reader = await ctx.identities!.identity(\"reader\");\n\tconst space = await createProbeSpace(ctx, personalspace());\n\ttry {\n\t\tconst res = await obtainCredential(ctx, reader, space.uri);\n\t\tif (res.credential)\n\t\t\treturn fail(\"a personalspace issued a credential to another account\");\n\t\t// The authority's own admission is policy.personalspace-owner-admitted:\n\t\t// a harness identity cannot be the authority, the target's own\n\t\t// delegation tokens can.\n\t\treturn isAccountRefusal(res.result.error)\n\t\t\t? pass(\n\t\t\t\t\t`refused another account with ${res.result.error} (the authority's admission is policy.personalspace-owner-admitted)`,\n\t\t\t\t)\n\t\t\t: fail(\n\t\t\t\t\t`refused with ${describe(res.result)}; expected ${ACCOUNT_REFUSALS.join(\" / \")}`,\n\t\t\t\t);\n\t} finally {\n\t\tawait deleteProbeSpace(ctx, space.uri);\n\t}\n});\n\nconst delegationWrongAud = crypto$(\n\t\"delegation.wrong-audience-refused\",\n\tasync (ctx) => {\n\t\tconst reader = await ctx.identities!.identity(\"reader\");\n\t\tconst space = await createProbeSpace(ctx, memberspace());\n\t\ttry {\n\t\t\tawait putMembers(ctx, space.uri, [\n\t\t\t\t{ did: reader.did, read: true, write: false },\n\t\t\t]);\n\t\t\t// Positive control: with the right audience the reader is admitted.\n\t\t\tconst control = await obtainCredential(ctx, reader, space.uri);\n\t\t\tif (!control.credential)\n\t\t\t\treturn fail(\n\t\t\t\t\t`correct-aud control failed (${describe(control.result)}); cannot attribute the wrong-aud refusal`,\n\t\t\t\t);\n\t\t\tconst { result, credential } = await obtainCredential(\n\t\t\t\tctx,\n\t\t\t\treader,\n\t\t\t\tspace.uri,\n\t\t\t\t{ audOverride: `${FOREIGN_DID}#atproto_pds` },\n\t\t\t);\n\t\t\tif (credential)\n\t\t\t\treturn fail(\"a token addressed to another host was accepted\");\n\t\t\treturn result.error === \"InvalidDelegationToken\"\n\t\t\t\t? pass(\"refused with InvalidDelegationToken\")\n\t\t\t\t: fail(\n\t\t\t\t\t\t`refused with ${describe(result)}, expected InvalidDelegationToken`,\n\t\t\t\t\t);\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\nasync function notifyRepoUpdate(\n\tctx: CheckContext,\n\twriter: {\n\t\tdid: string;\n\t\tjwtAlg: string;\n\t\tsign(b: Uint8Array): Promise<Uint8Array>;\n\t},\n\tspace: string,\n\trepoRev: string,\n\tdata: Uint8Array,\n) {\n\tconst jwt = await serviceJwt(writer, {\n\t\taud: spaceHostAud(ctx.target.did as Did),\n\t\tlxm: \"com.atproto.space.notifyRepoUpdate\",\n\t});\n\treturn xrpcPost(\n\t\tctx,\n\t\t\"com.atproto.space.notifyRepoUpdate\",\n\t\t{\n\t\t\tspace,\n\t\t\trepo: writer.did,\n\t\t\trepoRev,\n\t\t\tdata: { $bytes: toBase64(data).replace(/=+$/, \"\") },\n\t\t},\n\t\t{ Authorization: `Bearer ${jwt}` },\n\t);\n}\n\nconst notifyAccepted = crypto$(\n\t\"host.notifyrepoupdate-accepted\",\n\tasync (ctx) => {\n\t\tconst writer = await ctx.identities!.identity(\"writer\");\n\t\tconst space = await createProbeSpace(\n\t\t\tctx,\n\t\t\tmemberspace({ publicRead: true }),\n\t\t);\n\t\ttry {\n\t\t\tawait putMembers(ctx, space.uri, [\n\t\t\t\t{ did: writer.did, read: false, write: true },\n\t\t\t]);\n\t\t\tconst repoRev = tidNow();\n\t\t\tconst data = globalThis.crypto.getRandomValues(new Uint8Array(32));\n\t\t\tconst res = await notifyRepoUpdate(ctx, writer, space.uri, repoRev, data);\n\t\t\tif (res.status !== 200)\n\t\t\t\treturn fail(`notifyRepoUpdate ${describe(res)}`, res.json);\n\t\t\tconst { repos } = await listWriters(\n\t\t\t\tctx,\n\t\t\t\tawait obtainPublicCredential(ctx, space.uri),\n\t\t\t);\n\t\t\tconst entry = repos.find((r) => r.repo === writer.did);\n\t\t\tif (!entry) return fail(\"the notified writer is not in listWriters\");\n\t\t\tconst listed = lexBytes(entry.data);\n\t\t\treturn entry.$type === \"com.atproto.space.defs#repoWrite\" &&\n\t\t\t\tentry.repoRev === repoRev &&\n\t\t\t\tlisted &&\n\t\t\t\tbytesEqual(listed, data)\n\t\t\t\t? pass(\"accepted; listWriters reports the notified repoRev and data\")\n\t\t\t\t: fail(\"listWriters entry does not match the notification\", entry);\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\nconst notifyFuture = crypto$(\n\t\"host.notifyrepoupdate-future-rev\",\n\tasync (ctx) => {\n\t\tconst writer = await ctx.identities!.identity(\"writer\");\n\t\tconst space = await createProbeSpace(\n\t\t\tctx,\n\t\t\tmemberspace({ publicWrite: true }),\n\t\t);\n\t\ttry {\n\t\t\tconst hourAhead = BigInt(Date.now() + 60 * 60 * 1000) * 1000n;\n\t\t\tconst res = await notifyRepoUpdate(\n\t\t\t\tctx,\n\t\t\t\twriter,\n\t\t\t\tspace.uri,\n\t\t\t\ttidAt(hourAhead),\n\t\t\t\tnew Uint8Array(32),\n\t\t\t);\n\t\t\treturn res.error === \"FutureRev\"\n\t\t\t\t? pass(\"a repoRev an hour ahead answered FutureRev\")\n\t\t\t\t: fail(`answered ${describe(res)}, expected FutureRev`, res.json);\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\nconst notifyUnknown = crypto$(\n\t\"host.notifyrepoupdate-unknown-space\",\n\tasync (ctx) => {\n\t\tconst writer = await ctx.identities!.identity(\"writer\");\n\t\tconst res = await notifyRepoUpdate(\n\t\t\tctx,\n\t\t\twriter,\n\t\t\tunknownSpaceUri(ctx.target.did),\n\t\t\ttidNow(),\n\t\t\tnew Uint8Array(32),\n\t\t);\n\t\treturn res.error === \"SpaceNotFound\"\n\t\t\t? pass(\"answered SpaceNotFound\")\n\t\t\t: fail(`answered ${describe(res)}, expected SpaceNotFound`, res.json);\n\t},\n);\n\nconst writeRevocation = crypto$(\n\t\"memberspace.write-revocation-removes-writer\",\n\tasync (ctx) => {\n\t\tconst writer = await ctx.identities!.identity(\"writer\");\n\t\tconst space = await createProbeSpace(\n\t\t\tctx,\n\t\t\tmemberspace({ publicRead: true, publicWrite: true }),\n\t\t);\n\t\ttry {\n\t\t\tawait putMembers(ctx, space.uri, [\n\t\t\t\t{ did: writer.did, read: true, write: true },\n\t\t\t]);\n\t\t\tconst first = await notifyRepoUpdate(\n\t\t\t\tctx,\n\t\t\t\twriter,\n\t\t\t\tspace.uri,\n\t\t\t\ttidNow(),\n\t\t\t\tnew Uint8Array(32),\n\t\t\t);\n\t\t\tif (first.status !== 200)\n\t\t\t\treturn fail(`notifyRepoUpdate ${describe(first)}`, first.json);\n\t\t\tconst credential = await obtainPublicCredential(ctx, space.uri);\n\t\t\tconst entry = async () =>\n\t\t\t\t(await listWriters(ctx, credential)).repos\n\t\t\t\t\t.filter((r) => r.repo === writer.did)\n\t\t\t\t\t.at(-1);\n\t\t\tif ((await entry())?.$type !== \"com.atproto.space.defs#repoWrite\")\n\t\t\t\treturn fail(\"the writer never entered the writer set\");\n\t\t\t// Revoking write access removes it, announced as repoRemoved...\n\t\t\tawait putMembers(ctx, space.uri, [\n\t\t\t\t{ did: writer.did, read: true, write: false },\n\t\t\t]);\n\t\t\tconst removed = await entry();\n\t\t\tif (removed?.$type !== \"com.atproto.space.defs#repoRemoved\")\n\t\t\t\treturn fail(\n\t\t\t\t\t`after revoking write, the entry is ${JSON.stringify(removed)}`,\n\t\t\t\t);\n\t\t\t// ...and, even under publicWrite, a member without write is not tracked.\n\t\t\tconst again = await notifyRepoUpdate(\n\t\t\t\tctx,\n\t\t\t\twriter,\n\t\t\t\tspace.uri,\n\t\t\t\ttidNow(),\n\t\t\t\tnew Uint8Array(32),\n\t\t\t);\n\t\t\tconst after = await entry();\n\t\t\treturn after?.$type === \"com.atproto.space.defs#repoRemoved\"\n\t\t\t\t? pass(\n\t\t\t\t\t\t`removed as repoRemoved; a later notification was not tracked (${describe(again)})`,\n\t\t\t\t\t)\n\t\t\t\t: fail(\n\t\t\t\t\t\t\"a member without write access was tracked again under publicWrite\",\n\t\t\t\t\t\tafter,\n\t\t\t\t\t);\n\t\t} finally {\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\n/**\n * The revocation flow: a harness identity plays a foreign space authority,\n * the operator writes into that space (as a member's PDS would), and the\n * authority's credential reads the operator's repo — until revoked.\n */\nasync function revocationFlow(\n\tctx: CheckContext,\n\trevoker: \"authority\" | \"stranger\",\n): Promise<{\n\tdetail?: string;\n\trevoke?: { status: number; error?: string };\n\tafter?: { status: number; error?: string };\n}> {\n\tconst authority = await ctx.identities!.identity(\"authority\");\n\tconst space = spaceUri(authority.did, probeSkey());\n\tconst write = await operatorCreateRecord(ctx, space, POST, \"shared\", {\n\t\t$type: POST,\n\t\ttext: \"for the authority\",\n\t});\n\tif (write.status !== 200)\n\t\treturn {\n\t\t\tdetail: `operator write into a foreign space: ${describe(write)}`,\n\t\t};\n\tconst key = await createCredentialKey();\n\tconst credential: Credential = {\n\t\tcredential: await mintCredential(authority, space, key.did),\n\t\tkey,\n\t\tspace,\n\t};\n\tconst read = () =>\n\t\tcredentialGet(ctx, credential, \"com.atproto.space.getRecord\", {\n\t\t\tspace,\n\t\t\trepo: ctx.target.did,\n\t\t\tcollection: POST,\n\t\t\trkey: \"shared\",\n\t\t});\n\tconst before = await read();\n\tif (before.status !== 200)\n\t\treturn {\n\t\t\tdetail: `foreign authority's credential could not read: ${describe(before)}`,\n\t\t};\n\tconst signer =\n\t\trevoker === \"authority\"\n\t\t\t? authority\n\t\t\t: await ctx.identities!.identity(\"stranger\");\n\tconst jwt = await serviceJwt(signer, {\n\t\taud: ctx.target.did,\n\t\tlxm: \"com.atproto.space.notifyCredentialsRevoked\",\n\t});\n\tconst revoke = await xrpcPost(\n\t\tctx,\n\t\t\"com.atproto.space.notifyCredentialsRevoked\",\n\t\t{ space, credentials: [decodeJwt(credential.credential).payload.jti] },\n\t\t{ Authorization: `Bearer ${jwt}` },\n\t);\n\treturn { revoke, after: await read() };\n}\n\nconst revocationRefused = crypto$(\n\t\"revocation.revoked-credential-refused\",\n\tasync (ctx) => {\n\t\tconst flow = await revocationFlow(ctx, \"authority\");\n\t\tif (flow.detail) return fail(flow.detail);\n\t\tif (flow.revoke!.status !== 200)\n\t\t\treturn fail(\n\t\t\t\t`notifyCredentialsRevoked ${flow.revoke!.status} ${flow.revoke!.error ?? \"\"}`,\n\t\t\t);\n\t\treturn flow.after!.status >= 400 && flow.after!.status < 500\n\t\t\t? pass(\n\t\t\t\t\t`foreign credential read 200; after revocation refused (${flow.after!.status} ${flow.after!.error ?? \"\"})`,\n\t\t\t\t)\n\t\t\t: fail(`a revoked credential still read (${flow.after!.status})`);\n\t},\n);\n\nconst revocationName = crypto$(\"revocation.error-name\", async (ctx) => {\n\tconst flow = await revocationFlow(ctx, \"authority\");\n\tif (flow.detail) return fail(flow.detail);\n\treturn flow.after!.error === \"CredentialRevoked\"\n\t\t? pass(\"refused with CredentialRevoked\")\n\t\t: fail(`refused with ${flow.after!.status} ${flow.after!.error ?? \"\"}`);\n});\n\nconst revocationStranger = crypto$(\n\t\"revocation.non-authority-refused\",\n\tasync (ctx) => {\n\t\tconst flow = await revocationFlow(ctx, \"stranger\");\n\t\tif (flow.detail) return fail(flow.detail);\n\t\tif (flow.revoke!.status === 200)\n\t\t\treturn fail(\n\t\t\t\t\"accepted a revocation signed by someone other than the authority\",\n\t\t\t);\n\t\t// The method declares no error: the refusal is of the caller's\n\t\t// authority, an auth refusal — not a 5xx or a malformed-input 400.\n\t\tif (flow.revoke!.status !== 401 && flow.revoke!.status !== 403)\n\t\t\treturn fail(\n\t\t\t\t`refused the stranger's revocation with ${flow.revoke!.status} ${flow.revoke!.error ?? \"\"}, expected 401/403`,\n\t\t\t);\n\t\treturn flow.after!.status === 200\n\t\t\t? pass(\n\t\t\t\t\t`stranger's revocation refused (${flow.revoke!.status} ${flow.revoke!.error ?? \"\"}); credential still reads`,\n\t\t\t\t)\n\t\t\t: fail(\n\t\t\t\t\t`the revocation was refused but the credential stopped working (${flow.after!.status})`,\n\t\t\t\t);\n\t},\n);\n\nconst managedAccount = crypto$(\n\t\"managedspace.check-access-account\",\n\tasync (ctx) => {\n\t\tconst inbox = ctx.syncerInbox!;\n\t\tconst reader = await ctx.identities!.identity(\"reader\");\n\t\tconst lxm = \"com.atproto.managedspace.checkAccess\";\n\t\tlet answer = { read: false, write: false };\n\t\tinbox.respond(lxm, () => answer);\n\t\tconst space = await createProbeSpace(ctx, managedspace(inbox.service));\n\t\ttry {\n\t\t\tconst since = Date.now();\n\t\t\tconst denied = await obtainCredential(ctx, reader, space.uri);\n\t\t\tif (denied.credential)\n\t\t\t\treturn fail(\"issued a credential the managing app refused\");\n\t\t\tconst asked = await inbox.waitFor(\n\t\t\t\t(d) =>\n\t\t\t\t\td.lxm === lxm &&\n\t\t\t\t\td.receivedAt >= since &&\n\t\t\t\t\td.params?.repo === reader.did,\n\t\t\t\t5_000,\n\t\t\t);\n\t\t\tif (!asked)\n\t\t\t\treturn fail(\n\t\t\t\t\t`the managing app was never asked about the reader (${describe(denied.result)})`,\n\t\t\t\t);\n\t\t\tconst p = asked.params ?? {};\n\t\t\tif (p.space !== space.uri || \"access\" in p)\n\t\t\t\treturn fail(\"checkAccess carried the wrong params\", p);\n\t\t\tanswer = { read: true, write: false };\n\t\t\tconst allowed = await obtainCredential(ctx, reader, space.uri);\n\t\t\treturn allowed.credential\n\t\t\t\t? pass(\n\t\t\t\t\t\t`asked about the reader (space, repo); refused on read:false (${denied.result.error}), issued on read:true`,\n\t\t\t\t\t)\n\t\t\t\t: fail(\n\t\t\t\t\t\t`the managing app authorised but the credential was refused: ${describe(allowed.result)}`,\n\t\t\t\t\t);\n\t\t} finally {\n\t\t\tinbox.respond(lxm, undefined);\n\t\t\tawait deleteProbeSpace(ctx, space.uri);\n\t\t}\n\t},\n);\n\n/** The crypto-bound catalog, in descriptor order. */\nexport const cryptoChecks: Check[] = [\n\tmacCommit,\n\tmacRecord,\n\toplogFolds,\n\tgetRepoStar,\n\tcredentialSigned,\n\tdelegationSigned,\n\texportSpaceMeta,\n\timportSpaceMeta,\n\timportMetaNotAuthority,\n\timportMetaUnsupported,\n\timportMetaInvalid,\n\timportRepo,\n\timportRepoNotFound,\n\timportRepoInvalid,\n\timportRepoMismatch,\n\tmemberGate,\n\tpersonalOnly,\n\tdelegationWrongAud,\n\tnotifyAccepted,\n\tnotifyFuture,\n\tnotifyUnknown,\n\twriteRevocation,\n\trevocationRefused,\n\trevocationName,\n\trevocationStranger,\n\tmanagedAccount,\n];\n","/**\n * Harness identities.\n *\n * Multi-party checks need the harness to play parties that aren't the\n * target's operator: a reader (signing delegation tokens), a writer's PDS\n * (signing notifyWrite service auth) and a foreign space authority\n * (signing credentials and revocations). Each needs a DID the target can\n * resolve to the key the harness holds.\n *\n * Resolution is the caller's to arrange — it can't be solved in-library:\n *\n * - In an in-process fixture, wire the target's DID resolver to\n * {@link KeypairIdentityProvider.didDocument} (or to `didKey` for a\n * did:key-only resolver).\n * - Against a live target, publish each identity: serve\n * {@link KeypairIdentityProvider.didDocument} at a did:web the target\n * can fetch (the reference matrix runs one tiny server per identity on\n * `did:web:localhost%3A<port>`), or register a did:plc.\n *\n * What a published identity document must carry, per the alpha: a\n * `#atproto` verification method (it signs every space token and service\n * JWT) and — for an identity that receives calls, such as a syncer inbox\n * or a managing app — an `#atproto_pds` service, which is how a bare DID\n * service identifier resolves to an endpoint. Identities never serve\n * repos, so they publish no `#atproto_kem`.\n */\n\nimport { Secp256k1Keypair } from \"@atproto/crypto\";\nimport type { HarnessIdentity, IdentityProvider } from \"./model.js\";\n\n// Credential keys are WebCrypto and browser-safe, so they live in\n// ./space-auth.ts; re-exported here for the full entry's callers.\nexport { createCredentialKey } from \"./space-auth.js\";\nexport type { CredentialKey } from \"./space-auth.js\";\n\nexport interface HarnessIdentityWithKey extends HarnessIdentity {\n\t/** The did:key form of the identity's `#atproto` key, for resolver wiring. */\n\tdidKey: string;\n}\n\nexport interface IdentityDocumentOptions {\n\t/** Publish an `#atproto_pds` service at this endpoint (inboxes, managing apps). */\n\tserviceEndpoint?: string;\n\t/** A handle to list in `alsoKnownAs`. */\n\thandle?: string;\n}\n\n/**\n * An identity provider backed by secp256k1 keypairs. Identities are keyed\n * by role label and reused within a run, so \"reader\" is stable across the\n * checks that mint and then present its tokens.\n *\n * `didFor` gives each identity a resolvable DID (e.g.\n * `did:web:localhost%3A61234`), and may be async — a harness can start the\n * server that will publish the document there. When omitted, the\n * identity's DID is its own `did:key`, which only works against a target\n * whose resolver this provider is wired into.\n */\nexport class KeypairIdentityProvider implements IdentityProvider {\n\tprivate cache = new Map<string, Promise<HarnessIdentityWithKey>>();\n\n\tconstructor(\n\t\tprivate readonly didFor?: (\n\t\t\trole: string,\n\t\t\tdidKey: string,\n\t\t) => string | Promise<string>,\n\t) {}\n\n\tidentity(role: string): Promise<HarnessIdentityWithKey> {\n\t\tlet existing = this.cache.get(role);\n\t\tif (!existing) {\n\t\t\texisting = this.mint(role);\n\t\t\tthis.cache.set(role, existing);\n\t\t}\n\t\treturn existing;\n\t}\n\n\tprivate async mint(role: string): Promise<HarnessIdentityWithKey> {\n\t\tconst keypair = await Secp256k1Keypair.create({ exportable: true });\n\t\tconst didKey = keypair.did();\n\t\tconst did = this.didFor ? await this.didFor(role, didKey) : didKey;\n\t\treturn {\n\t\t\tdid,\n\t\t\tdidKey,\n\t\t\tjwtAlg: keypair.jwtAlg,\n\t\t\tsign: (bytes) => keypair.sign(bytes),\n\t\t};\n\t}\n\n\t/**\n\t * The DID document a resolvable identity must publish: its `#atproto`\n\t * key as a Multikey and, optionally, the `#atproto_pds` service the\n\t * target delivers to.\n\t */\n\tstatic didDocument(\n\t\tidentity: Pick<HarnessIdentityWithKey, \"did\" | \"didKey\">,\n\t\topts: IdentityDocumentOptions = {},\n\t): Record<string, unknown> {\n\t\treturn {\n\t\t\t\"@context\": [\n\t\t\t\t\"https://www.w3.org/ns/did/v1\",\n\t\t\t\t\"https://w3id.org/security/multikey/v1\",\n\t\t\t],\n\t\t\tid: identity.did,\n\t\t\t...(opts.handle ? { alsoKnownAs: [`at://${opts.handle}`] } : {}),\n\t\t\tverificationMethod: [\n\t\t\t\t{\n\t\t\t\t\tid: `${identity.did}#atproto`,\n\t\t\t\t\ttype: \"Multikey\",\n\t\t\t\t\tcontroller: identity.did,\n\t\t\t\t\tpublicKeyMultibase: identity.didKey.slice(\"did:key:\".length),\n\t\t\t\t},\n\t\t\t],\n\t\t\t...(opts.serviceEndpoint\n\t\t\t\t? {\n\t\t\t\t\t\tservice: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"#atproto_pds\",\n\t\t\t\t\t\t\t\ttype: \"AtprotoPersonalDataServer\",\n\t\t\t\t\t\t\t\tserviceEndpoint: opts.serviceEndpoint,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t};\n\t}\n\n\t/** All minted identities so far, for resolver wiring in fixtures. */\n\tminted(): Promise<HarnessIdentityWithKey[]> {\n\t\treturn Promise.all(this.cache.values());\n\t}\n}\n","/**\n * The full check catalog and the identity provider.\n *\n * This entry imports `@atproto/space`, so it pulls the spaces crypto libs\n * and their (node-ish) transitive graph. Import it from the CLI and the\n * vitest adapter — anywhere WebCrypto and those libs run — but never\n * from a browser bundle. The browser adapter imports the base catalog from\n * the package root instead.\n */\n\nimport { buildCatalog } from \"./registry.js\";\nimport { baseChecks } from \"./checks/base.js\";\nimport { operatorChecks } from \"./checks/operator.js\";\nimport { cryptoChecks } from \"./full/checks.js\";\n\nexport { KeypairIdentityProvider, createCredentialKey } from \"./identity.js\";\nexport type {\n\tCredentialKey,\n\tHarnessIdentityWithKey,\n\tIdentityDocumentOptions,\n} from \"./identity.js\";\n\nexport {\n\tcreateProbeSpace,\n\tdeleteProbeSpace,\n\tobtainCredential,\n\tobtainCredentialViaDelegation,\n\tobtainPublicCredential,\n\tcredentialCall,\n\tcredentialGet,\n\trequestCredential,\n\tmintCredential,\n\tmintDelegation,\n\tserviceJwt,\n\toperatorCreateRecord,\n} from \"./full/helpers.js\";\nexport type { Credential, ProbeSpace } from \"./full/helpers.js\";\n\nexport { createSyncerInbox } from \"./inbox.js\";\nexport type { SyncerInboxHandle } from \"./inbox.js\";\n\nexport { cryptoChecks } from \"./full/checks.js\";\nexport { operatorChecks } from \"./checks/operator.js\";\nexport { baseChecks } from \"./checks/base.js\";\n\n/**\n * The complete catalog: the browser-safe base and operator checks plus\n * the crypto-bound ones only this entry can run.\n */\nexport const fullCatalog = buildCatalog([\n\t...baseChecks,\n\t...operatorChecks,\n\t...cryptoChecks,\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,SAAS,WAAW,UAA2B;AAC9C,QAAO;EACN,QAAQ,SAAS;EACjB,OAAO,UAAsB,SAAS,KAAK,MAAM;EACjD,WAAW,SAAS;EACpB;;;;;;AAOF,SAAgB,eACf,UACA,OACA,aACkB;AAClB,QAAO,sBAAsB;EAC5B,KAAK,SAAS;EACd,KAAK;EACL,KAAK,eAAe,aAAa,eAAe,MA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;IACpB,MAAM;IACN,YAAY,SAAS;IACrB,oBAAoB,SAAS,OAAO,MAAM,EAAkB;IAC5D,CACD;GACD,GAAI,KAAK,kBACN,EACA,SAAS,CACR;IACC,IAAI;IACJ,MAAM;IACN,iBAAiB,KAAK;IACtB,CACD,EACD,GACA,EAAE;GACL;;;CAIF,SAA4C;AAC3C,SAAO,QAAQ,IAAI,KAAK,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;AChFzC,MAAa,cAAc,aAAa;CACvC,GAAG;CACH,GAAG;CACH,GAAG;CACH,CAAC"}
|
package/dist/full.d.ts
CHANGED
|
@@ -1,40 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as CheckContext, J as IdentityProvider, O as CredentialKey, P as createCredentialKey, S as XrpcResult, V as Check, _ as obtainPublicCredential, a as Credential, d as credentialCall, f as credentialGet, g as obtainCredentialViaDelegation, i as createSyncerInbox, l as ProbeSpace, n as operatorChecks, p as deleteProbeSpace, q as HarnessIdentity, r as SyncerInboxHandle, t as baseChecks, u as createProbeSpace, v as operatorCreateRecord, x as requestCredential } from "./base-CGsQgOwR.js";
|
|
2
|
+
import "@atproto/space";
|
|
2
3
|
|
|
3
4
|
//#region src/identity.d.ts
|
|
4
5
|
|
|
5
6
|
interface HarnessIdentityWithKey extends HarnessIdentity {
|
|
6
|
-
/** The did:key form of the identity's
|
|
7
|
+
/** The did:key form of the identity's `#atproto` key, for resolver wiring. */
|
|
7
8
|
didKey: string;
|
|
8
9
|
}
|
|
10
|
+
interface IdentityDocumentOptions {
|
|
11
|
+
/** Publish an `#atproto_pds` service at this endpoint (inboxes, managing apps). */
|
|
12
|
+
serviceEndpoint?: string;
|
|
13
|
+
/** A handle to list in `alsoKnownAs`. */
|
|
14
|
+
handle?: string;
|
|
15
|
+
}
|
|
9
16
|
/**
|
|
10
17
|
* An identity provider backed by secp256k1 keypairs. Identities are keyed
|
|
11
18
|
* by role label and reused within a run, so "reader" is stable across the
|
|
12
19
|
* checks that mint and then present its tokens.
|
|
13
20
|
*
|
|
14
|
-
* `
|
|
15
|
-
* `did:web:
|
|
16
|
-
*
|
|
17
|
-
*
|
|
21
|
+
* `didFor` gives each identity a resolvable DID (e.g.
|
|
22
|
+
* `did:web:localhost%3A61234`), and may be async — a harness can start the
|
|
23
|
+
* server that will publish the document there. When omitted, the
|
|
24
|
+
* identity's DID is its own `did:key`, which only works against a target
|
|
25
|
+
* whose resolver this provider is wired into.
|
|
18
26
|
*/
|
|
19
27
|
declare class KeypairIdentityProvider implements IdentityProvider {
|
|
20
|
-
private readonly
|
|
28
|
+
private readonly didFor?;
|
|
21
29
|
private cache;
|
|
22
|
-
constructor(
|
|
30
|
+
constructor(didFor?: ((role: string, didKey: string) => string | Promise<string>) | undefined);
|
|
23
31
|
identity(role: string): Promise<HarnessIdentityWithKey>;
|
|
24
32
|
private mint;
|
|
25
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The DID document a resolvable identity must publish: its `#atproto`
|
|
35
|
+
* key as a Multikey and, optionally, the `#atproto_pds` service the
|
|
36
|
+
* target delivers to.
|
|
37
|
+
*/
|
|
38
|
+
static didDocument(identity: Pick<HarnessIdentityWithKey, "did" | "didKey">, opts?: IdentityDocumentOptions): Record<string, unknown>;
|
|
26
39
|
/** All minted identities so far, for resolver wiring in fixtures. */
|
|
27
40
|
minted(): Promise<HarnessIdentityWithKey[]>;
|
|
28
41
|
}
|
|
29
42
|
//#endregion
|
|
30
43
|
//#region src/full/helpers.d.ts
|
|
31
|
-
|
|
32
|
-
/** Mint a delegation token for `identity` against `space`. */
|
|
33
|
-
declare function mintDelegation(ctx: CheckContext, identity: HarnessIdentity, space: string, audOverride?: string): Promise<string>;
|
|
34
44
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
45
|
+
* Mint a delegation token for `identity` against `space`, addressed (by
|
|
46
|
+
* default) to the space authority's `#atproto_pds` — the space host.
|
|
47
|
+
*/
|
|
48
|
+
declare function mintDelegation(identity: HarnessIdentity, space: string, audOverride?: string): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The full obtain flow as a foreign user: mint a delegation token as
|
|
51
|
+
* `identity` and exchange it for a credential bound to a fresh P-256 key.
|
|
52
|
+
* Returns the raw result so callers can assert on refusals.
|
|
38
53
|
*/
|
|
39
54
|
declare function obtainCredential(ctx: CheckContext, identity: HarnessIdentity, space: string, opts?: {
|
|
40
55
|
audOverride?: string;
|
|
@@ -43,9 +58,21 @@ declare function obtainCredential(ctx: CheckContext, identity: HarnessIdentity,
|
|
|
43
58
|
result: XrpcResult;
|
|
44
59
|
credential?: Credential;
|
|
45
60
|
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Mint a credential as the authority of `space` — a harness identity
|
|
63
|
+
* playing a foreign space authority whose credentials a repo host must
|
|
64
|
+
* honour for reads of its repos in that space.
|
|
65
|
+
*/
|
|
66
|
+
declare function mintCredential(authority: HarnessIdentity, space: string, keyDid: string): Promise<string>;
|
|
67
|
+
/** An inter-service auth JWT (`lxm`-scoped), signed as `identity`. */
|
|
68
|
+
declare function serviceJwt(identity: HarnessIdentity, opts: {
|
|
69
|
+
aud: string;
|
|
70
|
+
lxm: string;
|
|
71
|
+
expiresInSec?: number;
|
|
72
|
+
}): Promise<string>;
|
|
46
73
|
//#endregion
|
|
47
74
|
//#region src/full/checks.d.ts
|
|
48
|
-
/** The crypto-bound catalog
|
|
75
|
+
/** The crypto-bound catalog, in descriptor order. */
|
|
49
76
|
declare const cryptoChecks: Check[];
|
|
50
77
|
//#endregion
|
|
51
78
|
//#region src/full.d.ts
|
|
@@ -55,5 +82,5 @@ declare const cryptoChecks: Check[];
|
|
|
55
82
|
*/
|
|
56
83
|
declare const fullCatalog: Check[];
|
|
57
84
|
//#endregion
|
|
58
|
-
export { type Credential, type HarnessIdentityWithKey, KeypairIdentityProvider, type ProbeSpace, baseChecks,
|
|
85
|
+
export { type Credential, type CredentialKey, type HarnessIdentityWithKey, type IdentityDocumentOptions, KeypairIdentityProvider, type ProbeSpace, type SyncerInboxHandle, baseChecks, createCredentialKey, createProbeSpace, createSyncerInbox, credentialCall, credentialGet, cryptoChecks, deleteProbeSpace, fullCatalog, mintCredential, mintDelegation, obtainCredential, obtainCredentialViaDelegation, obtainPublicCredential, operatorChecks, operatorCreateRecord, requestCredential, serviceJwt };
|
|
59
86
|
//# sourceMappingURL=full.d.ts.map
|
package/dist/full.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full.d.ts","names":[],"sources":["../src/identity.ts","../src/full/helpers.ts","../src/full/checks.ts","../src/full.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"full.d.ts","names":[],"sources":["../src/identity.ts","../src/full/helpers.ts","../src/full/checks.ts","../src/full.ts"],"sourcesContent":[],"mappings":";;;;;AC4FgB,UDzDC,sBAAA,SAA+B,eC6DtC,CAAA;EAUY;;;UDlEL,uBAAA;EE0kCJ;;;;ACjkCb;;;;;;;;;;;;cHSa,uBAAA,YAAmC;;;mEAOhC;0BAGS,QAAQ;;;;;;;+BA2BrB,KAAK,kDACT,0BACJ;;YA+BO,QAAQ;;;;;;;ACzEnB;AAkBsB,iBAlBN,cAAA,CAkBsB,QAAA,EAjB3B,eAiB2B,EAAA,KAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,MAAA,CAAA,EAdnC,OAcmC,CAAA,MAAA,CAAA;;;;;;AAK5B,iBALY,gBAAA,CAKZ,GAAA,EAJJ,YAII,EAAA,QAAA,EAHC,eAGD,EAAA,KAAA,EAAA,MAAA,EAAA,KAAA,EAAA;EAcM,WAAA,CAAA,EAAA,MAAc;EAcR,iBAAU,CAAA,EAAA,MACrB;IA7BR;UAAkB;eAAyB;ACoiC9C,CAAA,CAAA;;;;ACjkCA;;iBF2CgB,cAAA,YACJ,iDAGT;;iBAUmB,UAAA,WACX;;;;IAER;;;;cCqgCU,cAAc;;;;;;AD3jC3B;AAkBsB,cExBT,WFwByB,EEpBpC,KAAA,EFoBoC"}
|
package/dist/full.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { C as operatorCreateRecord, D as requestCredential, S as obtainPublicCredential, V as createCredentialKey, a as operatorChecks, g as deleteProbeSpace, h as credentialGet, i as createSyncerInbox, m as credentialCall, p as createProbeSpace, u as baseChecks, x as obtainCredentialViaDelegation } from "./descriptors-BUCV_BuG.js";
|
|
2
|
+
import { a as mintDelegation, i as mintCredential, n as KeypairIdentityProvider, o as obtainCredential, r as cryptoChecks, s as serviceJwt, t as fullCatalog } from "./full-CKsHg6ox.js";
|
|
3
3
|
|
|
4
|
-
export { KeypairIdentityProvider, baseChecks,
|
|
4
|
+
export { KeypairIdentityProvider, baseChecks, createCredentialKey, createProbeSpace, createSyncerInbox, credentialCall, credentialGet, cryptoChecks, deleteProbeSpace, fullCatalog, mintCredential, mintDelegation, obtainCredential, obtainCredentialViaDelegation, obtainPublicCredential, operatorChecks, operatorCreateRecord, requestCredential, serviceJwt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { $ as fail, A as MAC_COVERED_HEADER, B as Capability, C as operatorHeaders, D as COMMIT_MAC_PROFILE, E as xrpcUrl, F as credentialSigMembers, G as CheckStatus, H as CheckContext, I as encapsulate, J as IdentityProvider, K as Citation, L as formatMacRequest, M as RECORD_MAC_PROFILE, N as SPACE_CREDENTIAL_SCHEME, O as CredentialKey, P as createCredentialKey, Q as Tier, R as isP256DidKey, S as XrpcResult, T as xrpcPost, U as CheckOutcome, V as Check, W as CheckResult, X as SyncerInbox, Y as InboxDelivery, Z as Target, _ as obtainPublicCredential, a as Credential, b as publicRead, c as Policy, d as credentialCall, et as pass, f as credentialGet, g as obtainCredentialViaDelegation, h as memberspace, i as createSyncerInbox, j as MacProfile, k as CredentialSigOptions, l as ProbeSpace, m as managedspace, n as operatorChecks, o as CredentialCallOptions, p as deleteProbeSpace, q as HarnessIdentity, r as SyncerInboxHandle, s as CredentialResult, t as baseChecks, u as createProbeSpace, v as operatorCreateRecord, w as xrpcGet, x as requestCredential, y as personalspace, z as spaceSigHeaders } from "./base-CGsQgOwR.js";
|
|
2
2
|
|
|
3
3
|
//#region src/registry.d.ts
|
|
4
4
|
|
|
@@ -39,20 +39,32 @@ declare function buildCatalog(checks: Check[]): Check[];
|
|
|
39
39
|
*/
|
|
40
40
|
declare function filterCatalog(catalog: Check[], filter: CatalogFilter): FilteredCatalog;
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region src/
|
|
42
|
+
//#region src/did.d.ts
|
|
43
|
+
declare const DEFAULT_PLC_DIRECTORY = "https://plc.directory";
|
|
44
|
+
interface DidDocument {
|
|
45
|
+
id: string;
|
|
46
|
+
alsoKnownAs?: string[];
|
|
47
|
+
verificationMethod?: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
type: string;
|
|
50
|
+
controller?: string;
|
|
51
|
+
publicKeyMultibase?: string;
|
|
52
|
+
}>;
|
|
53
|
+
service?: Array<{
|
|
54
|
+
id: string;
|
|
55
|
+
type: string;
|
|
56
|
+
serviceEndpoint: unknown;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
59
|
+
/** The URL a DID document is fetched from, mirroring the reference resolver. */
|
|
60
|
+
declare function didDocumentUrl(did: string, plcDirectory?: string): string;
|
|
61
|
+
declare function resolveDidDocument(ctx: Pick<CheckContext, "fetch" | "target" | "resolveDid">, did: string): Promise<DidDocument>;
|
|
43
62
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* Reading the header needs only a varint and a dag-cbor decode — no CAR
|
|
47
|
-
* library, no node streams — so it stays runnable anywhere the full entry
|
|
48
|
-
* runs.
|
|
63
|
+
* A verification method as a did:key, accepting the `Multikey` form and
|
|
64
|
+
* the legacy 2019 types PLC still emits (raw key bytes, no multicodec).
|
|
49
65
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
rootCount: number;
|
|
53
|
-
}
|
|
54
|
-
/** Parse just the CARv1 header block and report its version and root count. */
|
|
55
|
-
declare function readCarHeader(bytes: Uint8Array): CarHeaderInfo;
|
|
66
|
+
declare function verificationMethodDidKey(doc: DidDocument, fragment: string): string | undefined;
|
|
67
|
+
declare function serviceEndpoint(doc: DidDocument, fragment: string): string | undefined;
|
|
56
68
|
//#endregion
|
|
57
69
|
//#region src/descriptors.d.ts
|
|
58
70
|
interface CheckDescriptor {
|
|
@@ -63,11 +75,9 @@ interface CheckDescriptor {
|
|
|
63
75
|
citations: Citation[];
|
|
64
76
|
destructive?: boolean;
|
|
65
77
|
slow?: boolean;
|
|
78
|
+
timeoutMs?: number;
|
|
66
79
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Every crypto-bound check, by metadata. Keep in the same order and with
|
|
69
|
-
* the same fields as `cryptoChecks` (enforced by the drift test).
|
|
70
|
-
*/
|
|
80
|
+
/** Every crypto-bound check, by metadata, in catalog order. */
|
|
71
81
|
declare const cryptoCheckDescriptors: CheckDescriptor[];
|
|
72
82
|
/**
|
|
73
83
|
* Turn a descriptor into a listable Check. Its run() is never invoked —
|
|
@@ -79,6 +89,37 @@ declare const cryptoCheckDescriptors: CheckDescriptor[];
|
|
|
79
89
|
*/
|
|
80
90
|
declare function descriptorToStub(d: CheckDescriptor): Check;
|
|
81
91
|
//#endregion
|
|
92
|
+
//#region src/alpha.d.ts
|
|
93
|
+
/**
|
|
94
|
+
* The `@atproto/space` release the suite's verifiers and vendored lexicons
|
|
95
|
+
* are calibrated against: the spaces beta. Runners stamp it on every report.
|
|
96
|
+
* The name predates the beta and is kept for compatibility.
|
|
97
|
+
*/
|
|
98
|
+
declare const ALPHA_BUILD = "0.1.0";
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/changesets.d.ts
|
|
101
|
+
/**
|
|
102
|
+
* The upstream changesets the suite may cite, from bluesky-social/atproto
|
|
103
|
+
* `permissioned-data-alpha` at the vendored commit (see
|
|
104
|
+
* ../lexicons/MANIFEST.json). For alpha mechanics no lexicon can express —
|
|
105
|
+
* the credential HTTP signature, the MAC exchange, key discovery — a
|
|
106
|
+
* changeset is the alpha's only normative prose. Citations are checked
|
|
107
|
+
* against this list, the same typo guard lexicon citations get; re-vendor
|
|
108
|
+
* it alongside the lexicons.
|
|
109
|
+
*/
|
|
110
|
+
declare const knownChangesets: readonly string[];
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/proposal.d.ts
|
|
113
|
+
/**
|
|
114
|
+
* The section anchors of proposal 0016 (Atproto Spaces), as combined in
|
|
115
|
+
* bluesky-social/proposals#143 at b54ec685 — the spec this alpha
|
|
116
|
+
* implements. A `proposal` citation's ref is `0016#<anchor>`, checked
|
|
117
|
+
* against this list (the typo guard lexicon and changeset citations get).
|
|
118
|
+
* Regenerate it from the proposal's headings when the alpha moves.
|
|
119
|
+
*/
|
|
120
|
+
declare const PROPOSAL_COMMIT = "b54ec6853bab77edd4fd373804a480633094b324";
|
|
121
|
+
declare const knownProposalAnchors: readonly string[];
|
|
122
|
+
//#endregion
|
|
82
123
|
//#region src/runner.d.ts
|
|
83
124
|
interface RunReport {
|
|
84
125
|
suite: {
|
|
@@ -127,9 +168,9 @@ declare function renderReport(report: RunReport): string;
|
|
|
127
168
|
//#endregion
|
|
128
169
|
//#region src/lexicons.d.ts
|
|
129
170
|
/**
|
|
130
|
-
* Vendored lexicon access.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
171
|
+
* Vendored lexicon access. Generated by scripts/vendor-lexicons.mjs whenever
|
|
172
|
+
* lexicons/ is re-vendored — imports are explicit so bundlers carry the
|
|
173
|
+
* documents without filesystem access at runtime.
|
|
133
174
|
*/
|
|
134
175
|
interface LexiconDoc {
|
|
135
176
|
lexicon: number;
|
|
@@ -144,13 +185,34 @@ interface CoverageRequirement {
|
|
|
144
185
|
ref: string;
|
|
145
186
|
kind: "method" | "error";
|
|
146
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* A requirement the suite deliberately does not cover. `ref` is an exact
|
|
190
|
+
* requirement, or `*@error:Name` for that error on every method declaring
|
|
191
|
+
* it.
|
|
192
|
+
*/
|
|
193
|
+
interface CoverageExemption {
|
|
194
|
+
ref: string;
|
|
195
|
+
reason: string;
|
|
196
|
+
}
|
|
197
|
+
declare const coverageExemptions: CoverageExemption[];
|
|
147
198
|
interface CoverageReport {
|
|
148
199
|
requirements: CoverageRequirement[];
|
|
149
200
|
covered: Array<{
|
|
150
201
|
ref: string;
|
|
151
202
|
by: string[];
|
|
152
203
|
}>;
|
|
204
|
+
/** Requirements no `must` check covers and no exemption explains. */
|
|
153
205
|
gaps: CoverageRequirement[];
|
|
206
|
+
/** Requirements excused by an exemption, with its reason. */
|
|
207
|
+
exempt: Array<{
|
|
208
|
+
ref: string;
|
|
209
|
+
reason: string;
|
|
210
|
+
}>;
|
|
211
|
+
/**
|
|
212
|
+
* Exemptions that excuse nothing: they match no requirement, or every
|
|
213
|
+
* requirement they match is covered by a check after all.
|
|
214
|
+
*/
|
|
215
|
+
staleExemptions: CoverageExemption[];
|
|
154
216
|
/** Lexicon citations on checks that match no requirement (typo guard). */
|
|
155
217
|
danglingCitations: Array<{
|
|
156
218
|
checkId: string;
|
|
@@ -159,20 +221,20 @@ interface CoverageReport {
|
|
|
159
221
|
}
|
|
160
222
|
/** Extract the coverage requirements from the vendored lexicons. */
|
|
161
223
|
declare function coverageRequirements(docs?: LexiconDoc[]): CoverageRequirement[];
|
|
162
|
-
declare function coverageReport(catalog: Check[], docs?: LexiconDoc[]): CoverageReport;
|
|
224
|
+
declare function coverageReport(catalog: Check[], docs?: LexiconDoc[], exemptions?: CoverageExemption[]): CoverageReport;
|
|
163
225
|
//#endregion
|
|
164
226
|
//#region src/index.d.ts
|
|
165
227
|
/**
|
|
166
228
|
* A catalog for transports that cannot run the crypto-bound checks (the
|
|
167
229
|
* browser). The base checks run anonymously; the operator checks — writes,
|
|
168
|
-
*
|
|
169
|
-
* the harness supplies an operator session (an OAuth
|
|
170
|
-
* checker). Only the checks that genuinely need the
|
|
171
|
-
* foreign identities are metadata stubs, reported as
|
|
172
|
-
* testable here") — listed rather than omitted, so a green
|
|
173
|
-
* silently reads as fuller conformance than it proved.
|
|
230
|
+
* space management, blobs, credential issuance and presentation — are real
|
|
231
|
+
* and run whenever the harness supplies an operator session (an OAuth
|
|
232
|
+
* sign-in in the web checker). Only the checks that genuinely need the
|
|
233
|
+
* alpha crypto libs or foreign identities are metadata stubs, reported as
|
|
234
|
+
* skipped ("not testable here") — listed rather than omitted, so a green
|
|
235
|
+
* run never silently reads as fuller conformance than it proved.
|
|
174
236
|
*/
|
|
175
237
|
declare const browserCatalog: Check[];
|
|
176
238
|
//#endregion
|
|
177
|
-
export { type Capability, type CatalogFilter, type Check, type CheckContext, type CheckDescriptor, type CheckOutcome, type CheckResult, type CheckStatus, type Citation, type CoverageReport, type CoverageRequirement, type Credential, type
|
|
239
|
+
export { ALPHA_BUILD, COMMIT_MAC_PROFILE, type Capability, type CatalogFilter, type Check, type CheckContext, type CheckDescriptor, type CheckOutcome, type CheckResult, type CheckStatus, type Citation, type CoverageExemption, type CoverageReport, type CoverageRequirement, type Credential, type CredentialCallOptions, type CredentialKey, type CredentialResult, type CredentialSigOptions, DEFAULT_PLC_DIRECTORY, type DidDocument, type FilteredCatalog, type HarnessIdentity, type IdentityProvider, type InboxDelivery, type LexiconDoc, MAC_COVERED_HEADER, type MacProfile, PROPOSAL_COMMIT, type Policy, type ProbeSpace, RECORD_MAC_PROFILE, type RunOptions, type RunReport, SPACE_CREDENTIAL_SCHEME, type SyncerInbox, type SyncerInboxHandle, type Target, type Tier, type XrpcResult, baseChecks, browserCatalog, buildCatalog, coverageExemptions, coverageReport, coverageRequirements, createCredentialKey, createProbeSpace, createSyncerInbox, credentialCall, credentialGet, credentialSigMembers, cryptoCheckDescriptors, defineCheck, deleteProbeSpace, descriptorToStub, didDocumentUrl, encapsulate, fail, filterCatalog, formatMacRequest, isP256DidKey, knownChangesets, knownProposalAnchors, lexicons, managedspace, memberspace, obtainCredentialViaDelegation, obtainPublicCredential, operatorChecks, operatorCreateRecord, operatorHeaders, pass, personalspace, publicRead, renderReport, requestCredential, resolveDidDocument, runChecks, serviceEndpoint, spaceSigHeaders, verificationMethodDidKey, xrpcGet, xrpcPost, xrpcUrl };
|
|
178
240
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/registry.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/registry.ts","../src/did.ts","../src/descriptors.ts","../src/alpha.ts","../src/changesets.ts","../src/proposal.ts","../src/runner.ts","../src/lexicons.ts","../src/coverage.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;AA0BA;AAaA;;;;;AAMA;AAgBA;AACU,iBAhDM,WAAA,CAgDN,KAAA,EAhDyB,KAgDzB,CAAA,EAhDiC,KAgDjC;AACD,UArCQ,aAAA,CAqCR;EACN,KAAA,CAAA,EArCM,IAqCN,EAAA;EAAe;iBAnCF;;;ECbH;EAEI,IAAA,CAAA,EAAA,OAAW;EAaZ;EAeM,KAAA,CAAA,EAAA,MAAA,EAAA;EACX,GAAA,CAAA,EAAA,MAAA,EAAA;;AAEA,UDVM,eAAA,CCUN;EAAR,QAAA,EDTQ,KCSR,EAAA;EAAO;EA0BM,OAAA,EDjCN,KCiCM,CAAA;IA8BA,KAAA,ED/DS,KC+DT;;;;ACvFC,iBF2BD,YAAA,CE3BgB,MAAA,EF2BK,KE3BL,EAAA,CAAA,EF2Be,KE3Bf,EAAA;;;;;AAwBhC;AAmTgB,iBFhSA,aAAA,CEgSoB,OAAA,EF/R1B,KE+R4C,EAAA,EAAA,MAAK,EF9RlD,aE8RkD,CAAA,EF7RxD,eE6RwD;;;AF/RjD,cC9CG,qBAAA,GD8CH,uBAAA;AACD,UC7CQ,WAAA,CD6CR;EACN,EAAA,EA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