@interop/wallet-core 0.65.0 → 0.67.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 +12 -8
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +5 -4
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +32 -50
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +112 -21
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +248 -180
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +2 -6
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +31 -61
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +48 -132
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +88 -221
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +9 -0
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +97 -13
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +108 -174
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +8 -8
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +6 -6
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +51 -4
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +310 -55
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +37 -3
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +69 -34
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +148 -72
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +211 -137
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +63 -81
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +20 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +77 -294
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -5
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.js +18 -9
- package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +1 -1
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clientAnnex/zcap.d.ts +19 -0
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +80 -12
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/index.d.ts +3 -2
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +3 -2
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +33 -15
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/policy.d.ts +18 -0
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +22 -8
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -30
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +12 -27
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +6 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +27 -30
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/errors.d.ts +6 -5
- package/dist/descriptors/errors.d.ts.map +1 -1
- package/dist/descriptors/errors.js +6 -5
- package/dist/descriptors/errors.js.map +1 -1
- package/dist/descriptors/index.d.ts +7 -3
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +7 -3
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +28 -6
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +33 -7
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +3 -7
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +8 -10
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +39 -41
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/kmsAuthentication.d.ts +50 -0
- package/dist/genesis/kmsAuthentication.d.ts.map +1 -0
- package/dist/genesis/kmsAuthentication.js +49 -0
- package/dist/genesis/kmsAuthentication.js.map +1 -0
- package/dist/keyring/kdf.d.ts +16 -20
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +2 -2
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +8 -30
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +8 -31
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/clientKeyRecord.d.ts +2 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +28 -11
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +19 -5
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +17 -3
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +3 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +20 -8
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +92 -3
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +110 -4
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +8 -5
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +7 -6
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +68 -4
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +146 -33
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +110 -10
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +184 -40
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/recovery/continuation.d.ts +255 -0
- package/dist/recovery/continuation.d.ts.map +1 -0
- package/dist/recovery/continuation.js +471 -0
- package/dist/recovery/continuation.js.map +1 -0
- 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/recoveryDelegation.d.ts +40 -120
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +36 -268
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +42 -83
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +44 -380
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +35 -1
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +29 -10
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/classify.d.ts +3 -14
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +19 -40
- package/dist/request/classify.js.map +1 -1
- package/dist/request/index.d.ts +1 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +1 -0
- package/dist/request/index.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +19 -27
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts +5 -3
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +7 -6
- 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/queryPredicates.d.ts +98 -0
- package/dist/request/queryPredicates.d.ts.map +1 -0
- package/dist/request/queryPredicates.js +107 -0
- package/dist/request/queryPredicates.js.map +1 -0
- package/dist/resourceLog/document.d.ts +39 -0
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +41 -0
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
- package/dist/resourceLog/ladderRungs.js +3 -2
- package/dist/resourceLog/ladderRungs.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +8 -2
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/sync/engine.d.ts +38 -23
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js +36 -5
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/index.d.ts +9 -12
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +8 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +1 -2
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.d.ts +0 -31
- package/dist/sync/remint.d.ts.map +1 -1
- package/dist/sync/remint.js +32 -1
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +4 -41
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +4 -47
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +1 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +16 -56
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +7 -76
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +20 -40
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +35 -76
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +69 -44
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +63 -7
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +110 -19
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +18 -12
- package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
- package/dist/webvh/delegatedLogStore.js +32 -11
- package/dist/webvh/delegatedLogStore.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +39 -23
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +63 -45
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +19 -23
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +11 -7
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +9 -6
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +102 -65
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/mergeMethods.d.ts +84 -0
- package/dist/webvh/mergeMethods.d.ts.map +1 -0
- package/dist/webvh/mergeMethods.js +46 -0
- package/dist/webvh/mergeMethods.js.map +1 -0
- package/dist/webvh/revokeClient.d.ts +12 -2
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +126 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +21 -0
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +36 -14
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientKeyRecord.js","sourceRoot":"","sources":["../../src/keys/clientKeyRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5C;;;;GAIG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,EAAE,CAAA;AA8E9B;;;;;;;;;GASG;AACH,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,MAAM,GAAG,YAAY,EAKtB;IACC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,cAAc,CAAC,CAAA;IAC1D,CAAC;IACD,IAAI,KAAiB,CAAA;IACrB,IAAI,CAAC;QACH,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,oBAAoB,EAAE;YAC7D,KAAK,EAAE,GAAG;SACX,CAAC,CAAA;IACJ,CAAC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aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD,CAAA;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAAC,EAC5C,MAAM,EAGP;IACC,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAA;IACnE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC3D,CAAC;IACD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;IACrE,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AACxE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAuB;IAEvB,IAAI,CAAC;QACH,6BAA6B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* resource-hosted descriptor needs (the governing resource log, the
|
|
19
19
|
* latest-seen epoch pin, and a recipient resolver backed by the locally
|
|
20
20
|
* verified did:webvh document).
|
|
21
|
+
* - `currentEpochOf` -- the one implementation of "resolve a descriptor's
|
|
22
|
+
* current epoch, refusing a `currentEpoch` that names no epoch in its own
|
|
23
|
+
* list" (`UserKeyRosterIntegrityError`); every roster and collection
|
|
24
|
+
* descriptor read that needs the current epoch goes through it.
|
|
21
25
|
* - `userKeyRosterDescriptorStore` / `logGovernedDescriptorStore` -- that
|
|
22
26
|
* descriptor store: reads resolve to the roster log's verified head
|
|
23
27
|
* (`key-map/user-key.jsonl`), writes append signed entries; built from a
|
|
@@ -51,27 +55,37 @@
|
|
|
51
55
|
* standing unlock credential retired): the post-edit minimum controller version, the
|
|
52
56
|
* convergence rotation with its seal backstop, and the collection fan-out
|
|
53
57
|
* onto the fresh user key.
|
|
58
|
+
* - `retireRosterRecipientAndCascade` -- the same tail for a ceremony that
|
|
59
|
+
* rotates BEFORE its document edit (the two forgets): the minimum
|
|
60
|
+
* controller version at the caller's anchor, one named recipient retired
|
|
61
|
+
* (`rosterWrapsRecipient` deciding whether the append is still owed), the
|
|
62
|
+
* fresh key read back through a surviving recipient's wrap, and the same
|
|
63
|
+
* fan-out; no seal backstop.
|
|
54
64
|
* - `ensureWalletSpaceEpochs` -- the provision-time epoch[0] install for the
|
|
55
65
|
* wallet Space's encrypted collections, the EDV-bearing second step of
|
|
56
66
|
* `provisionWalletSpace`.
|
|
57
67
|
* - `ensureIndexedFirstEpoch` -- one collection's epoch[0] plus its
|
|
58
68
|
* blinded-index HMAC key, adopting a pre-blind-index roster as-is.
|
|
69
|
+
* - `walletSpaceProvisioner` -- the sync engine's `ensureProvisioned` closure
|
|
70
|
+
* over both steps, single-flight across the app's engines, refusing with
|
|
71
|
+
* `WalletSpaceProvisioningError` when a collection was left without its
|
|
72
|
+
* epoch so the engine never memoizes a torn run.
|
|
59
73
|
*/
|
|
60
74
|
export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
61
75
|
export type { UserKey } from './userKey.js';
|
|
62
76
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, isEnrolledClientKeyRecord, parseClientRecordPending, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
63
77
|
export type { ClientKeyRecord, ClientKeyRecordJson, ClientKeyRecordPending, EnrolledClientKeyRecord } from './clientKeyRecord.js';
|
|
64
|
-
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
78
|
+
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, currentEpochOf, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rosterWrapsRecipient, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
65
79
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
66
80
|
export type { CollectionUserKeyRotationOutcome, UserKeyCascadeResult } from './userKeyCascade.js';
|
|
67
|
-
export { rotateRosterToDocumentAndCascade } from './userKeyRosterCascade.js';
|
|
68
|
-
export type { CascadeCollections, RosterCascadeResult, RosterSealReport } from './userKeyRosterCascade.js';
|
|
69
|
-
export type { UserKeyRosterReadResult } from './userKeyRoster.js';
|
|
81
|
+
export { anchorRosterStoreAt, retireRosterRecipientAndCascade, rotateRosterToDocumentAndCascade } from './userKeyRosterCascade.js';
|
|
82
|
+
export type { CascadeCollections, RosterCascadeResult, RosterSealReport, UserKeyAdoptedHook } from './userKeyRosterCascade.js';
|
|
83
|
+
export type { DescriptorStoreRead, UserKeyRosterReadResult } from './userKeyRoster.js';
|
|
70
84
|
export type { KeyAgreementDocument } from '../resourceLog/document.js';
|
|
71
85
|
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
72
86
|
export { EPOCH_CONFIGURATION_STATE_TYPE, isSealableDescriptorStore, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
73
87
|
export type { SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
74
|
-
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs } from './spaceEpochs.js';
|
|
88
|
+
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs, WalletSpaceProvisioningError, walletSpaceProvisioner } from './spaceEpochs.js';
|
|
75
89
|
export type { WalletSpaceEpochsResult } from './spaceEpochs.js';
|
|
76
90
|
export { readClientLabels, removeClientLabel, setClientLabel } from './clientLabels.js';
|
|
77
91
|
export type { ClientLabelsRecord, ClientLabelsStore } from './clientLabels.js';
|
package/dist/keys/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,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AO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/keys/index.js
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* resource-hosted descriptor needs (the governing resource log, the
|
|
19
19
|
* latest-seen epoch pin, and a recipient resolver backed by the locally
|
|
20
20
|
* verified did:webvh document).
|
|
21
|
+
* - `currentEpochOf` -- the one implementation of "resolve a descriptor's
|
|
22
|
+
* current epoch, refusing a `currentEpoch` that names no epoch in its own
|
|
23
|
+
* list" (`UserKeyRosterIntegrityError`); every roster and collection
|
|
24
|
+
* descriptor read that needs the current epoch goes through it.
|
|
21
25
|
* - `userKeyRosterDescriptorStore` / `logGovernedDescriptorStore` -- that
|
|
22
26
|
* descriptor store: reads resolve to the roster log's verified head
|
|
23
27
|
* (`key-map/user-key.jsonl`), writes append signed entries; built from a
|
|
@@ -51,20 +55,30 @@
|
|
|
51
55
|
* standing unlock credential retired): the post-edit minimum controller version, the
|
|
52
56
|
* convergence rotation with its seal backstop, and the collection fan-out
|
|
53
57
|
* onto the fresh user key.
|
|
58
|
+
* - `retireRosterRecipientAndCascade` -- the same tail for a ceremony that
|
|
59
|
+
* rotates BEFORE its document edit (the two forgets): the minimum
|
|
60
|
+
* controller version at the caller's anchor, one named recipient retired
|
|
61
|
+
* (`rosterWrapsRecipient` deciding whether the append is still owed), the
|
|
62
|
+
* fresh key read back through a surviving recipient's wrap, and the same
|
|
63
|
+
* fan-out; no seal backstop.
|
|
54
64
|
* - `ensureWalletSpaceEpochs` -- the provision-time epoch[0] install for the
|
|
55
65
|
* wallet Space's encrypted collections, the EDV-bearing second step of
|
|
56
66
|
* `provisionWalletSpace`.
|
|
57
67
|
* - `ensureIndexedFirstEpoch` -- one collection's epoch[0] plus its
|
|
58
68
|
* blinded-index HMAC key, adopting a pre-blind-index roster as-is.
|
|
69
|
+
* - `walletSpaceProvisioner` -- the sync engine's `ensureProvisioned` closure
|
|
70
|
+
* over both steps, single-flight across the app's engines, refusing with
|
|
71
|
+
* `WalletSpaceProvisioningError` when a collection was left without its
|
|
72
|
+
* epoch so the engine never memoizes a torn run.
|
|
59
73
|
*/
|
|
60
74
|
export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
61
75
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, isEnrolledClientKeyRecord, parseClientRecordPending, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
62
|
-
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
76
|
+
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, currentEpochOf, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rosterWrapsRecipient, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
63
77
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
64
|
-
export { rotateRosterToDocumentAndCascade } from './userKeyRosterCascade.js';
|
|
78
|
+
export { anchorRosterStoreAt, retireRosterRecipientAndCascade, rotateRosterToDocumentAndCascade } from './userKeyRosterCascade.js';
|
|
65
79
|
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
66
80
|
export { EPOCH_CONFIGURATION_STATE_TYPE, isSealableDescriptorStore, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
67
|
-
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs } from './spaceEpochs.js';
|
|
81
|
+
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs, WalletSpaceProvisioningError, walletSpaceProvisioner } from './spaceEpochs.js';
|
|
68
82
|
export { readClientLabels, removeClientLabel, setClientLabel } from './clientLabels.js';
|
|
69
83
|
export { wasClientLabelsStore } from './wasLabelsStore.js';
|
|
70
84
|
//# sourceMappingURL=index.js.map
|
package/dist/keys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG5D,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAQ7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,cAAc,EACd,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,8BAA8B,EAC9B,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAK5B,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,2BAA2B,CAAA;AAalC,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -34,7 +34,9 @@ export interface SealableEncryptionDescriptorStore extends EncryptionDescriptorS
|
|
|
34
34
|
* Whether a descriptor store is log-governed and sealable -- the guard the
|
|
35
35
|
* ceremonies and sweeps use to run the seal backstop only where a governing
|
|
36
36
|
* log exists (an ordinary Collection-Description-backed store has nothing to
|
|
37
|
-
* seal).
|
|
37
|
+
* seal). Both members of the interface are probed, since the cascade tail's
|
|
38
|
+
* anchoring preamble relies on the second: a store decorated down to `seal`
|
|
39
|
+
* alone would otherwise pass as anchorable and never be anchored.
|
|
38
40
|
*
|
|
39
41
|
* @param store {EncryptionDescriptorStore}
|
|
40
42
|
* @returns {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EACL,8BAA8B,EAE/B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,8BAA8B,EAAE,CAAA;AAEzC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B,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iCAAiC,CAmQpC"}
|
|
@@ -38,14 +38,17 @@ export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
|
38
38
|
* Whether a descriptor store is log-governed and sealable -- the guard the
|
|
39
39
|
* ceremonies and sweeps use to run the seal backstop only where a governing
|
|
40
40
|
* log exists (an ordinary Collection-Description-backed store has nothing to
|
|
41
|
-
* seal).
|
|
41
|
+
* seal). Both members of the interface are probed, since the cascade tail's
|
|
42
|
+
* anchoring preamble relies on the second: a store decorated down to `seal`
|
|
43
|
+
* alone would otherwise pass as anchorable and never be anchored.
|
|
42
44
|
*
|
|
43
45
|
* @param store {EncryptionDescriptorStore}
|
|
44
46
|
* @returns {boolean}
|
|
45
47
|
*/
|
|
46
48
|
export function isSealableDescriptorStore(store) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
const candidate = store;
|
|
50
|
+
return (typeof candidate.seal === 'function' &&
|
|
51
|
+
typeof candidate.setMinimumControllerVersion === 'function');
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
54
|
* Translates the log-store port's CAS conflict (the library's
|
|
@@ -137,7 +140,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
137
140
|
lastVerified = confirmed;
|
|
138
141
|
lastVerifiedView = controller;
|
|
139
142
|
}
|
|
140
|
-
|
|
143
|
+
const store = {
|
|
141
144
|
async read() {
|
|
142
145
|
let view = null;
|
|
143
146
|
const current = await readGovernedEpochConfiguration({
|
|
@@ -162,14 +165,22 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
162
165
|
};
|
|
163
166
|
},
|
|
164
167
|
async replace(descriptor, { ifMatch }) {
|
|
165
|
-
if (lastVerified === null) {
|
|
166
|
-
throw new Error('Cannot replace the governed descriptor: replace must follow a ' +
|
|
167
|
-
'read on the same store instance.');
|
|
168
|
-
}
|
|
169
168
|
if (ifMatch === undefined) {
|
|
170
169
|
throw new Error('Cannot replace the governed descriptor: the backend returned no ' +
|
|
171
170
|
'validator, and the profile forbids an unconditional write.');
|
|
172
171
|
}
|
|
172
|
+
// An append builds on the head this instance last verified. A replace
|
|
173
|
+
// that no read on this instance precedes -- a caller seeding was-client's
|
|
174
|
+
// compare-and-swap from a read another instance made -- acquires that
|
|
175
|
+
// head now, the one acquisition the seed was meant to save; the
|
|
176
|
+
// caller's validator still guards the append, so a seed behind the
|
|
177
|
+
// served log loses the compare-and-swap as it would anywhere.
|
|
178
|
+
if (lastVerified === null) {
|
|
179
|
+
await store.read();
|
|
180
|
+
}
|
|
181
|
+
if (lastVerified === null) {
|
|
182
|
+
throw new Error('Cannot replace the governed descriptor: the log is absent.');
|
|
183
|
+
}
|
|
173
184
|
if (lastVerified.terminal) {
|
|
174
185
|
throw new ResourceLogClosedError({ nextLog: lastVerified.terminal });
|
|
175
186
|
}
|
|
@@ -306,5 +317,6 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
306
317
|
minimumControllerVersion = controller;
|
|
307
318
|
}
|
|
308
319
|
};
|
|
320
|
+
return store;
|
|
309
321
|
}
|
|
310
322
|
//# sourceMappingURL=rosterLogStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,uBAAuB,EAExB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAKxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,8BAA8B,EAC9B,8BAA8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,EAAE,CAAC;gBACtB,YAAY,GAAG,QAAQ,CAAA;gBACvB,gBAAgB,GAAG,UAAU,CAAA;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QACnC,CAAC;QAED,2BAA2B,CAAC,EAAE,UAAU,EAAE;YACxC,wBAAwB,GAAG,UAAU,CAAA;QACvC,CAAC;KACF,CAAA;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -42,6 +42,19 @@ export interface WalletSpaceEpochsResult {
|
|
|
42
42
|
collectionId: string;
|
|
43
43
|
error: unknown;
|
|
44
44
|
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Set when the fan-out was refused whole by the mint gate: the settled
|
|
47
|
+
* user-key roster's current epoch is not the `userKey` the caller handed
|
|
48
|
+
* in, so installing collection epochs under that key would strand them on
|
|
49
|
+
* a key the roster does not deliver. Nothing was installed and `outcomes`
|
|
50
|
+
* is empty. `rosterEpochId` is the roster's current epoch; it is absent
|
|
51
|
+
* only on a malformed roster naming no epoch at all, which is refused
|
|
52
|
+
* alike. The caller that recovers the roster's real key is the one
|
|
53
|
+
* installer.
|
|
54
|
+
*/
|
|
55
|
+
skipped?: {
|
|
56
|
+
rosterEpochId?: string;
|
|
57
|
+
};
|
|
45
58
|
}
|
|
46
59
|
/**
|
|
47
60
|
* Installs key epoch[0] on a collection together with its blinded-index HMAC
|
|
@@ -83,8 +96,9 @@ export declare function ensureIndexedFirstEpoch({ collection, recipients }: {
|
|
|
83
96
|
* `provisionWalletSpace` has declared the collections; the wallet Space's
|
|
84
97
|
* provisioning is complete only once both steps have.
|
|
85
98
|
*
|
|
86
|
-
* Run both steps from the sync engine's `ensureProvisioned` seam
|
|
87
|
-
*
|
|
99
|
+
* Run both steps from the sync engine's `ensureProvisioned` seam
|
|
100
|
+
* ({@link walletSpaceProvisioner} builds that closure) or, for a driver of its
|
|
101
|
+
* own, equally before the collection's first content push: the
|
|
88
102
|
* descriptor-before-first-content-push invariant rests on it.
|
|
89
103
|
*
|
|
90
104
|
* A collection that fails is reported in `failed` and the rest proceed, so a
|
|
@@ -104,11 +118,26 @@ export declare function ensureIndexedFirstEpoch({ collection, recipients }: {
|
|
|
104
118
|
* descriptor's cipher on every run is both correct and (in the settled case)
|
|
105
119
|
* free.
|
|
106
120
|
*
|
|
121
|
+
* **The mint gate.** Collection epochs install only under the key the user-key
|
|
122
|
+
* roster delivers. A caller holding the settled roster descriptor passes it as
|
|
123
|
+
* `rosterDescriptor`, and the fan-out is refused whole (`skipped`, nothing
|
|
124
|
+
* written) when the roster's current epoch is not `userKey`: epoch[0] is
|
|
125
|
+
* create-if-absent and every later ensure adopts it, so a collection installed
|
|
126
|
+
* under a key the roster does not deliver -- a genesis re-run's throwaway
|
|
127
|
+
* candidate over an adopted roster, a cached key the roster has rotated away
|
|
128
|
+
* from -- is keyed to nothing, permanently. The gate lives here so every
|
|
129
|
+
* installer runs the same test rather than re-deriving it. A caller without
|
|
130
|
+
* the roster in hand (the sync engine's provisioner, whose user key is the one
|
|
131
|
+
* login just adopted from the roster) runs ungated.
|
|
132
|
+
*
|
|
107
133
|
* @param options {object}
|
|
108
134
|
* @param options.was {WasClient}
|
|
109
135
|
* @param options.spaceId {string}
|
|
110
136
|
* @param options.userKey {UserKey} the account's user key, epoch[0]'s one
|
|
111
137
|
* initial recipient
|
|
138
|
+
* @param [options.rosterDescriptor] {CollectionEncryption} the settled
|
|
139
|
+
* user-key roster descriptor, when the caller holds it: the mint gate
|
|
140
|
+
* refuses the fan-out unless its current epoch IS `userKey`
|
|
112
141
|
* @param [options.collectionIds] {string[]} the encrypted collections to
|
|
113
142
|
* cover; defaults to the wallet Space roster's encrypted collections. A
|
|
114
143
|
* caller naming its own ids (e.g. `contacts`) must name only collections
|
|
@@ -121,11 +150,71 @@ export declare function ensureIndexedFirstEpoch({ collection, recipients }: {
|
|
|
121
150
|
* descriptor and whether this call installed its epoch[0] (`false` means an
|
|
122
151
|
* existing roster was adopted), plus the collections that failed
|
|
123
152
|
*/
|
|
124
|
-
export declare function ensureWalletSpaceEpochs({ was, spaceId, userKey, collectionIds, capability }: {
|
|
153
|
+
export declare function ensureWalletSpaceEpochs({ was, spaceId, userKey, rosterDescriptor, collectionIds, capability }: {
|
|
125
154
|
was: WasClient;
|
|
126
155
|
spaceId: string;
|
|
127
156
|
userKey: UserKey;
|
|
157
|
+
rosterDescriptor?: CollectionEncryption;
|
|
128
158
|
collectionIds?: string[];
|
|
129
159
|
capability?: IZcap;
|
|
130
160
|
}): Promise<WalletSpaceEpochsResult>;
|
|
161
|
+
/**
|
|
162
|
+
* Thrown by a {@link walletSpaceProvisioner} closure when the epoch[0] install
|
|
163
|
+
* left any collection behind: the collections that did settle are adopted, and
|
|
164
|
+
* the throw keeps the sync engine from memoizing a torn provisioning, so the
|
|
165
|
+
* next cycle re-runs it and converges.
|
|
166
|
+
*/
|
|
167
|
+
export declare class WalletSpaceProvisioningError extends Error {
|
|
168
|
+
failed: WalletSpaceEpochsResult['failed'];
|
|
169
|
+
constructor({ failed }: {
|
|
170
|
+
failed: WalletSpaceEpochsResult['failed'];
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Builds the sync engine's `ensureProvisioned` closure for a wallet Space: the
|
|
175
|
+
* provisioning two-step as one call -- `provisionWalletSpace` declares the
|
|
176
|
+
* roster, then {@link ensureWalletSpaceEpochs} installs epoch[0] on every
|
|
177
|
+
* encrypted collection -- with the memoization the engine adds on top.
|
|
178
|
+
*
|
|
179
|
+
* The closure is single-flight: one app runs one engine per synced
|
|
180
|
+
* collection, and every engine's first cycle asks for the same provisioning,
|
|
181
|
+
* so concurrent calls share one in-flight run instead of racing the same
|
|
182
|
+
* create-if-absent writes. A run that leaves a collection without its epoch
|
|
183
|
+
* throws {@link WalletSpaceProvisioningError} naming the collections, so the
|
|
184
|
+
* engine does not memoize it and the next cycle re-runs it; the collections
|
|
185
|
+
* that did settle are adopted untouched by that re-run.
|
|
186
|
+
*
|
|
187
|
+
* The optional `onSettled` hook receives every run's epoch report, a partial
|
|
188
|
+
* one included, BEFORE the refusal above: a transient failure on one
|
|
189
|
+
* collection never costs the caller the descriptors the others settled on,
|
|
190
|
+
* the property the epoch install itself keeps. That report is what an eager
|
|
191
|
+
* minter builds its cipher from: the returned descriptors are the settled
|
|
192
|
+
* ones, adopted or installed, and the engine's `remintPending` seam then
|
|
193
|
+
* re-mints whatever that cipher cannot route.
|
|
194
|
+
*
|
|
195
|
+
* @param options {object}
|
|
196
|
+
* @param options.was {WasClient}
|
|
197
|
+
* @param options.spaceId {string}
|
|
198
|
+
* @param options.controllerDid {string} the Space controller, used only when
|
|
199
|
+
* the Space does not exist yet
|
|
200
|
+
* @param options.userKey {UserKey} the account's user key, epoch[0]'s one
|
|
201
|
+
* initial recipient
|
|
202
|
+
* @param [options.collectionIds] {string[]} the encrypted collections to
|
|
203
|
+
* cover; defaults to the wallet Space roster's encrypted collections
|
|
204
|
+
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
205
|
+
* every epoch-install request (see {@link ensureWalletSpaceEpochs})
|
|
206
|
+
* @param [options.onSettled] {function}
|
|
207
|
+
* `(result: WalletSpaceEpochsResult) => void | Promise<void>`, called after
|
|
208
|
+
* each run's epoch install with its report, before a partial run's refusal
|
|
209
|
+
* @returns {() => Promise<void>} the engine's `ensureProvisioned` seam
|
|
210
|
+
*/
|
|
211
|
+
export declare function walletSpaceProvisioner({ was, spaceId, controllerDid, userKey, collectionIds, capability, onSettled }: {
|
|
212
|
+
was: WasClient;
|
|
213
|
+
spaceId: string;
|
|
214
|
+
controllerDid: string;
|
|
215
|
+
userKey: UserKey;
|
|
216
|
+
collectionIds?: string[];
|
|
217
|
+
capability?: IZcap;
|
|
218
|
+
onSettled?: (result: WalletSpaceEpochsResult) => void | Promise<void>;
|
|
219
|
+
}): () => Promise<void>;
|
|
131
220
|
//# sourceMappingURL=spaceEpochs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceEpochs.d.ts","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,KAAK,EACL,SAAS,EACV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"spaceEpochs.d.ts","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,KAAK,EACL,SAAS,EACV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CACd,MAAM,EACN;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,oBAAoB,CAAA;KAAE,CACzD,CAAA;IACD,MAAM,EAAE,KAAK,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACvD;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,kBAAkB,EAAE,CAAA;CACjC,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,oBAA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keys/spaceEpochs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ensureFirstEpoch } from '@interop/was-client/edv';
|
|
2
2
|
import { encryptedWalletCollectionIds } from '../space/collections.js';
|
|
3
|
+
import { provisionWalletSpace } from '../space/provisioning.js';
|
|
3
4
|
import { userKeyAsRecipient } from './userKeyCascade.js';
|
|
4
5
|
/**
|
|
5
6
|
* Installs key epoch[0] on a collection together with its blinded-index HMAC
|
|
@@ -34,7 +35,7 @@ export async function ensureIndexedFirstEpoch({ collection, recipients }) {
|
|
|
34
35
|
catch (err) {
|
|
35
36
|
// Errors cross package boundaries, so match the refusal on its stable
|
|
36
37
|
// `name` rather than on `instanceof`.
|
|
37
|
-
if (err
|
|
38
|
+
if (err?.name !== 'EncryptionError') {
|
|
38
39
|
throw err;
|
|
39
40
|
}
|
|
40
41
|
return await ensureFirstEpoch({ collection, recipients });
|
|
@@ -51,8 +52,9 @@ export async function ensureIndexedFirstEpoch({ collection, recipients }) {
|
|
|
51
52
|
* `provisionWalletSpace` has declared the collections; the wallet Space's
|
|
52
53
|
* provisioning is complete only once both steps have.
|
|
53
54
|
*
|
|
54
|
-
* Run both steps from the sync engine's `ensureProvisioned` seam
|
|
55
|
-
*
|
|
55
|
+
* Run both steps from the sync engine's `ensureProvisioned` seam
|
|
56
|
+
* ({@link walletSpaceProvisioner} builds that closure) or, for a driver of its
|
|
57
|
+
* own, equally before the collection's first content push: the
|
|
56
58
|
* descriptor-before-first-content-push invariant rests on it.
|
|
57
59
|
*
|
|
58
60
|
* A collection that fails is reported in `failed` and the rest proceed, so a
|
|
@@ -72,11 +74,26 @@ export async function ensureIndexedFirstEpoch({ collection, recipients }) {
|
|
|
72
74
|
* descriptor's cipher on every run is both correct and (in the settled case)
|
|
73
75
|
* free.
|
|
74
76
|
*
|
|
77
|
+
* **The mint gate.** Collection epochs install only under the key the user-key
|
|
78
|
+
* roster delivers. A caller holding the settled roster descriptor passes it as
|
|
79
|
+
* `rosterDescriptor`, and the fan-out is refused whole (`skipped`, nothing
|
|
80
|
+
* written) when the roster's current epoch is not `userKey`: epoch[0] is
|
|
81
|
+
* create-if-absent and every later ensure adopts it, so a collection installed
|
|
82
|
+
* under a key the roster does not deliver -- a genesis re-run's throwaway
|
|
83
|
+
* candidate over an adopted roster, a cached key the roster has rotated away
|
|
84
|
+
* from -- is keyed to nothing, permanently. The gate lives here so every
|
|
85
|
+
* installer runs the same test rather than re-deriving it. A caller without
|
|
86
|
+
* the roster in hand (the sync engine's provisioner, whose user key is the one
|
|
87
|
+
* login just adopted from the roster) runs ungated.
|
|
88
|
+
*
|
|
75
89
|
* @param options {object}
|
|
76
90
|
* @param options.was {WasClient}
|
|
77
91
|
* @param options.spaceId {string}
|
|
78
92
|
* @param options.userKey {UserKey} the account's user key, epoch[0]'s one
|
|
79
93
|
* initial recipient
|
|
94
|
+
* @param [options.rosterDescriptor] {CollectionEncryption} the settled
|
|
95
|
+
* user-key roster descriptor, when the caller holds it: the mint gate
|
|
96
|
+
* refuses the fan-out unless its current epoch IS `userKey`
|
|
80
97
|
* @param [options.collectionIds] {string[]} the encrypted collections to
|
|
81
98
|
* cover; defaults to the wallet Space roster's encrypted collections. A
|
|
82
99
|
* caller naming its own ids (e.g. `contacts`) must name only collections
|
|
@@ -89,7 +106,16 @@ export async function ensureIndexedFirstEpoch({ collection, recipients }) {
|
|
|
89
106
|
* descriptor and whether this call installed its epoch[0] (`false` means an
|
|
90
107
|
* existing roster was adopted), plus the collections that failed
|
|
91
108
|
*/
|
|
92
|
-
export async function ensureWalletSpaceEpochs({ was, spaceId, userKey, collectionIds, capability }) {
|
|
109
|
+
export async function ensureWalletSpaceEpochs({ was, spaceId, userKey, rosterDescriptor, collectionIds, capability }) {
|
|
110
|
+
if (rosterDescriptor && rosterDescriptor.currentEpoch !== userKey.id) {
|
|
111
|
+
return {
|
|
112
|
+
outcomes: {},
|
|
113
|
+
failed: [],
|
|
114
|
+
skipped: rosterDescriptor.currentEpoch !== undefined
|
|
115
|
+
? { rosterEpochId: rosterDescriptor.currentEpoch }
|
|
116
|
+
: {}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
93
119
|
const ids = collectionIds ?? encryptedWalletCollectionIds();
|
|
94
120
|
const outcomes = {};
|
|
95
121
|
const failed = [];
|
|
@@ -113,4 +139,84 @@ export async function ensureWalletSpaceEpochs({ was, spaceId, userKey, collectio
|
|
|
113
139
|
}));
|
|
114
140
|
return { outcomes, failed };
|
|
115
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Thrown by a {@link walletSpaceProvisioner} closure when the epoch[0] install
|
|
144
|
+
* left any collection behind: the collections that did settle are adopted, and
|
|
145
|
+
* the throw keeps the sync engine from memoizing a torn provisioning, so the
|
|
146
|
+
* next cycle re-runs it and converges.
|
|
147
|
+
*/
|
|
148
|
+
export class WalletSpaceProvisioningError extends Error {
|
|
149
|
+
failed;
|
|
150
|
+
constructor({ failed }) {
|
|
151
|
+
super(`Wallet Space provisioning left ${failed.length} collection(s) ` +
|
|
152
|
+
`without their first key epoch: ` +
|
|
153
|
+
failed.map(entry => `"${entry.collectionId}"`).join(', ') +
|
|
154
|
+
'.');
|
|
155
|
+
this.name = 'WalletSpaceProvisioningError';
|
|
156
|
+
this.failed = failed;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Builds the sync engine's `ensureProvisioned` closure for a wallet Space: the
|
|
161
|
+
* provisioning two-step as one call -- `provisionWalletSpace` declares the
|
|
162
|
+
* roster, then {@link ensureWalletSpaceEpochs} installs epoch[0] on every
|
|
163
|
+
* encrypted collection -- with the memoization the engine adds on top.
|
|
164
|
+
*
|
|
165
|
+
* The closure is single-flight: one app runs one engine per synced
|
|
166
|
+
* collection, and every engine's first cycle asks for the same provisioning,
|
|
167
|
+
* so concurrent calls share one in-flight run instead of racing the same
|
|
168
|
+
* create-if-absent writes. A run that leaves a collection without its epoch
|
|
169
|
+
* throws {@link WalletSpaceProvisioningError} naming the collections, so the
|
|
170
|
+
* engine does not memoize it and the next cycle re-runs it; the collections
|
|
171
|
+
* that did settle are adopted untouched by that re-run.
|
|
172
|
+
*
|
|
173
|
+
* The optional `onSettled` hook receives every run's epoch report, a partial
|
|
174
|
+
* one included, BEFORE the refusal above: a transient failure on one
|
|
175
|
+
* collection never costs the caller the descriptors the others settled on,
|
|
176
|
+
* the property the epoch install itself keeps. That report is what an eager
|
|
177
|
+
* minter builds its cipher from: the returned descriptors are the settled
|
|
178
|
+
* ones, adopted or installed, and the engine's `remintPending` seam then
|
|
179
|
+
* re-mints whatever that cipher cannot route.
|
|
180
|
+
*
|
|
181
|
+
* @param options {object}
|
|
182
|
+
* @param options.was {WasClient}
|
|
183
|
+
* @param options.spaceId {string}
|
|
184
|
+
* @param options.controllerDid {string} the Space controller, used only when
|
|
185
|
+
* the Space does not exist yet
|
|
186
|
+
* @param options.userKey {UserKey} the account's user key, epoch[0]'s one
|
|
187
|
+
* initial recipient
|
|
188
|
+
* @param [options.collectionIds] {string[]} the encrypted collections to
|
|
189
|
+
* cover; defaults to the wallet Space roster's encrypted collections
|
|
190
|
+
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
191
|
+
* every epoch-install request (see {@link ensureWalletSpaceEpochs})
|
|
192
|
+
* @param [options.onSettled] {function}
|
|
193
|
+
* `(result: WalletSpaceEpochsResult) => void | Promise<void>`, called after
|
|
194
|
+
* each run's epoch install with its report, before a partial run's refusal
|
|
195
|
+
* @returns {() => Promise<void>} the engine's `ensureProvisioned` seam
|
|
196
|
+
*/
|
|
197
|
+
export function walletSpaceProvisioner({ was, spaceId, controllerDid, userKey, collectionIds, capability, onSettled }) {
|
|
198
|
+
let inFlight = null;
|
|
199
|
+
const run = async () => {
|
|
200
|
+
await provisionWalletSpace({ was, spaceId, controllerDid });
|
|
201
|
+
const result = await ensureWalletSpaceEpochs({
|
|
202
|
+
was,
|
|
203
|
+
spaceId,
|
|
204
|
+
userKey,
|
|
205
|
+
collectionIds,
|
|
206
|
+
capability
|
|
207
|
+
});
|
|
208
|
+
await onSettled?.(result);
|
|
209
|
+
if (result.failed.length > 0) {
|
|
210
|
+
throw new WalletSpaceProvisioningError({ failed: result.failed });
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
return async () => {
|
|
214
|
+
if (inFlight === null) {
|
|
215
|
+
inFlight = run().finally(() => {
|
|
216
|
+
inFlight = null;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return inFlight;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
116
222
|
//# sourceMappingURL=spaceEpochs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceEpochs.js","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,gBAAgB,EAEjB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"spaceEpochs.js","sourceRoot":"","sources":["../../src/keys/spaceEpochs.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,gBAAgB,EAEjB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AA4BxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,UAAU,EACV,UAAU,EAIX;IACC,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU;YACV,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sEAAsE;QACtE,sCAAsC;QACt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C,CAAA;QACF,MAAM,SAAS,EAAE,CAAC,MAAM,CAAC,CAAA;QACzB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,4BAA4B,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACnE,CAAC;IACH,CAAC,CAAA;IACD,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC5B,QAAQ,GAAG,IAAI,CAAA;YACjB,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
* carries an epoch roster from provisioning (`ensureWalletSpaceEpochs`), so a
|
|
24
24
|
* descriptor met without epochs can only mean a tampering or pre-provisioning
|
|
25
25
|
* host and is refused fail-closed. A descriptor whose `currentEpoch` names no
|
|
26
|
-
* epoch in its own list is refused the same way
|
|
27
|
-
* `readUserKeyRoster` refuses on the roster itself
|
|
28
|
-
* arrive host-served
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* epoch in its own list is refused the same way, through the same helper
|
|
27
|
+
* `readUserKeyRoster` refuses on the roster itself ({@link currentEpochOf},
|
|
28
|
+
* `UserKeyRosterIntegrityError`): collection descriptors arrive host-served
|
|
29
|
+
* with no server-side epoch invariants, so a mismatched pair is a
|
|
30
|
+
* configuration no enrolled client authenticated, never something to
|
|
31
|
+
* evaluate against the last epoch. No construction anywhere installs a
|
|
31
32
|
* user-key secret as a collection epoch secret, which is what keeps a
|
|
32
33
|
* collection-epoch escrow (an App Connect grant, a share) from ever handing a
|
|
33
34
|
* grantee the user key itself.
|
|
@@ -111,6 +112,8 @@ export type CollectionUserKeyRotationOutcome = 'noop' | 'sealed' | 'escrowed' |
|
|
|
111
112
|
* @param options.generations {UserKey[]} every roster generation this client
|
|
112
113
|
* could unwrap ({@link unwrapUserKeyGenerations}), oldest first
|
|
113
114
|
* @returns {Promise<CollectionUserKeyRotationOutcome>}
|
|
115
|
+
* @throws {UserKeyRosterIntegrityError} the descriptor's `currentEpoch`
|
|
116
|
+
* names no epoch in its own list
|
|
114
117
|
*/
|
|
115
118
|
export declare function rotateCollectionEpochsToUserKey({ store, userKey, generations }: {
|
|
116
119
|
store: EncryptionDescriptorStore;
|