@interop/wallet-core 0.107.0 → 0.107.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/clientAnnex/grantRevocation.d.ts +11 -7
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
- package/dist/clientAnnex/grantRevocation.js +1 -1
- package/dist/clientAnnex/grantRevocation.js.map +1 -1
- package/dist/clients/grantState.d.ts +11 -9
- package/dist/clients/grantState.d.ts.map +1 -1
- package/dist/clients/grantState.js +19 -16
- package/dist/clients/grantState.js.map +1 -1
- package/dist/clients/index.d.ts +9 -9
- package/dist/clients/index.js +9 -9
- package/dist/clients/listing.d.ts +12 -14
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +17 -23
- package/dist/clients/listing.js.map +1 -1
- package/dist/connections/grantProof.d.ts +47 -14
- package/dist/connections/grantProof.d.ts.map +1 -1
- package/dist/connections/grantProof.js +88 -57
- package/dist/connections/grantProof.js.map +1 -1
- package/dist/connections/grants.d.ts +13 -1
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +15 -26
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +4 -3
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +3 -2
- package/dist/connections/index.js.map +1 -1
- package/dist/testing/signerFixture.d.ts +3 -3
- package/dist/testing/signerFixture.d.ts.map +1 -1
- package/dist/testing/signerFixture.js +7 -5
- package/dist/testing/signerFixture.js.map +1 -1
- package/dist/webvh/index.d.ts +13 -6
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +12 -5
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +124 -15
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +148 -43
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +4 -1
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +13 -14
- package/dist/webvh/standingZcap.js.map +1 -1
- package/package.json +5 -5
|
@@ -25,22 +25,26 @@
|
|
|
25
25
|
* pointer moves to another generation.
|
|
26
26
|
*/
|
|
27
27
|
import type { IDelegatedZcap, IZcap } from '@interop/data-integrity-core';
|
|
28
|
+
import type { AnnexDocumentResolver } from '../connections/index.js';
|
|
28
29
|
import { type PublishedKeyDocument } from '../webvh/index.js';
|
|
29
30
|
/**
|
|
30
31
|
* What a recorded grant is read against, off the session's verified account
|
|
31
32
|
* document: the account DID an enrolled client's promoted verification-method
|
|
32
|
-
* id is under, the
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
33
|
+
* id is under, the verified document itself (what every signer, a root
|
|
34
|
+
* grant's and an embedded generation delegation's alike, is checked against
|
|
35
|
+
* through `delegationSignerKey`), and the annex DID the document's
|
|
36
|
+
* delegated-clients pointer currently names, absent when it names none. The
|
|
37
|
+
* first two settle the orphaned reading; the last two settle whether an
|
|
38
|
+
* annex-signed grant's generation delegation still stands. The one object
|
|
39
|
+
* also serves the renewal's proof check (`verifyRecordedGrantProof`,
|
|
40
|
+
* `connections`), which is the only reader of the `annexDocument` resolver;
|
|
41
|
+
* the revocation reading does not call it.
|
|
38
42
|
*/
|
|
39
43
|
export interface AccountSignerCheck {
|
|
40
44
|
accountDid: string;
|
|
41
|
-
currentSigningKeys: Set<string>;
|
|
42
45
|
doc: PublishedKeyDocument;
|
|
43
46
|
clientAnnexDid?: string;
|
|
47
|
+
annexDocument: AnnexDocumentResolver;
|
|
44
48
|
}
|
|
45
49
|
/**
|
|
46
50
|
* How a server refusal of a grant's revocation is read, when the client can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantRevocation.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;A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AM,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,IAAI,EAAE,KAAK,CAAA;IACX,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAsBlC"}
|
|
@@ -34,7 +34,7 @@ export function classifyGrantRevocationRefusal({ zcap, signerCheck, now }) {
|
|
|
34
34
|
const state = deriveGrantSignerState({
|
|
35
35
|
signerKeyIds: [delegationProofKeyId(zcap)],
|
|
36
36
|
accountDid: signerCheck.accountDid,
|
|
37
|
-
|
|
37
|
+
doc: signerCheck.doc
|
|
38
38
|
});
|
|
39
39
|
return state === 'orphaned' ? 'orphaned' : undefined;
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantRevocation.js","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"grantRevocation.js","sourceRoot":"","sources":["../../src/clientAnnex/grantRevocation.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAiD7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,IAAI,EACJ,WAAW,EACX,GAAG,EAKJ;IACC,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC,WAAW,EAAE,CAAC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;QACpD,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;YACnC,OAAO,iBAAiB,CAAA;QAC1B,CAAC;QACD,0EAA0E;QAC1E,mEAAmE;QACnE,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;YAC3D,MAAM,OAAO,GAAG,8BAA8B,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAA;YAC1E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* embedded generation delegation instead: its signer, and the generation it
|
|
25
25
|
* names.
|
|
26
26
|
*/
|
|
27
|
+
import type { PublishedKeyDocument } from '../webvh/index.js';
|
|
27
28
|
/**
|
|
28
29
|
* Whether a set of recorded grants still verifies under the current-key-set
|
|
29
30
|
* rule:
|
|
@@ -41,10 +42,12 @@
|
|
|
41
42
|
export type GrantSignerState = 'active' | 'orphaned' | 'unknown';
|
|
42
43
|
/**
|
|
43
44
|
* Derives the {@link GrantSignerState} of a set of recorded delegation signers
|
|
44
|
-
* against the
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* against the keys the account's locally verified did:webvh document
|
|
46
|
+
* currently publishes under `capabilityDelegation`. Each signer is read
|
|
47
|
+
* through `delegationSignerKey` (`webvh`), the one reader every
|
|
48
|
+
* delegation-signer check shares, so the document itself is taken rather
|
|
49
|
+
* than a key set a caller built by some other rule, and a grant signed under
|
|
50
|
+
* the did:key form of a still-listed key stays active.
|
|
48
51
|
*
|
|
49
52
|
* A signer is judged against the document only when the document could have
|
|
50
53
|
* listed it: its DID is the account DID or a did:key. Any other signer (a
|
|
@@ -57,14 +60,13 @@ export type GrantSignerState = 'active' | 'orphaned' | 'unknown';
|
|
|
57
60
|
* grant's `proof.verificationMethod`; undefined for a summary-only record
|
|
58
61
|
* @param options.accountDid {string} the account's did:webvh, the DID an
|
|
59
62
|
* enrolled client's promoted verification-method id is under
|
|
60
|
-
* @param [options.
|
|
61
|
-
*
|
|
62
|
-
* available
|
|
63
|
+
* @param [options.doc] {PublishedKeyDocument} the locally verified account
|
|
64
|
+
* document, or undefined when none is available
|
|
63
65
|
* @returns {GrantSignerState}
|
|
64
66
|
*/
|
|
65
|
-
export declare function deriveGrantSignerState({ signerKeyIds, accountDid,
|
|
67
|
+
export declare function deriveGrantSignerState({ signerKeyIds, accountDid, doc }: {
|
|
66
68
|
signerKeyIds: Array<string | undefined>;
|
|
67
69
|
accountDid: string;
|
|
68
|
-
|
|
70
|
+
doc?: PublishedKeyDocument;
|
|
69
71
|
}): GrantSignerState;
|
|
70
72
|
//# sourceMappingURL=grantState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantState.d.ts","sourceRoot":"","sources":["../../src/clients/grantState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"grantState.d.ts","sourceRoot":"","sources":["../../src/clients/grantState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,UAAU,EACV,GAAG,EACJ,EAAE;IACD,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,oBAAoB,CAAA;CAC3B,GAAG,gBAAgB,CA4BnB"}
|
|
@@ -24,12 +24,16 @@
|
|
|
24
24
|
* embedded generation delegation instead: its signer, and the generation it
|
|
25
25
|
* names.
|
|
26
26
|
*/
|
|
27
|
+
import { parseVersionedVm } from '@interop/vh-resource-log';
|
|
28
|
+
import { delegationSignerKeyReader } from '../webvh/index.js';
|
|
27
29
|
/**
|
|
28
30
|
* Derives the {@link GrantSignerState} of a set of recorded delegation signers
|
|
29
|
-
* against the
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* against the keys the account's locally verified did:webvh document
|
|
32
|
+
* currently publishes under `capabilityDelegation`. Each signer is read
|
|
33
|
+
* through `delegationSignerKey` (`webvh`), the one reader every
|
|
34
|
+
* delegation-signer check shares, so the document itself is taken rather
|
|
35
|
+
* than a key set a caller built by some other rule, and a grant signed under
|
|
36
|
+
* the did:key form of a still-listed key stays active.
|
|
33
37
|
*
|
|
34
38
|
* A signer is judged against the document only when the document could have
|
|
35
39
|
* listed it: its DID is the account DID or a did:key. Any other signer (a
|
|
@@ -42,31 +46,30 @@
|
|
|
42
46
|
* grant's `proof.verificationMethod`; undefined for a summary-only record
|
|
43
47
|
* @param options.accountDid {string} the account's did:webvh, the DID an
|
|
44
48
|
* enrolled client's promoted verification-method id is under
|
|
45
|
-
* @param [options.
|
|
46
|
-
*
|
|
47
|
-
* available
|
|
49
|
+
* @param [options.doc] {PublishedKeyDocument} the locally verified account
|
|
50
|
+
* document, or undefined when none is available
|
|
48
51
|
* @returns {GrantSignerState}
|
|
49
52
|
*/
|
|
50
|
-
export function deriveGrantSignerState({ signerKeyIds, accountDid,
|
|
51
|
-
if (!
|
|
53
|
+
export function deriveGrantSignerState({ signerKeyIds, accountDid, doc }) {
|
|
54
|
+
if (!doc) {
|
|
52
55
|
return 'unknown';
|
|
53
56
|
}
|
|
54
57
|
const signers = signerKeyIds.filter((keyId) => keyId !== undefined);
|
|
55
58
|
if (signers.length === 0) {
|
|
56
59
|
return 'unknown';
|
|
57
60
|
}
|
|
61
|
+
const signerKey = delegationSignerKeyReader({ doc });
|
|
58
62
|
let accountSigners = 0;
|
|
59
63
|
for (const keyId of signers) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (did !== accountDid && !did.startsWith('did:key:')) {
|
|
64
|
+
// Split the way the reader splits it, so the two cannot disagree on
|
|
65
|
+
// which DID an id is under.
|
|
66
|
+
const did = parseVersionedVm(keyId)?.did;
|
|
67
|
+
if (did === undefined ||
|
|
68
|
+
(did !== accountDid && !did.startsWith('did:key:'))) {
|
|
66
69
|
continue;
|
|
67
70
|
}
|
|
68
71
|
accountSigners += 1;
|
|
69
|
-
if (
|
|
72
|
+
if (signerKey(keyId) !== undefined) {
|
|
70
73
|
return 'active';
|
|
71
74
|
}
|
|
72
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantState.js","sourceRoot":"","sources":["../../src/clients/grantState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"grantState.js","sourceRoot":"","sources":["../../src/clients/grantState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAmB7D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,YAAY,EACZ,UAAU,EACV,GAAG,EAKJ;IACC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CACjC,CAAC,KAAK,EAAmB,EAAE,CAAC,KAAK,KAAK,SAAS,CAChD,CAAA;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,SAAS,GAAG,yBAAyB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACpD,IAAI,cAAc,GAAG,CAAC,CAAA;IACtB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,oEAAoE;QACpE,4BAA4B;QAC5B,MAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,GAAG,CAAA;QACxC,IACE,GAAG,KAAK,SAAS;YACjB,CAAC,GAAG,KAAK,UAAU,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EACnD,CAAC;YACD,SAAQ;QACV,CAAC;QACD,cAAc,IAAI,CAAC,CAAA;QACnB,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,QAAQ,CAAA;QACjB,CAAC;IACH,CAAC;IACD,OAAO,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAA;AACpD,CAAC"}
|
package/dist/clients/index.d.ts
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
* - `listAccountClients` / `currentAccountSigningKeys` /
|
|
10
10
|
* `currentAccountRecordSigners` -- the listing over the locally verified
|
|
11
11
|
* did:webvh log, with names joined from the `connections` directory's
|
|
12
|
-
* wallet-client entries; the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* wallet-client entries; the enrolled clients' signing keys as the shared
|
|
13
|
+
* document reader publishes them; and that set widened by the document's
|
|
14
|
+
* ladder VMs, the allowlist a re-minted unlock or recovery record's proof
|
|
15
|
+
* is settled against. All take an already-verified log in place of
|
|
16
|
+
* fetching one.
|
|
17
17
|
* - `deriveGrantSignerState` -- the grant-state check a connected-apps
|
|
18
|
-
* surface runs over a recorded delegation's signer against
|
|
19
|
-
* active, orphaned (an enrolled client
|
|
20
|
-
* (
|
|
21
|
-
* document
|
|
18
|
+
* surface runs over a recorded delegation's signer against the verified
|
|
19
|
+
* document (`delegationSignerKey`): active, orphaned (an enrolled client
|
|
20
|
+
* the account struck), or unknown (no document to check against, or a
|
|
21
|
+
* client-annex per-visit signer the document does not list).
|
|
22
22
|
* - `disconnectEligibility` / `revokedClientKeysFor` / `cascadeCompletion` --
|
|
23
23
|
* the disconnect-eligibility policy as data and pure functions, so both
|
|
24
24
|
* surfaces refuse the same rows for the same reasons and report a partial
|
package/dist/clients/index.js
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
* - `listAccountClients` / `currentAccountSigningKeys` /
|
|
10
10
|
* `currentAccountRecordSigners` -- the listing over the locally verified
|
|
11
11
|
* did:webvh log, with names joined from the `connections` directory's
|
|
12
|
-
* wallet-client entries; the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* wallet-client entries; the enrolled clients' signing keys as the shared
|
|
13
|
+
* document reader publishes them; and that set widened by the document's
|
|
14
|
+
* ladder VMs, the allowlist a re-minted unlock or recovery record's proof
|
|
15
|
+
* is settled against. All take an already-verified log in place of
|
|
16
|
+
* fetching one.
|
|
17
17
|
* - `deriveGrantSignerState` -- the grant-state check a connected-apps
|
|
18
|
-
* surface runs over a recorded delegation's signer against
|
|
19
|
-
* active, orphaned (an enrolled client
|
|
20
|
-
* (
|
|
21
|
-
* document
|
|
18
|
+
* surface runs over a recorded delegation's signer against the verified
|
|
19
|
+
* document (`delegationSignerKey`): active, orphaned (an enrolled client
|
|
20
|
+
* the account struck), or unknown (no document to check against, or a
|
|
21
|
+
* client-annex per-visit signer the document does not list).
|
|
22
22
|
* - `disconnectEligibility` / `revokedClientKeysFor` / `cascadeCompletion` --
|
|
23
23
|
* the disconnect-eligibility policy as data and pure functions, so both
|
|
24
24
|
* surfaces refuse the same rows for the same reasons and report a partial
|
|
@@ -90,17 +90,16 @@ export declare function listAccountClients({ pointer, readDirectoryEntries, ownS
|
|
|
90
90
|
}): Promise<AccountClientView[]>;
|
|
91
91
|
/**
|
|
92
92
|
* The signing-key multibases of the account's currently enrolled wallet
|
|
93
|
-
* clients, from the locally verified did:webvh log
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* clients, from the locally verified did:webvh log, read by the shared
|
|
94
|
+
* `enrolledClientKeyMultibases` reader (each key is the resolved method's
|
|
95
|
+
* `publicKeyMultibase`). The app-grant signer check does not take this set:
|
|
96
|
+
* `deriveGrantSignerState` reads the verified document itself.
|
|
97
97
|
*
|
|
98
|
-
*
|
|
99
|
-
* gating on whether a session HAS a promoted account to check against stays
|
|
98
|
+
* The gating on whether a session HAS a promoted account to read stays
|
|
100
99
|
* app-side, since only the app knows what a guest or a storage-less session
|
|
101
100
|
* looks like. Throws when the log cannot be fetched or verified; a caller
|
|
102
|
-
* treating the
|
|
103
|
-
*
|
|
101
|
+
* treating the read as best-effort catches and degrades rather than failing
|
|
102
|
+
* its page.
|
|
104
103
|
*
|
|
105
104
|
* @param options {object}
|
|
106
105
|
* @param options.pointer {AccountLogPointer}
|
|
@@ -126,13 +125,12 @@ export declare function currentAccountSigningKeys({ pointer, verifiedLog, accoun
|
|
|
126
125
|
* the ladder VM is the only key left that can re-sign a record, and a reader
|
|
127
126
|
* that refused it would refuse every other unlock method's record after the
|
|
128
127
|
* transition). The ladder VM is recognized by the relation asymmetry
|
|
129
|
-
* (`
|
|
130
|
-
* its sibling.
|
|
128
|
+
* (`ladderVmKeyMultibases`) rather than by a marker. Same
|
|
129
|
+
* fetch-or-verified-log contract as its sibling.
|
|
131
130
|
*
|
|
132
|
-
*
|
|
133
|
-
* signer
|
|
134
|
-
*
|
|
135
|
-
* ladder VM would misread the transition state.
|
|
131
|
+
* A record-signer allowlist rather than a delegation-signer one: a recorded
|
|
132
|
+
* grant's signer is read against the document's `capabilityDelegation`
|
|
133
|
+
* members through `delegationSignerKey`, and this set plays no part in it.
|
|
136
134
|
*
|
|
137
135
|
* @param options {object}
|
|
138
136
|
* @param options.pointer {AccountLogPointer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAIL,gBAAgB,EAChB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE;;;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;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,OAAO,CAAA;CACnB;AAsFD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAA;IACpE,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiB/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,OAAO,EACP,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAOvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,OAAO,EACP,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAcvB"}
|
package/dist/clients/listing.js
CHANGED
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
* re-verifying `did.jsonl` per surface. Whether such a cache is safe to hold,
|
|
29
29
|
* and what invalidates it, is the caller's call.
|
|
30
30
|
*/
|
|
31
|
-
import {
|
|
32
|
-
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
31
|
+
import { enrolledClientKeyMultibases, ladderVmKeyMultibases, listEnrolledWebvhClients, verifyAccountLog } from '../webvh/index.js';
|
|
33
32
|
import { signingKeyMultibaseOfDid } from '../connections/didKey.js';
|
|
34
33
|
/**
|
|
35
34
|
* The directory's wallet-client entries keyed by the signing-key multibase
|
|
@@ -133,17 +132,16 @@ export async function listAccountClients({ pointer, readDirectoryEntries, ownSig
|
|
|
133
132
|
}
|
|
134
133
|
/**
|
|
135
134
|
* The signing-key multibases of the account's currently enrolled wallet
|
|
136
|
-
* clients, from the locally verified did:webvh log
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
135
|
+
* clients, from the locally verified did:webvh log, read by the shared
|
|
136
|
+
* `enrolledClientKeyMultibases` reader (each key is the resolved method's
|
|
137
|
+
* `publicKeyMultibase`). The app-grant signer check does not take this set:
|
|
138
|
+
* `deriveGrantSignerState` reads the verified document itself.
|
|
140
139
|
*
|
|
141
|
-
*
|
|
142
|
-
* gating on whether a session HAS a promoted account to check against stays
|
|
140
|
+
* The gating on whether a session HAS a promoted account to read stays
|
|
143
141
|
* app-side, since only the app knows what a guest or a storage-less session
|
|
144
142
|
* looks like. Throws when the log cannot be fetched or verified; a caller
|
|
145
|
-
* treating the
|
|
146
|
-
*
|
|
143
|
+
* treating the read as best-effort catches and degrades rather than failing
|
|
144
|
+
* its page.
|
|
147
145
|
*
|
|
148
146
|
* @param options {object}
|
|
149
147
|
* @param options.pointer {AccountLogPointer}
|
|
@@ -154,12 +152,12 @@ export async function listAccountClients({ pointer, readDirectoryEntries, ownSig
|
|
|
154
152
|
* @returns {Promise<Set<string>>}
|
|
155
153
|
*/
|
|
156
154
|
export async function currentAccountSigningKeys({ pointer, verifiedLog, accountLogPinStore }) {
|
|
157
|
-
const {
|
|
155
|
+
const { doc } = await resolveVerifiedAccountLog({
|
|
158
156
|
pointer,
|
|
159
157
|
verifiedLog,
|
|
160
158
|
accountLogPinStore
|
|
161
159
|
});
|
|
162
|
-
return
|
|
160
|
+
return enrolledClientKeyMultibases({ doc });
|
|
163
161
|
}
|
|
164
162
|
/**
|
|
165
163
|
* The keys the locally verified document backs as the signer of a RE-MINTED
|
|
@@ -172,13 +170,12 @@ export async function currentAccountSigningKeys({ pointer, verifiedLog, accountL
|
|
|
172
170
|
* the ladder VM is the only key left that can re-sign a record, and a reader
|
|
173
171
|
* that refused it would refuse every other unlock method's record after the
|
|
174
172
|
* transition). The ladder VM is recognized by the relation asymmetry
|
|
175
|
-
* (`
|
|
176
|
-
* its sibling.
|
|
173
|
+
* (`ladderVmKeyMultibases`) rather than by a marker. Same
|
|
174
|
+
* fetch-or-verified-log contract as its sibling.
|
|
177
175
|
*
|
|
178
|
-
*
|
|
179
|
-
* signer
|
|
180
|
-
*
|
|
181
|
-
* ladder VM would misread the transition state.
|
|
176
|
+
* A record-signer allowlist rather than a delegation-signer one: a recorded
|
|
177
|
+
* grant's signer is read against the document's `capabilityDelegation`
|
|
178
|
+
* members through `delegationSignerKey`, and this set plays no part in it.
|
|
182
179
|
*
|
|
183
180
|
* @param options {object}
|
|
184
181
|
* @param options.pointer {AccountLogPointer}
|
|
@@ -198,11 +195,8 @@ export async function currentAccountRecordSigners({ pointer, verifiedLog, accoun
|
|
|
198
195
|
pointer,
|
|
199
196
|
verifiedLog: verified
|
|
200
197
|
});
|
|
201
|
-
for (const
|
|
202
|
-
|
|
203
|
-
if (multibase !== undefined) {
|
|
204
|
-
keys.add(multibase);
|
|
205
|
-
}
|
|
198
|
+
for (const key of ladderVmKeyMultibases({ doc: verified.doc })) {
|
|
199
|
+
keys.add(key);
|
|
206
200
|
}
|
|
207
201
|
return keys;
|
|
208
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,wBAAwB,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AAC,EAAE,GAAG,EAAE,CAAC,CAAA;AAC7C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,EAChD,OAAO,EACP,WAAW,EACX,kBAAkB,EAKnB;IACC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC;QAC/C,OAAO;QACP,WAAW;QACX,kBAAkB;KACnB,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC;QAC3C,OAAO;QACP,WAAW,EAAE,QAAQ;KACtB,CAAC,CAAA;IACF,KAAK,MAAM,GAAG,IAAI,qBAAqB,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;QAC/D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACf,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -2,30 +2,55 @@ import type { ConnectionZcap } from './entry.js';
|
|
|
2
2
|
import type { PublishedKeyDocument } from '../webvh/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Why a recorded grant's proof does not verify as this account's. On the
|
|
5
|
-
* root arm the reasons describe the grant's own proof; on the
|
|
6
|
-
* describe the embedded parent's,
|
|
5
|
+
* root arm the unprefixed reasons describe the grant's own proof; on the
|
|
6
|
+
* annex arm they describe the embedded parent's, and the `leaf-` reasons
|
|
7
|
+
* describe the grant's own proof against the generation's annex document.
|
|
7
8
|
*
|
|
8
9
|
* - `unsigned` -- the proof is absent or names no `verificationMethod`.
|
|
9
10
|
* - `unsupported-suite` -- the proof is not an `eddsa-jcs-2022`
|
|
10
11
|
* `DataIntegrityProof` for `capabilityDelegation`, the one suite every
|
|
11
12
|
* delegation this library mints carries.
|
|
12
|
-
* - `signer-unlisted` -- the proof's `verificationMethod`
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* - `signer-unlisted` -- the proof's `verificationMethod` names no key the
|
|
14
|
+
* current document publishes under `capabilityDelegation`
|
|
15
|
+
* (`delegationSignerKey`, the one reader every delegation-signer check
|
|
16
|
+
* shares: the member's `publicKeyMultibase`, or the did:key form of a key
|
|
17
|
+
* the relation publishes): the current-key-set rule.
|
|
17
18
|
* - `signature-invalid` -- the signer is listed, and the signature does not
|
|
18
19
|
* verify over the capability under the key the document publishes for it.
|
|
19
20
|
* - `parent-not-annex` -- the grant embeds a parent whose `controller` is
|
|
20
21
|
* not an annex DID in the account's auxiliary Space, or the account points
|
|
21
22
|
* at no annex generation.
|
|
23
|
+
* - `leaf-generation-collected` -- the parent verified, and no annex
|
|
24
|
+
* document resolves for its generation: the generation was collected.
|
|
25
|
+
* - `leaf-unsigned`, `leaf-unsupported-suite`, `leaf-signer-unlisted`,
|
|
26
|
+
* `leaf-signature-invalid` -- the parent verified, and the leaf's own
|
|
27
|
+
* proof fails the same check, read against the generation's annex
|
|
28
|
+
* document instead of the account's.
|
|
22
29
|
*/
|
|
23
|
-
export type GrantProofRefusal =
|
|
30
|
+
export type GrantProofRefusal = DelegationProofRefusal | 'parent-not-annex' | 'leaf-generation-collected' | `leaf-${DelegationProofRefusal}`;
|
|
31
|
+
/**
|
|
32
|
+
* Why one capability's own delegation proof does not verify against the
|
|
33
|
+
* document it is read under; the unprefixed half of {@link GrantProofRefusal}.
|
|
34
|
+
*/
|
|
35
|
+
type DelegationProofRefusal = 'unsigned' | 'unsupported-suite' | 'signer-unlisted' | 'signature-invalid';
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the verified annex document of the generation an annex DID names,
|
|
38
|
+
* read under that log's chain-head pin, or `undefined` when the generation's
|
|
39
|
+
* log is absent (collected). The wallet supplies it. The proof check calls
|
|
40
|
+
* it once per generation per `signerCheck` object, whatever the number of
|
|
41
|
+
* grants checked under that object, concurrently or not; a wallet therefore
|
|
42
|
+
* builds one `signerCheck` per renewal pass, since a longer-lived one would
|
|
43
|
+
* keep serving a generation's document after a GC collected it.
|
|
44
|
+
*/
|
|
45
|
+
export type AnnexDocumentResolver = (options: {
|
|
46
|
+
clientAnnexDid: string;
|
|
47
|
+
}) => Promise<PublishedKeyDocument | undefined>;
|
|
24
48
|
/**
|
|
25
49
|
* The outcome of {@link verifyRecordedGrantProof}: verified, with the id of
|
|
26
|
-
* the verification method whose signature was checked (the
|
|
27
|
-
* signer on the root arm, the parent's on the annex arm), or
|
|
28
|
-
* the reason.
|
|
50
|
+
* the account-listed verification method whose signature was checked (the
|
|
51
|
+
* grant's own signer on the root arm, the parent's on the annex arm), or
|
|
52
|
+
* refused with the reason. The annex arm checks the leaf's per-visit signer
|
|
53
|
+
* too, but only the annex document lists it.
|
|
29
54
|
*/
|
|
30
55
|
export type GrantProofResult = {
|
|
31
56
|
verified: true;
|
|
@@ -40,9 +65,13 @@ export type GrantProofResult = {
|
|
|
40
65
|
* parent is verified by its own proof (the root arm); a grant embedding its
|
|
41
66
|
* parent delegation as the last link of its `proof.capabilityChain` is
|
|
42
67
|
* verified by that parent's proof, after the parent's `controller` is found
|
|
43
|
-
* to be an annex DID in the account's auxiliary Space
|
|
44
|
-
*
|
|
45
|
-
*
|
|
68
|
+
* to be an annex DID in the account's auxiliary Space, and then by its own
|
|
69
|
+
* proof against the annex document the caller resolves for that generation
|
|
70
|
+
* (the annex arm). A refusal says why. The root arm reads the current
|
|
71
|
+
* document alone, with no log history and no network; the annex arm's one
|
|
72
|
+
* read beyond it is the resolver's, made once per generation under one
|
|
73
|
+
* `signerCheck` object, and what the resolver throws propagates, so a caller
|
|
74
|
+
* whose annex read fails renews nothing.
|
|
46
75
|
*
|
|
47
76
|
* @param options {object}
|
|
48
77
|
* @param options.zcap {ConnectionZcap} the recorded capability, verbatim
|
|
@@ -52,6 +81,8 @@ export type GrantProofResult = {
|
|
|
52
81
|
* @param [options.signerCheck.clientAnnexDid] {string} the annex DID the
|
|
53
82
|
* document's delegated-clients pointer currently names; absent when it
|
|
54
83
|
* names none, which refuses every annex-arm grant
|
|
84
|
+
* @param options.signerCheck.annexDocument {AnnexDocumentResolver} the
|
|
85
|
+
* generation's annex document, for an annex-arm grant's leaf
|
|
55
86
|
* @returns {Promise<GrantProofResult>}
|
|
56
87
|
*/
|
|
57
88
|
export declare function verifyRecordedGrantProof({ zcap, signerCheck }: {
|
|
@@ -59,6 +90,8 @@ export declare function verifyRecordedGrantProof({ zcap, signerCheck }: {
|
|
|
59
90
|
signerCheck: {
|
|
60
91
|
doc: PublishedKeyDocument;
|
|
61
92
|
clientAnnexDid?: string;
|
|
93
|
+
annexDocument: AnnexDocumentResolver;
|
|
62
94
|
};
|
|
63
95
|
}): Promise<GrantProofResult>;
|
|
96
|
+
export {};
|
|
64
97
|
//# sourceMappingURL=grantProof.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantProof.d.ts","sourceRoot":"","sources":["../../src/connections/grantProof.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grantProof.d.ts","sourceRoot":"","sources":["../../src/connections/grantProof.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,iBAAiB,GACzB,sBAAsB,GACtB,kBAAkB,GAClB,2BAA2B,GAC3B,QAAQ,sBAAsB,EAAE,CAAA;AAEpC;;;GAGG;AACH,KAAK,sBAAsB,GACzB,UAAU,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,mBAAmB,CAAA;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE;IAC5C,cAAc,EAAE,MAAM,CAAA;CACvB,KAAK,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAA;AA8JlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,IAAI,EACJ,WAAW,EACZ,EAAE;IACD,IAAI,EAAE,cAAc,CAAA;IACpB,WAAW,EAAE;QACX,GAAG,EAAE,oBAAoB,CAAA;QACzB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,aAAa,EAAE,qBAAqB,CAAA;KACrC,CAAA;CACF,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsC5B"}
|