@interop/wallet-core 0.23.1 → 0.24.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 +33 -18
- package/dist/clients/revocation.d.ts +3 -6
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +5 -9
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +11 -17
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +22 -27
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +2 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +15 -10
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/keys/index.d.ts +11 -8
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +11 -8
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +34 -0
- package/dist/keys/rosterLogStore.d.ts.map +1 -0
- package/dist/keys/rosterLogStore.js +110 -0
- package/dist/keys/rosterLogStore.js.map +1 -0
- package/dist/keys/rosterStore.d.ts +18 -4
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +35 -16
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +1 -1
- package/dist/keys/userKeyCascade.js +1 -1
- package/dist/keys/userKeyRoster.d.ts +50 -97
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +44 -145
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/request/appKey.d.ts +254 -0
- package/dist/request/appKey.d.ts.map +1 -0
- package/dist/request/appKey.js +498 -0
- package/dist/request/appKey.js.map +1 -0
- package/dist/request/classify.d.ts +54 -3
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +106 -0
- package/dist/request/classify.js.map +1 -1
- package/dist/request/index.d.ts +4 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +4 -0
- package/dist/request/index.js.map +1 -1
- package/dist/request/processRequest.d.ts.map +1 -1
- package/dist/request/processRequest.js +15 -6
- package/dist/request/processRequest.js.map +1 -1
- package/dist/request/types.d.ts +45 -2
- package/dist/request/types.d.ts.map +1 -1
- package/dist/resourceLog/append.d.ts +103 -0
- package/dist/resourceLog/append.d.ts.map +1 -0
- package/dist/resourceLog/append.js +190 -0
- package/dist/resourceLog/append.js.map +1 -0
- package/dist/resourceLog/controller.d.ts +57 -0
- package/dist/resourceLog/controller.d.ts.map +1 -0
- package/dist/resourceLog/controller.js +81 -0
- package/dist/resourceLog/controller.js.map +1 -0
- package/dist/resourceLog/entry.d.ts +68 -0
- package/dist/resourceLog/entry.d.ts.map +1 -0
- package/dist/resourceLog/entry.js +167 -0
- package/dist/resourceLog/entry.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +75 -0
- package/dist/resourceLog/errors.d.ts.map +1 -0
- package/dist/resourceLog/errors.js +76 -0
- package/dist/resourceLog/errors.js.map +1 -0
- package/dist/resourceLog/index.d.ts +23 -0
- package/dist/resourceLog/index.d.ts.map +1 -0
- package/dist/resourceLog/index.js +23 -0
- package/dist/resourceLog/index.js.map +1 -0
- package/dist/resourceLog/pin.d.ts +44 -0
- package/dist/resourceLog/pin.d.ts.map +1 -0
- package/dist/resourceLog/pin.js +32 -0
- package/dist/resourceLog/pin.js.map +1 -0
- package/dist/resourceLog/verify.d.ts +89 -0
- package/dist/resourceLog/verify.d.ts.map +1 -0
- package/dist/resourceLog/verify.js +434 -0
- package/dist/resourceLog/verify.js.map +1 -0
- package/dist/space/collections.d.ts +14 -11
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +14 -11
- 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/didWeb.d.ts +4 -6
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +1 -2
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +1 -6
- package/dist/webvh/didWebvh.js.map +1 -1
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -53,8 +53,10 @@ The subpaths:
|
|
|
53
53
|
wallet-api messages and URLs), QueryByExample matching, cryptosuite
|
|
54
54
|
negotiation, `composeVp` (signer and holder injected), the pure
|
|
55
55
|
`processRequest` (consent runs in the caller; zcap / App Connect processing
|
|
56
|
-
injected), the
|
|
57
|
-
|
|
56
|
+
injected), the App Connect app-key credential module (query validation,
|
|
57
|
+
matching, minting, store-time refusal, legacy re-issue), the VC-API exchange
|
|
58
|
+
client, and VCALM `interaction:` URL handling. The VPR type vocabulary lives
|
|
59
|
+
in
|
|
58
60
|
[`@interop/data-integrity-core`](https://npm.im/@interop/data-integrity-core)
|
|
59
61
|
and is re-exported here.
|
|
60
62
|
|
|
@@ -72,22 +74,35 @@ The subpaths:
|
|
|
72
74
|
store they write through, and ZCap signing under the did:webvh
|
|
73
75
|
verification-method id.
|
|
74
76
|
|
|
75
|
-
- **`@interop/wallet-core/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
77
|
+
- **`@interop/wallet-core/resourceLog`** -- the client side of the Resource Log
|
|
78
|
+
Profile (the hash-linked log format governing key resources co-managed between
|
|
79
|
+
a wallet's clients and the storage server): full chain verification against an
|
|
80
|
+
adversarial host (parse shape, SCID and entry-hash recomputation, entry
|
|
81
|
+
proofs, the external-authorization rule against the independently verified
|
|
82
|
+
did:webvh controller document, terminal handover entries), the chain-head pin
|
|
83
|
+
with its continuity rules, the entry builders, and the read/append/create path
|
|
84
|
+
(compare-and-swap with rebase-and-retry, read-back confirmation). Transport
|
|
85
|
+
lives in [`@interop/was-client`](https://npm.im/@interop/was-client)'s `/log`
|
|
86
|
+
subpath; the hashing and proof kernel in
|
|
87
|
+
[`@interop/did-method-webvh`](https://npm.im/@interop/did-method-webvh).
|
|
88
|
+
|
|
89
|
+
- **`@interop/wallet-core/keys`** -- the user key and its wrap-set roster,
|
|
90
|
+
governed by the `key-map/user-key.jsonl` resource log: minting, the roster's
|
|
91
|
+
init/read/rotate primitives with their client-side guards (the verified log
|
|
92
|
+
itself, the latest-seen epoch pin, the document-backed recipient resolver),
|
|
93
|
+
the log-governed descriptor store those primitives drive, and the user key
|
|
94
|
+
rotation cascade's per-collection op (re-epoch a collection onto the roster's
|
|
95
|
+
current user key, staleness detected from durable state alone, history
|
|
96
|
+
escrowed -- also the completion sweep's building block), plus the detector
|
|
97
|
+
that converges a roster left wrapping the current key to a recipient the
|
|
98
|
+
account document no longer keys. Also `ensureWalletSpaceEpochs`, the
|
|
99
|
+
provision-time install of each encrypted wallet collection's key epoch[0] (a
|
|
100
|
+
fresh random epoch key wrapped to the user key) -- the EDV-bearing second step
|
|
101
|
+
of `provisionWalletSpace`. Also the enrolled-client display labels
|
|
102
|
+
(`key-map/client-labels.json`) and their WAS-backed store. Also the client-key
|
|
103
|
+
record codec: the contents and strict validation of the local record each
|
|
104
|
+
wallet client keeps its own key material in (storage and wrapping stay
|
|
105
|
+
app-side).
|
|
91
106
|
|
|
92
107
|
- **`@interop/wallet-core/clients`** -- the enrolled-client management surface:
|
|
93
108
|
the listing over the locally verified did:webvh log with display labels
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*/
|
|
47
47
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
48
48
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
49
|
-
import type { EncryptionDescriptorStore
|
|
49
|
+
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
50
50
|
import { type ClientWebvhUpdateKeys, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
|
|
51
51
|
import { type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
52
52
|
/**
|
|
@@ -109,12 +109,10 @@ 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/user-key.
|
|
112
|
+
* `key-map/user-key.jsonl` roster store
|
|
113
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
|
-
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
117
|
-
* signer (`userKeyRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
118
116
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
119
117
|
* roster epoch
|
|
120
118
|
* @param [options.onUserKeyAdopted] {Function} persists a rotated key: called
|
|
@@ -129,7 +127,7 @@ export interface ClientRevocationResult {
|
|
|
129
127
|
* keeps operating without a re-login
|
|
130
128
|
* @returns {Promise<ClientRevocationResult>}
|
|
131
129
|
*/
|
|
132
|
-
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey,
|
|
130
|
+
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintRecoveryDelegations, onRotationAdopted }: {
|
|
133
131
|
idStore: WebvhIdStore;
|
|
134
132
|
updateKeys: ClientWebvhUpdateKeys;
|
|
135
133
|
revokedClient: RevokedClientKeys;
|
|
@@ -138,7 +136,6 @@ export declare function revokeAccountClient({ idStore, updateKeys, revokedClient
|
|
|
138
136
|
rosterStore: EncryptionDescriptorStore;
|
|
139
137
|
userKey?: UserKey;
|
|
140
138
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
141
|
-
signEpochs: EpochsSigner;
|
|
142
139
|
pinnedEpochId?: string | null;
|
|
143
140
|
onUserKeyAdopted?: (adopted: {
|
|
144
141
|
userKey: UserKey;
|
|
@@ -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,
|
|
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,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,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,OAAO,CAAC,MA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AoB,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,CAqGlC"}
|
|
@@ -45,12 +45,10 @@ 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/user-key.
|
|
48
|
+
* `key-map/user-key.jsonl` roster store
|
|
49
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
|
-
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
53
|
-
* signer (`userKeyRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
54
52
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
55
53
|
* roster epoch
|
|
56
54
|
* @param [options.onUserKeyAdopted] {Function} persists a rotated key: called
|
|
@@ -65,7 +63,7 @@ async function collectionIdsOf({ collections }) {
|
|
|
65
63
|
* keeps operating without a re-login
|
|
66
64
|
* @returns {Promise<ClientRevocationResult>}
|
|
67
65
|
*/
|
|
68
|
-
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey,
|
|
66
|
+
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintRecoveryDelegations, onRotationAdopted }) {
|
|
69
67
|
if (ownSigningKeyMultibase &&
|
|
70
68
|
ownSigningKeyMultibase === revokedClient.signingKeyMultibase) {
|
|
71
69
|
throw new Error('This wallet cannot disconnect itself; use another enrolled wallet ' +
|
|
@@ -86,7 +84,7 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
86
84
|
});
|
|
87
85
|
// 2. The roster rotation, recipients resolved from that same document.
|
|
88
86
|
// Whether there IS a roster is settled BEFORE the rotation: an account with
|
|
89
|
-
// no `key-map/user-key.
|
|
87
|
+
// no `key-map/user-key.jsonl` (its collections are not encrypted yet) has nothing
|
|
90
88
|
// to rotate, and the rotation itself refuses an absent descriptor rather
|
|
91
89
|
// than no-op'ing. The document edit has already landed, so the client IS
|
|
92
90
|
// disconnected -- a completed cascade with nothing rotated, not a failure.
|
|
@@ -101,15 +99,13 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
101
99
|
await rotateUserKeyRoster({
|
|
102
100
|
store: rosterStore,
|
|
103
101
|
document: doc,
|
|
104
|
-
retireRecipientId: rosterRecipientKid(revokedClient)
|
|
105
|
-
signEpochs
|
|
102
|
+
retireRecipientId: rosterRecipientKid(revokedClient)
|
|
106
103
|
});
|
|
107
104
|
const read = await readUserKeyRoster({
|
|
108
105
|
store: rosterStore,
|
|
109
106
|
...(userKey ? { userKey } : {}),
|
|
110
107
|
clientKeyAgreementKey,
|
|
111
|
-
pinnedEpochId
|
|
112
|
-
document: doc
|
|
108
|
+
pinnedEpochId
|
|
113
109
|
});
|
|
114
110
|
if (!read) {
|
|
115
111
|
// The roster stood a moment ago and the rotation just wrote it, so its
|
|
@@ -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":"AAiDA,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,EAC7B,WAAW,EAGZ;IACC,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,CAAA;IACrC,OAAO,OAAO,aAAa,KAAK,UAAU;QACxC,CAAC,CAAC,MAAM,aAAa,EAAE;QACvB,CAAC,CAAC,aAAa,CAAA;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,iBAAiB,EAqBlB;IACC,IACE,sBAAsB;QACtB,sBAAsB,KAAK,aAAa,CAAC,mBAAmB,EAC5D,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,sCAAsC,CACzC,CAAA;IACH,CAAC;IACD,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,CACjD,CAAA;IACH,CAAC;IAED,2EAA2E;IAC3E,0EAA0E;IAC1E,mBAAmB;IACnB,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,iBAAiB,CAAC;QACtC,OAAO;QACP,UAAU;QACV,aAAa;QACb,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC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B,CAAC;QAChD,aAAa,EAAE,MAAM,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;QACrD,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,GAAG,CAAC,WAAW,CAAC,WAAW;YACzB,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;YAC1C,CAAC,CAAC,EAAE,CAAC;QACP,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,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,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The login-time wrap-set roster policy: what a wallet does with
|
|
6
|
-
* `key-map/user-key.
|
|
6
|
+
* `key-map/user-key.jsonl` 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:
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*/
|
|
47
47
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
48
48
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
49
|
-
import type { EncryptionDescriptorStore
|
|
49
|
+
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
50
50
|
import { type UserKey, type UserKeyRosterReadResult } from '../keys/index.js';
|
|
51
51
|
import type { AccountLogPointer } from './listing.js';
|
|
52
52
|
/**
|
|
@@ -61,19 +61,17 @@ export interface AdoptedUserKey {
|
|
|
61
61
|
/**
|
|
62
62
|
* The login-time roster read. See the module doc for the failure semantics.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
64
|
+
* Every read traces to the account document through the log-governed store
|
|
65
|
+
* itself: the roster resolves only from the roster log's verified head, whose
|
|
66
|
+
* entry proofs are checked against the locally verified account log. A log
|
|
67
|
+
* that cannot be fetched lands in the transport-failure class -- the session
|
|
68
|
+
* carries on under the cached key, WITHOUT adopting an unverifiable rotation
|
|
69
|
+
* -- while a roster no enrolled client signed onto the log, and a log that
|
|
70
|
+
* conflicts with the chain-head pin, are refusals like the other three.
|
|
71
71
|
*
|
|
72
72
|
* @param options {object}
|
|
73
73
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
74
74
|
* store
|
|
75
|
-
* @param options.pointer {AccountLogPointer} where the account log lives,
|
|
76
|
-
* for the lazy document verification above
|
|
77
75
|
* @param [options.userKey] {UserKey} this client's cached user key; omitted (a
|
|
78
76
|
* freshly enrolled client's first read) the key is always taken from the
|
|
79
77
|
* roster
|
|
@@ -88,9 +86,8 @@ export interface AdoptedUserKey {
|
|
|
88
86
|
* @returns {Promise<UserKeyRosterReadResult | null>} the read, or `null` when
|
|
89
87
|
* the account has no roster yet or the server could not be reached
|
|
90
88
|
*/
|
|
91
|
-
export declare function checkUserKeyRosterAtLogin({ store,
|
|
89
|
+
export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgreementKey, pinnedEpochId, onRosterRead }: {
|
|
92
90
|
store: EncryptionDescriptorStore;
|
|
93
|
-
pointer: AccountLogPointer;
|
|
94
91
|
userKey?: UserKey;
|
|
95
92
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
96
93
|
pinnedEpochId?: string | null;
|
|
@@ -119,8 +116,6 @@ export declare function checkUserKeyRosterAtLogin({ store, pointer, userKey, cli
|
|
|
119
116
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
120
117
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
121
118
|
* (identity) key-agreement key
|
|
122
|
-
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
123
|
-
* signer (`userKeyRosterEpochsSigner`), for the rotation this call may perform
|
|
124
119
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
125
120
|
* roster epoch
|
|
126
121
|
* @param [options.onUserKeyAdopted] {Function} called with the
|
|
@@ -128,13 +123,12 @@ export declare function checkUserKeyRosterAtLogin({ store, pointer, userKey, cli
|
|
|
128
123
|
* @returns {Promise<object>} whether the roster rotated on this call, the
|
|
129
124
|
* stale recipient kids found, and the key + descriptor to fan out with
|
|
130
125
|
*/
|
|
131
|
-
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey,
|
|
126
|
+
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted }: {
|
|
132
127
|
pointer: AccountLogPointer;
|
|
133
128
|
store: EncryptionDescriptorStore;
|
|
134
129
|
userKey: UserKey;
|
|
135
130
|
descriptor: CollectionEncryption;
|
|
136
131
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
137
|
-
signEpochs: EpochsSigner;
|
|
138
132
|
pinnedEpochId?: string | null;
|
|
139
133
|
onUserKeyAdopted?: (adopted: AdoptedUserKey) => Promise<void>;
|
|
140
134
|
}): Promise<{
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AAMzB,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;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,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,uBAAuB,GAAG,IAAI,CAAC,CA8B1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,OAAO,EACP,KAAK,EACL,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EACjB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CA6ED"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import { convergeUserKeyRosterToDocument, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, readUserKeyRoster } from '../keys/index.js';
|
|
2
|
+
import { ResourceLogContinuityError, ResourceLogIntegrityError } from '../resourceLog/index.js';
|
|
2
3
|
import { verifyAccountLog } from '../webvh/index.js';
|
|
3
4
|
/**
|
|
4
|
-
* Whether a thrown error is one of the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* them instead of warning and
|
|
5
|
+
* Whether a thrown error is one of the roster refusals -- a fabricated or
|
|
6
|
+
* discontinuous roster log, a rolled-back or replayed roster, an epoch
|
|
7
|
+
* configuration that fails authentication, and a current epoch this client
|
|
8
|
+
* cannot unwrap. They are the continuity class that refuses a session rather
|
|
9
|
+
* than degrading it, so both entry points rethrow them instead of warning and
|
|
10
|
+
* carrying on.
|
|
9
11
|
*
|
|
10
12
|
* @param err {unknown}
|
|
11
13
|
* @returns {boolean}
|
|
12
14
|
*/
|
|
13
15
|
function isRosterRefusal(err) {
|
|
14
|
-
return (err instanceof
|
|
16
|
+
return (err instanceof ResourceLogContinuityError ||
|
|
17
|
+
err instanceof ResourceLogIntegrityError ||
|
|
18
|
+
err instanceof UserKeyRosterContinuityError ||
|
|
15
19
|
err instanceof UserKeyRosterIntegrityError ||
|
|
16
20
|
err instanceof UserKeyRosterUnwrapError);
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* The login-time roster read. See the module doc for the failure semantics.
|
|
20
24
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Every read traces to the account document through the log-governed store
|
|
26
|
+
* itself: the roster resolves only from the roster log's verified head, whose
|
|
27
|
+
* entry proofs are checked against the locally verified account log. A log
|
|
28
|
+
* that cannot be fetched lands in the transport-failure class -- the session
|
|
29
|
+
* carries on under the cached key, WITHOUT adopting an unverifiable rotation
|
|
30
|
+
* -- while a roster no enrolled client signed onto the log, and a log that
|
|
31
|
+
* conflicts with the chain-head pin, are refusals like the other three.
|
|
28
32
|
*
|
|
29
33
|
* @param options {object}
|
|
30
34
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
31
35
|
* store
|
|
32
|
-
* @param options.pointer {AccountLogPointer} where the account log lives,
|
|
33
|
-
* for the lazy document verification above
|
|
34
36
|
* @param [options.userKey] {UserKey} this client's cached user key; omitted (a
|
|
35
37
|
* freshly enrolled client's first read) the key is always taken from the
|
|
36
38
|
* roster
|
|
@@ -45,14 +47,13 @@ function isRosterRefusal(err) {
|
|
|
45
47
|
* @returns {Promise<UserKeyRosterReadResult | null>} the read, or `null` when
|
|
46
48
|
* the account has no roster yet or the server could not be reached
|
|
47
49
|
*/
|
|
48
|
-
export async function checkUserKeyRosterAtLogin({ store,
|
|
50
|
+
export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgreementKey, pinnedEpochId, onRosterRead }) {
|
|
49
51
|
try {
|
|
50
52
|
const read = await readUserKeyRoster({
|
|
51
53
|
store,
|
|
52
54
|
...(userKey ? { userKey } : {}),
|
|
53
55
|
clientKeyAgreementKey,
|
|
54
|
-
pinnedEpochId
|
|
55
|
-
resolveDocument: async () => (await verifyAccountLog(pointer)).doc
|
|
56
|
+
pinnedEpochId
|
|
56
57
|
});
|
|
57
58
|
if (!read) {
|
|
58
59
|
return null;
|
|
@@ -98,8 +99,6 @@ export async function checkUserKeyRosterAtLogin({ store, pointer, userKey, clien
|
|
|
98
99
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
99
100
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
100
101
|
* (identity) key-agreement key
|
|
101
|
-
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
102
|
-
* signer (`userKeyRosterEpochsSigner`), for the rotation this call may perform
|
|
103
102
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
104
103
|
* roster epoch
|
|
105
104
|
* @param [options.onUserKeyAdopted] {Function} called with the
|
|
@@ -107,7 +106,7 @@ export async function checkUserKeyRosterAtLogin({ store, pointer, userKey, clien
|
|
|
107
106
|
* @returns {Promise<object>} whether the roster rotated on this call, the
|
|
108
107
|
* stale recipient kids found, and the key + descriptor to fan out with
|
|
109
108
|
*/
|
|
110
|
-
export async function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey,
|
|
109
|
+
export async function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted }) {
|
|
111
110
|
const unchanged = {
|
|
112
111
|
rotated: false,
|
|
113
112
|
staleRecipientIds: [],
|
|
@@ -116,15 +115,12 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
116
115
|
};
|
|
117
116
|
let rotated;
|
|
118
117
|
let staleRecipientIds;
|
|
119
|
-
let accountDocument;
|
|
120
118
|
try {
|
|
121
119
|
const { doc } = await verifyAccountLog(pointer);
|
|
122
|
-
accountDocument = doc;
|
|
123
120
|
const converged = await convergeUserKeyRosterToDocument({
|
|
124
121
|
store,
|
|
125
122
|
document: doc,
|
|
126
|
-
descriptor
|
|
127
|
-
signEpochs
|
|
123
|
+
descriptor
|
|
128
124
|
});
|
|
129
125
|
rotated = converged.rotated;
|
|
130
126
|
staleRecipientIds = converged.staleRecipientIds;
|
|
@@ -151,8 +147,7 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
151
147
|
store,
|
|
152
148
|
userKey,
|
|
153
149
|
clientKeyAgreementKey,
|
|
154
|
-
pinnedEpochId
|
|
155
|
-
document: accountDocument
|
|
150
|
+
pinnedEpochId
|
|
156
151
|
});
|
|
157
152
|
}
|
|
158
153
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAiDA,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,OAAO,CACL,GAAG,YAAY,0BAA0B;QACzC,GAA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CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,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,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Push, not pull, in the recovery-anchor order (decryption material before
|
|
16
16
|
* authorization): the enrolling client wraps the user key to the new client's
|
|
17
|
-
* key-agreement key in `key-map/user-key.
|
|
17
|
+
* key-agreement key in `key-map/user-key.jsonl` FIRST, then writes the two
|
|
18
18
|
* did:webvh log entries (commit, then add-VMs-and-update-key). No
|
|
19
19
|
* authorized-but-blind window exists at any point, and both tear points
|
|
20
20
|
* resume by re-running the ceremony with the same code -- a tear after the
|
|
@@ -127,7 +127,7 @@ export declare function mintEnrollmentRequest(): Promise<{
|
|
|
127
127
|
* client's own (identity) key-agreement key, unwrapping each epoch for
|
|
128
128
|
* re-wrapping
|
|
129
129
|
* @param options.userKeyRosterStore {EncryptionDescriptorStore} the account's
|
|
130
|
-
* `key-map/user-key.
|
|
130
|
+
* `key-map/user-key.jsonl` descriptor store
|
|
131
131
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
132
132
|
* @returns {Promise<object>} the account's did:webvh, plus the enrollee's
|
|
133
133
|
* own identity as this call already knows it: its did:key and its signing-key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":[],"mappings":"AAAA;;GAEG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;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACR,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;CAC3B,GAAG,MAAM,CAKT;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,IAAI,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;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACR,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,eAAe,EAAE,qBAAqB,CAAA;IACtC,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,CAsB3E;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,UAAU,EACV,eAAe,EACf,OAAO,EACR,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,qBAAqB,CAAA;IACtC,OAAO,EAAE,cAAc,CAAA;CACxB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAwEvD"}
|
|
@@ -5,8 +5,9 @@ import { enrollWebvhClient, mintClientWebvhUpdateKeys, updateKeyMultibase } from
|
|
|
5
5
|
import { clientSigningKeyMultibase, isWebvhDid, webvhZcapClient } from '../webvh/zcap.js';
|
|
6
6
|
import { AccountLogMissingError, verifyAccountLog } from '../webvh/verifyLog.js';
|
|
7
7
|
import { addUserKeyRosterRecipient } from '../keys/userKeyRoster.js';
|
|
8
|
-
import { readUserKeyRoster, rosterRecipientKid } from '../keys/userKeyRoster.js';
|
|
8
|
+
import { readUserKeyRoster, rosterRecipientKid, userKeyRosterLogSigner } from '../keys/userKeyRoster.js';
|
|
9
9
|
import { userKeyRosterDescriptorStore } from '../keys/rosterStore.js';
|
|
10
|
+
import { memoryResourceLogPinStore, webvhResourceLogController } from '../resourceLog/index.js';
|
|
10
11
|
import { CONNECT_CODE_PREFIX } from './connectCode.js';
|
|
11
12
|
/**
|
|
12
13
|
* The connect-code payload version this build mints and accepts.
|
|
@@ -221,7 +222,7 @@ export async function mintEnrollmentRequest() {
|
|
|
221
222
|
* client's own (identity) key-agreement key, unwrapping each epoch for
|
|
222
223
|
* re-wrapping
|
|
223
224
|
* @param options.userKeyRosterStore {EncryptionDescriptorStore} the account's
|
|
224
|
-
* `key-map/user-key.
|
|
225
|
+
* `key-map/user-key.jsonl` descriptor store
|
|
225
226
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
226
227
|
* @returns {Promise<object>} the account's did:webvh, plus the enrollee's
|
|
227
228
|
* own identity as this call already knows it: its did:key and its signing-key
|
|
@@ -311,21 +312,25 @@ export async function completeEnrollmentCore({ clientSeed, webvhUpdateKeys, poin
|
|
|
311
312
|
}
|
|
312
313
|
// The first roster read: signed with the `<did:webvh>#<multibase>` keyId
|
|
313
314
|
// the add entry just published, unwrapping the user key the enrolling client
|
|
314
|
-
// escrowed to this client's key-agreement key. The
|
|
315
|
-
//
|
|
316
|
-
// checked against -- a first read adopts whatever
|
|
317
|
-
//
|
|
318
|
-
// descriptor's own MAC.
|
|
315
|
+
// escrowed to this client's key-agreement key. The account log just
|
|
316
|
+
// verified above is the controller the roster log's entry proofs are
|
|
317
|
+
// checked against -- a first read adopts whatever head the log serves, so
|
|
318
|
+
// every entry must trace to keys the document backs, not to the served
|
|
319
|
+
// descriptor's own MAC. First contact: the chain-head pin this read
|
|
320
|
+
// establishes is session-local here; the app's durable pin is established
|
|
321
|
+
// by its own first login read.
|
|
319
322
|
const zcapClient = webvhZcapClient({ keyAgent, did });
|
|
320
323
|
const store = userKeyRosterDescriptorStore({
|
|
321
324
|
storageServerUrl: pointer.host,
|
|
322
325
|
zcapClient,
|
|
323
|
-
spaceId: pointer.spaceId
|
|
326
|
+
spaceId: pointer.spaceId,
|
|
327
|
+
resolveController: async () => webvhResourceLogController({ did, log: verified.log }),
|
|
328
|
+
pinStore: memoryResourceLogPinStore(),
|
|
329
|
+
signer: userKeyRosterLogSigner({ keyAgent })
|
|
324
330
|
});
|
|
325
331
|
const read = await readUserKeyRoster({
|
|
326
332
|
store,
|
|
327
|
-
clientKeyAgreementKey: keyAgreementKey
|
|
328
|
-
document: verified.doc
|
|
333
|
+
clientKeyAgreementKey: keyAgreementKey
|
|
329
334
|
});
|
|
330
335
|
if (!read) {
|
|
331
336
|
throw new Error('The account has no user key roster; it must finish provisioning before ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EACL,eAAe,EACf,4BAA4B,EAC7B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"en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A4B,CAAC;QACzC,gBAAgB,EAAE,OAAO,CAAC,IAAI;QAC9B,UAAU;QACV,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAC5B,0BAA0B,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC;QACxD,QAAQ,EAAE,yBAAyB,EAAE;QACrC,MAAM,EAAE,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;KAC7C,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC;QACnC,KAAK;QACL,qBAAqB,EAAE,eAAe;KACvC,CAAC,CAAA;IACF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,yEAAyE;YACvE,2BAA2B,CAC9B,CAAA;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAA;AACrE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* hosted DID log, its per-client update-key rotation, the client enrollment
|
|
21
21
|
* entries, and ZCap signing under the did:webvh verification-method id.
|
|
22
22
|
* - `@interop/wallet-core/keys` -- the user key and its
|
|
23
|
-
* `key-map/user-key.
|
|
23
|
+
* `key-map/user-key.jsonl` wrap-set roster log.
|
|
24
24
|
* - `@interop/wallet-core/descriptors` -- collection encryption-descriptor
|
|
25
25
|
* acquisition (fetch / cache / offline fallback) and the unknown-epoch
|
|
26
26
|
* refresh policy, including a self-refreshing EDV document cipher.
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* hosted DID log, its per-client update-key rotation, the client enrollment
|
|
21
21
|
* entries, and ZCap signing under the did:webvh verification-method id.
|
|
22
22
|
* - `@interop/wallet-core/keys` -- the user key and its
|
|
23
|
-
* `key-map/user-key.
|
|
23
|
+
* `key-map/user-key.jsonl` wrap-set roster log.
|
|
24
24
|
* - `@interop/wallet-core/descriptors` -- collection encryption-descriptor
|
|
25
25
|
* acquisition (fetch / cache / offline fallback) and the unknown-epoch
|
|
26
26
|
* refresh policy, including a self-refreshing EDV document cipher.
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
* strict validation of the local client-key record each client keeps its own
|
|
14
14
|
* key material in (storage and wrapping stay app-side).
|
|
15
15
|
* - `ensureUserKeyRoster` / `addUserKeyRosterRecipient` / `readUserKeyRoster` /
|
|
16
|
-
* `userKeyRosterRecipientResolver` -- the
|
|
17
|
-
* was-client descriptor-store seam, with the
|
|
18
|
-
* resource-hosted descriptor needs (
|
|
19
|
-
* and a recipient resolver backed by the locally
|
|
20
|
-
* document).
|
|
21
|
-
* - `userKeyRosterDescriptorStore` -- that
|
|
22
|
-
*
|
|
16
|
+
* `userKeyRosterRecipientResolver` -- the user key roster over the
|
|
17
|
+
* was-client descriptor-store seam, with the client-side guards a
|
|
18
|
+
* resource-hosted descriptor needs (the governing resource log, the
|
|
19
|
+
* latest-seen epoch pin, and a recipient resolver backed by the locally
|
|
20
|
+
* verified did:webvh document).
|
|
21
|
+
* - `userKeyRosterDescriptorStore` / `logGovernedDescriptorStore` -- that
|
|
22
|
+
* descriptor store: reads resolve to the roster log's verified head
|
|
23
|
+
* (`key-map/user-key.jsonl`), writes append signed entries; built from a
|
|
24
|
+
* bare signing client for the login-time direct read.
|
|
23
25
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
24
26
|
* the enrollment wrap, the roster read, and the rotation that retires it.
|
|
25
27
|
* - `convergeUserKeyRosterToDocument` -- the standing detector for a revocation
|
|
@@ -44,11 +46,12 @@ export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
|
44
46
|
export type { UserKey } from './userKey.js';
|
|
45
47
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
46
48
|
export type { ClientKeyRecord, ClientKeyRecordJson, EnrolledClientKeyRecord } from './clientKeyRecord.js';
|
|
47
|
-
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError,
|
|
49
|
+
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
48
50
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
49
51
|
export type { CollectionUserKeyRotationOutcome, UserKeyCascadeResult } from './userKeyCascade.js';
|
|
50
52
|
export type { UserKeyRosterReadResult, RosterRecipientDocument } from './userKeyRoster.js';
|
|
51
53
|
export { userKeyRosterDescriptorStore } from './rosterStore.js';
|
|
54
|
+
export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
52
55
|
export { ensureWalletSpaceEpochs } from './spaceEpochs.js';
|
|
53
56
|
export type { WalletSpaceEpochsResult } from './spaceEpochs.js';
|
|
54
57
|
export { readClientLabels, removeClientLabel, setClientLabel } 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;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