@interop/wallet-core 0.51.0 → 0.53.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 +7 -11
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +2 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -6
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +19 -6
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +51 -30
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +72 -26
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -3
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +2 -2
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +6 -6
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +5 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +19 -11
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +77 -14
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +146 -10
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +230 -26
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +6 -6
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +8 -8
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +18 -7
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +54 -14
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +67 -6
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +91 -15
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clients/listing.d.ts +1 -1
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +10 -7
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.js +1 -1
- package/dist/descriptors/logSource.d.ts +6 -4
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +7 -4
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +2 -1
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +1 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +6 -20
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +8 -5
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/unlockSpace.js +1 -1
- package/dist/keys/clientKeyRecord.d.ts +68 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +155 -20
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +2 -2
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +16 -14
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +164 -32
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +8 -7
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +6 -6
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +1 -1
- package/dist/keys/spaceEpochs.js +1 -1
- package/dist/keys/userKeyRoster.d.ts +3 -3
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +3 -3
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/log.d.ts +49 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +53 -0
- package/dist/log.js.map +1 -0
- package/dist/recovery/index.d.ts +2 -2
- package/dist/recovery/index.js +2 -2
- package/dist/recovery/recoveryDelegation.d.ts +6 -2
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +32 -6
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +67 -8
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +114 -19
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +9 -3
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +13 -8
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/capabilityRequest.d.ts +9 -1
- package/dist/request/capabilityRequest.d.ts.map +1 -1
- package/dist/request/capabilityRequest.js +13 -2
- package/dist/request/capabilityRequest.js.map +1 -1
- package/dist/request/classify.d.ts +37 -1
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +74 -3
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +5 -18
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js +9 -3
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/exchangeClient.d.ts +0 -23
- package/dist/request/exchangeClient.d.ts.map +1 -1
- package/dist/request/exchangeClient.js +30 -1
- package/dist/request/exchangeClient.js.map +1 -1
- package/dist/request/index.d.ts +4 -1
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +4 -1
- package/dist/request/index.js.map +1 -1
- package/dist/request/interactionRequest.d.ts +23 -0
- package/dist/request/interactionRequest.d.ts.map +1 -0
- package/dist/request/interactionRequest.js +46 -0
- package/dist/request/interactionRequest.js.map +1 -0
- package/dist/request/interactionUrl.d.ts +3 -14
- package/dist/request/interactionUrl.d.ts.map +1 -1
- package/dist/request/interactionUrl.js +24 -3
- package/dist/request/interactionUrl.js.map +1 -1
- package/dist/request/parse.d.ts +0 -10
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +15 -1
- package/dist/request/parse.js.map +1 -1
- package/dist/request/processRequest.d.ts.map +1 -1
- package/dist/request/processRequest.js +2 -1
- package/dist/request/processRequest.js.map +1 -1
- package/dist/request/types.d.ts +23 -2
- package/dist/request/types.d.ts.map +1 -1
- package/dist/resourceLog/controller.d.ts +48 -49
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +41 -20
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/errors.d.ts +12 -78
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +12 -79
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +17 -22
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +16 -21
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/license.d.ts +42 -27
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +53 -30
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +48 -1
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +52 -4
- package/dist/space/activity.js.map +1 -1
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/pull.d.ts +0 -22
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +30 -2
- package/dist/sync/pull.js.map +1 -1
- package/dist/unlock/index.d.ts +7 -7
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +6 -6
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +29 -28
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +25 -16
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts +1 -1
- package/dist/unlock/standingClient.js +3 -3
- package/dist/unlock/standingWebvh.d.ts +28 -10
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +75 -37
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +37 -0
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +54 -1
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +2 -2
- package/dist/webvh/delegatedLogStore.js +2 -2
- package/dist/webvh/didWeb.js +1 -1
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +33 -3
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +40 -11
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +1 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +1 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.js +1 -1
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +1 -1
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +1 -2
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +9 -11
- package/dist/display/alignment.d.ts +0 -55
- package/dist/display/alignment.d.ts.map +0 -1
- package/dist/display/alignment.js +0 -117
- package/dist/display/alignment.js.map +0 -1
- package/dist/display/credentialName.d.ts +0 -42
- package/dist/display/credentialName.d.ts.map +0 -1
- package/dist/display/credentialName.js +0 -106
- package/dist/display/credentialName.js.map +0 -1
- package/dist/display/displayFields.d.ts +0 -59
- package/dist/display/displayFields.d.ts.map +0 -1
- package/dist/display/displayFields.js +0 -136
- package/dist/display/displayFields.js.map +0 -1
- package/dist/display/evidence.d.ts +0 -50
- package/dist/display/evidence.d.ts.map +0 -1
- package/dist/display/evidence.js +0 -67
- package/dist/display/evidence.js.map +0 -1
- package/dist/display/image.d.ts +0 -18
- package/dist/display/image.d.ts.map +0 -1
- package/dist/display/image.js +0 -23
- package/dist/display/image.js.map +0 -1
- package/dist/display/index.d.ts +0 -38
- package/dist/display/index.d.ts.map +0 -1
- package/dist/display/index.js +0 -32
- package/dist/display/index.js.map +0 -1
- package/dist/display/issuer.d.ts +0 -105
- package/dist/display/issuer.d.ts.map +0 -1
- package/dist/display/issuer.js +0 -126
- package/dist/display/issuer.js.map +0 -1
- package/dist/display/obv3.d.ts +0 -82
- package/dist/display/obv3.d.ts.map +0 -1
- package/dist/display/obv3.js +0 -117
- package/dist/display/obv3.js.map +0 -1
- package/dist/display/parse.d.ts +0 -66
- package/dist/display/parse.d.ts.map +0 -1
- package/dist/display/parse.js +0 -104
- package/dist/display/parse.js.map +0 -1
- package/dist/display/subject.d.ts +0 -79
- package/dist/display/subject.d.ts.map +0 -1
- package/dist/display/subject.js +0 -124
- package/dist/display/subject.js.map +0 -1
- package/dist/display/text.d.ts +0 -53
- package/dist/display/text.d.ts.map +0 -1
- package/dist/display/text.js +0 -78
- package/dist/display/text.js.map +0 -1
- package/dist/display/types.d.ts +0 -55
- package/dist/display/types.d.ts.map +0 -1
- package/dist/display/types.js +0 -41
- package/dist/display/types.js.map +0 -1
- package/dist/display/validity.d.ts +0 -51
- package/dist/display/validity.d.ts.map +0 -1
- package/dist/display/validity.js +0 -51
- package/dist/display/validity.js.map +0 -1
- package/dist/display/verificationView.d.ts +0 -115
- package/dist/display/verificationView.d.ts.map +0 -1
- package/dist/display/verificationView.js +0 -199
- package/dist/display/verificationView.js.map +0 -1
- package/dist/resourceLog/append.d.ts +0 -112
- package/dist/resourceLog/append.d.ts.map +0 -1
- package/dist/resourceLog/append.js +0 -197
- package/dist/resourceLog/append.js.map +0 -1
- package/dist/resourceLog/entry.d.ts +0 -68
- package/dist/resourceLog/entry.d.ts.map +0 -1
- package/dist/resourceLog/entry.js +0 -167
- package/dist/resourceLog/entry.js.map +0 -1
- package/dist/resourceLog/pin.d.ts +0 -82
- package/dist/resourceLog/pin.d.ts.map +0 -1
- package/dist/resourceLog/pin.js +0 -57
- package/dist/resourceLog/pin.js.map +0 -1
- package/dist/resourceLog/seal.d.ts +0 -97
- package/dist/resourceLog/seal.d.ts.map +0 -1
- package/dist/resourceLog/seal.js +0 -113
- package/dist/resourceLog/seal.js.map +0 -1
- package/dist/resourceLog/verify.d.ts +0 -96
- package/dist/resourceLog/verify.d.ts.map +0 -1
- package/dist/resourceLog/verify.js +0 -474
- package/dist/resourceLog/verify.js.map +0 -1
- package/dist/resourceLog/vmFragment.d.ts +0 -33
- package/dist/resourceLog/vmFragment.d.ts.map +0 -1
- package/dist/resourceLog/vmFragment.js +0 -39
- package/dist/resourceLog/vmFragment.js.map +0 -1
package/README.md
CHANGED
|
@@ -65,10 +65,6 @@ The subpaths:
|
|
|
65
65
|
[`@interop/data-integrity-core`](https://npm.im/@interop/data-integrity-core)
|
|
66
66
|
and is re-exported here.
|
|
67
67
|
|
|
68
|
-
- **`@interop/wallet-core/display`** -- pure verifiable-credential derivation /
|
|
69
|
-
display helpers and credential input parsing. Raw values out (ISO strings,
|
|
70
|
-
`Date`, booleans); date formatting, i18n, and UI concerns stay in the app.
|
|
71
|
-
|
|
72
68
|
- **`@interop/wallet-core/webvh`** -- the account's did:webvh identity: the
|
|
73
69
|
hosted DID log, its per-client update-key rotation, the client enrollment
|
|
74
70
|
entries, the one-entry client-revocation edit (verification methods, update
|
|
@@ -145,13 +141,13 @@ The subpaths:
|
|
|
145
141
|
|
|
146
142
|
- **`@interop/wallet-core/unlock`** -- standing unlock credentials: every unlock
|
|
147
143
|
method (passphrase, passkey PRF, recovery code) as a standing credential in
|
|
148
|
-
the recovery-code
|
|
149
|
-
client identity and binding MAC key, the update-key ladder
|
|
144
|
+
the recovery-code configuration, with self-enrolling login. The
|
|
145
|
+
credential-derived client identity and binding MAC key, the update-key ladder
|
|
150
146
|
(latent-and-consumed did:webvh update authority from a random seed carried in
|
|
151
147
|
the unlock record, the current rung recovered from the log itself), the unlock
|
|
152
148
|
record codec (shell / bridge delegation / ladder members under a
|
|
153
149
|
credential-authenticated binding, with the bridge-only re-mint), the merged
|
|
154
|
-
document-
|
|
150
|
+
document-inventory edit (a verbatim `keyAgreement` entry or a
|
|
155
151
|
`publicKeyCommitment` entry for a low-entropy-derived key), and the
|
|
156
152
|
self-enrolling continuation with its composed completion.
|
|
157
153
|
|
|
@@ -192,10 +188,10 @@ import {
|
|
|
192
188
|
```
|
|
193
189
|
|
|
194
190
|
The `sync` and `space` subpaths are re-exported from the package root as well.
|
|
195
|
-
Every other subpath (`identity`, `request`, `
|
|
196
|
-
`
|
|
197
|
-
|
|
198
|
-
|
|
191
|
+
Every other subpath (`identity`, `request`, `webvh`, `keys`, `clients`,
|
|
192
|
+
`descriptors`, `keyring`, `enrollment`, `recovery`) is import-directly-only, so
|
|
193
|
+
consumers of the root never pull the signing / KMS / document-loader dependency
|
|
194
|
+
graph.
|
|
199
195
|
|
|
200
196
|
## Contribute
|
|
201
197
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* 2. The ladder-anchored did:webvh genesis
|
|
16
16
|
* (`ensureLadderAnchoredDidWebvh`): the entry signed by ladder rung 0, `updateKeys` = [rung 0], `nextKeyHashes`
|
|
17
17
|
* = [hash(rung 0), hash(rung 1)], the ladder VM and the credential's
|
|
18
|
-
* `keyAgreement`
|
|
18
|
+
* `keyAgreement` inventory folded in, `portable` unchanged. There is no KMS
|
|
19
19
|
* stage: the keystore is DEFERRED to the first durable enrollment (a
|
|
20
20
|
* ladder-anchored account has no consumer for the convenience VM, and a
|
|
21
21
|
* keystore under an evaporating identity would orphan).
|
|
@@ -52,7 +52,7 @@ import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
|
52
52
|
import type { WebvhIdStore } from '../webvh/didWebvh.js';
|
|
53
53
|
import type { UnlockKeyAgreementPublication } from '../unlock/standingWebvh.js';
|
|
54
54
|
import { type UserKey } from '../keys/index.js';
|
|
55
|
-
import type { ResourceLogPinStore } from '
|
|
55
|
+
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
56
56
|
import { type AccountGenesisResult } from '../genesis/accountGenesis.js';
|
|
57
57
|
/**
|
|
58
58
|
* The key set a credential-anchored signup mints locally before anything
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentialAnchoredGenesis.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAGL,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"credentialAnchoredGenesis.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAGL,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAA;AAErC;;;;;;;;GAQG;AACH,wBAAsB,mCAAmC,IAAI,OAAO,CAAC;IACnE,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;CAC3B,CAAC,CAED;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,sCAAsC,CAAC,EAC3D,GAAG,EACH,YAAY,EACZ,OAAO,EACP,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,iBAAwB,EACzB,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,EAAE,6BAA6B,CAAA;IAC3C,iBAAiB,EAAE,kBAAkB,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,YAAY,CAAA;IACrB,cAAc,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,yBAAyB,CAAA;IACvE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0FhC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* 2. The ladder-anchored did:webvh genesis
|
|
16
16
|
* (`ensureLadderAnchoredDidWebvh`): the entry signed by ladder rung 0, `updateKeys` = [rung 0], `nextKeyHashes`
|
|
17
17
|
* = [hash(rung 0), hash(rung 1)], the ladder VM and the credential's
|
|
18
|
-
* `keyAgreement`
|
|
18
|
+
* `keyAgreement` inventory folded in, `portable` unchanged. There is no KMS
|
|
19
19
|
* stage: the keystore is DEFERRED to the first durable enrollment (a
|
|
20
20
|
* ladder-anchored account has no consumer for the convenience VM, and a
|
|
21
21
|
* keystore under an evaporating identity would orphan).
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* so it can sign no roster append (the entry-proof rule), and its WAS
|
|
17
17
|
* invocations stop verifying (the current-key-set rule), so the collection
|
|
18
18
|
* fan-out cannot run either -- while a ladder-signed append is licensed only
|
|
19
|
-
* at a
|
|
19
|
+
* at a inventory-changing document version, which a not-last-client removal is
|
|
20
20
|
* not. So:
|
|
21
21
|
*
|
|
22
22
|
* 1. **The roster rotation**, PRE-edit, signed by the still-enrolled
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* residue could open.
|
|
32
32
|
* 3. **The removal entry** ({@link forgetWebvhClient}): one atomic
|
|
33
33
|
* ladder-signed entry through the bridge takes the client's whole document
|
|
34
|
-
*
|
|
34
|
+
* inventory out. The app's local wipe runs after this ceremony returns, so
|
|
35
35
|
* a tear anywhere before the entry reads as "not forgotten" and a re-click
|
|
36
36
|
* resumes.
|
|
37
37
|
*
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
61
61
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
62
62
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
63
|
+
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
63
64
|
import type { RevokedClientKeys } from '../webvh/revokeClient.js';
|
|
64
65
|
import { type CascadeCollections, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
65
66
|
import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
@@ -88,9 +89,18 @@ export interface DurableClientForgetResult {
|
|
|
88
89
|
* @param options {object}
|
|
89
90
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
90
91
|
* `did.jsonl` bridge store; also serves the ceremony's public pre-edit
|
|
91
|
-
* read
|
|
92
|
-
*
|
|
93
|
-
*
|
|
92
|
+
* read
|
|
93
|
+
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
94
|
+
* pins. Every read the ceremony makes -- the pre-edit read the roster
|
|
95
|
+
* rotation's recipient document comes from, and the removal entry's own
|
|
96
|
+
* read inside its conflict-retry loop -- is checked against the pinned
|
|
97
|
+
* head, so a served truncated prefix is refused (`ResourceLogContinuityError`,
|
|
98
|
+
* `rollback`) before any roster append or log publish, and the pin
|
|
99
|
+
* advances to the head the removal entry publishes. Without it the
|
|
100
|
+
* ceremony checks `expectedDid` only
|
|
101
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
102
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
103
|
+
* supplied
|
|
94
104
|
* @param options.ladderSeed {Uint8Array} the credential's ladder seed
|
|
95
105
|
* @param options.forgottenClient {RevokedClientKeys} this client's public
|
|
96
106
|
* halves; an `updateKeyMultibase` the log does not authorize (stale, or the
|
|
@@ -117,8 +127,10 @@ export interface DurableClientForgetResult {
|
|
|
117
127
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
118
128
|
* @returns {Promise<DurableClientForgetResult>}
|
|
119
129
|
*/
|
|
120
|
-
export declare function forgetDurableClient({ logStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }: {
|
|
130
|
+
export declare function forgetDurableClient({ logStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }: {
|
|
121
131
|
logStore: UnlockLogStore;
|
|
132
|
+
pinStore?: ResourceLogPinStore;
|
|
133
|
+
logId?: string;
|
|
122
134
|
ladderSeed: Uint8Array;
|
|
123
135
|
forgottenClient: RevokedClientKeys;
|
|
124
136
|
forgottenKeyAgreementKeyMultibase: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forget.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;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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AG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,iCAAiC,EACjC,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,yBAAyB,EACzB,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,WAAW,EACZ,EAAE;IACD,QAAQ,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,iBAAiB,CAAA;IAClC,iCAAiC,EAAE,MAAM,CAAA;IACzC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,yBAAyB,CAAA;IACtC,yBAAyB,EAAE,gBAAgB,CAAA;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC3B,OAAO,EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;CAChC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAwGrC"}
|
|
@@ -10,9 +10,18 @@ import { forgetWebvhClient, LastDurableClientForgetError } from './ladderAnchore
|
|
|
10
10
|
* @param options {object}
|
|
11
11
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
12
12
|
* `did.jsonl` bridge store; also serves the ceremony's public pre-edit
|
|
13
|
-
* read
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* read
|
|
14
|
+
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
15
|
+
* pins. Every read the ceremony makes -- the pre-edit read the roster
|
|
16
|
+
* rotation's recipient document comes from, and the removal entry's own
|
|
17
|
+
* read inside its conflict-retry loop -- is checked against the pinned
|
|
18
|
+
* head, so a served truncated prefix is refused (`ResourceLogContinuityError`,
|
|
19
|
+
* `rollback`) before any roster append or log publish, and the pin
|
|
20
|
+
* advances to the head the removal entry publishes. Without it the
|
|
21
|
+
* ceremony checks `expectedDid` only
|
|
22
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
23
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
24
|
+
* supplied
|
|
16
25
|
* @param options.ladderSeed {Uint8Array} the credential's ladder seed
|
|
17
26
|
* @param options.forgottenClient {RevokedClientKeys} this client's public
|
|
18
27
|
* halves; an `updateKeyMultibase` the log does not authorize (stale, or the
|
|
@@ -39,7 +48,7 @@ import { forgetWebvhClient, LastDurableClientForgetError } from './ladderAnchore
|
|
|
39
48
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
40
49
|
* @returns {Promise<DurableClientForgetResult>}
|
|
41
50
|
*/
|
|
42
|
-
export async function forgetDurableClient({ logStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }) {
|
|
51
|
+
export async function forgetDurableClient({ logStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }) {
|
|
43
52
|
// The pre-edit read, doing double duty: the last-client refusal must fire
|
|
44
53
|
// BEFORE the rotation (or a refused forget would already have retired this
|
|
45
54
|
// client's wrap), and the rotation's recipient resolver needs the pre-edit
|
|
@@ -48,7 +57,9 @@ export async function forgetDurableClient({ logStore, ladderSeed, forgottenClien
|
|
|
48
57
|
// readPublishedLog only calls getIdResourceRaw, so the narrow seam is
|
|
49
58
|
// safe.
|
|
50
59
|
idStore: logStore,
|
|
51
|
-
expectedDid
|
|
60
|
+
expectedDid,
|
|
61
|
+
...(pinStore ? { pinStore } : {}),
|
|
62
|
+
...(logId !== undefined ? { logId } : {})
|
|
52
63
|
});
|
|
53
64
|
if (!published) {
|
|
54
65
|
throw new Error('did:webvh: did.jsonl is missing; nothing to forget from.');
|
|
@@ -118,7 +129,9 @@ export async function forgetDurableClient({ logStore, ladderSeed, forgottenClien
|
|
|
118
129
|
ladderSeed,
|
|
119
130
|
forgottenClient,
|
|
120
131
|
...(knownLatentHashes ? { knownLatentHashes } : {}),
|
|
121
|
-
expectedDid
|
|
132
|
+
expectedDid,
|
|
133
|
+
...(pinStore ? { pinStore } : {}),
|
|
134
|
+
...(logId !== undefined ? { logId } : {})
|
|
122
135
|
});
|
|
123
136
|
return {
|
|
124
137
|
rotated,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAIpE,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAIpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAoB5B;;;;;;;;;;;;;;;;;;;;;;;;;;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C,IAAI;YACN,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,UAAU,EAAE;YAC9D,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC"}
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
* POST at all). So:
|
|
15
15
|
*
|
|
16
16
|
* 1. **The install entry** ({@link installLadderVmWebvh}): the ladder VM
|
|
17
|
-
* joins the document while the client's whole
|
|
17
|
+
* joins the document while the client's whole inventory stays -- the
|
|
18
18
|
* both-present transitional state. This is the ceremony's
|
|
19
|
-
*
|
|
19
|
+
* inventory-changing document version under the ceremony-tail license.
|
|
20
20
|
* 2. **The roster rotation**, ladder-signed, anchored at the install entry,
|
|
21
21
|
* HTTP-invoked under the still-standing client: the user key rotates off
|
|
22
22
|
* this client's wrap in ONE append (the license's one-shot shape), read
|
|
23
23
|
* back through the credential's standing wrap. Because the append's
|
|
24
24
|
* signer is the ladder VM -- a key the post-removal document still lists
|
|
25
|
-
* -- the roster log needs no seal
|
|
25
|
+
* -- the roster log needs no seal repair afterwards, which matters on
|
|
26
26
|
* an account where no enrolled client's login sweep will ever run again.
|
|
27
27
|
* 3. **The collection fan-out**, still under this client's invocation
|
|
28
28
|
* authority: every encrypted collection re-epochs onto the fresh key.
|
|
@@ -51,18 +51,25 @@
|
|
|
51
51
|
* management zcaps are granted to the account DID, which only an enrolled
|
|
52
52
|
* client can invoke) -- which is why the stage must run before the
|
|
53
53
|
* removal entry. The pass walks every entry and reports each one's fate,
|
|
54
|
-
* but the ceremony does not carry
|
|
55
|
-
* entry refuses the removal entry
|
|
56
|
-
* naming the records the pass
|
|
57
|
-
* nothing could ever re-sign that
|
|
54
|
+
* but the ceremony does not carry an unsettled entry past this point: a
|
|
55
|
+
* `failed` or `pending-entry` outcome refuses the removal entry
|
|
56
|
+
* ({@link RecordRemintFailedError}, naming the records the pass left
|
|
57
|
+
* unreached), since after the removal nothing could ever re-sign that
|
|
58
|
+
* record's bridge. The client stays
|
|
58
59
|
* enrolled, and a re-run reaches the entry again.
|
|
59
|
-
* 6. **The record re-bind seam** (`onBeforeRemoval
|
|
60
|
-
* the LOGIN credential's bridge and `delegatedClients` sibling
|
|
61
|
-
* ladder VM and re-seals its unlock record with the credential
|
|
62
|
-
* (a full re-wrap, proof verified rather than settled)
|
|
63
|
-
*
|
|
60
|
+
* 6. **The record re-bind seam** (`onBeforeRemoval`, required): the caller
|
|
61
|
+
* re-signs the LOGIN credential's bridge and `delegatedClients` sibling
|
|
62
|
+
* with the ladder VM and re-seals its unlock record with the credential
|
|
63
|
+
* in hand (a full re-wrap, proof verified rather than settled). Stage 5
|
|
64
|
+
* deliberately skips that credential (its record is re-sealed with the
|
|
65
|
+
* credential in hand rather than through a management zcap), so the
|
|
66
|
+
* seam is the only thing that ever re-signs the login credential's own
|
|
67
|
+
* bridge with the ladder VM. Without it the removal entry would leave
|
|
68
|
+
* every bridge signed by the struck key on an account with no durable
|
|
69
|
+
* client -- an account nothing can write to -- which is why a call that
|
|
70
|
+
* omits the seam is refused before any read.
|
|
64
71
|
* 7. **The removal entry** ({@link forgetLastWebvhClient}): the client's
|
|
65
|
-
* whole document
|
|
72
|
+
* whole document inventory out while the installed ladder VM keeps the
|
|
66
73
|
* account anchored. The app's local wipe runs after this ceremony
|
|
67
74
|
* returns.
|
|
68
75
|
*
|
|
@@ -89,7 +96,7 @@ import type { ZcapClient } from '@interop/ezcap';
|
|
|
89
96
|
import type { CollectionEncryption, IDelegatedZcap } from '@interop/was-client';
|
|
90
97
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
91
98
|
import { type RevokedClientKeys } from '../webvh/revokeClient.js';
|
|
92
|
-
import type { ResourceLogPinStore } from '
|
|
99
|
+
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
93
100
|
import { type CascadeCollections, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
94
101
|
import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
95
102
|
import type { AccountPointer } from '../keyring/record.js';
|
|
@@ -159,10 +166,16 @@ export interface LastDurableClientForgetResult {
|
|
|
159
166
|
rosterDescriptor?: CollectionEncryption;
|
|
160
167
|
}
|
|
161
168
|
/**
|
|
162
|
-
* The record re-mint stage could not
|
|
163
|
-
* record, so the removal entry was refused: `failed` names the entries
|
|
164
|
-
* re-mint threw (each carrying its cause)
|
|
165
|
-
*
|
|
169
|
+
* The record re-mint stage could not settle every other unlock method's
|
|
170
|
+
* record, so the removal entry was refused: `failed` names the entries the
|
|
171
|
+
* pass left unreached -- those whose re-mint threw (each carrying its cause)
|
|
172
|
+
* and those it skipped as pending-shaped (the entry's identity members name
|
|
173
|
+
* a credential other than the one its record is sealed to) -- and
|
|
174
|
+
* `unlockMethods` is the whole stage report. A pending-shaped entry blocks
|
|
175
|
+
* for the same reason a failed one does: its bridge is left signed by the
|
|
176
|
+
* key the removal entry strikes, and on a client-less account no login will
|
|
177
|
+
* ever heal it. The mender is a durable login, which is exactly what the
|
|
178
|
+
* removal would end. The forgotten client is still enrolled and every stage
|
|
166
179
|
* before this one has landed, so a re-run resumes at the re-mint. Matched
|
|
167
180
|
* on `name` (the errors cross app-injected seams that may resolve to another
|
|
168
181
|
* copy of this package).
|
|
@@ -185,11 +198,15 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
185
198
|
*
|
|
186
199
|
* @param options {object}
|
|
187
200
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
188
|
-
* `did.jsonl` bridge store; also serves the ceremony's public reads
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
201
|
+
* `did.jsonl` bridge store; also serves the ceremony's public reads
|
|
202
|
+
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
203
|
+
* pins, the account log's slot derived from `annex.accountSpaceId`. Every
|
|
204
|
+
* account-log read the ceremony makes -- the pre-install read, and the
|
|
205
|
+
* install and removal entries' own reads inside their conflict-retry
|
|
206
|
+
* loops -- is checked against the pinned head, so a served truncated
|
|
207
|
+
* prefix is refused (`ResourceLogContinuityError`, `rollback`) before any
|
|
208
|
+
* roster append or log publish, and each entry advances the pin to the
|
|
209
|
+
* head it publishes. Without it the ceremony checks `expectedDid` only
|
|
193
210
|
* @param options.ladderSeed {Uint8Array} the login credential's ladder seed
|
|
194
211
|
* @param options.forgottenClient {RevokedClientKeys} this client's public
|
|
195
212
|
* halves; an `updateKeyMultibase` the log does not authorize (stale, or the
|
|
@@ -204,7 +221,7 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
204
221
|
* @param options.rosterStoreFor {Function} `({ did, log }) => store` --
|
|
205
222
|
* builds the `key-map/user-key.jsonl` roster store whose appends are
|
|
206
223
|
* SIGNED BY THE LADDER VM and whose controller view resolves from the
|
|
207
|
-
* supplied post-install log (the
|
|
224
|
+
* supplied post-install log (the inventory-changing anchor the ceremony-tail
|
|
208
225
|
* license admits), while its HTTP requests invoke under the still-standing
|
|
209
226
|
* client
|
|
210
227
|
* @param options.credentialKeyAgreementKey {IKeyAgreementKey} the standing
|
|
@@ -238,20 +255,24 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
238
255
|
* re-seals through their management zcaps, invoked as the still-standing
|
|
239
256
|
* client. Omitted, the stage is skipped and the result carries no
|
|
240
257
|
* `unlockMethods` report -- the residue decision 0004's amendment stated.
|
|
241
|
-
* Supplied, an entry the pass could not re-mint
|
|
258
|
+
* Supplied, an entry the pass could not re-mint -- or skipped as
|
|
259
|
+
* pending-shaped -- refuses the removal entry
|
|
242
260
|
* (`RecordRemintFailedError`)
|
|
243
|
-
* @param
|
|
261
|
+
* @param options.onBeforeRemoval {Function}
|
|
244
262
|
* `({ did, doc, log }) => Promise<void>` -- the record re-bind seam: runs
|
|
245
263
|
* after the record re-mint stage, immediately before the removal entry,
|
|
246
264
|
* with the post-install published state. The caller re-signs the login
|
|
247
265
|
* credential's bridge and `delegatedClients` sibling with the ladder VM
|
|
248
|
-
* and re-seals its unlock record here
|
|
249
|
-
*
|
|
266
|
+
* and re-seals its unlock record here -- the only stage that reaches the
|
|
267
|
+
* login credential's record, which the `unlockMethods` pass skips. Must
|
|
268
|
+
* be idempotent (a resumed run invokes it again). Required: a call
|
|
269
|
+
* without it throws a `TypeError` before any read
|
|
250
270
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
251
271
|
* @returns {Promise<LastDurableClientForgetResult>}
|
|
252
272
|
*/
|
|
253
|
-
export declare function forgetLastDurableClient({ logStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStoreFor, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now }: {
|
|
273
|
+
export declare function forgetLastDurableClient({ logStore, pinStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStoreFor, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now }: {
|
|
254
274
|
logStore: UnlockLogStore;
|
|
275
|
+
pinStore?: ResourceLogPinStore;
|
|
255
276
|
ladderSeed: Uint8Array;
|
|
256
277
|
forgottenClient: RevokedClientKeys;
|
|
257
278
|
forgottenKeyAgreementKeyMultibase: string;
|
|
@@ -281,7 +302,7 @@ export declare function forgetLastDurableClient({ logStore, ladderSeed, forgotte
|
|
|
281
302
|
pinStore?: ResourceLogPinStore;
|
|
282
303
|
};
|
|
283
304
|
unlockMethods?: UnlockMethodsRemintReach;
|
|
284
|
-
onBeforeRemoval
|
|
305
|
+
onBeforeRemoval: (published: {
|
|
285
306
|
did: string;
|
|
286
307
|
doc: object;
|
|
287
308
|
log: DIDLog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1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tB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;KAC/B,CAAA;IACD,aAAa,CAAC,EAAE,wBAAwB,CAAA;IACxC,eAAe,EAAE,CAAC,SAAS,EAAE;QAC3B,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAgMzC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readPublishedLog, relationIds } from '../webvh/didWebvh.js';
|
|
2
|
+
import { accountLogPinId } from '../webvh/verifyLog.js';
|
|
2
3
|
import { clientRemovalTarget } from '../webvh/revokeClient.js';
|
|
3
4
|
import { delegationProofKeyId } from '../webvh/standingZcap.js';
|
|
4
|
-
import { vmFragmentOf } from '
|
|
5
|
+
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
5
6
|
import { cascadeCollectionsToUserKey, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from '../keys/index.js';
|
|
6
7
|
import { readLogOrThrow } from '../unlock/standingWebvh.js';
|
|
7
8
|
import { recordSignerFromAgent } from '../keyring/record.js';
|
|
@@ -11,10 +12,28 @@ import { ladderVmAgent, ladderVmZcapClient } from './zcap.js';
|
|
|
11
12
|
import { forgetLastWebvhClient, installLadderVmWebvh } from './ladderAnchored.js';
|
|
12
13
|
import { clientAnnexDidParts, clientAnnexLogPinId, delegatedClientsDelegationMinter, delegatedClientsPointer, ensureGenerationDelegationCurrent, generationDelegationHistory, mintGenerationDelegation, revokeTreatingAlreadyRevokedAsSuccess } from './log.js';
|
|
13
14
|
/**
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
16
|
-
* re-
|
|
17
|
-
*
|
|
15
|
+
* The re-mint outcomes that withhold the removal entry: a record the pass
|
|
16
|
+
* could not reach, and a pending-shaped entry it deliberately did not write
|
|
17
|
+
* (re-minting one would seal a half-retired credential a fresh bridge into
|
|
18
|
+
* the standing credential's record). Both leave a bridge the removal entry
|
|
19
|
+
* would rot for good on an account that will never see a durable login
|
|
20
|
+
* again.
|
|
21
|
+
*/
|
|
22
|
+
const REMINT_BLOCKING_OUTCOMES = [
|
|
23
|
+
'failed',
|
|
24
|
+
'pending-entry'
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* The record re-mint stage could not settle every other unlock method's
|
|
28
|
+
* record, so the removal entry was refused: `failed` names the entries the
|
|
29
|
+
* pass left unreached -- those whose re-mint threw (each carrying its cause)
|
|
30
|
+
* and those it skipped as pending-shaped (the entry's identity members name
|
|
31
|
+
* a credential other than the one its record is sealed to) -- and
|
|
32
|
+
* `unlockMethods` is the whole stage report. A pending-shaped entry blocks
|
|
33
|
+
* for the same reason a failed one does: its bridge is left signed by the
|
|
34
|
+
* key the removal entry strikes, and on a client-less account no login will
|
|
35
|
+
* ever heal it. The mender is a durable login, which is exactly what the
|
|
36
|
+
* removal would end. The forgotten client is still enrolled and every stage
|
|
18
37
|
* before this one has landed, so a re-run resumes at the re-mint. Matched
|
|
19
38
|
* on `name` (the errors cross app-injected seams that may resolve to another
|
|
20
39
|
* copy of this package).
|
|
@@ -23,8 +42,8 @@ export class RecordRemintFailedError extends Error {
|
|
|
23
42
|
failed;
|
|
24
43
|
unlockMethods;
|
|
25
44
|
constructor({ unlockMethods }) {
|
|
26
|
-
const failed = unlockMethods.outcomes.filter(outcome => outcome.outcome
|
|
27
|
-
super('did:webvh: the last-client forget could not
|
|
45
|
+
const failed = unlockMethods.outcomes.filter(outcome => REMINT_BLOCKING_OUTCOMES.includes(outcome.outcome));
|
|
46
|
+
super('did:webvh: the last-client forget could not settle the record of ' +
|
|
28
47
|
`${failed.length} other unlock method(s) (` +
|
|
29
48
|
failed.map(outcome => `"${outcome.label}"`).join(', ') +
|
|
30
49
|
'); the removal entry was not published. The client stays enrolled; ' +
|
|
@@ -45,11 +64,15 @@ export class RecordRemintFailedError extends Error {
|
|
|
45
64
|
*
|
|
46
65
|
* @param options {object}
|
|
47
66
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
48
|
-
* `did.jsonl` bridge store; also serves the ceremony's public reads
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
67
|
+
* `did.jsonl` bridge store; also serves the ceremony's public reads
|
|
68
|
+
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
69
|
+
* pins, the account log's slot derived from `annex.accountSpaceId`. Every
|
|
70
|
+
* account-log read the ceremony makes -- the pre-install read, and the
|
|
71
|
+
* install and removal entries' own reads inside their conflict-retry
|
|
72
|
+
* loops -- is checked against the pinned head, so a served truncated
|
|
73
|
+
* prefix is refused (`ResourceLogContinuityError`, `rollback`) before any
|
|
74
|
+
* roster append or log publish, and each entry advances the pin to the
|
|
75
|
+
* head it publishes. Without it the ceremony checks `expectedDid` only
|
|
53
76
|
* @param options.ladderSeed {Uint8Array} the login credential's ladder seed
|
|
54
77
|
* @param options.forgottenClient {RevokedClientKeys} this client's public
|
|
55
78
|
* halves; an `updateKeyMultibase` the log does not authorize (stale, or the
|
|
@@ -64,7 +87,7 @@ export class RecordRemintFailedError extends Error {
|
|
|
64
87
|
* @param options.rosterStoreFor {Function} `({ did, log }) => store` --
|
|
65
88
|
* builds the `key-map/user-key.jsonl` roster store whose appends are
|
|
66
89
|
* SIGNED BY THE LADDER VM and whose controller view resolves from the
|
|
67
|
-
* supplied post-install log (the
|
|
90
|
+
* supplied post-install log (the inventory-changing anchor the ceremony-tail
|
|
68
91
|
* license admits), while its HTTP requests invoke under the still-standing
|
|
69
92
|
* client
|
|
70
93
|
* @param options.credentialKeyAgreementKey {IKeyAgreementKey} the standing
|
|
@@ -98,25 +121,44 @@ export class RecordRemintFailedError extends Error {
|
|
|
98
121
|
* re-seals through their management zcaps, invoked as the still-standing
|
|
99
122
|
* client. Omitted, the stage is skipped and the result carries no
|
|
100
123
|
* `unlockMethods` report -- the residue decision 0004's amendment stated.
|
|
101
|
-
* Supplied, an entry the pass could not re-mint
|
|
124
|
+
* Supplied, an entry the pass could not re-mint -- or skipped as
|
|
125
|
+
* pending-shaped -- refuses the removal entry
|
|
102
126
|
* (`RecordRemintFailedError`)
|
|
103
|
-
* @param
|
|
127
|
+
* @param options.onBeforeRemoval {Function}
|
|
104
128
|
* `({ did, doc, log }) => Promise<void>` -- the record re-bind seam: runs
|
|
105
129
|
* after the record re-mint stage, immediately before the removal entry,
|
|
106
130
|
* with the post-install published state. The caller re-signs the login
|
|
107
131
|
* credential's bridge and `delegatedClients` sibling with the ladder VM
|
|
108
|
-
* and re-seals its unlock record here
|
|
109
|
-
*
|
|
132
|
+
* and re-seals its unlock record here -- the only stage that reaches the
|
|
133
|
+
* login credential's record, which the `unlockMethods` pass skips. Must
|
|
134
|
+
* be idempotent (a resumed run invokes it again). Required: a call
|
|
135
|
+
* without it throws a `TypeError` before any read
|
|
110
136
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
111
137
|
* @returns {Promise<LastDurableClientForgetResult>}
|
|
112
138
|
*/
|
|
113
|
-
export async function forgetLastDurableClient({ logStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStoreFor, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now = Date.now() }) {
|
|
139
|
+
export async function forgetLastDurableClient({ logStore, pinStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStoreFor, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now = Date.now() }) {
|
|
140
|
+
// The seam is the only stage that re-signs the login credential's bridge
|
|
141
|
+
// with the ladder VM; a run without it would land the removal entry over
|
|
142
|
+
// a record the struck key signed, on an account nothing could then write
|
|
143
|
+
// to. Refused before any read, so nothing is published.
|
|
144
|
+
if (typeof onBeforeRemoval !== 'function') {
|
|
145
|
+
throw new TypeError('forgetLastDurableClient requires onBeforeRemoval: the login ' +
|
|
146
|
+
"credential's record is re-bound only through that seam");
|
|
147
|
+
}
|
|
114
148
|
// The pre-install read and the two guards: a client with no remaining
|
|
115
149
|
// presence means the removal entry already landed (the finish-the-wipe
|
|
116
150
|
// state the app's next login maps -- nothing here can still invoke), and
|
|
117
151
|
// an account with another enrolled durable client belongs to the ordinary
|
|
118
152
|
// forget ceremony.
|
|
119
|
-
|
|
153
|
+
// The account log's pin slot, shared by every read and entry below.
|
|
154
|
+
const pinned = pinStore
|
|
155
|
+
? { pinStore, logId: accountLogPinId({ spaceId: annex.accountSpaceId }) }
|
|
156
|
+
: {};
|
|
157
|
+
const before = await readLogOrThrow({
|
|
158
|
+
store: logStore,
|
|
159
|
+
expectedDid,
|
|
160
|
+
...pinned
|
|
161
|
+
});
|
|
120
162
|
const preTarget = await clientRemovalTarget({
|
|
121
163
|
published: before,
|
|
122
164
|
client: forgottenClient
|
|
@@ -141,7 +183,8 @@ export async function forgetLastDurableClient({ logStore, ladderSeed, forgottenC
|
|
|
141
183
|
const install = await installLadderVmWebvh({
|
|
142
184
|
store: logStore,
|
|
143
185
|
ladderSeed,
|
|
144
|
-
expectedDid
|
|
186
|
+
expectedDid,
|
|
187
|
+
...pinned
|
|
145
188
|
});
|
|
146
189
|
// Stage 2: the roster rotation off this client's wrap, ladder-signed and
|
|
147
190
|
// anchored at the install entry, then stage 3, the collection fan-out --
|
|
@@ -223,31 +266,34 @@ export async function forgetLastDurableClient({ logStore, ladderSeed, forgottenC
|
|
|
223
266
|
now
|
|
224
267
|
});
|
|
225
268
|
// The one pass that will ever reach these records on a client-less
|
|
226
|
-
// account: a record it could not re-seal
|
|
269
|
+
// account: a record it could not re-seal -- or deliberately did not
|
|
270
|
+
// write, the pending-shaped entry -- would be left with a bridge the
|
|
227
271
|
// removal entry rots for good, so the removal is refused instead. The
|
|
228
272
|
// stages already landed are idempotent and the client still stands, so
|
|
229
273
|
// the re-run resumes here.
|
|
230
|
-
if (remint.outcomes.some(outcome => outcome.outcome
|
|
274
|
+
if (remint.outcomes.some(outcome => REMINT_BLOCKING_OUTCOMES.includes(outcome.outcome))) {
|
|
231
275
|
throw new RecordRemintFailedError({ unlockMethods: remint });
|
|
232
276
|
}
|
|
233
277
|
}
|
|
234
|
-
// Stage 6: the record re-bind seam
|
|
278
|
+
// Stage 6: the record re-bind seam -- the login credential's record, the
|
|
279
|
+
// one stage 5 skipped -- while the removal has not landed (a
|
|
235
280
|
// ladder-VM-signed bridge verifies from the install entry on, and the old
|
|
236
281
|
// client-signed one keeps verifying until the removal -- so a tear on
|
|
237
282
|
// either side of this callback leaves a working login).
|
|
238
|
-
await onBeforeRemoval
|
|
283
|
+
await onBeforeRemoval({
|
|
239
284
|
did: install.did,
|
|
240
285
|
doc: install.doc,
|
|
241
286
|
log: install.log
|
|
242
287
|
});
|
|
243
|
-
// Stage 7: the removal entry -- the client's whole
|
|
288
|
+
// Stage 7: the removal entry -- the client's whole inventory out, the
|
|
244
289
|
// installed ladder VM keeping the account anchored.
|
|
245
290
|
const removed = await forgetLastWebvhClient({
|
|
246
291
|
store: logStore,
|
|
247
292
|
ladderSeed,
|
|
248
293
|
forgottenClient,
|
|
249
294
|
...(knownLatentHashes ? { knownLatentHashes } : {}),
|
|
250
|
-
expectedDid
|
|
295
|
+
expectedDid,
|
|
296
|
+
...pinned
|
|
251
297
|
});
|
|
252
298
|
return {
|
|
253
299
|
installed: install.installed,
|