@interop/wallet-core 0.81.1 → 0.82.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.
|
@@ -54,8 +54,12 @@ export type CollectionUserKeyRotationOutcome = 'noop' | 'sealed' | 'escrowed' |
|
|
|
54
54
|
* - **Stale current epoch** (names a non-current generation): one
|
|
55
55
|
* `replaceRecipient` write -- the current user key escrowed into every epoch,
|
|
56
56
|
* a fresh epoch minted without the stale generations. Two requests per
|
|
57
|
-
* collection
|
|
58
|
-
*
|
|
57
|
+
* collection. On a log-governed (sealable) store, app recipients and other
|
|
58
|
+
* readers ride through: the current epoch comes from the verified log head,
|
|
59
|
+
* so its did:key roster is authenticated and re-wrapped as it stands
|
|
60
|
+
* (`trustRosterDidKeys`). On any other store the roster is host-served and
|
|
61
|
+
* unauthenticated, so the fresh epoch goes to the current user key alone
|
|
62
|
+
* and every other entry is dropped.
|
|
59
63
|
* - **Current already** and fully escrowed: no epoch write at all, so a naive
|
|
60
64
|
* re-run after a mid-cascade crash converges with zero redundant epochs. On
|
|
61
65
|
* a log-governed (sealable) store this is exactly where an unsealed log can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACp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,oBAAoB,CAAA;IACtC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,0BAA0B,CAAA;CACxC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4BhC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addRecipient, epochKeyIdFor, hasKeyEpochs, replaceRecipient } from '@interop/was-client/edv/core';
|
|
1
|
+
import { addRecipient, epochKeyIdFor, hasKeyEpochs, replaceRecipient, trustRosterDidKeys } from '@interop/was-client/edv/core';
|
|
2
2
|
import { isSealableDescriptorStore } from './rosterLogStore.js';
|
|
3
3
|
import { currentEpochOf } from './userKeyRoster.js';
|
|
4
4
|
import { userKeyVaultKeys } from './userKey.js';
|
|
@@ -10,8 +10,12 @@ import { unwrapUserKeyGenerations, userKeyAsRecipient } from './userKeyGeneratio
|
|
|
10
10
|
* - **Stale current epoch** (names a non-current generation): one
|
|
11
11
|
* `replaceRecipient` write -- the current user key escrowed into every epoch,
|
|
12
12
|
* a fresh epoch minted without the stale generations. Two requests per
|
|
13
|
-
* collection
|
|
14
|
-
*
|
|
13
|
+
* collection. On a log-governed (sealable) store, app recipients and other
|
|
14
|
+
* readers ride through: the current epoch comes from the verified log head,
|
|
15
|
+
* so its did:key roster is authenticated and re-wrapped as it stands
|
|
16
|
+
* (`trustRosterDidKeys`). On any other store the roster is host-served and
|
|
17
|
+
* unauthenticated, so the fresh epoch goes to the current user key alone
|
|
18
|
+
* and every other entry is dropped.
|
|
15
19
|
* - **Current already** and fully escrowed: no epoch write at all, so a naive
|
|
16
20
|
* re-run after a mid-cascade crash converges with zero redundant epochs. On
|
|
17
21
|
* a log-governed (sealable) store this is exactly where an unsealed log can
|
|
@@ -84,6 +88,9 @@ export async function rotateCollectionEpochsToUserKey({ store, userKey, generati
|
|
|
84
88
|
retire: staleKids,
|
|
85
89
|
recipient: userKeyAsRecipient({ userKey }),
|
|
86
90
|
owner: { keyAgreementKey: owner.keyAgreementKey },
|
|
91
|
+
resolveRecipientKey: isSealableDescriptorStore(store)
|
|
92
|
+
? trustRosterDidKeys
|
|
93
|
+
: vouchNoSurvivor,
|
|
87
94
|
pull: async () => { }
|
|
88
95
|
});
|
|
89
96
|
return 'rotated';
|
|
@@ -116,6 +123,18 @@ export async function rotateCollectionEpochsToUserKey({ store, userKey, generati
|
|
|
116
123
|
});
|
|
117
124
|
return 'escrowed';
|
|
118
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* The survivor resolver for a store whose roster is not authenticated: it
|
|
128
|
+
* vouches for no surviving entry. The incoming current user key needs no
|
|
129
|
+
* resolver (`replaceRecipient` wraps it from the key in hand), and every stale
|
|
130
|
+
* generation still in the current epoch is being retired, so a server-planted
|
|
131
|
+
* entry is dropped from the fresh epoch rather than handed its secret.
|
|
132
|
+
*
|
|
133
|
+
* @returns {Promise<null>}
|
|
134
|
+
*/
|
|
135
|
+
async function vouchNoSurvivor() {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
119
138
|
/**
|
|
120
139
|
* The collection fan-out of the user key rotation cascade: re-epochs every
|
|
121
140
|
* named collection onto the roster's current user key, in parallel, unwrapping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,
|
|
1
|
+
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAgB,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AQ,EAAE,MAAM,EAAE,CAAA;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/wallet-core",
|
|
3
3
|
"description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.82.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@eslint/js": "^10.0.1",
|
|
39
39
|
"@interop/logger": "^0.2.0",
|
|
40
40
|
"@interop/storage-core": "^0.20.0",
|
|
41
|
-
"@interop/was-client": "^0.
|
|
41
|
+
"@interop/was-client": "^0.74.0",
|
|
42
42
|
"@playwright/test": "^1.60.0",
|
|
43
43
|
"@types/node": "^26.0.1",
|
|
44
44
|
"@vitest/coverage-v8": "^4.1.7",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vitest": "^4.1.7"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@interop/was-client": ">=0.
|
|
56
|
+
"@interop/was-client": ">=0.74.0 <1.0.0"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"dist",
|