@interop/wallet-core 0.40.0 → 0.42.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 +17 -3
- package/dist/clients/listing.d.ts +4 -3
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/policy.d.ts +3 -2
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +3 -3
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +14 -4
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +29 -14
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +22 -15
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +32 -15
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/index.d.ts +1 -1
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +1 -1
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +58 -6
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +57 -15
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +30 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +58 -30
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/enrollment/index.d.ts +4 -1
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +4 -1
- package/dist/enrollment/index.js.map +1 -1
- package/dist/keyring/fetch.d.ts +12 -0
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +0 -2
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/index.d.ts +7 -6
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +7 -6
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +22 -6
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +9 -14
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/record.d.ts +30 -10
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +31 -15
- package/dist/keyring/record.js.map +1 -1
- package/dist/keys/index.d.ts +5 -3
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +3 -2
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +22 -2
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +40 -20
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +13 -1
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +18 -0
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +10 -3
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +10 -4
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +29 -21
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +47 -23
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +21 -11
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +19 -10
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +5 -17
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +4 -14
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +151 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -0
- package/dist/recovery/recoveryDelegation.js +261 -0
- package/dist/recovery/recoveryDelegation.js.map +1 -0
- package/dist/recovery/recoveryWebvh.d.ts +13 -22
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +53 -139
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/resourceLog/append.d.ts +12 -3
- package/dist/resourceLog/append.d.ts.map +1 -1
- package/dist/resourceLog/append.js +17 -10
- package/dist/resourceLog/append.js.map +1 -1
- package/dist/resourceLog/index.d.ts +1 -1
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +1 -1
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/pin.d.ts +46 -8
- package/dist/resourceLog/pin.d.ts.map +1 -1
- package/dist/resourceLog/pin.js +32 -7
- package/dist/resourceLog/pin.js.map +1 -1
- package/dist/resourceLog/seal.d.ts +4 -1
- package/dist/resourceLog/seal.d.ts.map +1 -1
- package/dist/resourceLog/seal.js +6 -2
- package/dist/resourceLog/seal.js.map +1 -1
- package/dist/unlock/index.d.ts +40 -0
- package/dist/unlock/index.d.ts.map +1 -0
- package/dist/unlock/index.js +36 -0
- package/dist/unlock/index.js.map +1 -0
- package/dist/unlock/ladder.d.ts +100 -0
- package/dist/unlock/ladder.d.ts.map +1 -0
- package/dist/unlock/ladder.js +144 -0
- package/dist/unlock/ladder.js.map +1 -0
- package/dist/unlock/selfEnroll.d.ts +83 -0
- package/dist/unlock/selfEnroll.d.ts.map +1 -0
- package/dist/unlock/selfEnroll.js +126 -0
- package/dist/unlock/selfEnroll.js.map +1 -0
- package/dist/unlock/standingClient.d.ts +68 -0
- package/dist/unlock/standingClient.d.ts.map +1 -0
- package/dist/unlock/standingClient.js +81 -0
- package/dist/unlock/standingClient.js.map +1 -0
- package/dist/unlock/standingWebvh.d.ts +153 -0
- package/dist/unlock/standingWebvh.d.ts.map +1 -0
- package/dist/unlock/standingWebvh.js +370 -0
- package/dist/unlock/standingWebvh.js.map +1 -0
- package/dist/unlock/unlockRecord.d.ts +207 -0
- package/dist/unlock/unlockRecord.d.ts.map +1 -0
- package/dist/unlock/unlockRecord.js +435 -0
- package/dist/unlock/unlockRecord.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +166 -7
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +286 -31
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +15 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +14 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/keyAgreement.d.ts +72 -0
- package/dist/webvh/keyAgreement.d.ts.map +1 -0
- package/dist/webvh/keyAgreement.js +47 -0
- package/dist/webvh/keyAgreement.js.map +1 -0
- package/dist/webvh/listClients.d.ts +69 -20
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +102 -14
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +21 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +31 -14
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +15 -2
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +22 -3
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +11 -5
- package/dist/recovery/recoveryRecord.d.ts +0 -171
- package/dist/recovery/recoveryRecord.d.ts.map +0 -1
- package/dist/recovery/recoveryRecord.js +0 -290
- package/dist/recovery/recoveryRecord.js.map +0 -1
package/dist/keyring/kdf.js
CHANGED
|
@@ -16,14 +16,11 @@
|
|
|
16
16
|
* (RFC 8018 / RFC 5869), so the two implementations agree bit for bit.
|
|
17
17
|
*/
|
|
18
18
|
import { CapabilityAgent } from '@interop/webkms-client';
|
|
19
|
-
import { Ed25519Signature2020 } from '@interop/ed25519-signature';
|
|
20
|
-
import { ZcapClient } from '@interop/ezcap';
|
|
21
|
-
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
22
19
|
import { base64urlnopad } from '@scure/base';
|
|
23
20
|
import { hkdf } from '@noble/hashes/hkdf.js';
|
|
24
21
|
import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';
|
|
25
22
|
import { sha256, sha512 } from '@noble/hashes/sha2.js';
|
|
26
|
-
import {
|
|
23
|
+
import { agentsFromKeyAgent } from '../identity/agents.js';
|
|
27
24
|
import { recordSignerFromAgent } from './record.js';
|
|
28
25
|
/**
|
|
29
26
|
* The load-bearing `CapabilityAgent` derivation names for an unlock identity
|
|
@@ -77,12 +74,17 @@ function nobleHash(hash) {
|
|
|
77
74
|
* family: PBKDF2 stretches a passphrase, HKDF expands already-uniform key
|
|
78
75
|
* material such as a passkey PRF output.
|
|
79
76
|
*
|
|
77
|
+
* Exported for the standing-credential derivation (`unlock/standingClient`):
|
|
78
|
+
* a standing unlock method expands its client identity and binding MAC key
|
|
79
|
+
* from this same seed under distinct HKDF salts, so the expensive stretch
|
|
80
|
+
* runs once per typed secret.
|
|
81
|
+
*
|
|
80
82
|
* @param options {object}
|
|
81
83
|
* @param options.secret {string | Uint8Array}
|
|
82
84
|
* @param options.kdf {UnlockKdf}
|
|
83
85
|
* @returns {Promise<Uint8Array>}
|
|
84
86
|
*/
|
|
85
|
-
async function deriveUnlockSeed({ secret, kdf }) {
|
|
87
|
+
export async function deriveUnlockSeed({ secret, kdf }) {
|
|
86
88
|
// Copy a bytes secret into a fresh buffer: a caller's slice may be a view
|
|
87
89
|
// into a larger buffer, and the codecs below read the whole view.
|
|
88
90
|
const secretBytes = typeof secret === 'string'
|
|
@@ -119,19 +121,12 @@ export async function deriveUnlockIdentity({ secret, kdf }) {
|
|
|
119
121
|
handle: UNLOCK_HANDLE,
|
|
120
122
|
keyName: UNLOCK_KEY_NAME
|
|
121
123
|
});
|
|
122
|
-
const signer = agent.getSigner();
|
|
123
|
-
const zcapClient = new ZcapClient({
|
|
124
|
-
SuiteClass: Ed25519Signature2020,
|
|
125
|
-
invocationSigner: signer,
|
|
126
|
-
delegationSigner: signer
|
|
127
|
-
});
|
|
128
124
|
// The unlock KAK is the Montgomery form of the unlock signing key -- the same
|
|
129
125
|
// derivation the client side uses (`agentsFromSeed`), so a returning user
|
|
130
126
|
// reconstitutes the exact key that wrapped the keyring record.
|
|
131
|
-
const keyAgreementKey =
|
|
132
|
-
|
|
127
|
+
const { zcapClient, keyAgreementKey, keyResolver } = agentsFromKeyAgent({
|
|
128
|
+
keyAgent: agent
|
|
133
129
|
});
|
|
134
|
-
const keyResolver = singleKeyResolver({ keyAgreementKey });
|
|
135
130
|
// The record signer is the unlock signing key itself, named by its public
|
|
136
131
|
// multibase: the keyring record's proof is made and checked against a key
|
|
137
132
|
// that derives from the secret, so the storage host never holds it and a
|
package/dist/keyring/kdf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kdf.js","sourceRoot":"","sources":["../../src/keyring/kdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kdf.js","sourceRoot":"","sources":["../../src/keyring/kdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAA;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,YA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|
keyAgreementKey: IKeyAgreementKey;
|
|
134
134
|
}): Promise<CollectionEncryption>;
|
|
135
135
|
/**
|
|
136
|
-
* Builds the record cipher: an EDV cipher over the record's own
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* kind
|
|
136
|
+
* Builds the record's reading cipher: an EDV cipher over the record's own
|
|
137
|
+
* descriptor, from the reader's key-agreement key. The unwrap paths' cipher
|
|
138
|
+
* (and the recovery record's, which reuses the keyring cipher context
|
|
139
|
+
* verbatim); the wrap paths seal through {@link recordSealCipher} instead. An
|
|
140
|
+
* app's own record kind passes its own `collectionId` so its failures name
|
|
141
|
+
* the record kind. The context labels errors only -- the codec is agnostic to
|
|
142
|
+
* it, so a record kind's real swap protection is its contents validation on
|
|
143
|
+
* unwrap.
|
|
142
144
|
*
|
|
143
145
|
* @param options {object}
|
|
144
146
|
* @param options.keyAgreementKey {IKeyAgreementKey} the wrapping KAK (for
|
|
@@ -155,6 +157,25 @@ export declare function recordCipher({ keyAgreementKey, keyResolver, encryption,
|
|
|
155
157
|
encryption: CollectionEncryption;
|
|
156
158
|
collectionId?: string;
|
|
157
159
|
}): Promise<DocCipher>;
|
|
160
|
+
/**
|
|
161
|
+
* Builds the record's sealing cipher: an encrypt-only EDV cipher over the
|
|
162
|
+
* record's own descriptor, needing no key-agreement secret -- a write seals to
|
|
163
|
+
* the descriptor's epoch public key, reconstructed from the epoch id. This is
|
|
164
|
+
* what lets the recovery re-mint, which holds only the code's unlock KAK
|
|
165
|
+
* public half, re-seal a record it can never open; the issuance wraps go
|
|
166
|
+
* through the same construction and produce the same envelope shape. Decrypt
|
|
167
|
+
* on it refuses with was-client's typed `EncryptOnlyCipherError`.
|
|
168
|
+
*
|
|
169
|
+
* @param options {object}
|
|
170
|
+
* @param options.encryption {CollectionEncryption} the record's descriptor
|
|
171
|
+
* @param [options.collectionId] {string} the cipher context failures are
|
|
172
|
+
* labeled with; defaults to the keyring context
|
|
173
|
+
* @returns {Promise<DocCipher>}
|
|
174
|
+
*/
|
|
175
|
+
export declare function recordSealCipher({ encryption, collectionId }: {
|
|
176
|
+
encryption: CollectionEncryption;
|
|
177
|
+
collectionId?: string;
|
|
178
|
+
}): Promise<DocCipher>;
|
|
158
179
|
/**
|
|
159
180
|
* Validates the common `{ version, encryption, wrapped }` frame of a stored
|
|
160
181
|
* record (keyring or recovery -- `label` names the refusals) and returns its
|
|
@@ -251,8 +272,8 @@ export interface KeyringRecordContents {
|
|
|
251
272
|
* @param [options.email] {string} the account email, when known
|
|
252
273
|
* @param [options.pointer] {AccountPointer} the account pointer (absent on
|
|
253
274
|
* no-WAS deployments)
|
|
254
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK
|
|
255
|
-
*
|
|
275
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK (its
|
|
276
|
+
* public half is all the wrap uses: sealing needs no key-agreement secret)
|
|
256
277
|
* @param options.signer {RecordSigner} the unlock identity's signing key
|
|
257
278
|
* (`recordSignerFromAgent` over the unlock agent)
|
|
258
279
|
* @param [options.createdAt] {string} the bind timestamp to stamp, as an ISO
|
|
@@ -260,12 +281,11 @@ export interface KeyringRecordContents {
|
|
|
260
281
|
* so it knows the stamp without unwrapping the record it just wrote.
|
|
261
282
|
* @returns {Promise<SignedRecord>}
|
|
262
283
|
*/
|
|
263
|
-
export declare function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey,
|
|
284
|
+
export declare function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey, signer, createdAt }: {
|
|
264
285
|
controller: string;
|
|
265
286
|
email?: string;
|
|
266
287
|
pointer?: AccountPointer;
|
|
267
288
|
keyAgreementKey: IKeyAgreementKey;
|
|
268
|
-
keyResolver: IKeyResolver;
|
|
269
289
|
signer: RecordSigner;
|
|
270
290
|
createdAt?: string;
|
|
271
291
|
}): Promise<SignedRecord>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,yBAAyB,CAAA;AAGhC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACvD;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,WAAW,EAAE,gBAAgB,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,iBAAiB,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,oBAAoB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OA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,CAAC,EACtC,UAAU,EACV,KAAK,EACL,OAAO,EACP,eAAe,EACf,MAAM,EACN,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,eAAe,EAAE,gBAAgB,CAAA;IACjC,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,YAAY,CAAC,CAyBxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,eAAe,EACf,WAAW,EACX,oBAAoB,EACrB,EAAE;IACD,MAAM,EAAE,OAAO,CAAA;IACf,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;IACzB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA2CjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACV,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,MAAM,CAQT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,KAAK,EACN,EAAE;IACD,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,MAAM,CAKT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAsB7E"}
|
package/dist/keyring/record.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* to a reader of the unlock Space.
|
|
32
32
|
*/
|
|
33
33
|
import { createDataIntegrityProofTemplate, defaultWebvhLogVerifier, signDataIntegrityProof, signerFromExternalKey, verifyEntryProofs } from '@interop/did-method-webvh';
|
|
34
|
-
import { createEdvDocCipher, initRecipients, ownerRecipient } from '@interop/was-client/edv';
|
|
34
|
+
import { createEdvDocCipher, createEdvEncryptOnlyDocCipher, initRecipients, ownerRecipient } from '@interop/was-client/edv';
|
|
35
35
|
import { KEYRING_COLLECTION } from '../space/collections.js';
|
|
36
36
|
/**
|
|
37
37
|
* The version stamped on the stored `{ version, encryption, wrapped, proof }`
|
|
@@ -186,12 +186,14 @@ export async function mintRecordEncryption({ keyAgreementKey }) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
* Builds the record cipher: an EDV cipher over the record's own
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* kind
|
|
189
|
+
* Builds the record's reading cipher: an EDV cipher over the record's own
|
|
190
|
+
* descriptor, from the reader's key-agreement key. The unwrap paths' cipher
|
|
191
|
+
* (and the recovery record's, which reuses the keyring cipher context
|
|
192
|
+
* verbatim); the wrap paths seal through {@link recordSealCipher} instead. An
|
|
193
|
+
* app's own record kind passes its own `collectionId` so its failures name
|
|
194
|
+
* the record kind. The context labels errors only -- the codec is agnostic to
|
|
195
|
+
* it, so a record kind's real swap protection is its contents validation on
|
|
196
|
+
* unwrap.
|
|
195
197
|
*
|
|
196
198
|
* @param options {object}
|
|
197
199
|
* @param options.keyAgreementKey {IKeyAgreementKey} the wrapping KAK (for
|
|
@@ -210,6 +212,24 @@ export async function recordCipher({ keyAgreementKey, keyResolver, encryption, c
|
|
|
210
212
|
encryption
|
|
211
213
|
});
|
|
212
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Builds the record's sealing cipher: an encrypt-only EDV cipher over the
|
|
217
|
+
* record's own descriptor, needing no key-agreement secret -- a write seals to
|
|
218
|
+
* the descriptor's epoch public key, reconstructed from the epoch id. This is
|
|
219
|
+
* what lets the recovery re-mint, which holds only the code's unlock KAK
|
|
220
|
+
* public half, re-seal a record it can never open; the issuance wraps go
|
|
221
|
+
* through the same construction and produce the same envelope shape. Decrypt
|
|
222
|
+
* on it refuses with was-client's typed `EncryptOnlyCipherError`.
|
|
223
|
+
*
|
|
224
|
+
* @param options {object}
|
|
225
|
+
* @param options.encryption {CollectionEncryption} the record's descriptor
|
|
226
|
+
* @param [options.collectionId] {string} the cipher context failures are
|
|
227
|
+
* labeled with; defaults to the keyring context
|
|
228
|
+
* @returns {Promise<DocCipher>}
|
|
229
|
+
*/
|
|
230
|
+
export async function recordSealCipher({ encryption, collectionId = KEYRING_COLLECTION.id }) {
|
|
231
|
+
return createEdvEncryptOnlyDocCipher({ collectionId, encryption });
|
|
232
|
+
}
|
|
213
233
|
/**
|
|
214
234
|
* Validates the common `{ version, encryption, wrapped }` frame of a stored
|
|
215
235
|
* record (keyring or recovery -- `label` names the refusals) and returns its
|
|
@@ -339,8 +359,8 @@ export async function verifyRecordProof({ record, allowedKeyMultibases, label =
|
|
|
339
359
|
* @param [options.email] {string} the account email, when known
|
|
340
360
|
* @param [options.pointer] {AccountPointer} the account pointer (absent on
|
|
341
361
|
* no-WAS deployments)
|
|
342
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK
|
|
343
|
-
*
|
|
362
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK (its
|
|
363
|
+
* public half is all the wrap uses: sealing needs no key-agreement secret)
|
|
344
364
|
* @param options.signer {RecordSigner} the unlock identity's signing key
|
|
345
365
|
* (`recordSignerFromAgent` over the unlock agent)
|
|
346
366
|
* @param [options.createdAt] {string} the bind timestamp to stamp, as an ISO
|
|
@@ -348,13 +368,9 @@ export async function verifyRecordProof({ record, allowedKeyMultibases, label =
|
|
|
348
368
|
* so it knows the stamp without unwrapping the record it just wrote.
|
|
349
369
|
* @returns {Promise<SignedRecord>}
|
|
350
370
|
*/
|
|
351
|
-
export async function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey,
|
|
371
|
+
export async function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey, signer, createdAt }) {
|
|
352
372
|
const encryption = await mintRecordEncryption({ keyAgreementKey });
|
|
353
|
-
const cipher = await
|
|
354
|
-
keyAgreementKey,
|
|
355
|
-
keyResolver,
|
|
356
|
-
encryption
|
|
357
|
-
});
|
|
373
|
+
const cipher = await recordSealCipher({ encryption });
|
|
358
374
|
const { envelope } = await cipher.encrypt({
|
|
359
375
|
data: {
|
|
360
376
|
controller,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAA;AAOlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EAGf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAwCvC;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;IAChC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EAQT;IACC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC7D,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAA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,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AACnD,CAAC"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
27
27
|
* anchors before the account document's latest membership change.
|
|
28
28
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
29
|
-
* the enrollment wrap
|
|
29
|
+
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
30
|
+
* it converges onto the account document instead.
|
|
30
31
|
* - `convergeUserKeyRosterToDocument` -- the standing detector for a revocation
|
|
31
32
|
* cascade torn between the document edit and the roster rotation: a roster
|
|
32
33
|
* recipient the document no longer keys is rotated away from.
|
|
@@ -54,8 +55,9 @@ export type { ClientKeyRecord, ClientKeyRecordJson, EnrolledClientKeyRecord } fr
|
|
|
54
55
|
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
55
56
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
56
57
|
export type { CollectionUserKeyRotationOutcome, UserKeyCascadeResult } from './userKeyCascade.js';
|
|
57
|
-
export type { UserKeyRosterReadResult
|
|
58
|
-
export {
|
|
58
|
+
export type { UserKeyRosterReadResult } from './userKeyRoster.js';
|
|
59
|
+
export type { KeyAgreementDocument } from '../webvh/keyAgreement.js';
|
|
60
|
+
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
59
61
|
export { EPOCH_CONFIGURATION_STATE_TYPE, isSealableDescriptorStore, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
60
62
|
export type { SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
61
63
|
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs } from './spaceEpochs.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAE5E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/keys/index.js
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
27
27
|
* anchors before the account document's latest membership change.
|
|
28
28
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
29
|
-
* the enrollment wrap
|
|
29
|
+
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
30
|
+
* it converges onto the account document instead.
|
|
30
31
|
* - `convergeUserKeyRosterToDocument` -- the standing detector for a revocation
|
|
31
32
|
* cascade torn between the document edit and the roster rotation: a roster
|
|
32
33
|
* recipient the document no longer keys is rotated away from.
|
|
@@ -51,7 +52,7 @@ export { mintUserKey, userKeyVaultKeys } from './userKey.js';
|
|
|
51
52
|
export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRecord, parseClientRecordUserKey, parseClientRecordWebvhKeys } from './clientKeyRecord.js';
|
|
52
53
|
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
53
54
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
54
|
-
export { userKeyRosterDescriptorStore } from './rosterStore.js';
|
|
55
|
+
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
55
56
|
export { EPOCH_CONFIGURATION_STATE_TYPE, isSealableDescriptorStore, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
56
57
|
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs } from './spaceEpochs.js';
|
|
57
58
|
export { readClientLabels, removeClientLabel, setClientLabel } from './clientLabels.js';
|
package/dist/keys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG5D,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAO7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -11,9 +11,22 @@ export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
|
11
11
|
* still anchors before the controller's latest membership change --
|
|
12
12
|
* `'sealed'` -- and writing nothing when the log is already sealed, absent,
|
|
13
13
|
* or has no membership change to seal against -- `'noop'`.
|
|
14
|
+
*
|
|
15
|
+
* `setControllerFloor()` is the post-edit freshness contract: a ceremony that
|
|
16
|
+
* just extended the account log (a revocation about to rotate the roster)
|
|
17
|
+
* hands the store the controller view built from that post-edit log, and the
|
|
18
|
+
* store's subsequent operations never resolve to anything staler. The
|
|
19
|
+
* injected `resolveController` still wins whenever it is at or past the floor
|
|
20
|
+
* (it may be fresher -- a concurrent enrollment), so the floor supersedes
|
|
21
|
+
* only a stale cached view, which would otherwise anchor the rotation before
|
|
22
|
+
* the edit and leave the log unsealed with the seal backstop blind to the
|
|
23
|
+
* removal.
|
|
14
24
|
*/
|
|
15
25
|
export interface SealableEncryptionDescriptorStore extends EncryptionDescriptorStore {
|
|
16
26
|
seal(): Promise<'sealed' | 'noop'>;
|
|
27
|
+
setControllerFloor(options: {
|
|
28
|
+
controller: ResourceLogController;
|
|
29
|
+
}): void;
|
|
17
30
|
}
|
|
18
31
|
/**
|
|
19
32
|
* Whether a descriptor store is log-governed and sealable -- the guard the
|
|
@@ -31,7 +44,11 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
31
44
|
* The controller view is resolved per operation (never held), so a caller
|
|
32
45
|
* that just edited the account document -- a revocation about to rotate the
|
|
33
46
|
* roster -- writes entries anchored at the post-edit head it now verifies,
|
|
34
|
-
* which is exactly what makes its rotation the sealing append.
|
|
47
|
+
* which is exactly what makes its rotation the sealing append. The revocation
|
|
48
|
+
* orchestrator does not leave that freshness to the injected resolver's
|
|
49
|
+
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
50
|
+
* own post-edit log, and a resolver still serving a stale cached view is
|
|
51
|
+
* superseded by it (see the interface doc).
|
|
35
52
|
*
|
|
36
53
|
* @param options {object}
|
|
37
54
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
@@ -40,14 +57,17 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
40
57
|
* (`webvhResourceLogController` over a `verifyAccountLog` result)
|
|
41
58
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head pin
|
|
42
59
|
* for this log
|
|
60
|
+
* @param options.logId {string} the pin-slot key for this log, from
|
|
61
|
+
* `resourceLogPinId`
|
|
43
62
|
* @param options.signer {ResourceLogSigner} this client's enrolled signing
|
|
44
63
|
* key, for the appends this store writes
|
|
45
64
|
* @returns {SealableEncryptionDescriptorStore}
|
|
46
65
|
*/
|
|
47
|
-
export declare function logGovernedDescriptorStore({ log, resolveController, pinStore, signer }: {
|
|
66
|
+
export declare function logGovernedDescriptorStore({ log, resolveController, pinStore, logId, signer }: {
|
|
48
67
|
log: ResourceLogStore;
|
|
49
68
|
resolveController: () => Promise<ResourceLogController>;
|
|
50
69
|
pinStore: ResourceLogPinStore;
|
|
70
|
+
logId: string;
|
|
51
71
|
signer: ResourceLogSigner;
|
|
52
72
|
}): SealableEncryptionDescriptorStore;
|
|
53
73
|
//# sourceMappingURL=rosterLogStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,yBAAyB,EAAE,M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Append, RESOURCE_LOG_METHOD } from '@interop/was-client/log';
|
|
2
|
-
import { buildResourceLogEntry, buildResourceLogGenesis,
|
|
3
|
-
import { EPOCH_CONFIGURATION_STATE_TYPE } from '../descriptors/logSource.js';
|
|
2
|
+
import { buildResourceLogEntry, buildResourceLogGenesis, ResourceLogClosedError, sealResourceLog, verifyResourceLog } from '../resourceLog/index.js';
|
|
3
|
+
import { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration } from '../descriptors/logSource.js';
|
|
4
4
|
export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
5
5
|
/**
|
|
6
6
|
* Whether a descriptor store is log-governed and sealable -- the guard the
|
|
@@ -21,7 +21,11 @@ export function isSealableDescriptorStore(store) {
|
|
|
21
21
|
* The controller view is resolved per operation (never held), so a caller
|
|
22
22
|
* that just edited the account document -- a revocation about to rotate the
|
|
23
23
|
* roster -- writes entries anchored at the post-edit head it now verifies,
|
|
24
|
-
* which is exactly what makes its rotation the sealing append.
|
|
24
|
+
* which is exactly what makes its rotation the sealing append. The revocation
|
|
25
|
+
* orchestrator does not leave that freshness to the injected resolver's
|
|
26
|
+
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
27
|
+
* own post-edit log, and a resolver still serving a stale cached view is
|
|
28
|
+
* superseded by it (see the interface doc).
|
|
25
29
|
*
|
|
26
30
|
* @param options {object}
|
|
27
31
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
@@ -30,15 +34,33 @@ export function isSealableDescriptorStore(store) {
|
|
|
30
34
|
* (`webvhResourceLogController` over a `verifyAccountLog` result)
|
|
31
35
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head pin
|
|
32
36
|
* for this log
|
|
37
|
+
* @param options.logId {string} the pin-slot key for this log, from
|
|
38
|
+
* `resourceLogPinId`
|
|
33
39
|
* @param options.signer {ResourceLogSigner} this client's enrolled signing
|
|
34
40
|
* key, for the appends this store writes
|
|
35
41
|
* @returns {SealableEncryptionDescriptorStore}
|
|
36
42
|
*/
|
|
37
|
-
export function logGovernedDescriptorStore({ log, resolveController, pinStore, signer }) {
|
|
43
|
+
export function logGovernedDescriptorStore({ log, resolveController, pinStore, logId, signer }) {
|
|
38
44
|
// The verified log observed by the most recent read on this store instance;
|
|
39
45
|
// a replace builds its entry on that head, pinned to the same read's etag,
|
|
40
46
|
// so a stale head loses the CAS instead of forking.
|
|
41
47
|
let lastVerified = null;
|
|
48
|
+
// The freshness floor a post-edit ceremony set (see the interface doc).
|
|
49
|
+
let controllerFloor = null;
|
|
50
|
+
async function currentController() {
|
|
51
|
+
const resolved = await resolveController();
|
|
52
|
+
if (controllerFloor === null) {
|
|
53
|
+
return resolved;
|
|
54
|
+
}
|
|
55
|
+
const floorHead = controllerFloor.versionIds[controllerFloor.versionIds.length - 1];
|
|
56
|
+
// A resolved view carrying the floor's head version is at or past the
|
|
57
|
+
// floor (the controller-log version list is append-only) and wins; one
|
|
58
|
+
// that does not is a stale cache the floor supersedes.
|
|
59
|
+
if (floorHead !== undefined && !resolved.versionIds.includes(floorHead)) {
|
|
60
|
+
return controllerFloor;
|
|
61
|
+
}
|
|
62
|
+
return resolved;
|
|
63
|
+
}
|
|
42
64
|
function toState(descriptor) {
|
|
43
65
|
const { history: _history, ...rest } = descriptor;
|
|
44
66
|
return { ...rest, type: EPOCH_CONFIGURATION_STATE_TYPE };
|
|
@@ -49,32 +71,26 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
49
71
|
entries: readBack.entries,
|
|
50
72
|
controller,
|
|
51
73
|
expectedMethod: RESOURCE_LOG_METHOD,
|
|
52
|
-
pin: await pinStore.read()
|
|
74
|
+
pin: await pinStore.read({ logId })
|
|
53
75
|
});
|
|
54
|
-
await pinStore.write(confirmed.pin);
|
|
76
|
+
await pinStore.write({ logId, pin: confirmed.pin });
|
|
55
77
|
lastVerified = confirmed;
|
|
56
78
|
}
|
|
57
79
|
return {
|
|
58
80
|
async read() {
|
|
59
|
-
const
|
|
60
|
-
const current = await readResourceLog({
|
|
81
|
+
const current = await readGovernedEpochConfiguration({
|
|
61
82
|
store: log,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
83
|
+
resolveController: currentController,
|
|
84
|
+
pinStore,
|
|
85
|
+
logId
|
|
65
86
|
});
|
|
66
87
|
if (current === null) {
|
|
67
88
|
lastVerified = null;
|
|
68
89
|
return null;
|
|
69
90
|
}
|
|
70
|
-
const state = current.verified.state;
|
|
71
|
-
if (state.type !== EPOCH_CONFIGURATION_STATE_TYPE) {
|
|
72
|
-
throw new ResourceLogIntegrityError(`The governed descriptor log carries state of type ` +
|
|
73
|
-
`"${state.type}", not "${EPOCH_CONFIGURATION_STATE_TYPE}".`);
|
|
74
|
-
}
|
|
75
91
|
lastVerified = current.verified;
|
|
76
92
|
return {
|
|
77
|
-
descriptor:
|
|
93
|
+
descriptor: current.descriptor,
|
|
78
94
|
etag: current.etag
|
|
79
95
|
};
|
|
80
96
|
},
|
|
@@ -90,7 +106,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
90
106
|
if (lastVerified.terminal) {
|
|
91
107
|
throw new ResourceLogClosedError({ nextLog: lastVerified.terminal });
|
|
92
108
|
}
|
|
93
|
-
const controller = await
|
|
109
|
+
const controller = await currentController();
|
|
94
110
|
const entry = await buildResourceLogEntry({
|
|
95
111
|
head: lastVerified.head,
|
|
96
112
|
state: toState(descriptor),
|
|
@@ -103,7 +119,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
103
119
|
await settle({ entry, controller });
|
|
104
120
|
},
|
|
105
121
|
async create(descriptor) {
|
|
106
|
-
const controller = await
|
|
122
|
+
const controller = await currentController();
|
|
107
123
|
const genesis = await buildResourceLogGenesis({
|
|
108
124
|
state: toState(descriptor),
|
|
109
125
|
method: RESOURCE_LOG_METHOD,
|
|
@@ -116,7 +132,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
116
132
|
await settle({ entry: genesis, controller });
|
|
117
133
|
},
|
|
118
134
|
async seal() {
|
|
119
|
-
const controller = await
|
|
135
|
+
const controller = await currentController();
|
|
120
136
|
// Reuse the log view the most recent read or confirmed append on this
|
|
121
137
|
// store instance verified: a rotation that just appended anchors past
|
|
122
138
|
// the removal, so the sweep resolves noop with no re-fetch, and a stale
|
|
@@ -126,6 +142,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
126
142
|
controller,
|
|
127
143
|
expectedMethod: RESOURCE_LOG_METHOD,
|
|
128
144
|
pinStore,
|
|
145
|
+
logId,
|
|
129
146
|
signer,
|
|
130
147
|
...(lastVerified === null ? {} : { verified: lastVerified })
|
|
131
148
|
});
|
|
@@ -133,6 +150,9 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
133
150
|
lastVerified = verified;
|
|
134
151
|
}
|
|
135
152
|
return sealed ? 'sealed' : 'noop';
|
|
153
|
+
},
|
|
154
|
+
setControllerFloor({ controller }) {
|
|
155
|
+
controllerFloor = controller;
|
|
136
156
|
}
|
|
137
157
|
};
|
|
138
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,aAAa,EACb,mBAAmB,EAEpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,aAAa,EACb,mBAAmB,EAEpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EAKlB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,6BAA6B,CAAA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,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;aAC7D,CAAC,CAAA;YACF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,YAAY,GAAG,QAAQ,CAAA;YACzB,CAAC;YACD,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QACnC,CAAC;QAED,kBAAkB,CAAC,EAAE,UAAU,EAAE;YAC/B,eAAe,GAAG,UAAU,CAAA;QAC9B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { ZcapClient } from '@interop/ezcap';
|
|
2
|
-
import type
|
|
2
|
+
import { type ResourceLogController, type ResourceLogPinStore, type ResourceLogSigner } from '../resourceLog/index.js';
|
|
3
3
|
import { type SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
4
|
+
/**
|
|
5
|
+
* The pin-slot key for a Space's user key roster log
|
|
6
|
+
* (`key-map/user-key.jsonl`) -- what a caller keying its own
|
|
7
|
+
* {@link ResourceLogPinStore} names the roster's pin by.
|
|
8
|
+
*
|
|
9
|
+
* @param options {object}
|
|
10
|
+
* @param options.spaceId {string} the data Space id
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
export declare function userKeyRosterPinId({ spaceId }: {
|
|
14
|
+
spaceId: string;
|
|
15
|
+
}): string;
|
|
4
16
|
/**
|
|
5
17
|
* Builds the log-governed descriptor store over the user key roster in a
|
|
6
18
|
* data Space: reads resolve to the verified head of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rosterStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAM3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACP,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iCAAiC,CAcpC"}
|