@interop/wallet-core 0.15.0 → 0.17.1
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/dist/clients/index.d.ts +2 -2
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +1 -1
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts +24 -3
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +20 -7
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +5 -2
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +27 -11
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +26 -5
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +93 -35
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/refresh.d.ts +3 -1
- package/dist/descriptors/refresh.d.ts.map +1 -1
- package/dist/descriptors/refresh.js +3 -1
- package/dist/descriptors/refresh.js.map +1 -1
- package/dist/display/alignment.d.ts +8 -2
- package/dist/display/alignment.d.ts.map +1 -1
- package/dist/display/alignment.js +11 -8
- package/dist/display/alignment.js.map +1 -1
- package/dist/display/displayFields.d.ts +6 -2
- package/dist/display/displayFields.d.ts.map +1 -1
- package/dist/display/displayFields.js.map +1 -1
- package/dist/display/evidence.d.ts +9 -3
- package/dist/display/evidence.d.ts.map +1 -1
- package/dist/display/evidence.js +3 -1
- package/dist/display/evidence.js.map +1 -1
- package/dist/display/index.d.ts +1 -1
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.js +1 -1
- package/dist/display/index.js.map +1 -1
- package/dist/display/issuer.d.ts +12 -4
- package/dist/display/issuer.d.ts.map +1 -1
- package/dist/display/issuer.js.map +1 -1
- package/dist/display/obv3.d.ts +7 -2
- package/dist/display/obv3.d.ts.map +1 -1
- package/dist/display/obv3.js +14 -24
- package/dist/display/obv3.js.map +1 -1
- package/dist/display/parse.d.ts +6 -2
- package/dist/display/parse.d.ts.map +1 -1
- package/dist/display/parse.js +6 -2
- package/dist/display/parse.js.map +1 -1
- package/dist/display/subject.d.ts +4 -0
- package/dist/display/subject.d.ts.map +1 -1
- package/dist/display/subject.js +12 -10
- package/dist/display/subject.js.map +1 -1
- package/dist/display/text.d.ts +11 -0
- package/dist/display/text.d.ts.map +1 -1
- package/dist/display/text.js +20 -4
- package/dist/display/text.js.map +1 -1
- package/dist/display/types.js +1 -1
- package/dist/display/types.js.map +1 -1
- package/dist/display/validity.js +4 -4
- package/dist/display/validity.js.map +1 -1
- package/dist/display/verificationView.d.ts +21 -7
- package/dist/display/verificationView.d.ts.map +1 -1
- package/dist/display/verificationView.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +5 -3
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +79 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/keys/clientKeyRecord.d.ts +3 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +42 -10
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +1 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/pukCascade.d.ts.map +1 -1
- package/dist/keys/pukCascade.js +13 -14
- package/dist/keys/pukCascade.js.map +1 -1
- package/dist/keys/pukRoster.d.ts +85 -7
- package/dist/keys/pukRoster.d.ts.map +1 -1
- package/dist/keys/pukRoster.js +136 -11
- package/dist/keys/pukRoster.js.map +1 -1
- package/dist/request/classify.d.ts +15 -1
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +38 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/composeVp.d.ts.map +1 -1
- package/dist/request/composeVp.js +10 -3
- package/dist/request/composeVp.js.map +1 -1
- package/dist/request/matching.d.ts +6 -0
- package/dist/request/matching.d.ts.map +1 -1
- package/dist/request/matching.js +33 -8
- package/dist/request/matching.js.map +1 -1
- package/dist/request/parse.d.ts +5 -2
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +30 -5
- package/dist/request/parse.js.map +1 -1
- package/dist/request/presentationSuite.d.ts.map +1 -1
- package/dist/request/presentationSuite.js +6 -2
- package/dist/request/presentationSuite.js.map +1 -1
- package/dist/request/processRequest.js +1 -1
- package/dist/request/processRequest.js.map +1 -1
- package/dist/space/activity.d.ts +21 -7
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +18 -6
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +18 -6
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +18 -6
- package/dist/space/collections.js.map +1 -1
- package/dist/space/wasLink.d.ts +6 -2
- package/dist/space/wasLink.d.ts.map +1 -1
- package/dist/space/wasLink.js +5 -2
- package/dist/space/wasLink.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts +1 -1
- package/dist/sync/contactsConflict.js +1 -1
- package/dist/sync/engine.d.ts +33 -11
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js +4 -3
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/pull.d.ts +5 -3
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +34 -10
- package/dist/sync/pull.js.map +1 -1
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +24 -8
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/types.d.ts +30 -6
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/webvh/didWebvh.d.ts +34 -0
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +56 -5
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +5 -2
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +4 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +77 -0
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +91 -1
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +11 -3
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +83 -14
- package/dist/webvh/revokeClient.js.map +1 -1
- package/package.json +3 -3
package/dist/clients/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - `listAccountClients` / `currentAccountSigningKeys` -- the listing over the
|
|
10
10
|
* locally verified did:webvh log, with display labels merged, and the same
|
|
11
11
|
* read reduced to the key set an app grant's delegation signer is checked
|
|
12
|
-
* against.
|
|
12
|
+
* against. Both take an already-verified log in place of fetching one.
|
|
13
13
|
* - `disconnectEligibility` / `revokedClientKeysFor` / `cascadeCompletion` --
|
|
14
14
|
* the disconnect-eligibility policy as data and pure functions, so both
|
|
15
15
|
* surfaces refuse the same rows for the same reasons and report a partial
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* convergence of the roster onto the account document.
|
|
23
23
|
*/
|
|
24
24
|
export { currentAccountSigningKeys, listAccountClients } from './listing.js';
|
|
25
|
-
export type { AccountClientView, AccountLogPointer } from './listing.js';
|
|
25
|
+
export type { AccountClientView, AccountLogPointer, VerifiedAccountLog } from './listing.js';
|
|
26
26
|
export { cascadeCompletion, disconnectEligibility, revokedClientKeysFor } from './policy.js';
|
|
27
27
|
export type { DisconnectRefusal } from './policy.js';
|
|
28
28
|
export { revokeAccountClient } from './revocation.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;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,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/clients/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - `listAccountClients` / `currentAccountSigningKeys` -- the listing over the
|
|
10
10
|
* locally verified did:webvh log, with display labels merged, and the same
|
|
11
11
|
* read reduced to the key set an app grant's delegation signer is checked
|
|
12
|
-
* against.
|
|
12
|
+
* against. Both take an already-verified log in place of fetching one.
|
|
13
13
|
* - `disconnectEligibility` / `revokedClientKeysFor` / `cascadeCompletion` --
|
|
14
14
|
* the disconnect-eligibility policy as data and pure functions, so both
|
|
15
15
|
* surfaces refuse the same rows for the same reasons and report a partial
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;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,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAA"}
|
|
@@ -19,8 +19,14 @@
|
|
|
19
19
|
* Labels are display metadata with no authority, so a label-read failure
|
|
20
20
|
* degrades to unlabeled rows; the listing itself fails only when the log
|
|
21
21
|
* cannot be fetched or verified.
|
|
22
|
+
*
|
|
23
|
+
* The two reads are independent, so they run together, and either entry point
|
|
24
|
+
* takes an already-verified log (`verifiedLog`) in place of fetching one --
|
|
25
|
+
* the seam a caller needs to keep one verified log for a session instead of
|
|
26
|
+
* re-verifying `did.jsonl` per surface. Whether such a cache is safe to hold,
|
|
27
|
+
* and what invalidates it, is the caller's call.
|
|
22
28
|
*/
|
|
23
|
-
import { type EnrolledWebvhClient } from '../webvh/index.js';
|
|
29
|
+
import { verifyAccountLog, type EnrolledWebvhClient } from '../webvh/index.js';
|
|
24
30
|
import { type ClientLabelsStore } from '../keys/index.js';
|
|
25
31
|
/**
|
|
26
32
|
* Where an account's did:webvh log is published: the account DID plus the
|
|
@@ -31,6 +37,15 @@ export interface AccountLogPointer {
|
|
|
31
37
|
spaceId: string;
|
|
32
38
|
host: string;
|
|
33
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A log that has already been fetched and locally verified -- exactly what
|
|
42
|
+
* `verifyAccountLog` resolves to. Both entry points below accept one so a
|
|
43
|
+
* caller holding a still-valid result (a session-lifetime cache, or two
|
|
44
|
+
* surfaces mounting together) reads the account's clients without re-fetching
|
|
45
|
+
* and re-verifying `did.jsonl`. The cache itself is the caller's: only the
|
|
46
|
+
* caller knows which ceremonies invalidate it.
|
|
47
|
+
*/
|
|
48
|
+
export type VerifiedAccountLog = Awaited<ReturnType<typeof verifyAccountLog>>;
|
|
34
49
|
/**
|
|
35
50
|
* One row of the listing: the log-stated client plus its display state.
|
|
36
51
|
* `updateKeyMultibase` is absent when the log attribution could not isolate
|
|
@@ -51,12 +66,15 @@ export interface AccountClientView extends EnrolledWebvhClient {
|
|
|
51
66
|
* `key-map/client-labels.json` store; omitted, every row is unlabeled
|
|
52
67
|
* @param [options.ownSigningKeyMultibase] {string} this client's own signing
|
|
53
68
|
* key, which marks its row `isCurrent`
|
|
69
|
+
* @param [options.verifiedLog] {VerifiedAccountLog} an already-verified log
|
|
70
|
+
* to read instead of fetching and verifying one
|
|
54
71
|
* @returns {Promise<AccountClientView[]>}
|
|
55
72
|
*/
|
|
56
|
-
export declare function listAccountClients({ pointer, labelsStore, ownSigningKeyMultibase }: {
|
|
73
|
+
export declare function listAccountClients({ pointer, labelsStore, ownSigningKeyMultibase, verifiedLog }: {
|
|
57
74
|
pointer: AccountLogPointer;
|
|
58
75
|
labelsStore?: ClientLabelsStore;
|
|
59
76
|
ownSigningKeyMultibase?: string;
|
|
77
|
+
verifiedLog?: VerifiedAccountLog;
|
|
60
78
|
}): Promise<AccountClientView[]>;
|
|
61
79
|
/**
|
|
62
80
|
* The signing-key multibases of the account's currently enrolled wallet
|
|
@@ -74,9 +92,12 @@ export declare function listAccountClients({ pointer, labelsStore, ownSigningKey
|
|
|
74
92
|
*
|
|
75
93
|
* @param options {object}
|
|
76
94
|
* @param options.pointer {AccountLogPointer}
|
|
95
|
+
* @param [options.verifiedLog] {VerifiedAccountLog} an already-verified log
|
|
96
|
+
* to read instead of fetching and verifying one
|
|
77
97
|
* @returns {Promise<Set<string>>}
|
|
78
98
|
*/
|
|
79
|
-
export declare function currentAccountSigningKeys({ pointer }: {
|
|
99
|
+
export declare function currentAccountSigningKeys({ pointer, verifiedLog }: {
|
|
80
100
|
pointer: AccountLogPointer;
|
|
101
|
+
verifiedLog?: VerifiedAccountLog;
|
|
81
102
|
}): Promise<Set<string>>;
|
|
82
103
|
//# sourceMappingURL=listing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAEL,gBAAgB,EAChB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE3E;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAA;AAE7E;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,WAAW,EACZ,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAA;CACjC,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgB/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,OAAO,EACP,WAAW,EACZ,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;CACjC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAKvB"}
|
package/dist/clients/listing.js
CHANGED
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
* Labels are display metadata with no authority, so a label-read failure
|
|
20
20
|
* degrades to unlabeled rows; the listing itself fails only when the log
|
|
21
21
|
* cannot be fetched or verified.
|
|
22
|
+
*
|
|
23
|
+
* The two reads are independent, so they run together, and either entry point
|
|
24
|
+
* takes an already-verified log (`verifiedLog`) in place of fetching one --
|
|
25
|
+
* the seam a caller needs to keep one verified log for a session instead of
|
|
26
|
+
* re-verifying `did.jsonl` per surface. Whether such a cache is safe to hold,
|
|
27
|
+
* and what invalidates it, is the caller's call.
|
|
22
28
|
*/
|
|
23
29
|
import { listEnrolledWebvhClients, verifyAccountLog } from '../webvh/index.js';
|
|
24
30
|
import { readClientLabels } from '../keys/index.js';
|
|
@@ -32,14 +38,19 @@ import { readClientLabels } from '../keys/index.js';
|
|
|
32
38
|
* `key-map/client-labels.json` store; omitted, every row is unlabeled
|
|
33
39
|
* @param [options.ownSigningKeyMultibase] {string} this client's own signing
|
|
34
40
|
* key, which marks its row `isCurrent`
|
|
41
|
+
* @param [options.verifiedLog] {VerifiedAccountLog} an already-verified log
|
|
42
|
+
* to read instead of fetching and verifying one
|
|
35
43
|
* @returns {Promise<AccountClientView[]>}
|
|
36
44
|
*/
|
|
37
|
-
export async function listAccountClients({ pointer, labelsStore, ownSigningKeyMultibase }) {
|
|
38
|
-
|
|
45
|
+
export async function listAccountClients({ pointer, labelsStore, ownSigningKeyMultibase, verifiedLog }) {
|
|
46
|
+
// The log read and the label read are independent, so they run together.
|
|
47
|
+
const [{ log }, labels] = await Promise.all([
|
|
48
|
+
verifiedLog ?? verifyAccountLog(pointer),
|
|
49
|
+
labelsStore
|
|
50
|
+
? readClientLabels({ store: labelsStore }).then(read => read.labels)
|
|
51
|
+
: Promise.resolve({})
|
|
52
|
+
]);
|
|
39
53
|
const clients = listEnrolledWebvhClients({ log });
|
|
40
|
-
const labels = labelsStore
|
|
41
|
-
? (await readClientLabels({ store: labelsStore })).labels
|
|
42
|
-
: {};
|
|
43
54
|
return clients.map(client => ({
|
|
44
55
|
...client,
|
|
45
56
|
...(labels[client.signingKeyMultibase] !== undefined
|
|
@@ -64,10 +75,12 @@ export async function listAccountClients({ pointer, labelsStore, ownSigningKeyMu
|
|
|
64
75
|
*
|
|
65
76
|
* @param options {object}
|
|
66
77
|
* @param options.pointer {AccountLogPointer}
|
|
78
|
+
* @param [options.verifiedLog] {VerifiedAccountLog} an already-verified log
|
|
79
|
+
* to read instead of fetching and verifying one
|
|
67
80
|
* @returns {Promise<Set<string>>}
|
|
68
81
|
*/
|
|
69
|
-
export async function currentAccountSigningKeys({ pointer }) {
|
|
70
|
-
const { log } = await verifyAccountLog(pointer);
|
|
82
|
+
export async function currentAccountSigningKeys({ pointer, verifiedLog }) {
|
|
83
|
+
const { log } = verifiedLog ?? (await verifyAccountLog(pointer));
|
|
71
84
|
return new Set(listEnrolledWebvhClients({ log }).map(client => client.signingKeyMultibase));
|
|
72
85
|
}
|
|
73
86
|
//# sourceMappingURL=listing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAA;AAiC3E;;;;;;;;;;;;;G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,CAC5E,CAAA;AACH,CAAC"}
|
|
@@ -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 } from '@interop/was-client/edv';
|
|
49
|
+
import type { EncryptionDescriptorStore, EpochsSigner } from '@interop/was-client/edv';
|
|
50
50
|
import { type ClientWebvhUpdateKeys, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
|
|
51
51
|
import { type Puk, type PukCascadeResult } from '../keys/index.js';
|
|
52
52
|
/**
|
|
@@ -113,6 +113,8 @@ export interface ClientRevocationResult {
|
|
|
113
113
|
* @param [options.puk] {Puk} this client's cached per-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 (`pukRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
116
118
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
117
119
|
* roster epoch
|
|
118
120
|
* @param [options.onPukAdopted] {Function} persists a rotated key: called
|
|
@@ -127,7 +129,7 @@ export interface ClientRevocationResult {
|
|
|
127
129
|
* keeps operating without a re-login
|
|
128
130
|
* @returns {Promise<ClientRevocationResult>}
|
|
129
131
|
*/
|
|
130
|
-
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, puk, clientKeyAgreementKey, pinnedEpochId, onPukAdopted, collections, remintRecoveryDelegations, onRotationAdopted }: {
|
|
132
|
+
export declare function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, puk, clientKeyAgreementKey, signEpochs, pinnedEpochId, onPukAdopted, collections, remintRecoveryDelegations, onRotationAdopted }: {
|
|
131
133
|
idStore: WebvhIdStore;
|
|
132
134
|
updateKeys: ClientWebvhUpdateKeys;
|
|
133
135
|
revokedClient: RevokedClientKeys;
|
|
@@ -136,6 +138,7 @@ export declare function revokeAccountClient({ idStore, updateKeys, revokedClient
|
|
|
136
138
|
rosterStore: EncryptionDescriptorStore;
|
|
137
139
|
puk?: Puk;
|
|
138
140
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
141
|
+
signEpochs: EpochsSigner;
|
|
139
142
|
pinnedEpochId?: string | null;
|
|
140
143
|
onPukAdopted?: (adopted: {
|
|
141
144
|
puk: Puk;
|
|
@@ -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,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,GAAG,EACR,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,WAAW,k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EAAE,CAAC,OAAO,EAAE;QACvB,GAAG,EAAE,GAAG,CAAA;QACR,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,GAAG,EAAE,GAAG,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAuGlC"}
|
|
@@ -49,6 +49,8 @@ async function collectionIdsOf({ collections }) {
|
|
|
49
49
|
* @param [options.puk] {Puk} this client's cached per-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 (`pukRosterEpochsSigner`), vouching for the rotated roster epoch
|
|
52
54
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
53
55
|
* roster epoch
|
|
54
56
|
* @param [options.onPukAdopted] {Function} persists a rotated key: called
|
|
@@ -63,7 +65,7 @@ async function collectionIdsOf({ collections }) {
|
|
|
63
65
|
* keeps operating without a re-login
|
|
64
66
|
* @returns {Promise<ClientRevocationResult>}
|
|
65
67
|
*/
|
|
66
|
-
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, puk, clientKeyAgreementKey, pinnedEpochId, onPukAdopted, collections, remintRecoveryDelegations, onRotationAdopted }) {
|
|
68
|
+
export async function revokeAccountClient({ idStore, updateKeys, revokedClient, knownLatentHashes, ownSigningKeyMultibase, rosterStore, puk, clientKeyAgreementKey, signEpochs, pinnedEpochId, onPukAdopted, collections, remintRecoveryDelegations, onRotationAdopted }) {
|
|
67
69
|
if (ownSigningKeyMultibase &&
|
|
68
70
|
ownSigningKeyMultibase === revokedClient.signingKeyMultibase) {
|
|
69
71
|
throw new Error('This wallet cannot disconnect itself; use another enrolled wallet ' +
|
|
@@ -83,26 +85,40 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
|
|
|
83
85
|
...(knownLatentHashes ? { knownLatentHashes } : {})
|
|
84
86
|
});
|
|
85
87
|
// 2. The roster rotation, recipients resolved from that same document.
|
|
88
|
+
// Whether there IS a roster is settled BEFORE the rotation: an account with
|
|
89
|
+
// no `key-map/puk.json` (its collections are not encrypted yet) has nothing
|
|
90
|
+
// to rotate, and the rotation itself refuses an absent descriptor rather
|
|
91
|
+
// than no-op'ing. The document edit has already landed, so the client IS
|
|
92
|
+
// disconnected -- a completed cascade with nothing rotated, not a failure.
|
|
93
|
+
const roster = await rosterStore.read();
|
|
94
|
+
if (roster === null) {
|
|
95
|
+
return {
|
|
96
|
+
rotated: false,
|
|
97
|
+
collections: { outcomes: {}, failed: [] },
|
|
98
|
+
document: doc
|
|
99
|
+
};
|
|
100
|
+
}
|
|
86
101
|
await rotatePukRoster({
|
|
87
102
|
store: rosterStore,
|
|
88
103
|
document: doc,
|
|
89
|
-
retireRecipientId: rosterRecipientKid(revokedClient)
|
|
104
|
+
retireRecipientId: rosterRecipientKid(revokedClient),
|
|
105
|
+
signEpochs
|
|
90
106
|
});
|
|
91
107
|
const read = await readPukRoster({
|
|
92
108
|
store: rosterStore,
|
|
93
109
|
...(puk ? { puk } : {}),
|
|
94
110
|
clientKeyAgreementKey,
|
|
95
|
-
pinnedEpochId
|
|
111
|
+
pinnedEpochId,
|
|
112
|
+
document: doc
|
|
96
113
|
});
|
|
97
114
|
if (!read) {
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
115
|
+
// The roster stood a moment ago and the rotation just wrote it, so its
|
|
116
|
+
// disappearance is a real fault, not the no-roster case above: the fresh
|
|
117
|
+
// key is only readable from the roster, and reporting success here would
|
|
118
|
+
// fan out under the retired one.
|
|
119
|
+
throw new Error('The wrap-set roster vanished between its rotation and the read that ' +
|
|
120
|
+
'adopts the fresh per-user key; the client is disconnected, but the ' +
|
|
121
|
+
'rotation must be completed by re-running the revocation.');
|
|
106
122
|
}
|
|
107
123
|
if (read.rotated) {
|
|
108
124
|
await onPukAdopted?.({
|
|
@@ -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":"AAoDA,OAAO,EACL,iBAAiB,EAIlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,eAAe,EAGhB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,GAAG,EACH,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,W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AE,IAAI,CAAC,GAAG;QACb,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAA;AACH,CAAC"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
*/
|
|
46
46
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
47
47
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
48
|
-
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
48
|
+
import type { EncryptionDescriptorStore, EpochsSigner } from '@interop/was-client/edv';
|
|
49
49
|
import { type Puk, type PukRosterReadResult } from '../keys/index.js';
|
|
50
50
|
import type { AccountLogPointer } from './listing.js';
|
|
51
51
|
/**
|
|
@@ -60,9 +60,19 @@ export interface AdoptedPuk {
|
|
|
60
60
|
/**
|
|
61
61
|
* The login-time roster read. See the module doc for the failure semantics.
|
|
62
62
|
*
|
|
63
|
+
* A read that adopts an epoch from the roster (a rotation by another client,
|
|
64
|
+
* or this client's first read) must trace it to the account document, so the
|
|
65
|
+
* account log is fetched and verified lazily on exactly that path (via
|
|
66
|
+
* `pointer`). A log that cannot be fetched then lands in the
|
|
67
|
+
* transport-failure class -- the session carries on under the cached key,
|
|
68
|
+
* WITHOUT adopting the unverifiable rotation -- while a roster whose epoch
|
|
69
|
+
* configuration no enrolled client signed is a refusal like the other three.
|
|
70
|
+
*
|
|
63
71
|
* @param options {object}
|
|
64
72
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
65
73
|
* store
|
|
74
|
+
* @param options.pointer {AccountLogPointer} where the account log lives,
|
|
75
|
+
* for the lazy document verification above
|
|
66
76
|
* @param [options.puk] {Puk} this client's cached per-user key; omitted (a
|
|
67
77
|
* freshly enrolled client's first read) the key is always taken from the
|
|
68
78
|
* roster
|
|
@@ -77,8 +87,9 @@ export interface AdoptedPuk {
|
|
|
77
87
|
* @returns {Promise<PukRosterReadResult | null>} the read, or `null` when
|
|
78
88
|
* the account has no roster yet or the server could not be reached
|
|
79
89
|
*/
|
|
80
|
-
export declare function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey, pinnedEpochId, onRosterRead }: {
|
|
90
|
+
export declare function checkPukRosterAtLogin({ store, pointer, puk, clientKeyAgreementKey, pinnedEpochId, onRosterRead }: {
|
|
81
91
|
store: EncryptionDescriptorStore;
|
|
92
|
+
pointer: AccountLogPointer;
|
|
82
93
|
puk?: Puk;
|
|
83
94
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
84
95
|
pinnedEpochId?: string | null;
|
|
@@ -89,8 +100,15 @@ export declare function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKe
|
|
|
89
100
|
* adopting a rotation the ordinary way (a roster re-read) and handing back the
|
|
90
101
|
* key and descriptor the collection fan-out should run against.
|
|
91
102
|
*
|
|
92
|
-
* Best-effort
|
|
93
|
-
*
|
|
103
|
+
* Best-effort UP TO the rotation: a log that cannot be fetched or verified, or
|
|
104
|
+
* a roster that turns out to need nothing, resolves to the unchanged input,
|
|
105
|
+
* since the fan-out is still worth running on the key this start already has.
|
|
106
|
+
* Past the rotation it is not best-effort at all -- once the roster has moved
|
|
107
|
+
* to a fresh key, that key is readable only from the roster, so a failed
|
|
108
|
+
* adoption throws rather than reporting `rotated: false` with the retired key
|
|
109
|
+
* and descriptor (which would skip `onPukAdopted` and fan the collections out
|
|
110
|
+
* onto the pre-rotation epoch). The three roster refusals rethrow throughout,
|
|
111
|
+
* exactly as {@link checkPukRosterAtLogin} rethrows them.
|
|
94
112
|
*
|
|
95
113
|
* @param options {object}
|
|
96
114
|
* @param options.pointer {AccountLogPointer} where the account log lives
|
|
@@ -100,6 +118,8 @@ export declare function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKe
|
|
|
100
118
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
101
119
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
102
120
|
* (identity) key-agreement key
|
|
121
|
+
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
122
|
+
* signer (`pukRosterEpochsSigner`), for the rotation this call may perform
|
|
103
123
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
104
124
|
* roster epoch
|
|
105
125
|
* @param [options.onPukAdopted] {Function} called with the
|
|
@@ -107,12 +127,13 @@ export declare function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKe
|
|
|
107
127
|
* @returns {Promise<object>} whether the roster rotated on this call, the
|
|
108
128
|
* stale recipient kids found, and the key + descriptor to fan out with
|
|
109
129
|
*/
|
|
110
|
-
export declare function convergePukRosterToAccount({ pointer, store, puk, descriptor, clientKeyAgreementKey, pinnedEpochId, onPukAdopted }: {
|
|
130
|
+
export declare function convergePukRosterToAccount({ pointer, store, puk, descriptor, clientKeyAgreementKey, signEpochs, pinnedEpochId, onPukAdopted }: {
|
|
111
131
|
pointer: AccountLogPointer;
|
|
112
132
|
store: EncryptionDescriptorStore;
|
|
113
133
|
puk: Puk;
|
|
114
134
|
descriptor: CollectionEncryption;
|
|
115
135
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
136
|
+
signEpochs: EpochsSigner;
|
|
116
137
|
pinnedEpochId?: string | null;
|
|
117
138
|
onPukAdopted?: (adopted: AdoptedPuk) => Promise<void>;
|
|
118
139
|
}): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;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","s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EACb,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,KAAK,EAAE,yBAAyB,CAAA;IAChC,GAAG,EAAE,GAAG,CAAA;IACR,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,UAAU,EAAE,YAAY,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtD,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,GAAG,EAAE,GAAG,CAAA;IACR,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CAiFD"}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
import { convergePukRosterToDocument, PukRosterContinuityError, PukRosterIntegrityError, PukRosterUnwrapError, readPukRoster } from '../keys/index.js';
|
|
2
2
|
import { verifyAccountLog } from '../webvh/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether a thrown error is one of the three roster refusals -- a rolled-back
|
|
5
|
+
* or replayed roster, an epoch configuration that fails authentication, and a
|
|
6
|
+
* current epoch this client cannot unwrap. They are the continuity class that
|
|
7
|
+
* refuses a session rather than degrading it, so both entry points rethrow
|
|
8
|
+
* them instead of warning and carrying on.
|
|
9
|
+
*
|
|
10
|
+
* @param err {unknown}
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
function isRosterRefusal(err) {
|
|
14
|
+
return (err instanceof PukRosterContinuityError ||
|
|
15
|
+
err instanceof PukRosterIntegrityError ||
|
|
16
|
+
err instanceof PukRosterUnwrapError);
|
|
17
|
+
}
|
|
3
18
|
/**
|
|
4
19
|
* The login-time roster read. See the module doc for the failure semantics.
|
|
5
20
|
*
|
|
21
|
+
* A read that adopts an epoch from the roster (a rotation by another client,
|
|
22
|
+
* or this client's first read) must trace it to the account document, so the
|
|
23
|
+
* account log is fetched and verified lazily on exactly that path (via
|
|
24
|
+
* `pointer`). A log that cannot be fetched then lands in the
|
|
25
|
+
* transport-failure class -- the session carries on under the cached key,
|
|
26
|
+
* WITHOUT adopting the unverifiable rotation -- while a roster whose epoch
|
|
27
|
+
* configuration no enrolled client signed is a refusal like the other three.
|
|
28
|
+
*
|
|
6
29
|
* @param options {object}
|
|
7
30
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
8
31
|
* store
|
|
32
|
+
* @param options.pointer {AccountLogPointer} where the account log lives,
|
|
33
|
+
* for the lazy document verification above
|
|
9
34
|
* @param [options.puk] {Puk} this client's cached per-user key; omitted (a
|
|
10
35
|
* freshly enrolled client's first read) the key is always taken from the
|
|
11
36
|
* roster
|
|
@@ -20,13 +45,14 @@ import { verifyAccountLog } from '../webvh/index.js';
|
|
|
20
45
|
* @returns {Promise<PukRosterReadResult | null>} the read, or `null` when
|
|
21
46
|
* the account has no roster yet or the server could not be reached
|
|
22
47
|
*/
|
|
23
|
-
export async function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey, pinnedEpochId, onRosterRead }) {
|
|
48
|
+
export async function checkPukRosterAtLogin({ store, pointer, puk, clientKeyAgreementKey, pinnedEpochId, onRosterRead }) {
|
|
24
49
|
try {
|
|
25
50
|
const read = await readPukRoster({
|
|
26
51
|
store,
|
|
27
52
|
...(puk ? { puk } : {}),
|
|
28
53
|
clientKeyAgreementKey,
|
|
29
|
-
pinnedEpochId
|
|
54
|
+
pinnedEpochId,
|
|
55
|
+
resolveDocument: async () => (await verifyAccountLog(pointer)).doc
|
|
30
56
|
});
|
|
31
57
|
if (!read) {
|
|
32
58
|
return null;
|
|
@@ -39,9 +65,7 @@ export async function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey,
|
|
|
39
65
|
return read;
|
|
40
66
|
}
|
|
41
67
|
catch (err) {
|
|
42
|
-
if (err
|
|
43
|
-
err instanceof PukRosterIntegrityError ||
|
|
44
|
-
err instanceof PukRosterUnwrapError) {
|
|
68
|
+
if (isRosterRefusal(err)) {
|
|
45
69
|
throw err;
|
|
46
70
|
}
|
|
47
71
|
// An unreachable server (or any transport hiccup) must not lock the user
|
|
@@ -56,8 +80,15 @@ export async function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey,
|
|
|
56
80
|
* adopting a rotation the ordinary way (a roster re-read) and handing back the
|
|
57
81
|
* key and descriptor the collection fan-out should run against.
|
|
58
82
|
*
|
|
59
|
-
* Best-effort
|
|
60
|
-
*
|
|
83
|
+
* Best-effort UP TO the rotation: a log that cannot be fetched or verified, or
|
|
84
|
+
* a roster that turns out to need nothing, resolves to the unchanged input,
|
|
85
|
+
* since the fan-out is still worth running on the key this start already has.
|
|
86
|
+
* Past the rotation it is not best-effort at all -- once the roster has moved
|
|
87
|
+
* to a fresh key, that key is readable only from the roster, so a failed
|
|
88
|
+
* adoption throws rather than reporting `rotated: false` with the retired key
|
|
89
|
+
* and descriptor (which would skip `onPukAdopted` and fan the collections out
|
|
90
|
+
* onto the pre-rotation epoch). The three roster refusals rethrow throughout,
|
|
91
|
+
* exactly as {@link checkPukRosterAtLogin} rethrows them.
|
|
61
92
|
*
|
|
62
93
|
* @param options {object}
|
|
63
94
|
* @param options.pointer {AccountLogPointer} where the account log lives
|
|
@@ -67,6 +98,8 @@ export async function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey,
|
|
|
67
98
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
68
99
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
69
100
|
* (identity) key-agreement key
|
|
101
|
+
* @param options.signEpochs {EpochsSigner} this client's epoch-configuration
|
|
102
|
+
* signer (`pukRosterEpochsSigner`), for the rotation this call may perform
|
|
70
103
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
71
104
|
* roster epoch
|
|
72
105
|
* @param [options.onPukAdopted] {Function} called with the
|
|
@@ -74,52 +107,77 @@ export async function checkPukRosterAtLogin({ store, puk, clientKeyAgreementKey,
|
|
|
74
107
|
* @returns {Promise<object>} whether the roster rotated on this call, the
|
|
75
108
|
* stale recipient kids found, and the key + descriptor to fan out with
|
|
76
109
|
*/
|
|
77
|
-
export async function convergePukRosterToAccount({ pointer, store, puk, descriptor, clientKeyAgreementKey, pinnedEpochId, onPukAdopted }) {
|
|
110
|
+
export async function convergePukRosterToAccount({ pointer, store, puk, descriptor, clientKeyAgreementKey, signEpochs, pinnedEpochId, onPukAdopted }) {
|
|
78
111
|
const unchanged = {
|
|
79
112
|
rotated: false,
|
|
80
113
|
staleRecipientIds: [],
|
|
81
114
|
puk,
|
|
82
115
|
descriptor
|
|
83
116
|
};
|
|
117
|
+
let rotated;
|
|
118
|
+
let staleRecipientIds;
|
|
119
|
+
let accountDocument;
|
|
84
120
|
try {
|
|
85
121
|
const { doc } = await verifyAccountLog(pointer);
|
|
86
|
-
|
|
122
|
+
accountDocument = doc;
|
|
123
|
+
const converged = await convergePukRosterToDocument({
|
|
87
124
|
store,
|
|
88
125
|
document: doc,
|
|
89
|
-
descriptor
|
|
126
|
+
descriptor,
|
|
127
|
+
signEpochs
|
|
90
128
|
});
|
|
91
|
-
|
|
92
|
-
|
|
129
|
+
rotated = converged.rotated;
|
|
130
|
+
staleRecipientIds = converged.staleRecipientIds;
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
if (isRosterRefusal(err)) {
|
|
134
|
+
throw err;
|
|
93
135
|
}
|
|
94
|
-
console.warn('
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
136
|
+
console.warn('Could not converge the wrap-set roster onto the account document:', err);
|
|
137
|
+
return unchanged;
|
|
138
|
+
}
|
|
139
|
+
if (!rotated) {
|
|
140
|
+
return unchanged;
|
|
141
|
+
}
|
|
142
|
+
console.warn('The wrap-set roster still wrapped the current key to ' +
|
|
143
|
+
`${staleRecipientIds.length} recipient(s) the account document no ` +
|
|
144
|
+
'longer keys; the rotation has been completed.');
|
|
145
|
+
// Rotated: the fresh key is only readable from the roster, so re-read it
|
|
146
|
+
// and adopt it before the collection fan-out runs against it. A failure
|
|
147
|
+
// here cannot resolve to the unchanged input -- the roster HAS moved.
|
|
148
|
+
let read;
|
|
149
|
+
try {
|
|
150
|
+
read = await readPukRoster({
|
|
100
151
|
store,
|
|
101
152
|
puk,
|
|
102
153
|
clientKeyAgreementKey,
|
|
103
|
-
pinnedEpochId
|
|
154
|
+
pinnedEpochId,
|
|
155
|
+
document: accountDocument
|
|
104
156
|
});
|
|
105
|
-
if (!read) {
|
|
106
|
-
return unchanged;
|
|
107
|
-
}
|
|
108
|
-
await onPukAdopted?.({
|
|
109
|
-
puk: read.puk,
|
|
110
|
-
latestEpochId: read.latestEpochId,
|
|
111
|
-
descriptor: read.descriptor
|
|
112
|
-
});
|
|
113
|
-
return {
|
|
114
|
-
rotated: true,
|
|
115
|
-
staleRecipientIds,
|
|
116
|
-
puk: read.puk,
|
|
117
|
-
descriptor: read.descriptor
|
|
118
|
-
};
|
|
119
157
|
}
|
|
120
158
|
catch (err) {
|
|
121
|
-
|
|
122
|
-
|
|
159
|
+
if (isRosterRefusal(err)) {
|
|
160
|
+
throw err;
|
|
161
|
+
}
|
|
162
|
+
throw new Error('The wrap-set roster was rotated onto a fresh per-user key, but the ' +
|
|
163
|
+
'read that adopts it failed; this session must not continue under ' +
|
|
164
|
+
'the retired key.', { cause: err });
|
|
165
|
+
}
|
|
166
|
+
if (!read) {
|
|
167
|
+
throw new Error('The wrap-set roster was rotated onto a fresh per-user key and then ' +
|
|
168
|
+
'reported absent; this session must not continue under the retired ' +
|
|
169
|
+
'key.');
|
|
123
170
|
}
|
|
171
|
+
await onPukAdopted?.({
|
|
172
|
+
puk: read.puk,
|
|
173
|
+
latestEpochId: read.latestEpochId,
|
|
174
|
+
descriptor: read.descriptor
|
|
175
|
+
});
|
|
176
|
+
return {
|
|
177
|
+
rotated: true,
|
|
178
|
+
staleRecipientIds,
|
|
179
|
+
puk: read.puk,
|
|
180
|
+
descriptor: read.descriptor
|
|
181
|
+
};
|
|
124
182
|
}
|
|
125
183
|
//# sourceMappingURL=rosterPolicy.js.map
|
|
@@ -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":"AAmDA,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EAId,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;GASG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,OAAO,CACL,GAAG,YAAY,wBAAwB;QACvC,GAAG,YAAY,uBAAuB;QACtC,GAAG,YAAY,oBAAoB,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,KAAK,EACL,OAAO,EACP,GAAG,EACH,qBAAqB,EACrB,aAAa,EACb,YAAY,EAQb;IACC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC;YAC/B,KAAK;YACL,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,qBAAqB;YACrB,aAAa;YACb,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;SACnE,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,YAAY,EAAE,CAAC;YACnB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|
25
25
|
}) => Promise<void>;
|
|
26
26
|
});
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Whether a collection still has its one refresh this session.
|
|
29
|
+
*/
|
|
28
30
|
shouldRefresh({ collectionId }: {
|
|
29
31
|
collectionId: string;
|
|
30
32
|
}): boolean;
|