@interop/wallet-core 0.66.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 +46 -18
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +112 -65
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +5 -6
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +26 -113
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +26 -150
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +79 -13
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +67 -122
- package/dist/clientAnnex/heal.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 +4 -4
- 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 +283 -47
- 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 +68 -57
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +96 -126
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.js +44 -20
- 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 +6 -2
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +5 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +14 -5
- 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/userKeyRoster.d.ts +30 -3
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +90 -15
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +5 -1
- 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 +23 -126
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +1 -266
- 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/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":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAA;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,GAAG,QAAQ,CAAA;CACrD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,UAAU,CAAC,EAAE,0BAA0B,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ToDocumentAndCascade } from '../keys/index.js';
|
|
3
|
+
import { assertUpdateKeyAttributed } from './policy.js';
|
|
3
4
|
/**
|
|
4
5
|
* Runs the whole revocation cascade for one enrolled wallet client. See the
|
|
5
6
|
* module doc for the order and the convergence story. Throws before touching
|
|
6
|
-
* anything on a call that must not proceed
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* anything on a call that must not proceed: a client whose active update key
|
|
8
|
+
* was not attributed is refused here, and a client revoking itself is refused
|
|
9
|
+
* by the document edit's own client-arm check, from the seeds it holds, before
|
|
10
|
+
* its entry publishes -- the one wording every wallet sees, with the `self`
|
|
11
|
+
* eligibility refusal in `policy.ts` naming the rule for the surface. Once
|
|
12
|
+
* the document edit lands, a thrown later stage leaves durable state a naive
|
|
13
|
+
* re-run -- or the login-time sweep -- converges from.
|
|
10
14
|
*
|
|
11
15
|
* The document edit's `StagedCommitmentAmbiguousError` passes through
|
|
12
16
|
* unwrapped, so a surface can re-word it ("disconnect this wallet from the
|
|
@@ -37,9 +41,6 @@ import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
|
37
41
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
38
42
|
* stored account pointer; supplied, the document edit refuses a `did.jsonl`
|
|
39
43
|
* resolving to any other account
|
|
40
|
-
* @param [options.ownSigningKeyMultibase] {string} this client's own signing
|
|
41
|
-
* key; supplied, self-revocation is refused up front by the rule the surface
|
|
42
|
-
* should name, rather than by the update-key check inside the edit
|
|
43
44
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
44
45
|
* `key-map/user-key.jsonl` roster store
|
|
45
46
|
* @param [options.userKey] {UserKey} this client's cached user key
|
|
@@ -51,28 +52,17 @@ import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
|
51
52
|
* with `{ userKey, latestEpochId, descriptor }` after the roster read and BEFORE
|
|
52
53
|
* the fan-out. The key and the epoch pin must persist atomically
|
|
53
54
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
54
|
-
* @param [options.remintRecoveryDelegations] {Function} `({ document }) =>
|
|
55
|
-
* Promise<{ reminted, skipped }>` -- the recovery-delegation re-mint stage,
|
|
56
|
-
* for a wallet that issues recovery codes
|
|
57
55
|
* @param [options.remintGenerationDelegation] {Function} `({ document }) =>
|
|
58
56
|
* Promise<GenerationDelegationRemint>` -- the generation-delegation
|
|
59
|
-
* re-mint stage, run against the post-edit document (stage
|
|
57
|
+
* re-mint stage, run against the post-edit document (stage 4 in the module
|
|
60
58
|
* doc); expected to catch its own failures and report them
|
|
61
59
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) => Promise<void>`
|
|
62
60
|
* -- the live-session adoption of a rotated key, run last so the session
|
|
63
61
|
* keeps operating without a re-login
|
|
64
62
|
* @returns {Promise<ClientRevocationResult>}
|
|
65
63
|
*/
|
|
66
|
-
export async function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid,
|
|
67
|
-
|
|
68
|
-
ownSigningKeyMultibase === revokedClient.signingKeyMultibase) {
|
|
69
|
-
throw new Error('This wallet cannot disconnect itself; use another enrolled wallet ' +
|
|
70
|
-
'client (or a recovery code) instead.');
|
|
71
|
-
}
|
|
72
|
-
if (!revokedClient.updateKeyMultibase) {
|
|
73
|
-
throw new Error("This wallet's update key could not be attributed from the account " +
|
|
74
|
-
'log, so it cannot be disconnected from here.');
|
|
75
|
-
}
|
|
64
|
+
export async function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintGenerationDelegation, onRotationAdopted }) {
|
|
65
|
+
assertUpdateKeyAttributed(revokedClient);
|
|
76
66
|
// 1. The document edit -- the pull axis everywhere, first. It resolves the
|
|
77
67
|
// document as it now stands, which is what stage 2 resolves its remaining
|
|
78
68
|
// recipients from.
|
|
@@ -111,11 +101,7 @@ export async function revokeAccountClient({ idStore, signer, projectionStore, re
|
|
|
111
101
|
...(generation ? { generation } : {})
|
|
112
102
|
};
|
|
113
103
|
}
|
|
114
|
-
// 4. The
|
|
115
|
-
// session's pre-adoption vault keys.
|
|
116
|
-
const recovery = await remintRecoveryDelegations?.({ document: doc });
|
|
117
|
-
// 5. The generation-delegation re-mint, against the same post-edit
|
|
118
|
-
// document.
|
|
104
|
+
// 4. The generation-delegation re-mint, against the post-edit document.
|
|
119
105
|
const generation = await remintGenerationDelegation?.({ document: doc });
|
|
120
106
|
if (tail.rotated) {
|
|
121
107
|
await onRotationAdopted?.({ userKey: tail.userKey });
|
|
@@ -127,7 +113,6 @@ export async function revokeAccountClient({ idStore, signer, projectionStore, re
|
|
|
127
113
|
document: doc,
|
|
128
114
|
userKey: tail.userKey,
|
|
129
115
|
rosterDescriptor: tail.rosterDescriptor,
|
|
130
|
-
...(recovery ? { recovery } : {}),
|
|
131
116
|
...(generation ? { generation } : {})
|
|
132
117
|
};
|
|
133
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AA4EA,OAAO,EACL,iBAAiB,EAKlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAmCvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,OAAO,EACP,MAAM,EACN,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,iBA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AC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC,CAAA;IACH,CAAC;IAED,wEAAwE;IACxE,MAAM,UAAU,GAAG,MAAM,0BAA0B,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAExE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAA;AACH,CAAC"}
|
|
@@ -137,6 +137,10 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
|
|
|
137
137
|
* store
|
|
138
138
|
* @param options.userKey {UserKey} the start's current user key
|
|
139
139
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
140
|
+
* @param [options.etag] {string} the validator that read was served under
|
|
141
|
+
* (`UserKeyRosterReadResult.etag`), when it was a read on this same
|
|
142
|
+
* `store` instance; with it, a convergence write is seeded from the
|
|
143
|
+
* start's read rather than acquiring the roster a second time
|
|
140
144
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
141
145
|
* (identity) key-agreement key
|
|
142
146
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
@@ -152,11 +156,12 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
|
|
|
152
156
|
* kids found, the kids escrowed by the mirror direction, and the key +
|
|
153
157
|
* descriptor to fan out with
|
|
154
158
|
*/
|
|
155
|
-
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }: {
|
|
159
|
+
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, etag, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }: {
|
|
156
160
|
pointer: AccountLogPointer;
|
|
157
161
|
store: EncryptionDescriptorStore;
|
|
158
162
|
userKey: UserKey;
|
|
159
163
|
descriptor: CollectionEncryption;
|
|
164
|
+
etag?: string;
|
|
160
165
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
161
166
|
pinnedEpochId?: string | null;
|
|
162
167
|
accountLogPinStore?: ResourceLogPinStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EA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E,oBAAoB,CAAA;CACjC,CAAC,CA+GD"}
|
|
@@ -132,6 +132,10 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
|
|
|
132
132
|
* store
|
|
133
133
|
* @param options.userKey {UserKey} the start's current user key
|
|
134
134
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
135
|
+
* @param [options.etag] {string} the validator that read was served under
|
|
136
|
+
* (`UserKeyRosterReadResult.etag`), when it was a read on this same
|
|
137
|
+
* `store` instance; with it, a convergence write is seeded from the
|
|
138
|
+
* start's read rather than acquiring the roster a second time
|
|
135
139
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
136
140
|
* (identity) key-agreement key
|
|
137
141
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
@@ -147,7 +151,7 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
|
|
|
147
151
|
* kids found, the kids escrowed by the mirror direction, and the key +
|
|
148
152
|
* descriptor to fan out with
|
|
149
153
|
*/
|
|
150
|
-
export async function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }) {
|
|
154
|
+
export async function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, etag, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }) {
|
|
151
155
|
const unchanged = {
|
|
152
156
|
rotated: false,
|
|
153
157
|
sealed: false,
|
|
@@ -159,24 +163,27 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
159
163
|
let rotated;
|
|
160
164
|
let staleRecipientIds;
|
|
161
165
|
let escrowedRecipientIds;
|
|
166
|
+
let converged;
|
|
162
167
|
try {
|
|
163
168
|
const { doc } = await verifyAccountLog({
|
|
164
169
|
...pointer,
|
|
165
170
|
...(accountLogPinStore ? { pinStore: accountLogPinStore } : {})
|
|
166
171
|
});
|
|
167
|
-
const
|
|
172
|
+
const result = await convergeUserKeyRosterToDocument({
|
|
168
173
|
store,
|
|
169
174
|
document: doc,
|
|
170
175
|
descriptor,
|
|
176
|
+
...(etag !== undefined ? { etag } : {}),
|
|
171
177
|
// The escrow direction needs a key that unwraps every epoch, and the
|
|
172
178
|
// login sweep is the standing mender for a ceremony torn between the
|
|
173
179
|
// entry that published a client and the append that was to wrap the
|
|
174
180
|
// user key to it. Without it only the retire direction would run here.
|
|
175
181
|
ownerKeyAgreementKey: clientKeyAgreementKey
|
|
176
182
|
});
|
|
177
|
-
rotated =
|
|
178
|
-
staleRecipientIds =
|
|
179
|
-
escrowedRecipientIds =
|
|
183
|
+
rotated = result.rotated;
|
|
184
|
+
staleRecipientIds = result.staleRecipientIds;
|
|
185
|
+
escrowedRecipientIds = result.escrowedRecipientIds;
|
|
186
|
+
converged = result.descriptor;
|
|
180
187
|
}
|
|
181
188
|
catch (err) {
|
|
182
189
|
if (isRosterRefusal(err)) {
|
|
@@ -217,31 +224,21 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
217
224
|
}
|
|
218
225
|
log.warn('The wrap-set roster still wrapped the current key to recipient(s) ' +
|
|
219
226
|
'the account document no longer keys; the rotation has been completed', { staleRecipientCount: staleRecipientIds.length });
|
|
220
|
-
// Rotated: the fresh key is only readable from the roster, so
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
throw new Error('The wrap-set roster was rotated onto a fresh user key, but the ' +
|
|
237
|
-
'read that adopts it failed; this session must not continue under ' +
|
|
238
|
-
'the retired key.', { cause: err });
|
|
239
|
-
}
|
|
240
|
-
if (!read) {
|
|
241
|
-
throw new Error('The wrap-set roster was rotated onto a fresh user key and then ' +
|
|
242
|
-
'reported absent; this session must not continue under the retired ' +
|
|
243
|
-
'key.');
|
|
244
|
-
}
|
|
227
|
+
// Rotated: the fresh key is only readable from the roster, so adopt it
|
|
228
|
+
// before the collection fan-out runs against it -- off the rotation's own
|
|
229
|
+
// verified result, so the roster is not acquired again (the continuity and
|
|
230
|
+
// possession checks still run). A rotation leaves the roster present, so
|
|
231
|
+
// the read cannot resolve absent; its refusals -- this client's own wrap
|
|
232
|
+
// missing from the fresh epoch, a rollback behind the pin -- propagate,
|
|
233
|
+
// since the roster HAS moved and this session must not continue under the
|
|
234
|
+
// retired key.
|
|
235
|
+
const read = await readUserKeyRoster({
|
|
236
|
+
store,
|
|
237
|
+
descriptor: converged,
|
|
238
|
+
userKey,
|
|
239
|
+
clientKeyAgreementKey,
|
|
240
|
+
pinnedEpochId
|
|
241
|
+
});
|
|
245
242
|
await onUserKeyAdopted?.({
|
|
246
243
|
userKey: read.userKey,
|
|
247
244
|
latestEpochId: read.latestEpochId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AA4DA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAA;IACrD,OAAO,CACL,IAAI,KAAK,8BAA8B;QACvC,IAAI,KAAK,6BAA6B;QACtC,IAAI,KAAK,0BAA0B,CAC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,mBAAmB,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAClD,CAAA;IAED,uEAAuE;IACvE,0EAA0E;IAC1E,2EAA2E;IAC3E,yEAAyE;IACzE,yEAAyE;IACzE,wEAAwE;IACxE,0EAA0E;IAC1E,eAAe;IACf,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC;QACnC,KAAK;QACL,UAAU,EAAE,SAAU;QACtB,OAAO;QACP,qBAAqB;QACrB,aAAa;KACd,CAAC,CAAA;IACF,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,oBAAoB;QACpB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
* Both classes assign their `name` explicitly, which is what makes the string
|
|
24
24
|
* a contract.
|
|
25
25
|
*
|
|
26
|
-
* The unknown-epoch half of the pair ships from `@interop/
|
|
27
|
-
* as `isUnknownEpochError
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* The unknown-epoch half of the pair ships from `@interop/was-client/sync`
|
|
27
|
+
* as `isUnknownEpochError`, beside the class that assigns the name. This half
|
|
28
|
+
* stays here on policy rather than on class adjacency: it classifies a
|
|
29
|
+
* roster-membership failure the wallet layer owns, and no sync driver
|
|
30
|
+
* dispatches on it. The file sits beside the cipher that raises the error and
|
|
31
|
+
* stays import-free for the same reason `resourceLog/errors.ts` does.
|
|
31
32
|
*/
|
|
32
33
|
/**
|
|
33
34
|
* Whether an error is the cipher's not-a-recipient signal (`KeyUnwrapError`):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/descriptors/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/descriptors/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD"}
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
* Both classes assign their `name` explicitly, which is what makes the string
|
|
24
24
|
* a contract.
|
|
25
25
|
*
|
|
26
|
-
* The unknown-epoch half of the pair ships from `@interop/
|
|
27
|
-
* as `isUnknownEpochError
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* The unknown-epoch half of the pair ships from `@interop/was-client/sync`
|
|
27
|
+
* as `isUnknownEpochError`, beside the class that assigns the name. This half
|
|
28
|
+
* stays here on policy rather than on class adjacency: it classifies a
|
|
29
|
+
* roster-membership failure the wallet layer owns, and no sync driver
|
|
30
|
+
* dispatches on it. The file sits beside the cipher that raises the error and
|
|
31
|
+
* stays import-free for the same reason `resourceLog/errors.ts` does.
|
|
31
32
|
*/
|
|
32
33
|
/**
|
|
33
34
|
* Whether an error is the cipher's not-a-recipient signal (`KeyUnwrapError`):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/descriptors/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/descriptors/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAQ,GAAiC,EAAE,IAAI,KAAK,gBAAgB,CAAA;AACtE,CAAC"}
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
* collections whose descriptor is governed by a resource log: every read
|
|
28
28
|
* (including the unknown-epoch refresh) re-verifies the log and resolves to
|
|
29
29
|
* its verified head state, refusing a head that is not a
|
|
30
|
-
* `WasEpochConfiguration`.
|
|
30
|
+
* `WasEpochConfiguration`. It keys each collection's chain-head pin by
|
|
31
|
+
* `collectionDescriptorLogPinId` over the Space id, the library-named slot
|
|
32
|
+
* (`space/<spaceId>/key-map/<collectionId>.jsonl`), so no app builds one.
|
|
31
33
|
* - `DescriptorRefreshPolicy` -- the once-per-collection-per-session
|
|
32
34
|
* unknown-epoch refresh guard, plus the refresh-and-re-read-once wrapper
|
|
33
35
|
* for hosts whose reads scan rows and count unknown-epoch skips.
|
|
@@ -38,11 +40,13 @@
|
|
|
38
40
|
* - `isKeyUnwrapError` -- how a host scanning rows tells "not a recipient of
|
|
39
41
|
* this epoch" from corruption, matched by `err.name` because the cipher is
|
|
40
42
|
* an injected seam. Its sibling `isUnknownEpochError` ships from
|
|
41
|
-
* `@interop/
|
|
43
|
+
* `@interop/was-client/sync`, beside the class it matches. This one stays
|
|
44
|
+
* here on policy: it classifies a roster-membership failure the wallet
|
|
45
|
+
* layer owns, and no sync driver dispatches on it.
|
|
42
46
|
*/
|
|
43
47
|
export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
|
|
44
48
|
export type { EncryptionDescriptorCache, EncryptionDescriptorSource } from './acquire.js';
|
|
45
|
-
export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
|
|
49
|
+
export { collectionDescriptorLogPinId, EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
|
|
46
50
|
export { DescriptorRefreshPolicy } from './refresh.js';
|
|
47
51
|
export { createRefreshingEdvDocCipher } from './cipher.js';
|
|
48
52
|
export { isKeyUnwrapError } from './errors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
* collections whose descriptor is governed by a resource log: every read
|
|
28
28
|
* (including the unknown-epoch refresh) re-verifies the log and resolves to
|
|
29
29
|
* its verified head state, refusing a head that is not a
|
|
30
|
-
* `WasEpochConfiguration`.
|
|
30
|
+
* `WasEpochConfiguration`. It keys each collection's chain-head pin by
|
|
31
|
+
* `collectionDescriptorLogPinId` over the Space id, the library-named slot
|
|
32
|
+
* (`space/<spaceId>/key-map/<collectionId>.jsonl`), so no app builds one.
|
|
31
33
|
* - `DescriptorRefreshPolicy` -- the once-per-collection-per-session
|
|
32
34
|
* unknown-epoch refresh guard, plus the refresh-and-re-read-once wrapper
|
|
33
35
|
* for hosts whose reads scan rows and count unknown-epoch skips.
|
|
@@ -38,10 +40,12 @@
|
|
|
38
40
|
* - `isKeyUnwrapError` -- how a host scanning rows tells "not a recipient of
|
|
39
41
|
* this epoch" from corruption, matched by `err.name` because the cipher is
|
|
40
42
|
* an injected seam. Its sibling `isUnknownEpochError` ships from
|
|
41
|
-
* `@interop/
|
|
43
|
+
* `@interop/was-client/sync`, beside the class it matches. This one stays
|
|
44
|
+
* here on policy: it classifies a roster-membership failure the wallet
|
|
45
|
+
* layer owns, and no sync driver dispatches on it.
|
|
42
46
|
*/
|
|
43
47
|
export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
|
|
44
|
-
export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
|
|
48
|
+
export { collectionDescriptorLogPinId, EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
|
|
45
49
|
export { DescriptorRefreshPolicy } from './refresh.js';
|
|
46
50
|
export { createRefreshingEdvDocCipher } from './cipher.js';
|
|
47
51
|
export { isKeyUnwrapError } from './errors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAMrB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -21,6 +21,29 @@ import type { EncryptionDescriptorSource } from './acquire.js';
|
|
|
21
21
|
* governed log entry, per WAS-EC.
|
|
22
22
|
*/
|
|
23
23
|
export declare const EPOCH_CONFIGURATION_STATE_TYPE = "WasEpochConfiguration";
|
|
24
|
+
/**
|
|
25
|
+
* The pin-slot key for a collection's governing descriptor log: the slot a
|
|
26
|
+
* keyed `ResourceLogPinStore` holds that log's chain-head pin under,
|
|
27
|
+
* `space/<spaceId>/key-map/<collectionId>.jsonl`. The library names it, as it
|
|
28
|
+
* names the account log's (`accountLogPinId`) and the roster's
|
|
29
|
+
* (`userKeyRosterPinId`) slots, so no app builds one of its own: the shape is
|
|
30
|
+
* host-free on purpose -- the Space id is what stays stable across a claimed
|
|
31
|
+
* host move, so a log served from a new host still lands in the same slot and
|
|
32
|
+
* is checked against the held pin rather than opening a fresh
|
|
33
|
+
* trust-on-first-use slate. The resource half mirrors the roster log's home
|
|
34
|
+
* (`key-map/user-key.jsonl`): a governing log lives in the plaintext,
|
|
35
|
+
* capability-gated key-map collection, beside the roster, since a log stored
|
|
36
|
+
* inside the encrypted collection it governs would itself be sealed.
|
|
37
|
+
*
|
|
38
|
+
* @param options {object}
|
|
39
|
+
* @param options.spaceId {string} the data Space id
|
|
40
|
+
* @param options.collectionId {string} the governed collection
|
|
41
|
+
* @returns {string}
|
|
42
|
+
*/
|
|
43
|
+
export declare function collectionDescriptorLogPinId({ spaceId, collectionId }: {
|
|
44
|
+
spaceId: string;
|
|
45
|
+
collectionId: string;
|
|
46
|
+
}): string;
|
|
24
47
|
/**
|
|
25
48
|
* The one governed epoch-configuration read: the fail-closed boundary that
|
|
26
49
|
* decides whether a served log state may be treated as an encryption
|
|
@@ -72,16 +95,15 @@ export declare function readGovernedEpochConfiguration({ store, resolveControlle
|
|
|
72
95
|
* `() => Promise<ResourceLogController>` -- the caller's currently verified
|
|
73
96
|
* controller view, resolved per operation
|
|
74
97
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
75
|
-
* pins, keyed per log
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* `resourceLogPinId`
|
|
98
|
+
* pins, keyed per log; each collection's slot is
|
|
99
|
+
* {@link collectionDescriptorLogPinId} over `spaceId`
|
|
100
|
+
* @param options.spaceId {string} the data Space the collections belong to
|
|
79
101
|
* @returns {EncryptionDescriptorSource}
|
|
80
102
|
*/
|
|
81
|
-
export declare function logGovernedDescriptorSource({ logFor, resolveController, pinStore,
|
|
103
|
+
export declare function logGovernedDescriptorSource({ logFor, resolveController, pinStore, spaceId }: {
|
|
82
104
|
logFor: (collectionId: string) => ResourceLogStore;
|
|
83
105
|
resolveController: () => Promise<ResourceLogController>;
|
|
84
106
|
pinStore: ResourceLogPinStore;
|
|
85
|
-
|
|
107
|
+
spaceId: string;
|
|
86
108
|
}): EncryptionDescriptorSource;
|
|
87
109
|
//# sourceMappingURL=logSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,OAAO,EACP,YAAY,EACb,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,MAAM,CAMT;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACN,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAA;IACvB,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,oBAAoB,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,IAAI,CAAC,CAwBR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACR,EAAE;IACD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAA;IAClD,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,0BAA0B,CAe7B"}
|
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
import { RESOURCE_LOG_METHOD } from '@interop/storage-core';
|
|
2
|
-
import { readResourceLog, ResourceLogIntegrityError } from '@interop/vh-resource-log';
|
|
2
|
+
import { readResourceLog, ResourceLogIntegrityError, resourceLogPinId } from '@interop/vh-resource-log';
|
|
3
|
+
import { KEY_MAP_COLLECTION } from '../space/collections.js';
|
|
3
4
|
/**
|
|
4
5
|
* The state-document schema identifier an encryption descriptor carries in a
|
|
5
6
|
* governed log entry, per WAS-EC.
|
|
6
7
|
*/
|
|
7
8
|
export const EPOCH_CONFIGURATION_STATE_TYPE = 'WasEpochConfiguration';
|
|
9
|
+
/**
|
|
10
|
+
* The pin-slot key for a collection's governing descriptor log: the slot a
|
|
11
|
+
* keyed `ResourceLogPinStore` holds that log's chain-head pin under,
|
|
12
|
+
* `space/<spaceId>/key-map/<collectionId>.jsonl`. The library names it, as it
|
|
13
|
+
* names the account log's (`accountLogPinId`) and the roster's
|
|
14
|
+
* (`userKeyRosterPinId`) slots, so no app builds one of its own: the shape is
|
|
15
|
+
* host-free on purpose -- the Space id is what stays stable across a claimed
|
|
16
|
+
* host move, so a log served from a new host still lands in the same slot and
|
|
17
|
+
* is checked against the held pin rather than opening a fresh
|
|
18
|
+
* trust-on-first-use slate. The resource half mirrors the roster log's home
|
|
19
|
+
* (`key-map/user-key.jsonl`): a governing log lives in the plaintext,
|
|
20
|
+
* capability-gated key-map collection, beside the roster, since a log stored
|
|
21
|
+
* inside the encrypted collection it governs would itself be sealed.
|
|
22
|
+
*
|
|
23
|
+
* @param options {object}
|
|
24
|
+
* @param options.spaceId {string} the data Space id
|
|
25
|
+
* @param options.collectionId {string} the governed collection
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function collectionDescriptorLogPinId({ spaceId, collectionId }) {
|
|
29
|
+
return resourceLogPinId({
|
|
30
|
+
spaceId,
|
|
31
|
+
collectionId: KEY_MAP_COLLECTION.id,
|
|
32
|
+
resourceId: `${collectionId}.jsonl`
|
|
33
|
+
});
|
|
34
|
+
}
|
|
8
35
|
/**
|
|
9
36
|
* The one governed epoch-configuration read: the fail-closed boundary that
|
|
10
37
|
* decides whether a served log state may be treated as an encryption
|
|
@@ -69,20 +96,19 @@ export async function readGovernedEpochConfiguration({ store, resolveController,
|
|
|
69
96
|
* `() => Promise<ResourceLogController>` -- the caller's currently verified
|
|
70
97
|
* controller view, resolved per operation
|
|
71
98
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
72
|
-
* pins, keyed per log
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* `resourceLogPinId`
|
|
99
|
+
* pins, keyed per log; each collection's slot is
|
|
100
|
+
* {@link collectionDescriptorLogPinId} over `spaceId`
|
|
101
|
+
* @param options.spaceId {string} the data Space the collections belong to
|
|
76
102
|
* @returns {EncryptionDescriptorSource}
|
|
77
103
|
*/
|
|
78
|
-
export function logGovernedDescriptorSource({ logFor, resolveController, pinStore,
|
|
104
|
+
export function logGovernedDescriptorSource({ logFor, resolveController, pinStore, spaceId }) {
|
|
79
105
|
return {
|
|
80
106
|
async collectionEncryption({ collectionId }) {
|
|
81
107
|
const current = await readGovernedEpochConfiguration({
|
|
82
108
|
store: logFor(collectionId),
|
|
83
109
|
resolveController,
|
|
84
110
|
pinStore,
|
|
85
|
-
logId:
|
|
111
|
+
logId: collectionDescriptorLogPinId({ spaceId, collectionId })
|
|
86
112
|
});
|
|
87
113
|
if (current === null) {
|
|
88
114
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,eAAe,EACf,yBAAyB,
|
|
1
|
+
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAKjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,uBAAuB,CAAA;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAC3C,OAAO,EACP,YAAY,E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,OAAO,CAAC;IACrD,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,qBAAqB,CAAA;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB,CAAC,CA2BD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,MAAM,EACN,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACR,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,MAAM,EAAE,gBAAgB,CAAA;IACxB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,kBAAkB,EAAE,yBAAyB,CAAA;IAC7C,OAAO,EAAE,YAAY,CAAA;CACtB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC,CAmC3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,UAAU,EACV,eAAe,EACf,OAAO,EACP,kBAAkB,EACnB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,qBAAqB,CAAA;IACtC,OAAO,EAAE,cAAc,CAAA;IACvB,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAyEvD"}
|
|
@@ -8,7 +8,7 @@ import { AccountLogMissingError, verifyAccountLog } from '../webvh/verifyLog.js'
|
|
|
8
8
|
import { addUserKeyRosterRecipient } from '../keys/userKeyRoster.js';
|
|
9
9
|
import { readUserKeyRoster, rosterRecipientKid, userKeyRosterLogSigner } from '../keys/userKeyRoster.js';
|
|
10
10
|
import { userKeyRosterDescriptorStore } from '../keys/rosterStore.js';
|
|
11
|
-
import {
|
|
11
|
+
import { anchorRosterStoreAt } from '../keys/userKeyRosterCascade.js';
|
|
12
12
|
import { memoryResourceLogPinStore } from '@interop/vh-resource-log';
|
|
13
13
|
import { webvhResourceLogController } from '../resourceLog/index.js';
|
|
14
14
|
import { CONNECT_CODE_PREFIX } from './connectCode.js';
|
|
@@ -214,7 +214,7 @@ export async function mintEnrollmentRequest() {
|
|
|
214
214
|
if (!keyAgreementKeyMultibase) {
|
|
215
215
|
throw new Error('The minted key-agreement key has no public multibase.');
|
|
216
216
|
}
|
|
217
|
-
const webvhUpdateKeys =
|
|
217
|
+
const webvhUpdateKeys = mintClientWebvhUpdateKeys();
|
|
218
218
|
const request = {
|
|
219
219
|
signingKeyMultibase: clientSigningKeyMultibase({ keyAgent }),
|
|
220
220
|
keyAgreementKeyMultibase,
|
|
@@ -304,11 +304,7 @@ export async function approveEnrollment({ request, signer, clientKeyAgreementKey
|
|
|
304
304
|
newClient: request
|
|
305
305
|
});
|
|
306
306
|
if (signer.kind === 'ladder') {
|
|
307
|
-
|
|
308
|
-
userKeyRosterStore.setMinimumControllerVersion({
|
|
309
|
-
controller: webvhResourceLogController({ did, log })
|
|
310
|
-
});
|
|
311
|
-
}
|
|
307
|
+
anchorRosterStoreAt({ rosterStore: userKeyRosterStore, did, log });
|
|
312
308
|
await escrow();
|
|
313
309
|
}
|
|
314
310
|
return {
|