@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,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lexicon": 1,
|
|
3
|
+
"id": "com.atproto.space.notifySpaceUpdate",
|
|
4
|
+
"defs": {
|
|
5
|
+
"main": {
|
|
6
|
+
"type": "procedure",
|
|
7
|
+
"description": "Notify a syncing service of an update to a space. Sent by the space host to the notification endpoint registered through authorizeSpaceSync.",
|
|
8
|
+
"input": {
|
|
9
|
+
"encoding": "application/json",
|
|
10
|
+
"schema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["space", "token", "update"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"space": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"format": "space-ref"
|
|
17
|
+
},
|
|
18
|
+
"token": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"maxLength": 512,
|
|
21
|
+
"description": "The token the endpoint was registered with."
|
|
22
|
+
},
|
|
23
|
+
"update": {
|
|
24
|
+
"type": "union",
|
|
25
|
+
"refs": [
|
|
26
|
+
"com.atproto.space.defs#repoWrite",
|
|
27
|
+
"com.atproto.space.defs#repoRemoved",
|
|
28
|
+
"#spaceDeleted",
|
|
29
|
+
"#registrationExpired"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"spaceDeleted": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "The space has been deleted. Confirm with authorizeSpaceSync before dropping its data.",
|
|
39
|
+
"properties": {}
|
|
40
|
+
},
|
|
41
|
+
"registrationExpired": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"description": "The endpoint's registration has expired. Sent in place of the first update after expiry. Call authorizeSpaceSync to keep receiving notifications.",
|
|
44
|
+
"required": ["spaceRev"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"spaceRev": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"format": "tid"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lexicon": 1,
|
|
3
|
+
"id": "com.atproto.space.policy",
|
|
4
|
+
"defs": {
|
|
5
|
+
"main": {
|
|
6
|
+
"type": "record",
|
|
7
|
+
"description": "A published copy of a space's policy. Only authoritative in the space authority's repo.",
|
|
8
|
+
"key": "literal:self",
|
|
9
|
+
"record": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"required": ["policy"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"policy": {
|
|
14
|
+
"type": "union",
|
|
15
|
+
"description": "PDSes must support all of the listed policies. Other space hosts may support only some of them, and any host may support policies beyond those listed.",
|
|
16
|
+
"refs": [
|
|
17
|
+
"com.atproto.personalspace.policy",
|
|
18
|
+
"com.atproto.memberspace.policy",
|
|
19
|
+
"com.atproto.managedspace.policy"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"defs": {
|
|
5
5
|
"main": {
|
|
6
6
|
"type": "procedure",
|
|
7
|
-
"description": "Write a record in a
|
|
7
|
+
"description": "Write a record in a space repo, creating or updating it as needed. Requires auth, implemented by PDS.",
|
|
8
8
|
"input": {
|
|
9
9
|
"encoding": "application/json",
|
|
10
10
|
"schema": {
|
|
@@ -13,32 +13,26 @@
|
|
|
13
13
|
"properties": {
|
|
14
14
|
"space": {
|
|
15
15
|
"type": "string",
|
|
16
|
-
"format": "space-ref"
|
|
17
|
-
"description": "Reference to the space."
|
|
16
|
+
"format": "space-ref"
|
|
18
17
|
},
|
|
19
18
|
"repo": {
|
|
20
19
|
"type": "string",
|
|
21
|
-
"format": "did"
|
|
22
|
-
"description": "The DID of the repo to write to (the authenticated member)."
|
|
20
|
+
"format": "did"
|
|
23
21
|
},
|
|
24
22
|
"collection": {
|
|
25
23
|
"type": "string",
|
|
26
|
-
"format": "nsid"
|
|
27
|
-
"description": "The NSID of the record collection."
|
|
24
|
+
"format": "nsid"
|
|
28
25
|
},
|
|
29
26
|
"rkey": {
|
|
30
27
|
"type": "string",
|
|
31
|
-
"format": "record-key"
|
|
32
|
-
"description": "The Record Key.",
|
|
33
|
-
"maxLength": 512
|
|
28
|
+
"format": "record-key"
|
|
34
29
|
},
|
|
35
30
|
"validate": {
|
|
36
31
|
"type": "boolean",
|
|
37
32
|
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."
|
|
38
33
|
},
|
|
39
34
|
"record": {
|
|
40
|
-
"type": "unknown"
|
|
41
|
-
"description": "The record to write."
|
|
35
|
+
"type": "unknown"
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
38
|
}
|
|
@@ -51,8 +45,7 @@
|
|
|
51
45
|
"properties": {
|
|
52
46
|
"uri": {
|
|
53
47
|
"type": "string",
|
|
54
|
-
"format": "at-uri"
|
|
55
|
-
"description": "URI of the written record."
|
|
48
|
+
"format": "at-uri"
|
|
56
49
|
},
|
|
57
50
|
"cid": {
|
|
58
51
|
"type": "string",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lexicon": 1,
|
|
3
|
+
"id": "com.atproto.space.removeWriter",
|
|
4
|
+
"defs": {
|
|
5
|
+
"main": {
|
|
6
|
+
"type": "procedure",
|
|
7
|
+
"description": "Remove an account from a space's writer set, as returned by listWriters. The removal is sent to registered syncers. The account is added back if it makes another authorized write to the space. Does nothing if the account is not in the writer set. Requires auth as the space authority, implemented by PDS.",
|
|
8
|
+
"input": {
|
|
9
|
+
"encoding": "application/json",
|
|
10
|
+
"schema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["space", "repo"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"space": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"format": "space-ref"
|
|
17
|
+
},
|
|
18
|
+
"repo": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "did"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"errors": [
|
|
26
|
+
{
|
|
27
|
+
"name": "SpaceNotFound"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "NotAuthorized"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lexicon": 1,
|
|
3
|
+
"id": "com.atproto.space.updateSpace",
|
|
4
|
+
"defs": {
|
|
5
|
+
"main": {
|
|
6
|
+
"type": "procedure",
|
|
7
|
+
"description": "Replace the policy of a space. Changing to a different policy type discards state held by the previous policy, such as a member list. Requires auth as the space authority, implemented by PDS.",
|
|
8
|
+
"input": {
|
|
9
|
+
"encoding": "application/json",
|
|
10
|
+
"schema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["space", "policy"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"space": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"format": "space-ref"
|
|
17
|
+
},
|
|
18
|
+
"policy": {
|
|
19
|
+
"type": "union",
|
|
20
|
+
"description": "PDSes must support all of the listed policies. Other space hosts may support only some of them, and any host may support policies beyond those listed.",
|
|
21
|
+
"refs": [
|
|
22
|
+
"com.atproto.personalspace.policy",
|
|
23
|
+
"com.atproto.memberspace.policy",
|
|
24
|
+
"com.atproto.managedspace.policy"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"errors": [
|
|
31
|
+
{
|
|
32
|
+
"name": "SpaceNotFound"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "NotAuthorized"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "UnsupportedPolicy"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcirrus/space-conformance",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Black-box conformance suite for atproto spaces implementations (
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Black-box conformance suite for atproto spaces implementations (beta)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -12,19 +12,12 @@
|
|
|
12
12
|
".": "./dist/index.js",
|
|
13
13
|
"./full": "./dist/full.js"
|
|
14
14
|
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@atproto/crypto": "^0.4.5",
|
|
17
|
-
"@atproto/lex-cbor": "^0.1.6",
|
|
18
|
-
"@atproto/lex-data": "^0.1.7",
|
|
19
|
-
"@atproto/oauth-client-node": "0.0.0-spaces-alpha-20260818163953",
|
|
20
|
-
"@atproto/space": "0.0.0-spaces-alpha-20260818163953"
|
|
21
|
-
},
|
|
22
15
|
"devDependencies": {
|
|
23
16
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
24
17
|
"publint": "^0.3.16",
|
|
25
18
|
"tsdown": "^0.18.3",
|
|
26
19
|
"typescript": "^5.9.3",
|
|
27
|
-
"vitest": "4.1.
|
|
20
|
+
"vitest": "^4.1.12"
|
|
28
21
|
},
|
|
29
22
|
"repository": {
|
|
30
23
|
"type": "git",
|
|
@@ -44,10 +37,17 @@
|
|
|
44
37
|
"bin": {
|
|
45
38
|
"space-conformance": "./dist/cli.js"
|
|
46
39
|
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@atproto/crypto": "^0.5.9",
|
|
42
|
+
"@atproto/lex-data": "^0.1.11",
|
|
43
|
+
"@atproto/oauth-client-node": "^0.5.22",
|
|
44
|
+
"@atproto/space": "^0.1.0"
|
|
45
|
+
},
|
|
47
46
|
"scripts": {
|
|
48
47
|
"build": "tsdown",
|
|
49
48
|
"dev": "tsdown --watch",
|
|
50
49
|
"test": "vitest run",
|
|
51
|
-
"check": "publint && attw --pack --profile esm-only"
|
|
50
|
+
"check": "publint && attw --pack --profile esm-only",
|
|
51
|
+
"vendor-lexicons": "node scripts/vendor-lexicons.mjs"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/dist/base-D8a-ZK57.d.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
//#region src/model.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* The check model.
|
|
4
|
-
*
|
|
5
|
-
* A check is a black-box probe of a live spaces implementation: an async
|
|
6
|
-
* function over a transport, plus machine-readable metadata that says what
|
|
7
|
-
* it tests, on whose authority, and what it needs from the harness.
|
|
8
|
-
*
|
|
9
|
-
* Tiers, and why they matter: a conformance suite that fails
|
|
10
|
-
* implementations on its author's opinions poisons its own authority.
|
|
11
|
-
* Every `must` check cites specified behavior — a lexicon shape, a
|
|
12
|
-
* declared error name, a requirement in the proposal or the upstream PDS
|
|
13
|
-
* design spec. `should` checks encode reference-implementation behavior
|
|
14
|
-
* the spec leaves open, and are calibrated by running this suite against
|
|
15
|
-
* the reference: a `should` the reference fails is stale by definition.
|
|
16
|
-
* `info` checks report implementation choices and never fail anyone.
|
|
17
|
-
*/
|
|
18
|
-
type Tier = "must" | "should" | "info";
|
|
19
|
-
/** Where a check's claim comes from. Every `must` check needs at least one. */
|
|
20
|
-
interface Citation {
|
|
21
|
-
/** e.g. "lexicon", "proposal", "pds-design-spec", "reference" */
|
|
22
|
-
source: "lexicon" | "proposal" | "pds-design-spec" | "reference";
|
|
23
|
-
/**
|
|
24
|
-
* Locator within the source: a lexicon id (optionally `#def` or
|
|
25
|
-
* `@error:Name`), a proposal section anchor, or a design-spec heading.
|
|
26
|
-
* Lexicon locators are machine-checked by the coverage generator.
|
|
27
|
-
*/
|
|
28
|
-
ref: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* What the harness must supply for a check to run. A runner skips (and
|
|
32
|
-
* reports as "not testable") any check whose needs it cannot meet.
|
|
33
|
-
*
|
|
34
|
-
* - `operator`: an authenticated session on the target (any full-access
|
|
35
|
-
* scheme; how it was obtained is the harness's business).
|
|
36
|
-
* - `oauth-session`: specifically an OAuth-granted session with `space:`
|
|
37
|
-
* scopes — only harnesses that can drive the target's consent flow.
|
|
38
|
-
* - `identities`: harness-controlled DIDs with resolvable documents and
|
|
39
|
-
* held keys, for playing reader/writer roles.
|
|
40
|
-
* - `syncer-inbox`: an HTTPS endpoint the harness controls that the
|
|
41
|
-
* target can deliver notifications to.
|
|
42
|
-
* - `pds-blobs`: the target is a full PDS implementing
|
|
43
|
-
* `com.atproto.repo.uploadBlob` and `com.atproto.sync.getBlob` — needed
|
|
44
|
-
* to prove a space blob is not served publicly. A standalone space host,
|
|
45
|
-
* or an isolated space-routes fixture, does not provide it.
|
|
46
|
-
* - `pds-delegation`: the target implements
|
|
47
|
-
* `com.atproto.space.getDelegationToken`, so the operator can obtain a
|
|
48
|
-
* credential for its own space (the bulletin self-flow) with no
|
|
49
|
-
* harness-held reader key. A space-routes fixture does not provide it.
|
|
50
|
-
* - `alpha-libs`: the transport can execute the alpha crypto libraries
|
|
51
|
-
* (`@atproto/space`), whose bundle pulls node-only dependencies. Real
|
|
52
|
-
* checks never declare it — importing the full entry implies it — but
|
|
53
|
-
* the browser catalog's metadata stubs do, so a browser harness (which
|
|
54
|
-
* never declares it) reports them "not testable here" instead of
|
|
55
|
-
* running a stub.
|
|
56
|
-
*/
|
|
57
|
-
type Capability = "operator" | "oauth-session" | "identities" | "syncer-inbox" | "pds-blobs" | "pds-delegation" | "alpha-libs";
|
|
58
|
-
type CheckStatus = "pass" | "fail" | "skipped" | "error";
|
|
59
|
-
interface CheckResult {
|
|
60
|
-
id: string;
|
|
61
|
-
tier: Tier;
|
|
62
|
-
status: CheckStatus;
|
|
63
|
-
/** One line: what was observed, or why skipped/errored. */
|
|
64
|
-
detail: string;
|
|
65
|
-
citations: Citation[];
|
|
66
|
-
/** Optional request/response evidence for the report. */
|
|
67
|
-
evidence?: unknown;
|
|
68
|
-
durationMs?: number;
|
|
69
|
-
}
|
|
70
|
-
/** An identity the harness controls: a resolvable DID plus its keys. */
|
|
71
|
-
interface HarnessIdentity {
|
|
72
|
-
did: string;
|
|
73
|
-
/** Sign bytes with the identity's atproto signing key (ES256K/ES256). */
|
|
74
|
-
sign(bytes: Uint8Array): Promise<Uint8Array>;
|
|
75
|
-
/** JWT `alg` for {@link sign}. */
|
|
76
|
-
jwtAlg: string;
|
|
77
|
-
}
|
|
78
|
-
/** A DPoP key the harness controls (always ES256, per the proposal). */
|
|
79
|
-
interface DpopKey {
|
|
80
|
-
bareJwk: Record<string, unknown>;
|
|
81
|
-
/** Algorithms the key supports; `["ES256"]` for DPoP. */
|
|
82
|
-
algorithms: readonly string[];
|
|
83
|
-
/** RFC 7638 thumbprint of {@link bareJwk}. */
|
|
84
|
-
jkt: string;
|
|
85
|
-
createJwt(header: Record<string, unknown>, payload: Record<string, unknown>): Promise<string>;
|
|
86
|
-
}
|
|
87
|
-
interface IdentityProvider {
|
|
88
|
-
/** Mint (or reuse) a harness identity by role label. */
|
|
89
|
-
identity(role: string): Promise<HarnessIdentity>;
|
|
90
|
-
/** Mint a fresh DPoP key. */
|
|
91
|
-
dpopKey(): Promise<DpopKey>;
|
|
92
|
-
}
|
|
93
|
-
interface SyncerInbox {
|
|
94
|
-
/** The service identifier to register (did, optionally with #fragment). */
|
|
95
|
-
service: string;
|
|
96
|
-
/** Wait for a delivery matching the predicate, or time out (null). */
|
|
97
|
-
waitFor(predicate: (delivery: InboxDelivery) => boolean, timeoutMs: number): Promise<InboxDelivery | null>;
|
|
98
|
-
}
|
|
99
|
-
interface InboxDelivery {
|
|
100
|
-
lxm: string;
|
|
101
|
-
body: unknown;
|
|
102
|
-
authorization?: string;
|
|
103
|
-
receivedAt: number;
|
|
104
|
-
}
|
|
105
|
-
/** Description of the implementation under test. */
|
|
106
|
-
interface Target {
|
|
107
|
-
/** Public origin, e.g. https://pds.example.com */
|
|
108
|
-
origin: string;
|
|
109
|
-
/** The DID whose repos / spaces the target serves. */
|
|
110
|
-
did: string;
|
|
111
|
-
/** Free-form implementation label for the report ("cirrus", "reference"). */
|
|
112
|
-
implementation?: string;
|
|
113
|
-
}
|
|
114
|
-
interface CheckContext {
|
|
115
|
-
target: Target;
|
|
116
|
-
fetch: typeof fetch;
|
|
117
|
-
/**
|
|
118
|
-
* Present when the harness has an authenticated session on the target.
|
|
119
|
-
* Provide `authorize` when auth is plain header injection (a bearer
|
|
120
|
-
* token), or `fetch` when each request must be individually signed — a
|
|
121
|
-
* DPoP-bound OAuth session, where the proof depends on the method and
|
|
122
|
-
* URL, cannot be expressed as headers alone. At least one is required;
|
|
123
|
-
* `fetch` wins when both are present.
|
|
124
|
-
*/
|
|
125
|
-
operator?: {
|
|
126
|
-
/** Add auth to a request (header injection). */
|
|
127
|
-
authorize?(init: RequestInit & {
|
|
128
|
-
headers: Headers;
|
|
129
|
-
}): Promise<void>;
|
|
130
|
-
/** A fetch that carries the operator's credentials on every request. */
|
|
131
|
-
fetch?: typeof fetch;
|
|
132
|
-
/** True when this session came from an OAuth grant with space: scopes. */
|
|
133
|
-
oauth: boolean;
|
|
134
|
-
};
|
|
135
|
-
identities?: IdentityProvider;
|
|
136
|
-
syncerInbox?: SyncerInbox;
|
|
137
|
-
/**
|
|
138
|
-
* Scratch space shared across checks in one run — e.g. the probe space
|
|
139
|
-
* a setup check created, reused by later checks. Keys are namespaced by
|
|
140
|
-
* convention (`"probe.space.uri"`).
|
|
141
|
-
*/
|
|
142
|
-
state: Map<string, unknown>;
|
|
143
|
-
/** Structured logging into the run report. */
|
|
144
|
-
log(message: string): void;
|
|
145
|
-
}
|
|
146
|
-
interface Check {
|
|
147
|
-
id: string;
|
|
148
|
-
title: string;
|
|
149
|
-
tier: Tier;
|
|
150
|
-
citations: Citation[];
|
|
151
|
-
needs: Capability[];
|
|
152
|
-
/** Creates or deletes state on the target (probe spaces, records). */
|
|
153
|
-
destructive?: boolean;
|
|
154
|
-
/** Depends on real time passing (expiry windows); excluded by default. */
|
|
155
|
-
slow?: boolean;
|
|
156
|
-
run(ctx: CheckContext): Promise<CheckOutcome>;
|
|
157
|
-
}
|
|
158
|
-
/** What a check's run() returns; the runner wraps it into a CheckResult. */
|
|
159
|
-
interface CheckOutcome {
|
|
160
|
-
status: "pass" | "fail";
|
|
161
|
-
detail: string;
|
|
162
|
-
evidence?: unknown;
|
|
163
|
-
}
|
|
164
|
-
declare const pass: (detail: string, evidence?: unknown) => CheckOutcome;
|
|
165
|
-
declare const fail: (detail: string, evidence?: unknown) => CheckOutcome;
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/dpop.d.ts
|
|
168
|
-
/**
|
|
169
|
-
* WebCrypto ES256 DPoP key implementing the minimal surface a DPoP proof
|
|
170
|
-
* needs (`bareJwk`, `algorithms`, `createJwt`) plus the RFC 7638
|
|
171
|
-
* thumbprint. Hand-rolled to avoid `@atproto/jwk-jose`, whose bundled jose
|
|
172
|
-
* resolves to its Node build under the workers test pool and cannot sign.
|
|
173
|
-
*/
|
|
174
|
-
declare function createDpopKey(): Promise<DpopKey>;
|
|
175
|
-
/**
|
|
176
|
-
* An RFC 9449 DPoP proof over `key`, matching the reference verifier:
|
|
177
|
-
* header `{alg, typ: "dpop+jwt", jwk}`; claims `jti` (random), `htm`,
|
|
178
|
-
* `htu` (query and fragment stripped, RFC 9449 §4.2), `iat`, and — only
|
|
179
|
-
* when presenting a credential — `ath`, the base64url SHA-256 of it.
|
|
180
|
-
*/
|
|
181
|
-
declare function createDpopProofJwt(key: DpopKey, opts: {
|
|
182
|
-
htm: string;
|
|
183
|
-
htu: string;
|
|
184
|
-
credential?: string;
|
|
185
|
-
}): Promise<string>;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/http.d.ts
|
|
188
|
-
declare function xrpcUrl(origin: string, nsid: string, params?: Record<string, string | undefined>): string;
|
|
189
|
-
interface XrpcResult {
|
|
190
|
-
status: number;
|
|
191
|
-
/** Parsed JSON body, or undefined for non-JSON responses. */
|
|
192
|
-
json?: unknown;
|
|
193
|
-
/** The atproto `error` name, when the body carries one. */
|
|
194
|
-
error?: string;
|
|
195
|
-
headers: Headers;
|
|
196
|
-
response: Response;
|
|
197
|
-
}
|
|
198
|
-
/** GET an XRPC query. `headers` may carry auth. */
|
|
199
|
-
declare function xrpcGet(ctx: CheckContext, nsid: string, params?: Record<string, string | undefined>, headers?: HeadersInit): Promise<XrpcResult>;
|
|
200
|
-
/** POST an XRPC procedure with a JSON body. */
|
|
201
|
-
declare function xrpcPost(ctx: CheckContext, nsid: string, body: unknown, headers?: HeadersInit): Promise<XrpcResult>;
|
|
202
|
-
/** Add the operator's auth to a headers object, if a session is present. */
|
|
203
|
-
declare function operatorHeaders(ctx: CheckContext, extra?: HeadersInit): Promise<Headers>;
|
|
204
|
-
//#endregion
|
|
205
|
-
//#region src/checks/operator.d.ts
|
|
206
|
-
interface ProbeSpace {
|
|
207
|
-
uri: string;
|
|
208
|
-
type: string;
|
|
209
|
-
skey: string;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Create a probe space owned by the target and cache it for the run.
|
|
213
|
-
* Requires an operator session with space management authority.
|
|
214
|
-
*/
|
|
215
|
-
declare function createProbeSpace(ctx: CheckContext, policy?: Record<string, unknown>, appAccess?: Record<string, unknown>): Promise<ProbeSpace>;
|
|
216
|
-
/** Delete a probe space, best-effort (cleanup). */
|
|
217
|
-
declare function deleteProbeSpace(ctx: CheckContext, space: string): Promise<void>;
|
|
218
|
-
/** Operator creates a record in a space; returns the response. */
|
|
219
|
-
declare function operatorCreateRecord(ctx: CheckContext, space: string, collection: string, rkey: string, record: Record<string, unknown>): Promise<XrpcResult>;
|
|
220
|
-
interface Credential {
|
|
221
|
-
credential: string;
|
|
222
|
-
dpopKey: DpopKey;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Obtain a credential the way a real app does: ask the target's own
|
|
226
|
-
* `getDelegationToken` (with the operator session) for a delegation token,
|
|
227
|
-
* then exchange it at `getSpaceCredential`. This is the bulletin self-flow
|
|
228
|
-
* — it needs no harness-held reader key, so it runs against any real PDS
|
|
229
|
-
* (Cirrus, the reference) and exercises the target's own token minting.
|
|
230
|
-
*/
|
|
231
|
-
declare function obtainCredentialViaDelegation(ctx: CheckContext, space: string): Promise<{
|
|
232
|
-
result: XrpcResult;
|
|
233
|
-
credential?: Credential;
|
|
234
|
-
delegation: XrpcResult;
|
|
235
|
-
}>;
|
|
236
|
-
/** A credential-authenticated GET, with a fresh proof bound to the request. */
|
|
237
|
-
declare function credentialGet(ctx: CheckContext, credential: Credential, nsid: string, params: Record<string, string | undefined>): Promise<XrpcResult>;
|
|
238
|
-
/**
|
|
239
|
-
* The operator catalog: runnable anywhere the harness has an operator
|
|
240
|
-
* session — browser included.
|
|
241
|
-
*/
|
|
242
|
-
declare const operatorChecks: Check[];
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region src/checks/base.d.ts
|
|
245
|
-
/** Checks that need no crypto and no session — safe in any transport. */
|
|
246
|
-
declare const baseChecks: Check[];
|
|
247
|
-
//#endregion
|
|
248
|
-
export { Tier as A, Citation as C, InboxDelivery as D, IdentityProvider as E, pass as M, SyncerInbox as O, CheckStatus as S, HarnessIdentity as T, Capability as _, credentialGet as a, CheckOutcome as b, operatorChecks as c, operatorHeaders as d, xrpcGet as f, createDpopProofJwt as g, createDpopKey as h, createProbeSpace as i, fail as j, Target as k, operatorCreateRecord as l, xrpcUrl as m, Credential as n, deleteProbeSpace as o, xrpcPost as p, ProbeSpace as r, obtainCredentialViaDelegation as s, baseChecks as t, XrpcResult as u, Check as v, DpopKey as w, CheckResult as x, CheckContext as y };
|
|
249
|
-
//# sourceMappingURL=base-D8a-ZK57.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-D8a-ZK57.d.ts","names":[],"sources":["../src/model.ts","../src/dpop.ts","../src/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