@interop/wallet-core 0.106.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/README.md +1 -1
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +0 -1
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +55 -24
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +111 -31
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/generationRung.d.ts +5 -21
- package/dist/clientAnnex/generationRung.d.ts.map +1 -1
- package/dist/clientAnnex/generationRung.js +30 -41
- package/dist/clientAnnex/generationRung.js.map +1 -1
- 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/clientAnnex/heal.d.ts +14 -4
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +32 -12
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +6 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +6 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +106 -59
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +156 -111
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +5 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +5 -0
- package/dist/clientAnnex/recoveryLadderAnchored.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/accountBuilder.d.ts.map +1 -1
- package/dist/testing/accountBuilder.js +0 -1
- package/dist/testing/accountBuilder.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/unlock/retire.d.ts +5 -2
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js.map +1 -1
- package/dist/webvh/clientAnnexDid.d.ts +4 -5
- package/dist/webvh/clientAnnexDid.d.ts.map +1 -1
- package/dist/webvh/clientAnnexDid.js +4 -5
- package/dist/webvh/clientAnnexDid.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/ladderDerivation.d.ts +1 -2
- package/dist/webvh/ladderDerivation.d.ts.map +1 -1
- package/dist/webvh/ladderDerivation.js +5 -5
- package/dist/webvh/ladderDerivation.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 +12 -12
|
@@ -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"}
|
|
@@ -21,20 +21,55 @@
|
|
|
21
21
|
* `capabilityDelegation` in the current document, and the signature must
|
|
22
22
|
* verify over the capability under that key. A grant a transient session
|
|
23
23
|
* minted chains under the generation delegation embedded as the last link
|
|
24
|
-
* of its `proof.capabilityChain`, and
|
|
24
|
+
* of its `proof.capabilityChain`, and both links are verified. The parent
|
|
25
25
|
* must be delegated to an annex DID in the account's auxiliary Space (the
|
|
26
26
|
* Space the account's delegated-clients pointer names, compared by host and
|
|
27
|
-
* Space id,
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* Space id), and its own proof must verify under a key or ladder VM the
|
|
28
|
+
* current document lists. The leaf is then verified the same way against
|
|
29
|
+
* the annex document of the parent's generation. The parent alone would not
|
|
30
|
+
* do: it is genuine and host-held, so a host could copy it under a leaf of
|
|
31
|
+
* its own naming a planted party. The caller resolves that annex document
|
|
32
|
+
* (`signerCheck.annexDocument`), since `connections` sits below the annex
|
|
33
|
+
* and cannot read the log itself; a collected generation resolves to none,
|
|
34
|
+
* and a grant minted under it is refused.
|
|
32
35
|
*/
|
|
33
36
|
import { DataIntegrityProof } from '@interop/data-integrity-proof';
|
|
34
37
|
import { createVerifyCryptosuite } from '@interop/ed25519-signature/eddsa-jcs-2022';
|
|
35
|
-
import {
|
|
36
|
-
import { embeddedParentCapability, firstDelegationProof } from '../webvh/index.js';
|
|
38
|
+
import { delegationSignerKey, embeddedParentCapability, firstDelegationProof } from '../webvh/index.js';
|
|
37
39
|
import { parseClientAnnexDid } from '../webvh/clientAnnexDid.js';
|
|
40
|
+
/**
|
|
41
|
+
* The annex documents resolved under each `signerCheck` object, one promise
|
|
42
|
+
* per generation, so a renewal pass's concurrent grant checks under one
|
|
43
|
+
* generation share one read of its log. A rejected read is evicted, so a
|
|
44
|
+
* later check under the same object asks again; the checks in flight share
|
|
45
|
+
* the rejection.
|
|
46
|
+
*/
|
|
47
|
+
const resolvedAnnexDocuments = new WeakMap();
|
|
48
|
+
/**
|
|
49
|
+
* The generation's annex document through the `signerCheck`'s resolver,
|
|
50
|
+
* memoized on the `signerCheck` object.
|
|
51
|
+
*
|
|
52
|
+
* @param options {object}
|
|
53
|
+
* @param options.signerCheck {object} the object the memo is keyed on
|
|
54
|
+
* @param options.signerCheck.annexDocument {AnnexDocumentResolver}
|
|
55
|
+
* @param options.clientAnnexDid {string} the generation's annex DID
|
|
56
|
+
* @returns {Promise<PublishedKeyDocument | undefined>}
|
|
57
|
+
*/
|
|
58
|
+
function resolveAnnexDocument({ signerCheck, clientAnnexDid }) {
|
|
59
|
+
let byGeneration = resolvedAnnexDocuments.get(signerCheck);
|
|
60
|
+
if (byGeneration === undefined) {
|
|
61
|
+
byGeneration = new Map();
|
|
62
|
+
resolvedAnnexDocuments.set(signerCheck, byGeneration);
|
|
63
|
+
}
|
|
64
|
+
const pending = byGeneration.get(clientAnnexDid);
|
|
65
|
+
if (pending !== undefined) {
|
|
66
|
+
return pending;
|
|
67
|
+
}
|
|
68
|
+
const resolving = signerCheck.annexDocument({ clientAnnexDid });
|
|
69
|
+
byGeneration.set(clientAnnexDid, resolving);
|
|
70
|
+
resolving.catch(() => byGeneration.delete(clientAnnexDid));
|
|
71
|
+
return resolving;
|
|
72
|
+
}
|
|
38
73
|
/**
|
|
39
74
|
* The suite every delegation proof this library mints carries, and the one
|
|
40
75
|
* this check verifies.
|
|
@@ -45,24 +80,23 @@ const DELEGATION_PROOF_SHAPE = {
|
|
|
45
80
|
proofPurpose: 'capabilityDelegation'
|
|
46
81
|
};
|
|
47
82
|
/**
|
|
48
|
-
* Verifies one capability's delegation proof against the
|
|
49
|
-
* the
|
|
83
|
+
* Verifies one capability's delegation proof against the document its signer
|
|
84
|
+
* is listed in (the account document, or a generation's annex document for
|
|
85
|
+
* an annex-arm leaf): the signer must stand under `capabilityDelegation`, and
|
|
86
|
+
* the signature must
|
|
50
87
|
* verify over the capability under that key. The key material is what the
|
|
51
|
-
* document publishes for the signer,
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* A proof naming the did:key form of a key (`did:key:<key>#<key>`, the form a
|
|
57
|
-
* client signs under) verifies under that key when the relation publishes it.
|
|
58
|
-
* A proof set is read by its first proof, as every other reader of a
|
|
59
|
-
* delegation does.
|
|
88
|
+
* document publishes for the signer, read through `delegationSignerKey`
|
|
89
|
+
* (`webvh`), so no resolver is consulted and the renewal check cannot drift
|
|
90
|
+
* from the revocation and staleness readers over the same document. A proof
|
|
91
|
+
* set is read by its first proof, as every other reader of a delegation
|
|
92
|
+
* does.
|
|
60
93
|
*
|
|
61
94
|
* @param options {object}
|
|
62
95
|
* @param options.zcap {IZcap} the capability, proof included
|
|
63
|
-
* @param options.doc {PublishedKeyDocument} the locally verified
|
|
64
|
-
*
|
|
65
|
-
* @returns {Promise<
|
|
96
|
+
* @param options.doc {PublishedKeyDocument} the locally verified document
|
|
97
|
+
* the signer is listed in
|
|
98
|
+
* @returns {Promise<{ verified: true, signerKeyId: string } | { verified:
|
|
99
|
+
* false, reason: DelegationProofRefusal }>}
|
|
66
100
|
*/
|
|
67
101
|
async function verifyDelegationProof({ zcap, doc }) {
|
|
68
102
|
const { proof: _proof, ...document } = zcap;
|
|
@@ -76,7 +110,7 @@ async function verifyDelegationProof({ zcap, doc }) {
|
|
|
76
110
|
return { verified: false, reason: 'unsupported-suite' };
|
|
77
111
|
}
|
|
78
112
|
const signerKeyId = single.verificationMethod;
|
|
79
|
-
const keyMultibase =
|
|
113
|
+
const keyMultibase = delegationSignerKey({ doc, signerKeyId });
|
|
80
114
|
if (keyMultibase === undefined) {
|
|
81
115
|
return { verified: false, reason: 'signer-unlisted' };
|
|
82
116
|
}
|
|
@@ -108,36 +142,6 @@ async function verifyDelegationProof({ zcap, doc }) {
|
|
|
108
142
|
}
|
|
109
143
|
return { verified: true, signerKeyId };
|
|
110
144
|
}
|
|
111
|
-
/**
|
|
112
|
-
* The key the document publishes under `capabilityDelegation` for a proof's
|
|
113
|
-
* `verificationMethod` DID URL, or `undefined` when the URL names no listed
|
|
114
|
-
* key. A URL under the document's DID dereferences to the member it names
|
|
115
|
-
* and takes that member's published key. A did:key URL carries its key in
|
|
116
|
-
* the DID itself and must name a key the relation publishes.
|
|
117
|
-
*
|
|
118
|
-
* @param options {object}
|
|
119
|
-
* @param options.doc {PublishedKeyDocument}
|
|
120
|
-
* @param options.signerKeyId {string} the proof's `verificationMethod`
|
|
121
|
-
* @returns {string | undefined}
|
|
122
|
-
*/
|
|
123
|
-
function listedSignerKey({ doc, signerKeyId }) {
|
|
124
|
-
const hash = signerKeyId.indexOf('#');
|
|
125
|
-
const fragment = vmFragmentOf(signerKeyId);
|
|
126
|
-
if (hash === -1 || fragment === undefined) {
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
const did = signerKeyId.slice(0, hash);
|
|
130
|
-
const relation = 'capabilityDelegation';
|
|
131
|
-
const member = relationMemberNamed({ doc, relation, did, fragment });
|
|
132
|
-
if (member !== undefined) {
|
|
133
|
-
return memberKeyMultibase(member);
|
|
134
|
-
}
|
|
135
|
-
if (did === `did:key:${fragment}` &&
|
|
136
|
-
relationKeyMultibases({ doc, relation }).has(fragment)) {
|
|
137
|
-
return fragment;
|
|
138
|
-
}
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
145
|
/**
|
|
142
146
|
* Whether two annex DIDs name the same auxiliary Space: the same host and
|
|
143
147
|
* the same Space id, whatever their generations. A string that is not an
|
|
@@ -162,9 +166,13 @@ function sameAuxiliarySpace({ did, other }) {
|
|
|
162
166
|
* parent is verified by its own proof (the root arm); a grant embedding its
|
|
163
167
|
* parent delegation as the last link of its `proof.capabilityChain` is
|
|
164
168
|
* verified by that parent's proof, after the parent's `controller` is found
|
|
165
|
-
* to be an annex DID in the account's auxiliary Space
|
|
166
|
-
*
|
|
167
|
-
*
|
|
169
|
+
* to be an annex DID in the account's auxiliary Space, and then by its own
|
|
170
|
+
* proof against the annex document the caller resolves for that generation
|
|
171
|
+
* (the annex arm). A refusal says why. The root arm reads the current
|
|
172
|
+
* document alone, with no log history and no network; the annex arm's one
|
|
173
|
+
* read beyond it is the resolver's, made once per generation under one
|
|
174
|
+
* `signerCheck` object, and what the resolver throws propagates, so a caller
|
|
175
|
+
* whose annex read fails renews nothing.
|
|
168
176
|
*
|
|
169
177
|
* @param options {object}
|
|
170
178
|
* @param options.zcap {ConnectionZcap} the recorded capability, verbatim
|
|
@@ -174,6 +182,8 @@ function sameAuxiliarySpace({ did, other }) {
|
|
|
174
182
|
* @param [options.signerCheck.clientAnnexDid] {string} the annex DID the
|
|
175
183
|
* document's delegated-clients pointer currently names; absent when it
|
|
176
184
|
* names none, which refuses every annex-arm grant
|
|
185
|
+
* @param options.signerCheck.annexDocument {AnnexDocumentResolver} the
|
|
186
|
+
* generation's annex document, for an annex-arm grant's leaf
|
|
177
187
|
* @returns {Promise<GrantProofResult>}
|
|
178
188
|
*/
|
|
179
189
|
export async function verifyRecordedGrantProof({ zcap, signerCheck }) {
|
|
@@ -190,6 +200,27 @@ export async function verifyRecordedGrantProof({ zcap, signerCheck }) {
|
|
|
190
200
|
!sameAuxiliarySpace({ did: controller, other: signerCheck.clientAnnexDid })) {
|
|
191
201
|
return { verified: false, reason: 'parent-not-annex' };
|
|
192
202
|
}
|
|
193
|
-
|
|
203
|
+
const parentResult = await verifyDelegationProof({
|
|
204
|
+
zcap: parent,
|
|
205
|
+
doc: signerCheck.doc
|
|
206
|
+
});
|
|
207
|
+
if (!parentResult.verified) {
|
|
208
|
+
return parentResult;
|
|
209
|
+
}
|
|
210
|
+
const generationDoc = await resolveAnnexDocument({
|
|
211
|
+
signerCheck,
|
|
212
|
+
clientAnnexDid: controller
|
|
213
|
+
});
|
|
214
|
+
if (generationDoc === undefined) {
|
|
215
|
+
return { verified: false, reason: 'leaf-generation-collected' };
|
|
216
|
+
}
|
|
217
|
+
const leaf = await verifyDelegationProof({
|
|
218
|
+
zcap: zcap,
|
|
219
|
+
doc: generationDoc
|
|
220
|
+
});
|
|
221
|
+
if (leaf.verified) {
|
|
222
|
+
return parentResult;
|
|
223
|
+
}
|
|
224
|
+
return { verified: false, reason: `leaf-${leaf.reason}` };
|
|
194
225
|
}
|
|
195
226
|
//# sourceMappingURL=grantProof.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantProof.js","sourceRoot":"","sources":["../../src/connections/grantProof.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"grantProof.js","sourceRoot":"","sources":["../../src/connections/grantProof.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AAGnF,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAkEhE;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,IAAI,OAAO,EAGvC,CAAA;AAEH;;;;;;;;;GASG;AACH,SAAS,oBAAoB,CAAC,EAC5B,WAAW,EACX,cAAc,EAIf;IACC,IAAI,YAAY,GAAG,sBAAsB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC1D,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,YAAY,GAAG,IAAI,GAAG,EAAE,CAAA;QACxB,sBAAsB,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;IACvD,CAAC;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAChD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC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AAE,MAAM,EAAE,2BAA2B,EAAE,CAAA;IACjE,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC;QACvC,IAAI,EAAE,IAAwB;QAC9B,GAAG,EAAE,aAAa;KACnB,CAAC,CAAA;IACF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,OAAO,YAAY,CAAA;IACrB,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,IAAI,CAAC,MAAM,EAAE,EAAE,CAAA;AAC3D,CAAC"}
|
|
@@ -319,16 +319,28 @@ export declare function agentGrantDue({ zcap, pointedDelegationId, doc, renewalW
|
|
|
319
319
|
* parent) counts when its own proof names the key. A grant with an embedded
|
|
320
320
|
* parent counts when the parent's proof names the key, the parent's minter.
|
|
321
321
|
*
|
|
322
|
+
* This is an attribution read, so it has to work after the withdrawing
|
|
323
|
+
* edit has landed as well as before it (a torn ceremony's sweep holds only
|
|
324
|
+
* the post-edit document). A grant counts when its proof's method id and the
|
|
325
|
+
* given `keyId` name one signer under `sameSigner` (`webvh`): the same id
|
|
326
|
+
* verbatim, or the same named key. An id the document no longer publishes
|
|
327
|
+
* still matches the grants signed under that exact id. To reach a grant
|
|
328
|
+
* signed under the did:key form of a struck key once the edit has landed,
|
|
329
|
+
* hand the key as a bare multibase too.
|
|
330
|
+
*
|
|
322
331
|
* @param options {object}
|
|
323
332
|
* @param options.entries {ConnectionEntry[]}
|
|
324
333
|
* @param options.keyId {string} a verification-method id in either DID
|
|
325
334
|
* form, or a bare multibase
|
|
326
335
|
* @param options.spaceUrl {string} this Space's container URL
|
|
336
|
+
* @param options.doc {PublishedKeyDocument} the locally verified account
|
|
337
|
+
* document, before or after the key is withdrawn
|
|
327
338
|
* @returns {ConnectionEntry[]}
|
|
328
339
|
*/
|
|
329
|
-
export declare function agentConnectionsSignedBy({ entries, keyId, spaceUrl }: {
|
|
340
|
+
export declare function agentConnectionsSignedBy({ entries, keyId, spaceUrl, doc }: {
|
|
330
341
|
entries: ConnectionEntry[];
|
|
331
342
|
keyId: string;
|
|
332
343
|
spaceUrl: string;
|
|
344
|
+
doc: PublishedKeyDocument;
|
|
333
345
|
}): ConnectionEntry[];
|
|
334
346
|
//# sourceMappingURL=grants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAU5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,QAA2B,CAAA;AAErE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACT,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,OAAO,CAaV;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,eAAe,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,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AAE;IACD,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CActB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACT,EAAE;IACD,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,eAAe,EAAE,CA0BpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,mBAAmB,EACnB,GAAG,EACH,eAA+C,EAC/C,GAAgB,EACjB,EAAE;IACD,IAAI,EAAE,cAAc,CAAA;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,GAAG,EAAE,oBAAoB,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAeV;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,GAAG,EACJ,EAAE;IACD,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,oBAAoB,CAAA;CAC1B,GAAG,eAAe,EAAE,CAmBpB"}
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* The grant index the revocation orchestrators share: the grants of one
|
|
6
|
-
* entry that pass the reader checks, their targets, the live and expired
|
|
7
|
-
* split, and the recipient kid a grant's controller derives.
|
|
8
|
-
*
|
|
9
|
-
* Every reader applies the same two checks, since the storage host can plant
|
|
10
|
-
* an entry and also holds every capability a party ever invoked. A grant
|
|
11
|
-
* whose `zcap.controller` is not the entry's `id` is dropped, so an entry at
|
|
12
|
-
* one party's id cannot steer a revocation at another party's capabilities.
|
|
13
|
-
* A grant whose `zcap.invocationTarget` is not under this Space's container
|
|
14
|
-
* URL is dropped, so no reader acts on a capability over another Space.
|
|
15
|
-
*
|
|
16
|
-
* The agent-connection readers sit beside them: the received list (the
|
|
17
|
-
* capabilities an agent handed the wallet, over targets outside this Space),
|
|
18
|
-
* the live inbox channel, the latest grant per scope, the grants one
|
|
19
|
-
* connection request's consent produced, the agent grant renewal predicate,
|
|
20
|
-
* and the agent entries one key signed grants for.
|
|
21
|
-
*/
|
|
22
|
-
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
23
1
|
import { connectionRecipientKid } from './didKey.js';
|
|
24
2
|
import { grantKindOf } from './entry.js';
|
|
25
3
|
import { INBOX_COLLECTION } from '../space/collections.js';
|
|
26
|
-
import { delegationProofKeyId, delegationSignerGone, embeddedParentCapability, zcapExpiring } from '../webvh/index.js';
|
|
4
|
+
import { delegationProofKeyId, delegationSignerGone, delegationSignerKeyReader, embeddedParentCapability, sameSigner, zcapExpiring } from '../webvh/index.js';
|
|
27
5
|
/**
|
|
28
6
|
* The agent grant renewal window: ninety days before its `expires`, a grant
|
|
29
7
|
* to an agent is due for renewal. Distinct from the thirty-day window the
|
|
@@ -410,19 +388,30 @@ export function agentGrantDue({ zcap, pointedDelegationId, doc, renewalWindowMs
|
|
|
410
388
|
* parent) counts when its own proof names the key. A grant with an embedded
|
|
411
389
|
* parent counts when the parent's proof names the key, the parent's minter.
|
|
412
390
|
*
|
|
391
|
+
* This is an attribution read, so it has to work after the withdrawing
|
|
392
|
+
* edit has landed as well as before it (a torn ceremony's sweep holds only
|
|
393
|
+
* the post-edit document). A grant counts when its proof's method id and the
|
|
394
|
+
* given `keyId` name one signer under `sameSigner` (`webvh`): the same id
|
|
395
|
+
* verbatim, or the same named key. An id the document no longer publishes
|
|
396
|
+
* still matches the grants signed under that exact id. To reach a grant
|
|
397
|
+
* signed under the did:key form of a struck key once the edit has landed,
|
|
398
|
+
* hand the key as a bare multibase too.
|
|
399
|
+
*
|
|
413
400
|
* @param options {object}
|
|
414
401
|
* @param options.entries {ConnectionEntry[]}
|
|
415
402
|
* @param options.keyId {string} a verification-method id in either DID
|
|
416
403
|
* form, or a bare multibase
|
|
417
404
|
* @param options.spaceUrl {string} this Space's container URL
|
|
405
|
+
* @param options.doc {PublishedKeyDocument} the locally verified account
|
|
406
|
+
* document, before or after the key is withdrawn
|
|
418
407
|
* @returns {ConnectionEntry[]}
|
|
419
408
|
*/
|
|
420
|
-
export function agentConnectionsSignedBy({ entries, keyId, spaceUrl }) {
|
|
421
|
-
const
|
|
409
|
+
export function agentConnectionsSignedBy({ entries, keyId, spaceUrl, doc }) {
|
|
410
|
+
const signerKey = delegationSignerKeyReader({ doc });
|
|
422
411
|
const signedBy = (zcap) => {
|
|
423
412
|
const proofKeyId = delegationProofKeyId(zcap);
|
|
424
413
|
return (proofKeyId !== undefined &&
|
|
425
|
-
(
|
|
414
|
+
sameSigner({ signerId: proofKeyId, otherId: keyId, signerKey }));
|
|
426
415
|
};
|
|
427
416
|
return entries.filter(entry => entry.kind === 'agent' &&
|
|
428
417
|
entry.retired === undefined &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACb,MAAM,mBAAmB,CAAA;AAG1B;;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M,CAAC,EAAE,KAAK,mBAAmB;QACjC,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,GAAG,EAMJ;IACC,MAAM,SAAS,GAAG,yBAAyB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAW,EAAE;QACxC,MAAM,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAC7C,OAAO,CACL,UAAU,KAAK,SAAS;YACxB,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAChE,CAAA;IACH,CAAC,CAAA;IACD,OAAO,OAAO,CAAC,MAAM,CACnB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,IAAI,KAAK,OAAO;QACtB,KAAK,CAAC,OAAO,KAAK,SAAS;QAC3B,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAwB,CAAA;YAC3C,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAA;YAC7C,OAAO,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,CAAA;QACjC,CAAC,CAAC,CACL,CAAA;AACH,CAAC"}
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
* `markDeclined`).
|
|
30
30
|
* - The proof check a renewal runs over a recorded grant
|
|
31
31
|
* (`verifyRecordedGrantProof`), which verifies the delegation signature
|
|
32
|
-
* under a key the current document lists, and
|
|
33
|
-
*
|
|
32
|
+
* under a key the current document lists, and an annex-signed grant's
|
|
33
|
+
* leaf under the generation's annex document the caller resolves, and
|
|
34
|
+
* the action-set readers (`allowsAction`, `normalizedActions`).
|
|
34
35
|
* - The writer arm: lazy registration (`registerConnectionWriter`), the
|
|
35
36
|
* pull-path touch (`touchConnectionWriter`), the per-entry sweep
|
|
36
37
|
* (`sweepConnectionWriters`), and `resolveWriter` for history views.
|
|
@@ -49,7 +50,7 @@ export type { ConnectionsListing, ReadConnection } from './read.js';
|
|
|
49
50
|
export { AGENT_GRANT_RENEWAL_WINDOW_MS, agentConnectionsSignedBy, agentGrantDue, allowsAction, collectionIdInSpace, connectionGrants, grantRecipientKid, grantTargets, isTargetInSpace, grantScopeKey, latestGrantsPerScope, latestIndexPerScope, liveInboxChannel, normalizedActions, receivedGrantLapsed, receivedGrants, renewalScopeGrants, splitGrantsByExpiry } from './grants.js';
|
|
50
51
|
export type { ConnectionGrant, ConnectionReceivedGrant } from './grants.js';
|
|
51
52
|
export { verifyRecordedGrantProof } from './grantProof.js';
|
|
52
|
-
export type { GrantProofRefusal, GrantProofResult } from './grantProof.js';
|
|
53
|
+
export type { AnnexDocumentResolver, GrantProofRefusal, GrantProofResult } from './grantProof.js';
|
|
53
54
|
export { connectionDidKey, connectionRecipientKid, signingKeyMultibaseOfDid } from './didKey.js';
|
|
54
55
|
export { ConnectionKindMismatchError } from './errors.js';
|
|
55
56
|
export { clearReceivedGrants, dropReceivedGrant, markDeclined, pruneSupersededGrants, recordGrants, recordReceivedGrants, recordRenewedGrants, removeGrants, retireConnection, setConnectionLabel, settleOutboxItem, unretireConnection } from './upsert.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,E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BAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
* `markDeclined`).
|
|
30
30
|
* - The proof check a renewal runs over a recorded grant
|
|
31
31
|
* (`verifyRecordedGrantProof`), which verifies the delegation signature
|
|
32
|
-
* under a key the current document lists, and
|
|
33
|
-
*
|
|
32
|
+
* under a key the current document lists, and an annex-signed grant's
|
|
33
|
+
* leaf under the generation's annex document the caller resolves, and
|
|
34
|
+
* the action-set readers (`allowsAction`, `normalizedActions`).
|
|
34
35
|
* - The writer arm: lazy registration (`registerConnectionWriter`), the
|
|
35
36
|
* pull-path touch (`touchConnectionWriter`), the per-entry sweep
|
|
36
37
|
* (`sweepConnectionWriters`), and `resolveWriter` for history views.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AAanB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3D,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAM1D,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL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