@interop/wallet-core 0.62.0 → 0.66.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/README.md +41 -16
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +119 -35
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +227 -160
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -8
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +37 -64
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +85 -38
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +155 -98
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -2
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +16 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +65 -14
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +397 -298
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +23 -7
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +26 -7
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +58 -0
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +249 -41
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +391 -346
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +237 -53
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +533 -198
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +12 -6
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +44 -72
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +123 -0
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
- package/dist/clientAnnex/spaceCapability.js +152 -0
- package/dist/clientAnnex/spaceCapability.js.map +1 -0
- package/dist/clientAnnex/stages.d.ts +63 -0
- package/dist/clientAnnex/stages.d.ts.map +1 -0
- package/dist/clientAnnex/stages.js +64 -0
- package/dist/clientAnnex/stages.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +42 -35
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/policy.d.ts +15 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +12 -6
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -10
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +13 -5
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +10 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +41 -24
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +6 -23
- package/dist/descriptors/acquire.js.map +1 -1
- package/dist/descriptors/cipher.d.ts.map +1 -1
- package/dist/descriptors/cipher.js +5 -0
- package/dist/descriptors/cipher.js.map +1 -1
- package/dist/descriptors/errors.d.ts +43 -0
- package/dist/descriptors/errors.d.ts.map +1 -0
- package/dist/descriptors/errors.js +45 -0
- package/dist/descriptors/errors.js.map +1 -0
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +37 -10
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +52 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +42 -11
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +80 -22
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +3 -1
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +3 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/identity/agents.d.ts +17 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +23 -7
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +3 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/index.d.ts +2 -1
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +2 -1
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +3 -6
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +14 -5
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -36
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +22 -8
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +20 -6
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +15 -12
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +21 -16
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +10 -9
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -3
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +8 -5
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +7 -6
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +95 -8
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +278 -35
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +117 -16
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +184 -43
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/keys/wasLabelsStore.d.ts +9 -2
- package/dist/keys/wasLabelsStore.d.ts.map +1 -1
- package/dist/keys/wasLabelsStore.js +14 -6
- package/dist/keys/wasLabelsStore.js.map +1 -1
- package/dist/log.d.ts +7 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/recovery/index.d.ts +13 -9
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +12 -8
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +27 -7
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +18 -6
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +23 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +66 -46
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +75 -63
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +127 -116
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +35 -1
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +29 -10
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/classify.d.ts +32 -8
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +39 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +1 -6
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +2 -2
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +2 -3
- package/dist/request/parse.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +34 -12
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +79 -86
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +182 -0
- package/dist/resourceLog/document.d.ts.map +1 -0
- package/dist/resourceLog/document.js +159 -0
- package/dist/resourceLog/document.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +47 -8
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +54 -8
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +7 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +7 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts +35 -0
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
- package/dist/resourceLog/ladderRungs.js +352 -0
- package/dist/resourceLog/ladderRungs.js.map +1 -0
- package/dist/resourceLog/license.d.ts +42 -17
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +38 -24
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +15 -15
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +15 -15
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +11 -0
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +13 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/deleteSpace.d.ts +28 -0
- package/dist/space/deleteSpace.d.ts.map +1 -0
- package/dist/space/deleteSpace.js +44 -0
- package/dist/space/deleteSpace.js.map +1 -0
- package/dist/space/errors.d.ts.map +1 -1
- package/dist/space/errors.js +0 -1
- package/dist/space/errors.js.map +1 -1
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +6 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/plaintextCollection.d.ts +43 -0
- package/dist/space/plaintextCollection.d.ts.map +1 -0
- package/dist/space/plaintextCollection.js +17 -0
- package/dist/space/plaintextCollection.js.map +1 -0
- package/dist/stages.d.ts +23 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +23 -0
- package/dist/stages.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.js +4 -4
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.js +2 -2
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +41 -1
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +47 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +5 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +35 -7
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +52 -14
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +5 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +217 -35
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +469 -210
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +146 -0
- package/dist/webvh/accountEntry.d.ts.map +1 -0
- package/dist/webvh/accountEntry.js +239 -0
- package/dist/webvh/accountEntry.js.map +1 -0
- package/dist/webvh/didWeb.d.ts +12 -7
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +2 -2
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +164 -0
- package/dist/webvh/didWebProjection.d.ts.map +1 -0
- package/dist/webvh/didWebProjection.js +230 -0
- package/dist/webvh/didWebProjection.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +275 -136
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +307 -340
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +65 -0
- package/dist/webvh/enrollClient.d.ts.map +1 -0
- package/dist/webvh/enrollClient.js +172 -0
- package/dist/webvh/enrollClient.js.map +1 -0
- package/dist/webvh/index.d.ts +37 -12
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +33 -10
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +1 -35
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -30
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +41 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +99 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +61 -14
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +91 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +59 -5
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +76 -11
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +8 -8
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +39 -14
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +14 -1
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +3 -27
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +2 -2
- package/dist/webvh/keyAgreement.d.ts +0 -97
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -71
- package/dist/webvh/keyAgreement.js.map +0 -1
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The one refusal class the resource-log layer still owns after the generic
|
|
6
|
-
* client side moved to `@interop/vh-resource-log
|
|
7
|
-
* refusal
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* client side moved to `@interop/vh-resource-log` -- the ceremony-tail
|
|
7
|
+
* license refusal -- and the shared read-side classification of that
|
|
8
|
+
* library's taxonomy ({@link isResourceLogRefusal}: which refusals a caller
|
|
9
|
+
* must not paper over with a cached copy). The generic taxonomy
|
|
10
|
+
* (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
|
|
11
|
+
* `ResourceLogClosedError`, `LogNotConfirmedError`, and the store port's
|
|
12
|
+
* `ResourceLogConflictError`) is the library's; wallet-core re-exports none
|
|
13
|
+
* of it -- one owner per name. Like every class in that taxonomy, this one
|
|
14
|
+
* assigns its `name` string explicitly and is matched by `err.name` across
|
|
15
|
+
* package boundaries (the WC-64 rule; minified class names do not survive
|
|
16
|
+
* bundling), which is also why the predicate compares names rather than
|
|
17
|
+
* constructors and why this file stays import-free.
|
|
14
18
|
*/
|
|
15
19
|
/**
|
|
16
20
|
* A ladder-signed append outside the ceremony-tail license: it is not the
|
|
@@ -27,4 +31,39 @@ export declare class ResourceLogLicenseError extends Error {
|
|
|
27
31
|
cause?: unknown;
|
|
28
32
|
});
|
|
29
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether a resource-log refusal is one a caller must NOT paper over with a
|
|
36
|
+
* cached copy: a fabricated log (`ResourceLogIntegrityError`), or a log that
|
|
37
|
+
* is not the continuation of the pinned history
|
|
38
|
+
* (`ResourceLogContinuityError`) -- EXCEPT continuity reason `rollback`.
|
|
39
|
+
*
|
|
40
|
+
* This is the one implementation of the rollback carve-out ARCHITECTURE.md
|
|
41
|
+
* states once as policy. A rollback is reconcilable divergence, possibly
|
|
42
|
+
* nothing worse than replication lag: the pin is never regressed and nothing
|
|
43
|
+
* rolled back is adopted, so serving the cached copy while a lagging replica
|
|
44
|
+
* catches up is exactly the offline case, and refusing there would lock a
|
|
45
|
+
* healthy account out of its own start. A `fork` or an SCID/method switch is
|
|
46
|
+
* a refusal like fabrication.
|
|
47
|
+
*
|
|
48
|
+
* `ResourceLogLicenseError` is deliberately absent, so a license refusal on a
|
|
49
|
+
* READ lands in the soft transport class (warn, serve cached). Ratified
|
|
50
|
+
* behavior, not omission: the log is not corrupt and the signer genuinely
|
|
51
|
+
* holds the credential, so the append is unlicensed rather than forged. The
|
|
52
|
+
* two shapes that argues against -- a compromised still-listed key holder,
|
|
53
|
+
* and a genuine unlicensed entry N masking a forged entry N+1 under whole-log
|
|
54
|
+
* first-failure semantics -- were weighed and accepted (WC-149). The
|
|
55
|
+
* pre-write half of the license is where the class does its work: a
|
|
56
|
+
* conformant writer is refused before an unlicensed entry can land.
|
|
57
|
+
*
|
|
58
|
+
* Matched on `err.name` rather than `instanceof`: these errors are raised
|
|
59
|
+
* inside app-injected seams that can resolve to a different copy of this
|
|
60
|
+
* package (linked, or duplicated through a dependency tree), and an
|
|
61
|
+
* `instanceof` miss would drop a security refusal into a caller's
|
|
62
|
+
* warn-and-proceed branch. Callers add only the names the generic taxonomy
|
|
63
|
+
* does not carry.
|
|
64
|
+
*
|
|
65
|
+
* @param err {unknown}
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
export declare function isResourceLogRefusal(err: unknown): boolean;
|
|
30
69
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAS1D"}
|
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The one refusal class the resource-log layer still owns after the generic
|
|
6
|
-
* client side moved to `@interop/vh-resource-log
|
|
7
|
-
* refusal
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* client side moved to `@interop/vh-resource-log` -- the ceremony-tail
|
|
7
|
+
* license refusal -- and the shared read-side classification of that
|
|
8
|
+
* library's taxonomy ({@link isResourceLogRefusal}: which refusals a caller
|
|
9
|
+
* must not paper over with a cached copy). The generic taxonomy
|
|
10
|
+
* (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
|
|
11
|
+
* `ResourceLogClosedError`, `LogNotConfirmedError`, and the store port's
|
|
12
|
+
* `ResourceLogConflictError`) is the library's; wallet-core re-exports none
|
|
13
|
+
* of it -- one owner per name. Like every class in that taxonomy, this one
|
|
14
|
+
* assigns its `name` string explicitly and is matched by `err.name` across
|
|
15
|
+
* package boundaries (the WC-64 rule; minified class names do not survive
|
|
16
|
+
* bundling), which is also why the predicate compares names rather than
|
|
17
|
+
* constructors and why this file stays import-free.
|
|
14
18
|
*/
|
|
15
19
|
/**
|
|
16
20
|
* A ladder-signed append outside the ceremony-tail license: it is not the
|
|
@@ -28,4 +32,46 @@ export class ResourceLogLicenseError extends Error {
|
|
|
28
32
|
this.name = 'ResourceLogLicenseError';
|
|
29
33
|
}
|
|
30
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether a resource-log refusal is one a caller must NOT paper over with a
|
|
37
|
+
* cached copy: a fabricated log (`ResourceLogIntegrityError`), or a log that
|
|
38
|
+
* is not the continuation of the pinned history
|
|
39
|
+
* (`ResourceLogContinuityError`) -- EXCEPT continuity reason `rollback`.
|
|
40
|
+
*
|
|
41
|
+
* This is the one implementation of the rollback carve-out ARCHITECTURE.md
|
|
42
|
+
* states once as policy. A rollback is reconcilable divergence, possibly
|
|
43
|
+
* nothing worse than replication lag: the pin is never regressed and nothing
|
|
44
|
+
* rolled back is adopted, so serving the cached copy while a lagging replica
|
|
45
|
+
* catches up is exactly the offline case, and refusing there would lock a
|
|
46
|
+
* healthy account out of its own start. A `fork` or an SCID/method switch is
|
|
47
|
+
* a refusal like fabrication.
|
|
48
|
+
*
|
|
49
|
+
* `ResourceLogLicenseError` is deliberately absent, so a license refusal on a
|
|
50
|
+
* READ lands in the soft transport class (warn, serve cached). Ratified
|
|
51
|
+
* behavior, not omission: the log is not corrupt and the signer genuinely
|
|
52
|
+
* holds the credential, so the append is unlicensed rather than forged. The
|
|
53
|
+
* two shapes that argues against -- a compromised still-listed key holder,
|
|
54
|
+
* and a genuine unlicensed entry N masking a forged entry N+1 under whole-log
|
|
55
|
+
* first-failure semantics -- were weighed and accepted (WC-149). The
|
|
56
|
+
* pre-write half of the license is where the class does its work: a
|
|
57
|
+
* conformant writer is refused before an unlicensed entry can land.
|
|
58
|
+
*
|
|
59
|
+
* Matched on `err.name` rather than `instanceof`: these errors are raised
|
|
60
|
+
* inside app-injected seams that can resolve to a different copy of this
|
|
61
|
+
* package (linked, or duplicated through a dependency tree), and an
|
|
62
|
+
* `instanceof` miss would drop a security refusal into a caller's
|
|
63
|
+
* warn-and-proceed branch. Callers add only the names the generic taxonomy
|
|
64
|
+
* does not carry.
|
|
65
|
+
*
|
|
66
|
+
* @param err {unknown}
|
|
67
|
+
* @returns {boolean}
|
|
68
|
+
*/
|
|
69
|
+
export function isResourceLogRefusal(err) {
|
|
70
|
+
const candidate = err;
|
|
71
|
+
if (candidate?.name === 'ResourceLogIntegrityError') {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return (candidate?.name === 'ResourceLogContinuityError' &&
|
|
75
|
+
candidate.reason !== 'rollback');
|
|
76
|
+
}
|
|
31
77
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,MAAM,SAAS,GAAG,GAAkD,CAAA;IACpE,IAAI,SAAS,EAAE,IAAI,KAAK,2BAA2B,EAAE,CAAC;QACpD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,CACL,SAAS,EAAE,IAAI,KAAK,4BAA4B;QAChD,SAAS,CAAC,MAAM,KAAK,UAAU,CAChC,CAAA;AACH,CAAC"}
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* `@interop/vh-resource-log` -- the did:webvh controller adapter (the
|
|
8
8
|
* library's controller port extended with the per-version
|
|
9
9
|
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
|
-
* hook),
|
|
11
|
-
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`)
|
|
10
|
+
* hook), the ceremony-tail license the hook carries
|
|
11
|
+
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
|
|
12
|
+
* and the import-free account-document leaf both are built on (`document.ts`
|
|
13
|
+
* -- relation resolution, ladder-VM recognition, the credential class),
|
|
14
|
+
* whose public home is `webvh`, which re-exports it.
|
|
12
15
|
* Everything generic -- the JSON Lines codec, the store port and
|
|
13
16
|
* `confirmAppend`, chain verification, the chain-head pin
|
|
14
17
|
* (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
* export: this subpath pulls the did:webvh and ed25519 dependency graph.
|
|
20
23
|
*/
|
|
21
24
|
export { webvhResourceLogController, type ControllerInventory, type WebvhResourceLogController } from './controller.js';
|
|
22
|
-
export { ResourceLogLicenseError } from './errors.js';
|
|
25
|
+
export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
|
|
26
|
+
export { attributeLadderRungsPerVersion, type LadderRungKeys } from './ladderRungs.js';
|
|
23
27
|
export { assertLadderAppendLicensed } from './license.js';
|
|
24
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* `@interop/vh-resource-log` -- the did:webvh controller adapter (the
|
|
8
8
|
* library's controller port extended with the per-version
|
|
9
9
|
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
|
-
* hook),
|
|
11
|
-
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`)
|
|
10
|
+
* hook), the ceremony-tail license the hook carries
|
|
11
|
+
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
|
|
12
|
+
* and the import-free account-document leaf both are built on (`document.ts`
|
|
13
|
+
* -- relation resolution, ladder-VM recognition, the credential class),
|
|
14
|
+
* whose public home is `webvh`, which re-exports it.
|
|
12
15
|
* Everything generic -- the JSON Lines codec, the store port and
|
|
13
16
|
* `confirmAppend`, chain verification, the chain-head pin
|
|
14
17
|
* (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
* export: this subpath pulls the did:webvh and ed25519 dependency graph.
|
|
20
23
|
*/
|
|
21
24
|
export { webvhResourceLogController } from './controller.js';
|
|
22
|
-
export { ResourceLogLicenseError } from './errors.js';
|
|
25
|
+
export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
|
|
26
|
+
export { attributeLadderRungsPerVersion } from './ladderRungs.js';
|
|
23
27
|
export { assertLadderAppendLicensed } from './license.js';
|
|
24
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAE/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DIDLog, DIDLogEntry } from '@interop/did-method-webvh';
|
|
2
|
+
/**
|
|
3
|
+
* The rung keys attributed to each standing ladder VM, keyed by the ladder
|
|
4
|
+
* VM's own `publicKeyMultibase`. A ladder the walk could not attribute
|
|
5
|
+
* carries no entry at all, which is what makes an unattributed ladder refuse.
|
|
6
|
+
*/
|
|
7
|
+
export type LadderRungKeys = Map<string, Set<string>>;
|
|
8
|
+
/**
|
|
9
|
+
* The update-key multibases that signed one log entry: the fragment of each
|
|
10
|
+
* proof's `did:key:<multibase>#<multibase>` verification method.
|
|
11
|
+
*
|
|
12
|
+
* @param entry {DIDLogEntry | undefined}
|
|
13
|
+
* @returns {Set<string>}
|
|
14
|
+
*/
|
|
15
|
+
export declare function entrySignerKeysOf(entry: DIDLogEntry | undefined): Set<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Attributes each standing ladder VM's rung keys, one snapshot per log entry:
|
|
18
|
+
* the returned array is indexed by entry position, and each snapshot names
|
|
19
|
+
* what the log attributes as of that version and no later one. A ladder is
|
|
20
|
+
* anchored at the entry introducing its VM and climbs from there by the
|
|
21
|
+
* last-position rule (the module header states both).
|
|
22
|
+
*
|
|
23
|
+
* A snapshot names a ladder's rungs that the version still authorizes in
|
|
24
|
+
* `updateKeys`, plus any rung that signed the version's own entry -- the one
|
|
25
|
+
* question the ceremony-tail license asks of this map, so a rung retired by
|
|
26
|
+
* the very entry it signed still answers it. A ladder left with no such rung
|
|
27
|
+
* is absent from that snapshot rather than present and empty, as is a ladder
|
|
28
|
+
* the walk refuses, so a caller cannot mistake "no rung attributed" for "this
|
|
29
|
+
* key signed nothing".
|
|
30
|
+
*
|
|
31
|
+
* @param log {DIDLog} a resolved, caller-verified account log
|
|
32
|
+
* @returns {Promise<LadderRungKeys[]>} one snapshot per entry, in log order
|
|
33
|
+
*/
|
|
34
|
+
export declare function attributeLadderRungsPerVersion(log: DIDLog): Promise<LadderRungKeys[]>;
|
|
35
|
+
//# sourceMappingURL=ladderRungs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ladderRungs.d.ts","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAQpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU7E;AAgGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,cAAc,EAAE,CAAC,CA+L3B"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Seedless ladder-rung attribution over a verified account log: which update
|
|
6
|
+
* keys are rungs of which standing ladder, read from the log alone. The
|
|
7
|
+
* ceremony-tail license's third shape needs it -- shape 3 admits a
|
|
8
|
+
* ladder-signed roster append only when the document version it anchors at was
|
|
9
|
+
* itself signed by a rung of the SAME ladder that signs the append, and a
|
|
10
|
+
* reader on the verify side holds no ladder seed to answer that with.
|
|
11
|
+
*
|
|
12
|
+
* The walk is deliberately narrow and fails closed. A ladder is anchored at
|
|
13
|
+
* the entry that introduces its verification method, in the two shapes that
|
|
14
|
+
* entry can take: the ladder-anchored genesis, where the entry authorizes
|
|
15
|
+
* exactly one update key and that key signed it (rung 0 revealed outright);
|
|
16
|
+
* and the bind another signer publishes, where rung 0 arrives as the one hash
|
|
17
|
+
* the entry newly commits, revealed by whichever later entry authorizes its
|
|
18
|
+
* pre-image. Anything else leaves the ladder unattributed, and an
|
|
19
|
+
* unattributed ladder never satisfies shape 3.
|
|
20
|
+
*
|
|
21
|
+
* Which of the two an entry is takes one question first: whose the key it
|
|
22
|
+
* reveals already is. An entry authorizing exactly one self-signing key is
|
|
23
|
+
* the genesis shape only when no ladder already holds that key and the entry
|
|
24
|
+
* publishes no enrolled client. A ladder-branch bind is the counterexample --
|
|
25
|
+
* the ACTING credential's rung reveals itself in the very entry that
|
|
26
|
+
* introduces another credential's ladder VM and commits its rung-0 hash -- so
|
|
27
|
+
* the newcomer anchors on that commitment and the acting ladder climbs onto
|
|
28
|
+
* the rung it just revealed. Reading it the other way would anchor the
|
|
29
|
+
* newcomer on a key it does not hold and hand the acting ladder a shot at a
|
|
30
|
+
* version the newcomer's bind minted. The remembered recovery spend's
|
|
31
|
+
* add-and-retire entry is the enrolled-client counterexample: it introduces
|
|
32
|
+
* the replacement code's ladder VM while the one key it authorizes is the new
|
|
33
|
+
* CLIENT's update key.
|
|
34
|
+
*
|
|
35
|
+
* An anchored ladder then CLIMBS with the log, by the last-position rule of
|
|
36
|
+
* `decisions/0007-ladder-reveal-hash-order.md` read forward. An entry that
|
|
37
|
+
* authorizes exactly one new update key and was signed by that key is a
|
|
38
|
+
* prerotation reveal; when the key's hash was committed LAST among some
|
|
39
|
+
* earlier entry's additions, and that earlier entry itself authorized exactly
|
|
40
|
+
* one key and was signed by it, the committer was committing for itself, so
|
|
41
|
+
* the revealed key is the next rung of the ladder that earlier key belongs
|
|
42
|
+
* to. The step is taken only while the ladder's own VM still stands in the
|
|
43
|
+
* revealing entry's document. Without the climb a self-enrollment would end
|
|
44
|
+
* the attribution outright -- it retires the spent rung, so the ladder would
|
|
45
|
+
* be frozen at a key the account no longer authorizes -- and a passkey
|
|
46
|
+
* account, which self-enrolls by construction, could never satisfy shape 3.
|
|
47
|
+
*
|
|
48
|
+
* Two states stay out of reach on purpose, and both refuse rather than guess.
|
|
49
|
+
* An entry introducing more than one ladder VM names no rung for any of them.
|
|
50
|
+
* And a hash committed anywhere but last is never climbed: an enrollment
|
|
51
|
+
* approval reuses its rung, so its commit entry authorizes no key at all and
|
|
52
|
+
* the client update key its add entry authorizes sits in the commit's first
|
|
53
|
+
* position rather than its last. Under-attributing costs a refused append,
|
|
54
|
+
* which the ceremony surfaces and a retry cannot mend; over-attributing would
|
|
55
|
+
* hand a ladder a shot minted by an enrolled client's own entry, which is the
|
|
56
|
+
* class the license exists to exclude.
|
|
57
|
+
*
|
|
58
|
+
* The parameter carry-forward here is the did:webvh log format's own rule (an
|
|
59
|
+
* entry that omits `updateKeys` or `nextKeyHashes` keeps the previous entry's)
|
|
60
|
+
* read at layer 0, where the `webvh` layer's reader cannot be imported.
|
|
61
|
+
*/
|
|
62
|
+
import { deriveNextKeyHash } from '@interop/did-method-webvh';
|
|
63
|
+
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
64
|
+
import { ladderVmMethods, resolvedRelationMethods } from './document.js';
|
|
65
|
+
/**
|
|
66
|
+
* The update-key multibases that signed one log entry: the fragment of each
|
|
67
|
+
* proof's `did:key:<multibase>#<multibase>` verification method.
|
|
68
|
+
*
|
|
69
|
+
* @param entry {DIDLogEntry | undefined}
|
|
70
|
+
* @returns {Set<string>}
|
|
71
|
+
*/
|
|
72
|
+
export function entrySignerKeysOf(entry) {
|
|
73
|
+
const keys = new Set();
|
|
74
|
+
for (const proof of entry?.proof ?? []) {
|
|
75
|
+
const id = proof.verificationMethod;
|
|
76
|
+
const keyMultibase = id === undefined ? undefined : vmFragmentOf(id);
|
|
77
|
+
if (keyMultibase !== undefined) {
|
|
78
|
+
keys.add(keyMultibase);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return keys;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The ladder VMs' key multibases in one entry's document.
|
|
85
|
+
*
|
|
86
|
+
* @param doc {AccountDocument | undefined}
|
|
87
|
+
* @returns {Set<string>}
|
|
88
|
+
*/
|
|
89
|
+
function ladderKeysOf(doc) {
|
|
90
|
+
const keys = new Set();
|
|
91
|
+
if (!doc) {
|
|
92
|
+
return keys;
|
|
93
|
+
}
|
|
94
|
+
for (const method of ladderVmMethods({ doc })) {
|
|
95
|
+
if (typeof method.publicKeyMultibase === 'string') {
|
|
96
|
+
keys.add(method.publicKeyMultibase);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return keys;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The enrolled clients' signing-key multibases in one entry's document: the
|
|
103
|
+
* `capabilityInvocation` methods, which is what an enrolled client publishes
|
|
104
|
+
* and a ladder VM deliberately does not. Only the SET matters here -- an
|
|
105
|
+
* entry that grows it published a client, and the update key such an entry
|
|
106
|
+
* authorizes is that client's rather than any ladder's rung.
|
|
107
|
+
*
|
|
108
|
+
* @param doc {AccountDocument | undefined}
|
|
109
|
+
* @returns {Set<string>}
|
|
110
|
+
*/
|
|
111
|
+
function enrolledClientKeysOf(doc) {
|
|
112
|
+
const keys = new Set();
|
|
113
|
+
if (!doc) {
|
|
114
|
+
return keys;
|
|
115
|
+
}
|
|
116
|
+
for (const method of resolvedRelationMethods({
|
|
117
|
+
doc,
|
|
118
|
+
relation: 'capabilityInvocation'
|
|
119
|
+
})) {
|
|
120
|
+
if (typeof method.publicKeyMultibase === 'string') {
|
|
121
|
+
keys.add(method.publicKeyMultibase);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return keys;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The ladder a key is already a rung of, or `undefined` when no ladder holds
|
|
128
|
+
* it. Asked of the revealed key before the anchoring branch runs, since a key
|
|
129
|
+
* another ladder owns can anchor nothing.
|
|
130
|
+
*
|
|
131
|
+
* @param options {object}
|
|
132
|
+
* @param options.rungsByLadder {LadderRungKeys}
|
|
133
|
+
* @param options.key {string}
|
|
134
|
+
* @returns {string | undefined}
|
|
135
|
+
*/
|
|
136
|
+
function ownerOfRung({ rungsByLadder, key }) {
|
|
137
|
+
for (const [ladderKey, rungs] of rungsByLadder) {
|
|
138
|
+
if (rungs.has(key)) {
|
|
139
|
+
return ladderKey;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Members of `next` that `previous` does not carry, in order.
|
|
146
|
+
*
|
|
147
|
+
* @param options {object}
|
|
148
|
+
* @param options.next {Iterable<string>}
|
|
149
|
+
* @param options.previous {Set<string>}
|
|
150
|
+
* @returns {string[]}
|
|
151
|
+
*/
|
|
152
|
+
function addedMembers({ next, previous }) {
|
|
153
|
+
const added = [];
|
|
154
|
+
for (const member of next) {
|
|
155
|
+
if (!previous.has(member) && !added.includes(member)) {
|
|
156
|
+
added.push(member);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return added;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Attributes each standing ladder VM's rung keys, one snapshot per log entry:
|
|
163
|
+
* the returned array is indexed by entry position, and each snapshot names
|
|
164
|
+
* what the log attributes as of that version and no later one. A ladder is
|
|
165
|
+
* anchored at the entry introducing its VM and climbs from there by the
|
|
166
|
+
* last-position rule (the module header states both).
|
|
167
|
+
*
|
|
168
|
+
* A snapshot names a ladder's rungs that the version still authorizes in
|
|
169
|
+
* `updateKeys`, plus any rung that signed the version's own entry -- the one
|
|
170
|
+
* question the ceremony-tail license asks of this map, so a rung retired by
|
|
171
|
+
* the very entry it signed still answers it. A ladder left with no such rung
|
|
172
|
+
* is absent from that snapshot rather than present and empty, as is a ladder
|
|
173
|
+
* the walk refuses, so a caller cannot mistake "no rung attributed" for "this
|
|
174
|
+
* key signed nothing".
|
|
175
|
+
*
|
|
176
|
+
* @param log {DIDLog} a resolved, caller-verified account log
|
|
177
|
+
* @returns {Promise<LadderRungKeys[]>} one snapshot per entry, in log order
|
|
178
|
+
*/
|
|
179
|
+
export async function attributeLadderRungsPerVersion(log) {
|
|
180
|
+
const snapshots = [];
|
|
181
|
+
const rungsByLadder = new Map();
|
|
182
|
+
// A rung-0 hash a bind entry committed, awaiting the entry that authorizes
|
|
183
|
+
// its pre-image. One owner per hash: a second claimant retires the claim,
|
|
184
|
+
// since neither ladder can then be told from the other.
|
|
185
|
+
const claims = new Map();
|
|
186
|
+
// Ladder VMs the walk refused, so a later snapshot cannot resurrect one.
|
|
187
|
+
const refused = new Set();
|
|
188
|
+
// A hash an entry committed LAST among its additions, mapped to the ladder
|
|
189
|
+
// whose rung both authorized and signed that entry: the pre-image, when a
|
|
190
|
+
// later entry reveals it, is that ladder's next rung. Spent on sight.
|
|
191
|
+
const climbs = new Map();
|
|
192
|
+
let previousLadderKeys = new Set();
|
|
193
|
+
let previousClientKeys = new Set();
|
|
194
|
+
let previousUpdateKeys = new Set();
|
|
195
|
+
let previousNextKeyHashes = new Set();
|
|
196
|
+
let updateKeys = [];
|
|
197
|
+
let nextKeyHashes = [];
|
|
198
|
+
for (const entry of log) {
|
|
199
|
+
if (entry.parameters?.updateKeys) {
|
|
200
|
+
updateKeys = entry.parameters.updateKeys;
|
|
201
|
+
}
|
|
202
|
+
if (entry.parameters?.nextKeyHashes) {
|
|
203
|
+
nextKeyHashes = entry.parameters.nextKeyHashes;
|
|
204
|
+
}
|
|
205
|
+
const doc = entry.state;
|
|
206
|
+
const ladderKeys = ladderKeysOf(doc);
|
|
207
|
+
const introduced = addedMembers({
|
|
208
|
+
next: ladderKeys,
|
|
209
|
+
previous: previousLadderKeys
|
|
210
|
+
});
|
|
211
|
+
const addedKeys = addedMembers({
|
|
212
|
+
next: updateKeys,
|
|
213
|
+
previous: previousUpdateKeys
|
|
214
|
+
});
|
|
215
|
+
const addedHashes = addedMembers({
|
|
216
|
+
next: nextKeyHashes,
|
|
217
|
+
previous: previousNextKeyHashes
|
|
218
|
+
});
|
|
219
|
+
const signers = entrySignerKeysOf(entry);
|
|
220
|
+
// A committed rung-0 hash whose pre-image this entry authorizes: the bind
|
|
221
|
+
// shape's second half. The claim is spent whether or not it names a
|
|
222
|
+
// ladder, so a retired claim can never be picked up later.
|
|
223
|
+
for (const key of addedKeys) {
|
|
224
|
+
const hash = await deriveNextKeyHash(key);
|
|
225
|
+
if (!claims.has(hash)) {
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
const owner = claims.get(hash);
|
|
229
|
+
claims.delete(hash);
|
|
230
|
+
if (owner !== null && owner !== undefined && !refused.has(owner)) {
|
|
231
|
+
rungsByLadder.set(owner, (rungsByLadder.get(owner) ?? new Set()).add(key));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// The CLIMB: this entry authorizes exactly one new key and that key
|
|
235
|
+
// signed it (a prerotation reveal), and an earlier entry committed the
|
|
236
|
+
// key's hash in last position under a rung of a known ladder. The
|
|
237
|
+
// candidate is spent whether or not the guard below admits it, so a
|
|
238
|
+
// released hash can never be climbed later.
|
|
239
|
+
const revealedRung = addedKeys.length === 1 ? addedKeys[0] : undefined;
|
|
240
|
+
if (revealedRung !== undefined && signers.has(revealedRung)) {
|
|
241
|
+
const hash = await deriveNextKeyHash(revealedRung);
|
|
242
|
+
const owner = climbs.get(hash);
|
|
243
|
+
climbs.delete(hash);
|
|
244
|
+
// The ladder's own VM must still stand in THIS entry's document. That
|
|
245
|
+
// is what keeps a recovery spend out: the spent credential's
|
|
246
|
+
// reveal-and-commit entry commits the REPLACEMENT credential's hash
|
|
247
|
+
// last, and the entry revealing that hash is the one that strikes the
|
|
248
|
+
// spent credential's ladder VM.
|
|
249
|
+
if (owner !== undefined &&
|
|
250
|
+
!refused.has(owner) &&
|
|
251
|
+
ladderKeys.has(owner) &&
|
|
252
|
+
rungsByLadder.has(owner)) {
|
|
253
|
+
rungsByLadder.set(owner, (rungsByLadder.get(owner) ?? new Set()).add(revealedRung));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// WHOSE the revealed key already is, resolved BEFORE the anchoring
|
|
257
|
+
// branch: the claim resolution and the climb above have just credited it
|
|
258
|
+
// where it belongs, so a hit here names a ladder that already holds it.
|
|
259
|
+
// A ladder-branch bind entry is the shape this orders: the ACTING
|
|
260
|
+
// credential's rung reveals itself in the very entry that introduces
|
|
261
|
+
// another credential's ladder VM, and reading that rung as the newcomer's
|
|
262
|
+
// rung 0 would anchor the newcomer on a key it does not hold AND credit
|
|
263
|
+
// the acting ladder with the newcomer's rung-0 commitment below.
|
|
264
|
+
const revealedOwner = revealedRung === undefined
|
|
265
|
+
? undefined
|
|
266
|
+
: ownerOfRung({ rungsByLadder, key: revealedRung });
|
|
267
|
+
// Whether this entry also published an enrolled client. The one key such
|
|
268
|
+
// an entry authorizes is that client's update key (the remembered
|
|
269
|
+
// recovery spend's add-and-retire entry, which introduces the replacement
|
|
270
|
+
// code's ladder VM beside the new client), so it anchors no ladder.
|
|
271
|
+
const introducedClients = addedMembers({
|
|
272
|
+
next: enrolledClientKeysOf(doc),
|
|
273
|
+
previous: previousClientKeys
|
|
274
|
+
});
|
|
275
|
+
// The introduction, the one place a ladder is anchored. A VM introduced
|
|
276
|
+
// beside another names no rung for either.
|
|
277
|
+
let claimedHere;
|
|
278
|
+
if (introduced.length > 1) {
|
|
279
|
+
for (const ladderKey of introduced) {
|
|
280
|
+
refused.add(ladderKey);
|
|
281
|
+
rungsByLadder.delete(ladderKey);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else if (introduced.length === 1) {
|
|
285
|
+
const ladderKey = introduced[0];
|
|
286
|
+
refused.delete(ladderKey);
|
|
287
|
+
rungsByLadder.delete(ladderKey);
|
|
288
|
+
const revealed = addedKeys[0];
|
|
289
|
+
// Rung 0 revealed outright, the ladder-anchored genesis shape: one key
|
|
290
|
+
// authorized, signing its own entry, owned by no other ladder and not a
|
|
291
|
+
// client's.
|
|
292
|
+
const revealsOwnRungZero = addedKeys.length === 1 &&
|
|
293
|
+
revealed !== undefined &&
|
|
294
|
+
signers.has(revealed) &&
|
|
295
|
+
revealedOwner === undefined &&
|
|
296
|
+
introducedClients.length === 0;
|
|
297
|
+
// The commitment arm: the bind another signer publishes, where rung 0
|
|
298
|
+
// arrives as a commitment and is picked up when a later entry reveals
|
|
299
|
+
// its pre-image. It covers the bind an enrolled client signs (which
|
|
300
|
+
// authorizes no key of its own) and the ladder-branch bind another
|
|
301
|
+
// credential's rung signs (which authorizes that rung and nothing
|
|
302
|
+
// else), both of which commit exactly the newcomer's rung-0 hash.
|
|
303
|
+
const commitsRungZero = addedHashes.length === 1 &&
|
|
304
|
+
(addedKeys.length === 0 || revealedOwner !== undefined);
|
|
305
|
+
if (revealsOwnRungZero) {
|
|
306
|
+
rungsByLadder.set(ladderKey, new Set([revealed]));
|
|
307
|
+
}
|
|
308
|
+
else if (commitsRungZero) {
|
|
309
|
+
const hash = addedHashes[0];
|
|
310
|
+
// A hash two binds commit is nobody's: retire the claim outright.
|
|
311
|
+
claims.set(hash, claims.has(hash) ? null : ladderKey);
|
|
312
|
+
claimedHere = hash;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
refused.add(ladderKey);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
// What this entry committed for ITSELF: the last of its newly committed
|
|
319
|
+
// hashes, recorded against the ladder whose rung authorized and signed
|
|
320
|
+
// the entry. Recorded after the introduction branch, so a ladder-anchored
|
|
321
|
+
// genesis stages its own rung 1. An entry that reuses its rung authorizes
|
|
322
|
+
// no key of its own and so records nothing, and a hash the introduction
|
|
323
|
+
// above claimed for the ladder this entry BINDS is that ladder's rung 0
|
|
324
|
+
// rather than the signer's next rung.
|
|
325
|
+
const committedLast = addedHashes[addedHashes.length - 1];
|
|
326
|
+
const signingLadder = revealedRung === undefined
|
|
327
|
+
? undefined
|
|
328
|
+
: ownerOfRung({ rungsByLadder, key: revealedRung });
|
|
329
|
+
if (revealedRung !== undefined &&
|
|
330
|
+
signers.has(revealedRung) &&
|
|
331
|
+
signingLadder !== undefined &&
|
|
332
|
+
committedLast !== undefined &&
|
|
333
|
+
committedLast !== claimedHere) {
|
|
334
|
+
climbs.set(committedLast, signingLadder);
|
|
335
|
+
}
|
|
336
|
+
const authorized = new Set(updateKeys);
|
|
337
|
+
const snapshot = new Map();
|
|
338
|
+
for (const [ladderKey, rungs] of rungsByLadder) {
|
|
339
|
+
const standing = [...rungs].filter(rung => authorized.has(rung) || signers.has(rung));
|
|
340
|
+
if (standing.length > 0) {
|
|
341
|
+
snapshot.set(ladderKey, new Set(standing));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
snapshots.push(snapshot);
|
|
345
|
+
previousLadderKeys = ladderKeys;
|
|
346
|
+
previousClientKeys = enrolledClientKeysOf(doc);
|
|
347
|
+
previousUpdateKeys = new Set(updateKeys);
|
|
348
|
+
previousNextKeyHashes = new Set(nextKeyHashes);
|
|
349
|
+
}
|
|
350
|
+
return snapshots;
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=ladderRungs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ladderRungs.js","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,eAAe,EACf,uBAAuB,EAExB,MAAM,eAAe,CAAA;AAStB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA8B;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACnC,MAAM,YAAY,GAAG,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACpE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAA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