@interop/wallet-core 0.17.1 → 0.18.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 +13 -13
- package/dist/clients/index.d.ts +4 -3
- 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/policy.d.ts +3 -3
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +1 -1
- package/dist/clients/revocation.d.ts +15 -15
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +19 -19
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +26 -25
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +29 -29
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +16 -16
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +19 -19
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/enrollment/index.d.ts +1 -1
- package/dist/enrollment/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/keys/clientKeyRecord.d.ts +16 -16
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +39 -35
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +19 -17
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +16 -14
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -3
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +13 -13
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/userKey.d.ts +43 -0
- package/dist/keys/userKey.d.ts.map +1 -0
- package/dist/keys/{puk.js → userKey.js} +23 -21
- package/dist/keys/userKey.js.map +1 -0
- package/dist/keys/{pukCascade.d.ts → userKeyCascade.d.ts} +69 -69
- package/dist/keys/userKeyCascade.d.ts.map +1 -0
- package/dist/keys/{pukCascade.js → userKeyCascade.js} +67 -64
- package/dist/keys/userKeyCascade.js.map +1 -0
- package/dist/keys/{pukRoster.d.ts → userKeyRoster.d.ts} +73 -74
- package/dist/keys/userKeyRoster.d.ts.map +1 -0
- package/dist/keys/{pukRoster.js → userKeyRoster.js} +86 -83
- package/dist/keys/userKeyRoster.js.map +1 -0
- package/dist/recovery/index.d.ts +1 -1
- package/dist/recovery/index.js +1 -1
- package/dist/recovery/recoveryCode.d.ts +1 -1
- package/dist/recovery/recoveryCode.js +6 -6
- package/dist/recovery/recoveryRecord.d.ts +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +1 -1
- package/dist/recovery/recoveryWebvh.js +1 -1
- package/dist/space/activity.d.ts +1 -1
- package/dist/space/activity.js +1 -1
- package/dist/space/collections.d.ts +17 -17
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +16 -16
- package/dist/space/collections.js.map +1 -1
- package/dist/space/index.d.ts +2 -2
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +2 -2
- package/dist/space/index.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +1 -1
- package/dist/webvh/didWebvh.js +6 -6
- package/package.json +1 -1
- package/dist/keys/puk.d.ts +0 -42
- package/dist/keys/puk.d.ts.map +0 -1
- package/dist/keys/puk.js.map +0 -1
- package/dist/keys/pukCascade.d.ts.map +0 -1
- package/dist/keys/pukCascade.js.map +0 -1
- package/dist/keys/pukRoster.d.ts.map +0 -1
- package/dist/keys/pukRoster.js.map +0 -1
package/README.md
CHANGED
|
@@ -71,19 +71,19 @@ The subpaths:
|
|
|
71
71
|
store they write through, and ZCap signing under the did:webvh
|
|
72
72
|
verification-method id.
|
|
73
73
|
|
|
74
|
-
- **`@interop/wallet-core/keys`** -- the
|
|
75
|
-
`key-map/
|
|
76
|
-
primitives with their client-side guards (`epochsMac`, the
|
|
77
|
-
pin, the document-backed recipient resolver), the roster's
|
|
78
|
-
descriptor store, and the
|
|
79
|
-
collection onto the roster's current
|
|
80
|
-
state alone, history escrowed -- also the
|
|
81
|
-
plus the detector that converges a roster
|
|
82
|
-
recipient the account document no longer
|
|
83
|
-
display labels (`key-map/client-labels.json`)
|
|
84
|
-
the client-key record codec: the contents and
|
|
85
|
-
record each wallet client keeps its own key
|
|
86
|
-
stay app-side).
|
|
74
|
+
- **`@interop/wallet-core/keys`** -- the user key and its
|
|
75
|
+
`key-map/user-key.json` wrap-set roster: minting, the roster's
|
|
76
|
+
init/read/rotate primitives with their client-side guards (`epochsMac`, the
|
|
77
|
+
latest-seen epoch pin, the document-backed recipient resolver), the roster's
|
|
78
|
+
compare-and-swap descriptor store, and the user key rotation cascade's
|
|
79
|
+
per-collection op (re-epoch a collection onto the roster's current user key,
|
|
80
|
+
staleness detected from durable state alone, history escrowed -- also the
|
|
81
|
+
completion sweep's building block), plus the detector that converges a roster
|
|
82
|
+
left wrapping the current key to a recipient the account document no longer
|
|
83
|
+
keys. Also the enrolled-client display labels (`key-map/client-labels.json`)
|
|
84
|
+
and their WAS-backed store. Also the client-key record codec: the contents and
|
|
85
|
+
strict validation of the local record each wallet client keeps its own key
|
|
86
|
+
material in (storage and wrapping stay app-side).
|
|
87
87
|
|
|
88
88
|
- **`@interop/wallet-core/clients`** -- the enrolled-client management surface:
|
|
89
89
|
the listing over the locally verified did:webvh log with display labels
|
package/dist/clients/index.d.ts
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* - `revokeAccountClient` -- the revocation cascade in dependency order
|
|
18
18
|
* (document edit, roster rotation, collection fan-out, optional recovery
|
|
19
19
|
* re-mints), with the app-specific stages injected.
|
|
20
|
-
* - `
|
|
20
|
+
* - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
|
|
21
|
+
* login-time
|
|
21
22
|
* roster policy: which roster failures refuse a session, and the standing
|
|
22
23
|
* convergence of the roster onto the account document.
|
|
23
24
|
*/
|
|
@@ -27,6 +28,6 @@ export { cascadeCompletion, disconnectEligibility, revokedClientKeysFor } from '
|
|
|
27
28
|
export type { DisconnectRefusal } from './policy.js';
|
|
28
29
|
export { revokeAccountClient } from './revocation.js';
|
|
29
30
|
export type { CascadeCollections, ClientRevocationResult } from './revocation.js';
|
|
30
|
-
export {
|
|
31
|
-
export type {
|
|
31
|
+
export { checkUserKeyRosterAtLogin, convergeUserKeyRosterToAccount } from './rosterPolicy.js';
|
|
32
|
+
export type { AdoptedUserKey } from './rosterPolicy.js';
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/clients/index.js
CHANGED
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
* - `revokeAccountClient` -- the revocation cascade in dependency order
|
|
18
18
|
* (document edit, roster rotation, collection fan-out, optional recovery
|
|
19
19
|
* re-mints), with the app-specific stages injected.
|
|
20
|
-
* - `
|
|
20
|
+
* - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
|
|
21
|
+
* login-time
|
|
21
22
|
* roster policy: which roster failures refuse a session, and the standing
|
|
22
23
|
* convergence of the roster onto the account document.
|
|
23
24
|
*/
|
|
24
25
|
export { currentAccountSigningKeys, listAccountClients } from './listing.js';
|
|
25
26
|
export { cascadeCompletion, disconnectEligibility, revokedClientKeysFor } from './policy.js';
|
|
26
27
|
export { revokeAccountClient } from './revocation.js';
|
|
27
|
-
export {
|
|
28
|
+
export { checkUserKeyRosterAtLogin, convergeUserKeyRosterToAccount } from './rosterPolicy.js';
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAO5E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAMrD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA"}
|
package/dist/clients/policy.d.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* that as an error would contradict its own refreshed listing.
|
|
30
30
|
*/
|
|
31
31
|
import type { RevokedClientKeys } from '../webvh/index.js';
|
|
32
|
-
import type {
|
|
32
|
+
import type { UserKeyCascadeResult } from '../keys/index.js';
|
|
33
33
|
import type { AccountClientView } from './listing.js';
|
|
34
34
|
/**
|
|
35
35
|
* Why a listed row cannot be disconnected. See the module doc.
|
|
@@ -70,10 +70,10 @@ export declare function revokedClientKeysFor({ client }: {
|
|
|
70
70
|
* success, never an error (see the module doc).
|
|
71
71
|
*
|
|
72
72
|
* @param options {object}
|
|
73
|
-
* @param options.collections {
|
|
73
|
+
* @param options.collections {UserKeyCascadeResult} the collection fan-out result
|
|
74
74
|
* @returns {'complete' | 'partial'}
|
|
75
75
|
*/
|
|
76
76
|
export declare function cascadeCompletion({ collections }: {
|
|
77
|
-
collections:
|
|
77
|
+
collections: UserKeyCascadeResult;
|
|
78
78
|
}): 'complete' | 'partial';
|
|
79
79
|
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAC3B,MAAM,GAAG,aAAa,GAAG,yBAAyB,CAAA;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACR,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAWpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iBAAiB,CAYpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACZ,EAAE;IACD,WAAW,EAAE,oBAAoB,CAAA;CAClC,GAAG,UAAU,GAAG,SAAS,CAEzB"}
|
package/dist/clients/policy.js
CHANGED
|
@@ -46,7 +46,7 @@ export function revokedClientKeysFor({ client }) {
|
|
|
46
46
|
* success, never an error (see the module doc).
|
|
47
47
|
*
|
|
48
48
|
* @param options {object}
|
|
49
|
-
* @param options.collections {
|
|
49
|
+
* @param options.collections {UserKeyCascadeResult} the collection fan-out result
|
|
50
50
|
* @returns {'complete' | 'partial'}
|
|
51
51
|
*/
|
|
52
52
|
export function cascadeCompletion({ collections }) {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* leaves the document. There is no per-collection revoke anywhere in the
|
|
17
17
|
* cascade; apps a revoked client had connected reconnect through the
|
|
18
18
|
* ordinary connect flow.
|
|
19
|
-
* 2. **The
|
|
19
|
+
* 2. **The user key rotation** in the wrap-set roster, recipients resolved
|
|
20
20
|
* from the document the edit itself just resolved to (no re-fetch of the
|
|
21
21
|
* log this call just extended). The roster delivers, never sources, so the
|
|
22
22
|
* revoked client's entry is dropped even before the retire filter. An
|
|
@@ -48,7 +48,7 @@ import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
|
48
48
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
49
49
|
import type { EncryptionDescriptorStore, EpochsSigner } from '@interop/was-client/edv';
|
|
50
50
|
import { type ClientWebvhUpdateKeys, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
|
|
51
|
-
import { type
|
|
51
|
+
import { type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
52
52
|
/**
|
|
53
53
|
* Where the cascade's collection fan-out gets its work: which encrypted
|
|
54
54
|
* collections exist (only the app knows -- a mobile replica names the
|
|
@@ -69,9 +69,9 @@ export interface CascadeCollections {
|
|
|
69
69
|
*/
|
|
70
70
|
export interface ClientRevocationResult {
|
|
71
71
|
rotated: boolean;
|
|
72
|
-
collections:
|
|
72
|
+
collections: UserKeyCascadeResult;
|
|
73
73
|
document: object;
|
|
74
|
-
|
|
74
|
+
userKey?: UserKey;
|
|
75
75
|
rosterDescriptor?: CollectionEncryption;
|
|
76
76
|
recovery?: {
|
|
77
77
|
reminted: number;
|
|
@@ -109,39 +109,39 @@ export interface ClientRevocationResult {
|
|
|
109
109
|
* key; supplied, self-revocation is refused up front by the rule the surface
|
|
110
110
|
* should name, rather than by the update-key check inside the edit
|
|
111
111
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
112
|
-
* `key-map/
|
|
113
|
-
* @param [options.
|
|
112
|
+
* `key-map/user-key.json` roster store
|
|
113
|
+
* @param [options.userKey] {UserKey} this client's cached user key
|
|
114
114
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
115
115
|
* (identity) key-agreement key -- its roster entry
|
|
116
116
|
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
117
|
-
* signer (`
|
|
117
|
+
* signer (`userKeyRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
118
118
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
119
119
|
* roster epoch
|
|
120
|
-
* @param [options.
|
|
121
|
-
* with `{
|
|
120
|
+
* @param [options.onUserKeyAdopted] {Function} persists a rotated key: called
|
|
121
|
+
* with `{ userKey, latestEpochId, descriptor }` after the roster read and BEFORE
|
|
122
122
|
* the fan-out. The key and the epoch pin must persist atomically
|
|
123
123
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
124
124
|
* @param [options.remintRecoveryDelegations] {Function} `({ document }) =>
|
|
125
125
|
* Promise<{ reminted, skipped }>` -- the recovery-delegation re-mint stage,
|
|
126
126
|
* for a wallet that issues recovery codes
|
|
127
|
-
* @param [options.onRotationAdopted] {Function} `({
|
|
127
|
+
* @param [options.onRotationAdopted] {Function} `({ userKey }) => Promise<void>`
|
|
128
128
|
* -- the live-session adoption of a rotated key, run last so the session
|
|
129
129
|
* keeps operating without a re-login
|
|
130
130
|
* @returns {Promise<ClientRevocationResult>}
|
|
131
131
|
*/
|
|
132
|
-
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore,
|
|
132
|
+
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey, signEpochs, pinnedEpochId, onUserKeyAdopted, collections, remintRecoveryDelegations, onRotationAdopted }: {
|
|
133
133
|
idStore: WebvhIdStore;
|
|
134
134
|
updateKeys: ClientWebvhUpdateKeys;
|
|
135
135
|
revokedClient: RevokedClientKeys;
|
|
136
136
|
knownLatentHashes?: string[];
|
|
137
137
|
ownSigningKeyMultibase?: string;
|
|
138
138
|
rosterStore: EncryptionDescriptorStore;
|
|
139
|
-
|
|
139
|
+
userKey?: UserKey;
|
|
140
140
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
141
141
|
signEpochs: EpochsSigner;
|
|
142
142
|
pinnedEpochId?: string | null;
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
onUserKeyAdopted?: (adopted: {
|
|
144
|
+
userKey: UserKey;
|
|
145
145
|
latestEpochId: string;
|
|
146
146
|
descriptor: CollectionEncryption;
|
|
147
147
|
}) => Promise<void>;
|
|
@@ -153,7 +153,7 @@ export declare function revokeAccountClient({ idStore, updateKeys, revokedClient
|
|
|
153
153
|
skipped: number;
|
|
154
154
|
}>;
|
|
155
155
|
onRotationAdopted?: (rotation: {
|
|
156
|
-
|
|
156
|
+
userKey: UserKey;
|
|
157
157
|
}) => Promise<void>;
|
|
158
158
|
}): Promise<ClientRevocationResult>;
|
|
159
159
|
//# sourceMappingURL=revocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EACV,yBAAyB,EACzB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKL,KAAK,
|
|
1
|
+
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EACV,yBAAyB,EACzB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,OAA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A;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE;QACpC,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpD,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAuGlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { revokeWebvhClient } from '../webvh/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cascadeCollectionsToUserKey, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from '../keys/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Resolves the collection ids the fan-out covers, whether they are a fixed set
|
|
5
5
|
* or a listing the app performs.
|
|
@@ -45,27 +45,27 @@ async function collectionIdsOf({ collections }) {
|
|
|
45
45
|
* key; supplied, self-revocation is refused up front by the rule the surface
|
|
46
46
|
* should name, rather than by the update-key check inside the edit
|
|
47
47
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
48
|
-
* `key-map/
|
|
49
|
-
* @param [options.
|
|
48
|
+
* `key-map/user-key.json` roster store
|
|
49
|
+
* @param [options.userKey] {UserKey} this client's cached user key
|
|
50
50
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
51
51
|
* (identity) key-agreement key -- its roster entry
|
|
52
52
|
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
53
|
-
* signer (`
|
|
53
|
+
* signer (`userKeyRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
54
54
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
55
55
|
* roster epoch
|
|
56
|
-
* @param [options.
|
|
57
|
-
* with `{
|
|
56
|
+
* @param [options.onUserKeyAdopted] {Function} persists a rotated key: called
|
|
57
|
+
* with `{ userKey, latestEpochId, descriptor }` after the roster read and BEFORE
|
|
58
58
|
* the fan-out. The key and the epoch pin must persist atomically
|
|
59
59
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
60
60
|
* @param [options.remintRecoveryDelegations] {Function} `({ document }) =>
|
|
61
61
|
* Promise<{ reminted, skipped }>` -- the recovery-delegation re-mint stage,
|
|
62
62
|
* for a wallet that issues recovery codes
|
|
63
|
-
* @param [options.onRotationAdopted] {Function} `({
|
|
63
|
+
* @param [options.onRotationAdopted] {Function} `({ userKey }) => Promise<void>`
|
|
64
64
|
* -- the live-session adoption of a rotated key, run last so the session
|
|
65
65
|
* keeps operating without a re-login
|
|
66
66
|
* @returns {Promise<ClientRevocationResult>}
|
|
67
67
|
*/
|
|
68
|
-
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore,
|
|
68
|
+
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey, signEpochs, pinnedEpochId, onUserKeyAdopted, collections, remintRecoveryDelegations, onRotationAdopted }) {
|
|
69
69
|
if (ownSigningKeyMultibase &&
|
|
70
70
|
ownSigningKeyMultibase === revokedClient.signingKeyMultibase) {
|
|
71
71
|
throw new Error('This wallet cannot disconnect itself; use another enrolled wallet ' +
|
|
@@ -86,7 +86,7 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
86
86
|
});
|
|
87
87
|
// 2. The roster rotation, recipients resolved from that same document.
|
|
88
88
|
// Whether there IS a roster is settled BEFORE the rotation: an account with
|
|
89
|
-
// no `key-map/
|
|
89
|
+
// no `key-map/user-key.json` (its collections are not encrypted yet) has nothing
|
|
90
90
|
// to rotate, and the rotation itself refuses an absent descriptor rather
|
|
91
91
|
// than no-op'ing. The document edit has already landed, so the client IS
|
|
92
92
|
// disconnected -- a completed cascade with nothing rotated, not a failure.
|
|
@@ -98,15 +98,15 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
98
98
|
document: doc
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
await
|
|
101
|
+
await rotateUserKeyRoster({
|
|
102
102
|
store: rosterStore,
|
|
103
103
|
document: doc,
|
|
104
104
|
retireRecipientId: rosterRecipientKid(revokedClient),
|
|
105
105
|
signEpochs
|
|
106
106
|
});
|
|
107
|
-
const read = await
|
|
107
|
+
const read = await readUserKeyRoster({
|
|
108
108
|
store: rosterStore,
|
|
109
|
-
...(
|
|
109
|
+
...(userKey ? { userKey } : {}),
|
|
110
110
|
clientKeyAgreementKey,
|
|
111
111
|
pinnedEpochId,
|
|
112
112
|
document: doc
|
|
@@ -117,12 +117,12 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
117
117
|
// key is only readable from the roster, and reporting success here would
|
|
118
118
|
// fan out under the retired one.
|
|
119
119
|
throw new Error('The wrap-set roster vanished between its rotation and the read that ' +
|
|
120
|
-
'adopts the fresh
|
|
120
|
+
'adopts the fresh user key; the client is disconnected, but the ' +
|
|
121
121
|
'rotation must be completed by re-running the revocation.');
|
|
122
122
|
}
|
|
123
123
|
if (read.rotated) {
|
|
124
|
-
await
|
|
125
|
-
|
|
124
|
+
await onUserKeyAdopted?.({
|
|
125
|
+
userKey: read.userKey,
|
|
126
126
|
latestEpochId: read.latestEpochId,
|
|
127
127
|
descriptor: read.descriptor
|
|
128
128
|
});
|
|
@@ -130,7 +130,7 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
130
130
|
// 3. The collection fan-out, in parallel -- run even when this call found
|
|
131
131
|
// the roster already rotated (a re-run after a crash), because the staleness
|
|
132
132
|
// rule finds exactly the stranded collections.
|
|
133
|
-
const cascade = await
|
|
133
|
+
const cascade = await cascadeCollectionsToUserKey({
|
|
134
134
|
collectionIds: await collectionIdsOf({ collections }),
|
|
135
135
|
storeFor: collections.storeFor,
|
|
136
136
|
...(collections.isEncrypted
|
|
@@ -138,19 +138,19 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
138
138
|
: {}),
|
|
139
139
|
rosterDescriptor: read.descriptor,
|
|
140
140
|
clientKeyAgreementKey,
|
|
141
|
-
|
|
141
|
+
userKey: read.userKey
|
|
142
142
|
});
|
|
143
143
|
// 4. The recovery re-mints, while the registry is still readable under the
|
|
144
144
|
// session's pre-adoption vault keys.
|
|
145
145
|
const recovery = await remintRecoveryDelegations?.({ document: doc });
|
|
146
146
|
if (read.rotated) {
|
|
147
|
-
await onRotationAdopted?.({
|
|
147
|
+
await onRotationAdopted?.({ userKey: read.userKey });
|
|
148
148
|
}
|
|
149
149
|
return {
|
|
150
150
|
rotated: read.rotated,
|
|
151
151
|
collections: cascade,
|
|
152
152
|
document: doc,
|
|
153
|
-
|
|
153
|
+
userKey: read.userKey,
|
|
154
154
|
rosterDescriptor: read.descriptor,
|
|
155
155
|
...(recovery ? { recovery } : {})
|
|
156
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAoDA,OAAO,EACL,iBAAiB,EAIlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAoDA,OAAO,EACL,iBAAiB,EAIlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,kBAAkB,CAAA;AA8BzB;;;;;;;GAOG;AACH,KAAK,UAAU,eAAe,CAAC,E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ACjC,qBAAqB;QACrB,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAA;IAEF,2EAA2E;IAC3E,qCAAqC;IACrC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAErE,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,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAA;AACH,CAAC"}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The login-time wrap-set roster policy: what a wallet does with
|
|
6
|
-
* `key-map/
|
|
6
|
+
* `key-map/user-key.json` when a session starts, and how it decides between
|
|
7
7
|
* refusing the session and carrying on offline.
|
|
8
8
|
*
|
|
9
9
|
* Two steps, in this order:
|
|
10
10
|
*
|
|
11
|
-
* - {@link
|
|
11
|
+
* - {@link checkUserKeyRosterAtLogin} -- one direct read of the roster, before
|
|
12
|
+
* any
|
|
12
13
|
* storage client or cipher is built (a stale key would silently fail to
|
|
13
14
|
* decrypt everything written since another client rotated it). The served
|
|
14
15
|
* roster is authenticated and checked against the locally pinned latest-seen
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
* (an unreachable server, a transport hiccup) is warned about and resolves
|
|
23
24
|
* `null`, so an offline start keeps working from the cached key.
|
|
24
25
|
*
|
|
25
|
-
* - {@link
|
|
26
|
+
* - {@link convergeUserKeyRosterToAccount} -- the roster stage of the
|
|
26
27
|
* cascade-completion sweep, which the collection fan-out then runs behind. A
|
|
27
28
|
* revocation torn between its document edit and its roster rotation leaves
|
|
28
29
|
* the roster wrapping the CURRENT key to a client the document no longer
|
|
@@ -46,14 +47,14 @@
|
|
|
46
47
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
47
48
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
48
49
|
import type { EncryptionDescriptorStore, EpochsSigner } from '@interop/was-client/edv';
|
|
49
|
-
import { type
|
|
50
|
+
import { type UserKey, type UserKeyRosterReadResult } from '../keys/index.js';
|
|
50
51
|
import type { AccountLogPointer } from './listing.js';
|
|
51
52
|
/**
|
|
52
|
-
* What an adopted
|
|
53
|
+
* What an adopted user key carries: the key itself, the roster epoch to
|
|
53
54
|
* pin as latest-seen, and the descriptor it was read from.
|
|
54
55
|
*/
|
|
55
|
-
export interface
|
|
56
|
-
|
|
56
|
+
export interface AdoptedUserKey {
|
|
57
|
+
userKey: UserKey;
|
|
57
58
|
latestEpochId: string;
|
|
58
59
|
descriptor: CollectionEncryption;
|
|
59
60
|
}
|
|
@@ -73,7 +74,7 @@ export interface AdoptedPuk {
|
|
|
73
74
|
* store
|
|
74
75
|
* @param options.pointer {AccountLogPointer} where the account log lives,
|
|
75
76
|
* for the lazy document verification above
|
|
76
|
-
* @param [options.
|
|
77
|
+
* @param [options.userKey] {UserKey} this client's cached user key; omitted (a
|
|
77
78
|
* freshly enrolled client's first read) the key is always taken from the
|
|
78
79
|
* roster
|
|
79
80
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
@@ -81,20 +82,20 @@ export interface AdoptedPuk {
|
|
|
81
82
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
82
83
|
* roster epoch
|
|
83
84
|
* @param [options.onRosterRead] {Function} called with the
|
|
84
|
-
* {@link
|
|
85
|
+
* {@link AdoptedUserKey} of every successful read (whether or not it rotated),
|
|
85
86
|
* so the epoch pin advances to the epoch just authenticated; the key and the
|
|
86
87
|
* pin must persist atomically
|
|
87
|
-
* @returns {Promise<
|
|
88
|
+
* @returns {Promise<UserKeyRosterReadResult | null>} the read, or `null` when
|
|
88
89
|
* the account has no roster yet or the server could not be reached
|
|
89
90
|
*/
|
|
90
|
-
export declare function
|
|
91
|
+
export declare function checkUserKeyRosterAtLogin({ store, pointer, userKey, clientKeyAgreementKey, pinnedEpochId, onRosterRead }: {
|
|
91
92
|
store: EncryptionDescriptorStore;
|
|
92
93
|
pointer: AccountLogPointer;
|
|
93
|
-
|
|
94
|
+
userKey?: UserKey;
|
|
94
95
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
95
96
|
pinnedEpochId?: string | null;
|
|
96
|
-
onRosterRead?: (adopted:
|
|
97
|
-
}): Promise<
|
|
97
|
+
onRosterRead?: (adopted: AdoptedUserKey) => Promise<void>;
|
|
98
|
+
}): Promise<UserKeyRosterReadResult | null>;
|
|
98
99
|
/**
|
|
99
100
|
* Converges the roster onto the account's locally verified did:webvh document,
|
|
100
101
|
* adopting a rotation the ordinary way (a roster re-read) and handing back the
|
|
@@ -106,40 +107,40 @@ export declare function checkPukRosterAtLogin({ store, pointer, puk, clientKeyAg
|
|
|
106
107
|
* Past the rotation it is not best-effort at all -- once the roster has moved
|
|
107
108
|
* to a fresh key, that key is readable only from the roster, so a failed
|
|
108
109
|
* adoption throws rather than reporting `rotated: false` with the retired key
|
|
109
|
-
* and descriptor (which would skip `
|
|
110
|
-
* onto the pre-rotation epoch). The three roster refusals rethrow
|
|
111
|
-
* exactly as {@link
|
|
110
|
+
* and descriptor (which would skip `onUserKeyAdopted` and fan the collections
|
|
111
|
+
* out onto the pre-rotation epoch). The three roster refusals rethrow
|
|
112
|
+
* throughout, exactly as {@link checkUserKeyRosterAtLogin} rethrows them.
|
|
112
113
|
*
|
|
113
114
|
* @param options {object}
|
|
114
115
|
* @param options.pointer {AccountLogPointer} where the account log lives
|
|
115
116
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
116
117
|
* store
|
|
117
|
-
* @param options.
|
|
118
|
+
* @param options.userKey {UserKey} the start's current user key
|
|
118
119
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
119
120
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
120
121
|
* (identity) key-agreement key
|
|
121
122
|
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
122
|
-
* signer (`
|
|
123
|
+
* signer (`userKeyRosterEpochsSigner`), for the rotation this call may perform
|
|
123
124
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
124
125
|
* roster epoch
|
|
125
|
-
* @param [options.
|
|
126
|
-
* {@link
|
|
126
|
+
* @param [options.onUserKeyAdopted] {Function} called with the
|
|
127
|
+
* {@link AdoptedUserKey} of a rotation, before the fan-out runs
|
|
127
128
|
* @returns {Promise<object>} whether the roster rotated on this call, the
|
|
128
129
|
* stale recipient kids found, and the key + descriptor to fan out with
|
|
129
130
|
*/
|
|
130
|
-
export declare function
|
|
131
|
+
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, signEpochs, pinnedEpochId, onUserKeyAdopted }: {
|
|
131
132
|
pointer: AccountLogPointer;
|
|
132
133
|
store: EncryptionDescriptorStore;
|
|
133
|
-
|
|
134
|
+
userKey: UserKey;
|
|
134
135
|
descriptor: CollectionEncryption;
|
|
135
136
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
136
137
|
signEpochs: EpochsSigner;
|
|
137
138
|
pinnedEpochId?: string | null;
|
|
138
|
-
|
|
139
|
+
onUserKeyAdopted?: (adopted: AdoptedUserKey) => Promise<void>;
|
|
139
140
|
}): Promise<{
|
|
140
141
|
rotated: boolean;
|
|
141
142
|
staleRecipientIds: string[];
|
|
142
|
-
|
|
143
|
+
userKey: UserKey;
|
|
143
144
|
descriptor: CollectionEncryption;
|
|
144
145
|
}>;
|
|
145
146
|
//# sourceMappingURL=rosterPolicy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EACV,yBAAyB,EACzB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAE7B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,oBAAoB,CAAA;CACjC;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1D,GAAG,OAAO,CAAC,uBAAu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