@interop/wallet-core 0.62.0 → 0.65.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 +55 -34
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +102 -56
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +16 -2
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +11 -9
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +62 -18
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +92 -26
- 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 +7 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +38 -5
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +346 -236
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +21 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +24 -5
- 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 +222 -33
- 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 +162 -43
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +423 -192
- 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 +26 -12
- 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 +10 -6
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +9 -5
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +12 -11
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +15 -13
- 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/userKeyRoster.d.ts +57 -7
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +222 -17
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +7 -6
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +7 -6
- 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 +12 -8
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +11 -7
- 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.map +1 -1
- package/dist/recovery/recoveryDelegation.js +21 -34
- 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/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
package/dist/sync/types.d.ts
CHANGED
|
@@ -8,7 +8,18 @@
|
|
|
8
8
|
* `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
|
|
9
9
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
10
10
|
* `@interop/was-client/sync` and are re-exported here so a single import gives
|
|
11
|
-
* a consumer both the wire types and the replica-side seams.
|
|
11
|
+
* a consumer both the wire types and the replica-side seams. Beside the three
|
|
12
|
+
* signal classes sit the three predicates that CLASSIFY them
|
|
13
|
+
* ({@link isSyncConflictError}, {@link isSyncNotFoundError},
|
|
14
|
+
* {@link isUnknownEpochError}): each is raised inside an app-injected seam --
|
|
15
|
+
* the port for the two wire signals, the caller's `DocCipher` for the third --
|
|
16
|
+
* which can resolve to a second copy of `@interop/was-client` (a `link:` dev
|
|
17
|
+
* setup, a dedupe miss through a dependency tree), so they are matched on
|
|
18
|
+
* `err.name` and never with `instanceof`. The same rule the resource-log
|
|
19
|
+
* refusal classes follow, and for the same reason: an `instanceof` miss here
|
|
20
|
+
* turns every push 412 into a fatal cycle error and makes the create-loss
|
|
21
|
+
* re-mint rethrow instead of re-minting. Every one of the three classes
|
|
22
|
+
* assigns its `name` explicitly, which is what makes the string a contract.
|
|
12
23
|
*
|
|
13
24
|
* The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
|
|
14
25
|
* `ResolveConflict`) is the replica's side of the contract: it stands in for a
|
|
@@ -24,6 +35,35 @@
|
|
|
24
35
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
25
36
|
export type { Json, SyncCheckpoint, WireDoc, MasterState, WasSyncPort, DocCipher } from '@interop/was-client/sync';
|
|
26
37
|
import type { Json, MasterState, SyncCheckpoint, WireDoc } from '@interop/was-client/sync';
|
|
38
|
+
/**
|
|
39
|
+
* Whether an error is the replication port's rejected-conditional-write signal
|
|
40
|
+
* (`WasSyncConflictError`, HTTP 412): a lost-update `If-Match` mismatch, or a
|
|
41
|
+
* create-if-absent whose target already exists. The push loop's one settle-and-
|
|
42
|
+
* reconcile branch; everything else propagates to the engine's backoff.
|
|
43
|
+
*
|
|
44
|
+
* @param err {unknown}
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
export declare function isSyncConflictError(err: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether an error is the replication port's absent-target signal
|
|
50
|
+
* (`WasSyncNotFoundError`, HTTP 404). On a delete that is a settled outcome
|
|
51
|
+
* -- already gone, or the write never reached the server -- not a conflict.
|
|
52
|
+
*
|
|
53
|
+
* @param err {unknown}
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
export declare function isSyncNotFoundError(err: unknown): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether an error is the cipher's unknown-epoch signal (`UnknownEpochError`):
|
|
59
|
+
* an envelope naming recipient key ids whose epoch the descriptor this reader
|
|
60
|
+
* holds does not list at all. Distinct from a key the reader simply does not
|
|
61
|
+
* have (`KeyUnwrapError`), which re-reading the descriptor cannot fix.
|
|
62
|
+
*
|
|
63
|
+
* @param err {unknown}
|
|
64
|
+
* @returns {boolean}
|
|
65
|
+
*/
|
|
66
|
+
export declare function isUnknownEpochError(err: unknown): boolean;
|
|
27
67
|
/**
|
|
28
68
|
* A dirty local synced-docs row awaiting push. `data` is the stored body (the
|
|
29
69
|
* EDV envelope on an encrypted collection, or the plaintext JSON on a plaintext
|
package/dist/sync/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EACV,IAAI,EACJ,WAAW,EACX,cAAc,EACd,OAAO,EACR,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IAC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AAE;QACzB,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;QAC1B,UAAU,EAAE,gBAAgB,CAAA;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE;QACvB,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,IAAI,CAAA;QACd,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAClC"}
|
package/dist/sync/types.js
CHANGED
|
@@ -8,7 +8,18 @@
|
|
|
8
8
|
* `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
|
|
9
9
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
10
10
|
* `@interop/was-client/sync` and are re-exported here so a single import gives
|
|
11
|
-
* a consumer both the wire types and the replica-side seams.
|
|
11
|
+
* a consumer both the wire types and the replica-side seams. Beside the three
|
|
12
|
+
* signal classes sit the three predicates that CLASSIFY them
|
|
13
|
+
* ({@link isSyncConflictError}, {@link isSyncNotFoundError},
|
|
14
|
+
* {@link isUnknownEpochError}): each is raised inside an app-injected seam --
|
|
15
|
+
* the port for the two wire signals, the caller's `DocCipher` for the third --
|
|
16
|
+
* which can resolve to a second copy of `@interop/was-client` (a `link:` dev
|
|
17
|
+
* setup, a dedupe miss through a dependency tree), so they are matched on
|
|
18
|
+
* `err.name` and never with `instanceof`. The same rule the resource-log
|
|
19
|
+
* refusal classes follow, and for the same reason: an `instanceof` miss here
|
|
20
|
+
* turns every push 412 into a fatal cycle error and makes the create-loss
|
|
21
|
+
* re-mint rethrow instead of re-minting. Every one of the three classes
|
|
22
|
+
* assigns its `name` explicitly, which is what makes the string a contract.
|
|
12
23
|
*
|
|
13
24
|
* The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
|
|
14
25
|
* `ResolveConflict`) is the replica's side of the contract: it stands in for a
|
|
@@ -22,4 +33,39 @@
|
|
|
22
33
|
* Native, against a fake port and an in-memory store.
|
|
23
34
|
*/
|
|
24
35
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
36
|
+
/**
|
|
37
|
+
* Whether an error is the replication port's rejected-conditional-write signal
|
|
38
|
+
* (`WasSyncConflictError`, HTTP 412): a lost-update `If-Match` mismatch, or a
|
|
39
|
+
* create-if-absent whose target already exists. The push loop's one settle-and-
|
|
40
|
+
* reconcile branch; everything else propagates to the engine's backoff.
|
|
41
|
+
*
|
|
42
|
+
* @param err {unknown}
|
|
43
|
+
* @returns {boolean}
|
|
44
|
+
*/
|
|
45
|
+
export function isSyncConflictError(err) {
|
|
46
|
+
return err?.name === 'WasSyncConflictError';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether an error is the replication port's absent-target signal
|
|
50
|
+
* (`WasSyncNotFoundError`, HTTP 404). On a delete that is a settled outcome
|
|
51
|
+
* -- already gone, or the write never reached the server -- not a conflict.
|
|
52
|
+
*
|
|
53
|
+
* @param err {unknown}
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
export function isSyncNotFoundError(err) {
|
|
57
|
+
return err?.name === 'WasSyncNotFoundError';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether an error is the cipher's unknown-epoch signal (`UnknownEpochError`):
|
|
61
|
+
* an envelope naming recipient key ids whose epoch the descriptor this reader
|
|
62
|
+
* holds does not list at all. Distinct from a key the reader simply does not
|
|
63
|
+
* have (`KeyUnwrapError`), which re-reading the descriptor cannot fix.
|
|
64
|
+
*
|
|
65
|
+
* @param err {unknown}
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
export function isUnknownEpochError(err) {
|
|
69
|
+
return err?.name === 'UnknownEpochError';
|
|
70
|
+
}
|
|
25
71
|
//# sourceMappingURL=types.js.map
|
package/dist/sync/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAiBjC;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,sBAAsB,CAAA;AAC5E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,sBAAsB,CAAA;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,mBAAmB,CAAA;AACzE,CAAC"}
|
package/dist/unlock/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
23
|
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
|
+
* It refuses (`UnclaimedLadderVmRetirementError`) when the ladder
|
|
26
|
+
* attribution cannot claim the retired credential's ladder VM;
|
|
27
|
+
* `preflightUnlockCredentialRetirement` runs that gate read-only, before a
|
|
28
|
+
* caller establishes anything.
|
|
25
29
|
*
|
|
26
30
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
31
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
@@ -35,7 +39,7 @@ export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentit
|
|
|
35
39
|
export type { StandingUnlockClient, UnlockClientIdentity } from './standingClient.js';
|
|
36
40
|
export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
|
|
37
41
|
export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, UnlockRecordProofState } from './unlockRecord.js';
|
|
38
|
-
export { LadderInventoryDriftError, publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
42
|
+
export { assertLadderVmClaimed, LadderInventoryDriftError, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
39
43
|
export type { LadderVmRemovalReport, StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
|
|
40
44
|
export { retireUnlockCredential } from './retire.js';
|
|
41
45
|
export type { ClientAnnexInventoryRetirement, UnlockCredentialRetirementResult } from './retire.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
|
package/dist/unlock/index.js
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
23
|
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
|
+
* It refuses (`UnclaimedLadderVmRetirementError`) when the ladder
|
|
26
|
+
* attribution cannot claim the retired credential's ladder VM;
|
|
27
|
+
* `preflightUnlockCredentialRetirement` runs that gate read-only, before a
|
|
28
|
+
* caller establishes anything.
|
|
25
29
|
*
|
|
26
30
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
31
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
@@ -33,6 +37,6 @@
|
|
|
33
37
|
*/
|
|
34
38
|
export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
|
|
35
39
|
export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
|
|
36
|
-
export { LadderInventoryDriftError, publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
40
|
+
export { assertLadderVmClaimed, LadderInventoryDriftError, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
37
41
|
export { retireUnlockCredential } from './retire.js';
|
|
38
42
|
//# sourceMappingURL=index.js.map
|
package/dist/unlock/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAQ3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/unlock/retire.d.ts
CHANGED
|
@@ -71,6 +71,21 @@
|
|
|
71
71
|
* skip, so the roster rotation -- the ceremony's essential remedy -- always
|
|
72
72
|
* runs.
|
|
73
73
|
*
|
|
74
|
+
* Both stages carry the retirement gate (`decisions/0015`): a credential
|
|
75
|
+
* retired here carries a ladder, so its ladder VM must be claimed -- by the
|
|
76
|
+
* seed, or by the log's attribution -- before the edit strikes anything. A
|
|
77
|
+
* claim that strikes nothing while ladder VMs stand unclaimed refuses with
|
|
78
|
+
* `UnclaimedLadderVmRetirementError`, at stage 0 before the re-mint pass
|
|
79
|
+
* writes a sibling record and again inside the edit before its entry
|
|
80
|
+
* publishes, so the credential still stands and the log is unchanged. The
|
|
81
|
+
* leftover the gate closes is a retired credential's VM standing under
|
|
82
|
+
* `capabilityDelegation`, which could still sign a DELETE-only capability on
|
|
83
|
+
* the account Space. Callers that establish a replacement before retiring
|
|
84
|
+
* run `preflightUnlockCredentialRetirement` first, so the refusal lands
|
|
85
|
+
* before establishment rather than in a torn state. The recovery-code
|
|
86
|
+
* removal shares the edit but not the gate: a code carries no ladder VM to
|
|
87
|
+
* claim.
|
|
88
|
+
*
|
|
74
89
|
* Stage 0 and stage 1 each read the log for themselves, and the two reads are
|
|
75
90
|
* tied by a cross-check rather than by luck: stage 0 hands its attributed
|
|
76
91
|
* ladder VM ids to the edit as `expectedLadderVmIds`, and the edit refuses
|
|
@@ -96,7 +111,8 @@ import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
|
96
111
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
97
112
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
98
113
|
import { type CascadeCollections, type RosterSealReport, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
99
|
-
import type {
|
|
114
|
+
import type { WebvhIdStore } from '../webvh/index.js';
|
|
115
|
+
import type { AccountLogSigner } from '../webvh/accountEntry.js';
|
|
100
116
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
101
117
|
import { type LadderVmRemovalReport, type StandingUnlockKeys } from './standingWebvh.js';
|
|
102
118
|
/**
|
|
@@ -143,15 +159,23 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
143
159
|
*
|
|
144
160
|
* @param options {object}
|
|
145
161
|
* @param options.idStore {WebvhIdStore} the account's `id` collection store
|
|
146
|
-
* @param options.
|
|
147
|
-
* client's own did:webvh update-key seeds,
|
|
162
|
+
* @param options.signer {AccountLogSigner} who signs the inventory edit:
|
|
163
|
+
* the retiring enrolled client's own did:webvh update-key seeds, or the
|
|
164
|
+
* ACTING (surviving or successor) credential's ladder seed
|
|
148
165
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
149
166
|
* public inventory (its key-agreement publication and its recorded update
|
|
150
167
|
* key, which the inventory edit treats as a ladder anchor rather than truth
|
|
151
168
|
* -- see `removeUnlockKey`)
|
|
152
169
|
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
153
170
|
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
154
|
-
* ladder attribution
|
|
171
|
+
* ladder attribution, and it is what a retry supplies after a seedless run
|
|
172
|
+
* refused with `UnclaimedLadderVmRetirementError`
|
|
173
|
+
* @param [options.projectionStore] {object} an `id`-collection store the
|
|
174
|
+
* caller may write through, passed straight to the inventory edit: the
|
|
175
|
+
* post-strike `did:web` projection is PUT through it immediately before
|
|
176
|
+
* that entry publishes, so a ladder-signed retirement does not leave
|
|
177
|
+
* `did.json` naming the retired credential. Best-effort, and omitted the
|
|
178
|
+
* behavior is unchanged (see `removeUnlockKey`)
|
|
155
179
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
156
180
|
* stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
|
|
157
181
|
* resolving to any other account
|
|
@@ -181,7 +205,10 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
181
205
|
* re-mint (stage 0), run against the PRE-edit document with the ladder VM
|
|
182
206
|
* ids this retirement is about to strike. Fail-closed: a throw aborts the
|
|
183
207
|
* retirement before the document edit. Absent, the stage is skipped and no
|
|
184
|
-
* log read happens for it (the no-WAS path)
|
|
208
|
+
* log read happens for it (the no-WAS path). It is also skipped on the
|
|
209
|
+
* ladder arm: every unlock record is signed by its own credential's ladder
|
|
210
|
+
* VM, so this strike rots no sibling record, and there is nothing to
|
|
211
|
+
* re-mint (`decisions/0019`)
|
|
185
212
|
* @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
|
|
186
213
|
* Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
|
|
187
214
|
* the module doc), run against the post-edit document; a throw is caught
|
|
@@ -191,11 +218,12 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
191
218
|
* the session keeps operating without a re-login
|
|
192
219
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
193
220
|
*/
|
|
194
|
-
export declare function retireUnlockCredential({ idStore,
|
|
221
|
+
export declare function retireUnlockCredential({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }: {
|
|
195
222
|
idStore: WebvhIdStore;
|
|
196
|
-
|
|
223
|
+
signer: AccountLogSigner;
|
|
197
224
|
unlockKeys: StandingUnlockKeys;
|
|
198
225
|
ladderSeed?: Uint8Array;
|
|
226
|
+
projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
199
227
|
expectedDid?: string;
|
|
200
228
|
pinStore?: ResourceLogPinStore;
|
|
201
229
|
logId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,EAML,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,8BAA8B,CAAA;IAC5C,gBAAgB,CAAC,EAAE,OA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C,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE;QACjC,QAAQ,EAAE,MAAM,CAAA;QAChB,qBAAqB,EAAE,MAAM,EAAE,CAAA;KAChC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACtB,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE;QACrC,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAC7C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAoI5C"}
|
package/dist/unlock/retire.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { readPublishedLogOrThrow } from '../webvh/didWebvh.js';
|
|
3
|
+
import { assertLadderVmClaimed, attributeUnlockLadderInventory, ladderVmClaimOf, removeUnlockKey, unlockKeyVmId } from './standingWebvh.js';
|
|
3
4
|
/**
|
|
4
5
|
* Retires one standing unlock credential from an account. See the module doc
|
|
5
6
|
* for the order and the convergence story. Once the inventory edit lands, a
|
|
@@ -8,15 +9,23 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
|
|
|
8
9
|
*
|
|
9
10
|
* @param options {object}
|
|
10
11
|
* @param options.idStore {WebvhIdStore} the account's `id` collection store
|
|
11
|
-
* @param options.
|
|
12
|
-
* client's own did:webvh update-key seeds,
|
|
12
|
+
* @param options.signer {AccountLogSigner} who signs the inventory edit:
|
|
13
|
+
* the retiring enrolled client's own did:webvh update-key seeds, or the
|
|
14
|
+
* ACTING (surviving or successor) credential's ladder seed
|
|
13
15
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
14
16
|
* public inventory (its key-agreement publication and its recorded update
|
|
15
17
|
* key, which the inventory edit treats as a ladder anchor rather than truth
|
|
16
18
|
* -- see `removeUnlockKey`)
|
|
17
19
|
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
18
20
|
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
19
|
-
* ladder attribution
|
|
21
|
+
* ladder attribution, and it is what a retry supplies after a seedless run
|
|
22
|
+
* refused with `UnclaimedLadderVmRetirementError`
|
|
23
|
+
* @param [options.projectionStore] {object} an `id`-collection store the
|
|
24
|
+
* caller may write through, passed straight to the inventory edit: the
|
|
25
|
+
* post-strike `did:web` projection is PUT through it immediately before
|
|
26
|
+
* that entry publishes, so a ladder-signed retirement does not leave
|
|
27
|
+
* `did.json` naming the retired credential. Best-effort, and omitted the
|
|
28
|
+
* behavior is unchanged (see `removeUnlockKey`)
|
|
20
29
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
21
30
|
* stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
|
|
22
31
|
* resolving to any other account
|
|
@@ -46,7 +55,10 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
|
|
|
46
55
|
* re-mint (stage 0), run against the PRE-edit document with the ladder VM
|
|
47
56
|
* ids this retirement is about to strike. Fail-closed: a throw aborts the
|
|
48
57
|
* retirement before the document edit. Absent, the stage is skipped and no
|
|
49
|
-
* log read happens for it (the no-WAS path)
|
|
58
|
+
* log read happens for it (the no-WAS path). It is also skipped on the
|
|
59
|
+
* ladder arm: every unlock record is signed by its own credential's ladder
|
|
60
|
+
* VM, so this strike rots no sibling record, and there is nothing to
|
|
61
|
+
* re-mint (`decisions/0019`)
|
|
50
62
|
* @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
|
|
51
63
|
* Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
|
|
52
64
|
* the module doc), run against the post-edit document; a throw is caught
|
|
@@ -56,7 +68,7 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
|
|
|
56
68
|
* the session keeps operating without a re-login
|
|
57
69
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
58
70
|
*/
|
|
59
|
-
export async function retireUnlockCredential({ idStore,
|
|
71
|
+
export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }) {
|
|
60
72
|
// 0. The dependent-record re-mint, against the PRE-edit document: whatever
|
|
61
73
|
// the doomed ladder VM signed for OTHER credentials is re-signed under a
|
|
62
74
|
// key that outlives the edit. The pass is named the VM ids the attribution
|
|
@@ -70,11 +82,17 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
70
82
|
};
|
|
71
83
|
let dependentRecords;
|
|
72
84
|
let expectedLadderVmIds;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
// The stage is the enrolled branch's alone. On the ladder arm a record's
|
|
86
|
+
// bridge and sibling are signed by its own credential's ladder VM, so this
|
|
87
|
+
// strike reaches no record but the retired credential's own, which the
|
|
88
|
+
// caller deletes with its unlock Space (`decisions/0019`).
|
|
89
|
+
const ranRemint = Boolean(remintDependentRecords) && signer.kind === 'client';
|
|
90
|
+
if (ranRemint && remintDependentRecords) {
|
|
91
|
+
const published = await readPublishedLogOrThrow({
|
|
92
|
+
idStore,
|
|
76
93
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
77
|
-
...pinned
|
|
94
|
+
...pinned,
|
|
95
|
+
missingMessage: 'did:webvh: did.jsonl is missing; nothing to enroll into.'
|
|
78
96
|
});
|
|
79
97
|
const inventory = await attributeUnlockLadderInventory({
|
|
80
98
|
log: published.log,
|
|
@@ -82,6 +100,24 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
82
100
|
unlockKeys,
|
|
83
101
|
...(ladderSeed ? { ladderSeed } : {})
|
|
84
102
|
});
|
|
103
|
+
// The gate, before the pass writes anything: a claim that strikes no
|
|
104
|
+
// ladder VM while VMs stand unclaimed refuses here, with the credential
|
|
105
|
+
// still standing and no sibling record touched.
|
|
106
|
+
await assertLadderVmClaimed({
|
|
107
|
+
log: published.log,
|
|
108
|
+
doc: published.doc,
|
|
109
|
+
credentialVmId: unlockKeyVmId({
|
|
110
|
+
did: published.did,
|
|
111
|
+
keyAgreement: unlockKeys.keyAgreement
|
|
112
|
+
}),
|
|
113
|
+
claim: await ladderVmClaimOf({
|
|
114
|
+
doc: published.doc,
|
|
115
|
+
did: published.did,
|
|
116
|
+
inventory,
|
|
117
|
+
...(ladderSeed ? { ladderSeed } : {})
|
|
118
|
+
}),
|
|
119
|
+
anchorKeyMultibase: unlockKeys.updateKeyMultibase
|
|
120
|
+
});
|
|
85
121
|
// What the edit's own attribution must resolve to: the pass below acts on
|
|
86
122
|
// this list, so an edit that resolved a different one would strike
|
|
87
123
|
// something the pass never covered.
|
|
@@ -96,10 +132,12 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
96
132
|
// its remaining recipients from.
|
|
97
133
|
const { did, doc, log, ladderVm } = await removeUnlockKey({
|
|
98
134
|
idStore,
|
|
99
|
-
|
|
135
|
+
signer,
|
|
100
136
|
unlockKeys,
|
|
101
137
|
...(ladderSeed ? { ladderSeed } : {}),
|
|
138
|
+
...(projectionStore ? { projectionStore } : {}),
|
|
102
139
|
...(expectedLadderVmIds !== undefined ? { expectedLadderVmIds } : {}),
|
|
140
|
+
requireLadderVmClaim: true,
|
|
103
141
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
104
142
|
...pinned,
|
|
105
143
|
...(verb !== undefined ? { verb } : {})
|
|
@@ -119,7 +157,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
119
157
|
}
|
|
120
158
|
}
|
|
121
159
|
// 2. The shared roster-and-cascade tail: the roster rotation onto the
|
|
122
|
-
// post-edit document (with its post-edit controller
|
|
160
|
+
// post-edit document (with its post-edit minimum controller version and its seal
|
|
123
161
|
// backstop), then the collection fan-out onto the fresh key.
|
|
124
162
|
const tail = await rotateRosterToDocumentAndCascade({
|
|
125
163
|
rosterStore,
|
|
@@ -141,7 +179,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
141
179
|
collections: tail.collections,
|
|
142
180
|
document: doc,
|
|
143
181
|
...(clientAnnex ? { clientAnnex } : {}),
|
|
144
|
-
...(
|
|
182
|
+
...(ranRemint ? { dependentRecords } : {})
|
|
145
183
|
};
|
|
146
184
|
}
|
|
147
185
|
if (tail.rotated) {
|
|
@@ -156,7 +194,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
156
194
|
userKey: tail.userKey,
|
|
157
195
|
rosterDescriptor: tail.rosterDescriptor,
|
|
158
196
|
...(clientAnnex ? { clientAnnex } : {}),
|
|
159
|
-
...(
|
|
197
|
+
...(ranRemint ? { dependentRecords } : {})
|
|
160
198
|
};
|
|
161
199
|
}
|
|
162
200
|
//# sourceMappingURL=retire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAgHA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,eAAe,EACf,aAAa,EAGd,MAAM,oBAAoB,CAAA;AAwC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,MAAM,CAAC,KAAK,U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WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,GAAG;YACb,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3C,CAAA;IACH,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ;QACR,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3C,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingClient.d.ts","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standingClient.d.ts","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,yCAAyC,CAAA;AAI1E;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmBhC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,aAAa,EAAE,UAAU,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkBhC"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { hkdf } from '@noble/hashes/hkdf.js';
|
|
24
24
|
import { sha256 } from '@noble/hashes/sha2.js';
|
|
25
|
+
import { rosterRecipientKid } from '../keys/userKeyRoster.js';
|
|
25
26
|
import { agentsFromSeed } from '../identity/agents.js';
|
|
26
27
|
/**
|
|
27
28
|
* The HKDF salt for a standing credential's client-side expansions, and the
|
|
@@ -57,7 +58,10 @@ export async function unlockClientIdentityFromSeed({ clientSeed }) {
|
|
|
57
58
|
clientDid: agents.keyAgent.id,
|
|
58
59
|
signingKeyMultibase: signingKeyMultibase,
|
|
59
60
|
keyAgreementKeyMultibase,
|
|
60
|
-
recipientKid:
|
|
61
|
+
recipientKid: rosterRecipientKid({
|
|
62
|
+
signingKeyMultibase: signingKeyMultibase,
|
|
63
|
+
keyAgreementKeyMultibase
|
|
64
|
+
})
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingClient.js","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sCAAsC,CAAA;AAC1E,MAAM,yBAAyB,GAAG,aAAa,CAAA;AAC/C,MAAM,yBAAyB,GAAG,aAAa,CAAA;AAwB/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,UAAU,EAGX;IACC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;IACzD,MAAM,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,GACpD,MAAM,CAAC,eAA6D,CAAA;IACtE,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;IAC3E,CAAC;IACD,MAAM,CAAC,EAAE,AAAD,EAAG,mBAAmB,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/D,OAAO;QACL,UAAU;QACV,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC7B,mBAAmB,EAAE,mBAAoB;QACzC,wBAAwB;QACxB,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"standingClient.js","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;GAkB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