@interop/wallet-core 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/clients/listing.d.ts +4 -3
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/policy.d.ts +3 -2
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +3 -3
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +14 -4
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +29 -14
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +22 -15
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +32 -15
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/index.d.ts +1 -1
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +1 -1
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +58 -6
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +57 -15
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +30 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +58 -30
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/enrollment/index.d.ts +4 -1
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +4 -1
- package/dist/enrollment/index.js.map +1 -1
- package/dist/keyring/fetch.d.ts +12 -0
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +0 -2
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/index.d.ts +7 -6
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +7 -6
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +22 -6
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +9 -14
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/record.d.ts +30 -10
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +31 -15
- package/dist/keyring/record.js.map +1 -1
- package/dist/keys/index.d.ts +5 -3
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +3 -2
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +22 -2
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +40 -20
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +13 -1
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +18 -0
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +10 -3
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +10 -4
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +29 -21
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +47 -23
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +21 -11
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +19 -10
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +5 -17
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +4 -14
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +151 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -0
- package/dist/recovery/recoveryDelegation.js +261 -0
- package/dist/recovery/recoveryDelegation.js.map +1 -0
- package/dist/recovery/recoveryWebvh.d.ts +13 -22
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +53 -139
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/resourceLog/append.d.ts +12 -3
- package/dist/resourceLog/append.d.ts.map +1 -1
- package/dist/resourceLog/append.js +17 -10
- package/dist/resourceLog/append.js.map +1 -1
- package/dist/resourceLog/index.d.ts +1 -1
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +1 -1
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/pin.d.ts +46 -8
- package/dist/resourceLog/pin.d.ts.map +1 -1
- package/dist/resourceLog/pin.js +32 -7
- package/dist/resourceLog/pin.js.map +1 -1
- package/dist/resourceLog/seal.d.ts +4 -1
- package/dist/resourceLog/seal.d.ts.map +1 -1
- package/dist/resourceLog/seal.js +6 -2
- package/dist/resourceLog/seal.js.map +1 -1
- package/dist/unlock/index.d.ts +40 -0
- package/dist/unlock/index.d.ts.map +1 -0
- package/dist/unlock/index.js +36 -0
- package/dist/unlock/index.js.map +1 -0
- package/dist/unlock/ladder.d.ts +100 -0
- package/dist/unlock/ladder.d.ts.map +1 -0
- package/dist/unlock/ladder.js +144 -0
- package/dist/unlock/ladder.js.map +1 -0
- package/dist/unlock/selfEnroll.d.ts +83 -0
- package/dist/unlock/selfEnroll.d.ts.map +1 -0
- package/dist/unlock/selfEnroll.js +126 -0
- package/dist/unlock/selfEnroll.js.map +1 -0
- package/dist/unlock/standingClient.d.ts +68 -0
- package/dist/unlock/standingClient.d.ts.map +1 -0
- package/dist/unlock/standingClient.js +81 -0
- package/dist/unlock/standingClient.js.map +1 -0
- package/dist/unlock/standingWebvh.d.ts +153 -0
- package/dist/unlock/standingWebvh.d.ts.map +1 -0
- package/dist/unlock/standingWebvh.js +370 -0
- package/dist/unlock/standingWebvh.js.map +1 -0
- package/dist/unlock/unlockRecord.d.ts +207 -0
- package/dist/unlock/unlockRecord.d.ts.map +1 -0
- package/dist/unlock/unlockRecord.js +435 -0
- package/dist/unlock/unlockRecord.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +166 -7
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +286 -31
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +15 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +14 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/keyAgreement.d.ts +72 -0
- package/dist/webvh/keyAgreement.d.ts.map +1 -0
- package/dist/webvh/keyAgreement.js +47 -0
- package/dist/webvh/keyAgreement.js.map +1 -0
- package/dist/webvh/listClients.d.ts +69 -20
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +102 -14
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +21 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +31 -14
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +15 -2
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +22 -3
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +11 -5
- package/dist/recovery/recoveryRecord.d.ts +0 -171
- package/dist/recovery/recoveryRecord.d.ts.map +0 -1
- package/dist/recovery/recoveryRecord.js +0 -290
- package/dist/recovery/recoveryRecord.js.map +0 -1
package/dist/webvh/index.js
CHANGED
|
@@ -11,9 +11,19 @@
|
|
|
11
11
|
* `revokeWebvhClient` -- provisioning, per-client update-key rotation, the
|
|
12
12
|
* two-entry client enrollment ceremony, and the one-entry client
|
|
13
13
|
* revocation edit, all over the narrow `WebvhIdStore` seam.
|
|
14
|
+
* - `markedVerificationMethodPair` -- the one builder of a client's published
|
|
15
|
+
* verification-method pair (the account-controlled signing method plus the
|
|
16
|
+
* key-agreement method under the controller marker), which every write site
|
|
17
|
+
* uses and which refuses a key-agreement key that is not the signing key's
|
|
18
|
+
* canonical X25519 twin (`keyAgreementTwinMultibase`).
|
|
14
19
|
* - `listEnrolledWebvhClients` -- the enrolled-client listing over a
|
|
15
20
|
* caller-verified log (keyed on `capabilityInvocation`, update keys
|
|
16
21
|
* recovered by log attribution), for a "your wallets" surface.
|
|
22
|
+
* - `keyAgreementCommitment` / `commitmentMatchesKey` -- the
|
|
23
|
+
* `MultikeyCommitment` wire rule: the bare sha2-256 multihash, base64url
|
|
24
|
+
* no-pad, over a key-agreement key's decoded multikey bytes, and the
|
|
25
|
+
* decode-based check that verifies a candidate key against a published
|
|
26
|
+
* commitment.
|
|
17
27
|
* - `delegationKeyInDocument` -- the current-key-set rule for one recorded
|
|
18
28
|
* delegation: does the document still publish the key that signed it (a
|
|
19
29
|
* missing key id reads as "cannot be checked", so: no).
|
|
@@ -33,10 +43,11 @@
|
|
|
33
43
|
* Kept out of the root export: this subpath pulls the did:webvh, ed25519, and
|
|
34
44
|
* ezcap dependency graph (the same isolation pattern as `./identity`).
|
|
35
45
|
*/
|
|
36
|
-
export { didWebvhControllerTemplate, ensureDidWebvh, enrollWebvhClient, mintClientWebvhUpdateKeys, relationIds, repairKeyBindings, rotateWebvhUpdateKey, updateKeyMultibase, WebvhLogConflictError, withLogConflictRetry } from './didWebvh.js';
|
|
37
|
-
export { AccountLogMissingError, verifyAccountLog } from './verifyLog.js';
|
|
46
|
+
export { BYOE_CONTEXT_URL, clientKeyAgreementController, commitmentMatchesKey, didWebvhControllerTemplate, ensureDidWebvh, enrollWebvhClient, keyAgreementCommitment, keyAgreementTwinMultibase, MULTIKEY_COMMITMENT_VM_TYPE, markedVerificationMethodPair, mintClientWebvhUpdateKeys, relationIds, repairKeyBindings, rotateWebvhUpdateKey, updateKeyMultibase, WebvhLogConflictError, withLogConflictRetry } from './didWebvh.js';
|
|
47
|
+
export { accountLogPinId, AccountLogMissingError, verifyAccountLog } from './verifyLog.js';
|
|
38
48
|
export { wasWebvhIdStore } from './wasIdStore.js';
|
|
39
|
-
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases,
|
|
49
|
+
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
|
|
50
|
+
export { resolvedKeyAgreementMethods } from './keyAgreement.js';
|
|
40
51
|
export { revokeWebvhClient, StagedCommitmentAmbiguousError } from './revokeClient.js';
|
|
41
52
|
export { multibaseOf } from './didWeb.js';
|
|
42
53
|
export { clientSigningKeyMultibase, didKeyZcapClient, isWebvhDid, webvhCapabilityAgent, webvhSigner, webvhZcapClient } from './zcap.js';
|
package/dist/webvh/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAW1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,EAChB,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The ONE reference-resolving reader for a did:webvh document's `keyAgreement`
|
|
6
|
+
* relation, and the document shape it reads.
|
|
7
|
+
*
|
|
8
|
+
* The relation may carry either form the DID Core data model allows -- a string
|
|
9
|
+
* reference into `verificationMethod`, or an embedded method -- so every
|
|
10
|
+
* consumer that asks "which key-agreement methods does this document publish"
|
|
11
|
+
* must resolve references first. That resolution lives here once, and the
|
|
12
|
+
* consumers are plain filters over its result: the client listing and the
|
|
13
|
+
* revocation removal keep only the methods carrying a client's controller
|
|
14
|
+
* marker, while the user key roster's recipient resolver deliberately keeps
|
|
15
|
+
* unmarked methods too.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately dependency-light -- it imports nothing at all -- so the `keys`
|
|
18
|
+
* layer can share the reader without pulling the ceremony or signing graph.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* A locally verified did:webvh document, read for the `keyAgreement` methods it
|
|
22
|
+
* publishes and the controller each one carries. Structural on purpose: a
|
|
23
|
+
* resolved `DIDDoc` satisfies it, and so does any narrower document shape a
|
|
24
|
+
* wallet already holds.
|
|
25
|
+
*/
|
|
26
|
+
export interface KeyAgreementDocument {
|
|
27
|
+
verificationMethod?: Array<{
|
|
28
|
+
id?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
controller?: string;
|
|
31
|
+
publicKeyMultibase?: string;
|
|
32
|
+
publicKeyCommitment?: string;
|
|
33
|
+
}>;
|
|
34
|
+
keyAgreement?: Array<string | {
|
|
35
|
+
id?: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
controller?: string;
|
|
38
|
+
publicKeyMultibase?: string;
|
|
39
|
+
publicKeyCommitment?: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The materialized shape {@link resolvedKeyAgreementMethods} returns: a
|
|
44
|
+
* `keyAgreement` verification method carrying either the key itself
|
|
45
|
+
* (`publicKeyMultibase`) or, for a low-entropy-derived standing unlock
|
|
46
|
+
* credential, its hash commitment (`publicKeyCommitment`). The `type` rides
|
|
47
|
+
* along so a consumer can tell the two published flavors apart (`Multikey` vs
|
|
48
|
+
* `MultikeyCommitment`) instead of inferring the flavor from which property
|
|
49
|
+
* happens to be present.
|
|
50
|
+
*/
|
|
51
|
+
export interface ResolvedKeyAgreementMethod {
|
|
52
|
+
id?: string;
|
|
53
|
+
type?: string;
|
|
54
|
+
controller?: string;
|
|
55
|
+
publicKeyMultibase?: string;
|
|
56
|
+
publicKeyCommitment?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The `keyAgreement` verification methods a document publishes, materialized:
|
|
60
|
+
* string references resolved against `verificationMethod` (a reference nothing
|
|
61
|
+
* backs is dropped), embedded methods taken verbatim. Document order is
|
|
62
|
+
* preserved, and nothing is filtered -- deciding which of these methods belongs
|
|
63
|
+
* to whom is each caller's own rule.
|
|
64
|
+
*
|
|
65
|
+
* @param options {object}
|
|
66
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
67
|
+
* @returns {ResolvedKeyAgreementMethod[]}
|
|
68
|
+
*/
|
|
69
|
+
export declare function resolvedKeyAgreementMethods({ doc }: {
|
|
70
|
+
doc: KeyAgreementDocument;
|
|
71
|
+
}): ResolvedKeyAgreementMethod[];
|
|
72
|
+
//# sourceMappingURL=keyAgreement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyAgreement.d.ts","sourceRoot":"","sources":["../../src/webvh/keyAgreement.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAC7B,CAAC,CAAA;IACF,YAAY,CAAC,EAAE,KAAK,CAChB,MAAM,GACN;QACE,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAC7B,CACJ,CAAA;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,oBAAoB,CAAA;CAC1B,GAAG,0BAA0B,EAAE,CAe/B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The ONE reference-resolving reader for a did:webvh document's `keyAgreement`
|
|
6
|
+
* relation, and the document shape it reads.
|
|
7
|
+
*
|
|
8
|
+
* The relation may carry either form the DID Core data model allows -- a string
|
|
9
|
+
* reference into `verificationMethod`, or an embedded method -- so every
|
|
10
|
+
* consumer that asks "which key-agreement methods does this document publish"
|
|
11
|
+
* must resolve references first. That resolution lives here once, and the
|
|
12
|
+
* consumers are plain filters over its result: the client listing and the
|
|
13
|
+
* revocation removal keep only the methods carrying a client's controller
|
|
14
|
+
* marker, while the user key roster's recipient resolver deliberately keeps
|
|
15
|
+
* unmarked methods too.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately dependency-light -- it imports nothing at all -- so the `keys`
|
|
18
|
+
* layer can share the reader without pulling the ceremony or signing graph.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The `keyAgreement` verification methods a document publishes, materialized:
|
|
22
|
+
* string references resolved against `verificationMethod` (a reference nothing
|
|
23
|
+
* backs is dropped), embedded methods taken verbatim. Document order is
|
|
24
|
+
* preserved, and nothing is filtered -- deciding which of these methods belongs
|
|
25
|
+
* to whom is each caller's own rule.
|
|
26
|
+
*
|
|
27
|
+
* @param options {object}
|
|
28
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
29
|
+
* @returns {ResolvedKeyAgreementMethod[]}
|
|
30
|
+
*/
|
|
31
|
+
export function resolvedKeyAgreementMethods({ doc }) {
|
|
32
|
+
const byId = new Map();
|
|
33
|
+
for (const method of doc.verificationMethod ?? []) {
|
|
34
|
+
if (typeof method?.id === 'string') {
|
|
35
|
+
byId.set(method.id, method);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const methods = [];
|
|
39
|
+
for (const entry of doc.keyAgreement ?? []) {
|
|
40
|
+
const method = typeof entry === 'string' ? byId.get(entry) : entry;
|
|
41
|
+
if (method) {
|
|
42
|
+
methods.push(method);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return methods;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=keyAgreement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyAgreement.js","sourceRoot":"","sources":["../../src/webvh/keyAgreement.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AA6CH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,GAAG,EAGJ;IACC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsC,CAAA;IAC1D,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,kBAAkB,IAAI,EAAE,EAAE,CAAC;QAClD,IAAI,OAAO,MAAM,EAAE,EAAE,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAiC,EAAE,CAAA;IAChD,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -28,12 +28,18 @@
|
|
|
28
28
|
* - `addedAt` -- the `versionTime` of the entry that published the client's
|
|
29
29
|
* verification methods (its enrollment moment, as the log states it).
|
|
30
30
|
*
|
|
31
|
-
* The X25519 `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
31
|
+
* The X25519 `keyAgreementKeyMultibases` set is READ from the document, not
|
|
32
|
+
* derived: it is every `keyAgreement` method published under the client's
|
|
33
|
+
* controller marker (`controller: did:key:<signing multibase>`, the write-side
|
|
34
|
+
* convention every enrollment follows). The marker is what tells a client's
|
|
35
|
+
* key-agreement methods apart from the deliberately unmarked ones a recovery
|
|
36
|
+
* continuation publishes beside them. It is hard-required -- a client with no
|
|
37
|
+
* marked method reports an EMPTY set, the same refuse-not-guess rule the
|
|
38
|
+
* update-key attribution follows, since a guessed key-agreement key would make
|
|
39
|
+
* a revocation report success over a method that never left the document. The
|
|
40
|
+
* whole set is built in a single pass over the document's resolved
|
|
41
|
+
* key-agreement methods, grouped by controller once and looked up per client,
|
|
42
|
+
* rather than a per-client rescan.
|
|
37
43
|
*
|
|
38
44
|
* Verification is the CALLER's job: pass a log that was resolved and checked
|
|
39
45
|
* against the account pointer (the wallet's ordinary
|
|
@@ -46,14 +52,22 @@
|
|
|
46
52
|
* decide "does this delegation still chain" decides it in one place.
|
|
47
53
|
*/
|
|
48
54
|
import type { DIDLog } from '@interop/did-method-webvh';
|
|
49
|
-
import type {
|
|
55
|
+
import type { KeyAgreementDocument } from './keyAgreement.js';
|
|
50
56
|
/**
|
|
51
|
-
* One enrolled wallet client as the log states it. `
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
57
|
+
* One enrolled wallet client as the log states it. `keyAgreementKeyMultibases`
|
|
58
|
+
* is REQUIRED and set-valued: every key-agreement method the client's
|
|
59
|
+
* controller marker claims, in document order, deduplicated. An EMPTY array is
|
|
60
|
+
* the refuse-not-guess state -- the document carries no marked method for the
|
|
61
|
+
* client. `updateKeyMultibase` and `addedAt` are absent when the log
|
|
62
|
+
* attribution cannot recover them (see the module doc).
|
|
63
|
+
*
|
|
64
|
+
* A client that published several marked key-agreement methods surfaces the
|
|
65
|
+
* full set here; revoking it removes them all regardless, because the removal
|
|
66
|
+
* filters the document by the marker rather than by this member.
|
|
55
67
|
*/
|
|
56
|
-
export interface EnrolledWebvhClient
|
|
68
|
+
export interface EnrolledWebvhClient {
|
|
69
|
+
signingKeyMultibase: string;
|
|
70
|
+
keyAgreementKeyMultibases: string[];
|
|
57
71
|
updateKeyMultibase?: string;
|
|
58
72
|
addedAt?: string;
|
|
59
73
|
}
|
|
@@ -110,19 +124,54 @@ export declare function delegationKeyInDocument({ doc, delegationKeyId }: {
|
|
|
110
124
|
delegationKeyId?: string;
|
|
111
125
|
}): boolean;
|
|
112
126
|
/**
|
|
113
|
-
* The
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
127
|
+
* The `keyAgreement` verification methods one client's controller marker
|
|
128
|
+
* claims: the document's resolved key-agreement methods
|
|
129
|
+
* ({@link resolvedKeyAgreementMethods}) filtered to those whose `controller` is
|
|
130
|
+
* the client's did:key (see `clientKeyAgreementController`).
|
|
131
|
+
*
|
|
132
|
+
* The marker is HARD-REQUIRED here, and that is where this predicate parts
|
|
133
|
+
* company with the user key roster's recipient resolver, which filters the same
|
|
134
|
+
* reader's result by nothing more than "carries a public key multibase".
|
|
135
|
+
* Listing and revocation are refuse-not-guess surfaces: an unmarked method
|
|
136
|
+
* matched by proximity would make a revocation report success over a method
|
|
137
|
+
* that never left the document. The roster resolver's job is the opposite --
|
|
138
|
+
* it must keep wrapping the user key to the deliberately unmarked
|
|
139
|
+
* key-agreement methods a recovery code publishes, so it matches them too.
|
|
140
|
+
*
|
|
141
|
+
* The ordinary shape is exactly one method, but the result is a SET rather
|
|
142
|
+
* than a first match on purpose: a revocation has to remove every method the
|
|
143
|
+
* marker claims, or a client with a second published key-agreement key would
|
|
144
|
+
* keep a standing wrap target after a revocation reported success.
|
|
145
|
+
*
|
|
146
|
+
* @param options {object}
|
|
147
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
148
|
+
* @param options.signingKeyMultibase {string} the client's Ed25519 signing
|
|
149
|
+
* key, as the document publishes it
|
|
150
|
+
* @returns {Array<{ id?: string, publicKeyMultibase?: string }>}
|
|
151
|
+
*/
|
|
152
|
+
export declare function markedKeyAgreementMethods({ doc, signingKeyMultibase }: {
|
|
153
|
+
doc: KeyAgreementDocument;
|
|
154
|
+
signingKeyMultibase: string;
|
|
155
|
+
}): Array<{
|
|
156
|
+
id?: string;
|
|
157
|
+
publicKeyMultibase?: string;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* The key multibases of the `keyAgreement` methods one client's controller
|
|
161
|
+
* marker claims -- {@link markedKeyAgreementMethods}, reduced to the
|
|
162
|
+
* multibases a roster wrap and a listing row speak in. A method carrying no
|
|
163
|
+
* `publicKeyMultibase` falls back to the fragment of its id (for a did:webvh
|
|
164
|
+
* document the two agree).
|
|
118
165
|
*
|
|
119
166
|
* @param options {object}
|
|
167
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
120
168
|
* @param options.signingKeyMultibase {string}
|
|
121
|
-
* @returns {string}
|
|
169
|
+
* @returns {string[]}
|
|
122
170
|
*/
|
|
123
|
-
export declare function
|
|
171
|
+
export declare function markedKeyAgreementMultibases({ doc, signingKeyMultibase }: {
|
|
172
|
+
doc: KeyAgreementDocument;
|
|
124
173
|
signingKeyMultibase: string;
|
|
125
|
-
}): string;
|
|
174
|
+
}): string[];
|
|
126
175
|
/**
|
|
127
176
|
* One enrolled client's ACTIVE update key as the log states it, keyed on the
|
|
128
177
|
* signing key the document publishes for it -- the same attribution the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listClients.d.ts","sourceRoot":"","sources":["../../src/webvh/listClients.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"listClients.d.ts","sourceRoot":"","sources":["../../src/webvh/listClients.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAQvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IACl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ACD,GAAG,EAAE,MAAM,CAAA;IACX,mBAAmB,EAAE,MAAM,CAAA;CAC5B,GAAG,MAAM,GAAG,SAAS,CAKrB;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,mBAAmB,EAAE,CAmCxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { x25519RecipientFromDidKey } from '@interop/was-client/edv';
|
|
2
1
|
import { vmFragmentOf } from '../resourceLog/vmFragment.js';
|
|
3
|
-
import { effectiveParameters, relationIds } from './didWebvh.js';
|
|
2
|
+
import { clientKeyAgreementController, effectiveParameters, relationIds } from './didWebvh.js';
|
|
3
|
+
import { resolvedKeyAgreementMethods } from './keyAgreement.js';
|
|
4
4
|
/**
|
|
5
5
|
* The key multibases the document currently publishes: every verification
|
|
6
6
|
* method's `publicKeyMultibase`, plus the fragment of its id (for a did:webvh
|
|
@@ -56,19 +56,104 @@ export function delegationKeyInDocument({ doc, delegationKeyId }) {
|
|
|
56
56
|
return documentKeyMultibases({ doc }).has(multibase);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
59
|
+
* The `keyAgreement` verification methods one client's controller marker
|
|
60
|
+
* claims: the document's resolved key-agreement methods
|
|
61
|
+
* ({@link resolvedKeyAgreementMethods}) filtered to those whose `controller` is
|
|
62
|
+
* the client's did:key (see `clientKeyAgreementController`).
|
|
63
|
+
*
|
|
64
|
+
* The marker is HARD-REQUIRED here, and that is where this predicate parts
|
|
65
|
+
* company with the user key roster's recipient resolver, which filters the same
|
|
66
|
+
* reader's result by nothing more than "carries a public key multibase".
|
|
67
|
+
* Listing and revocation are refuse-not-guess surfaces: an unmarked method
|
|
68
|
+
* matched by proximity would make a revocation report success over a method
|
|
69
|
+
* that never left the document. The roster resolver's job is the opposite --
|
|
70
|
+
* it must keep wrapping the user key to the deliberately unmarked
|
|
71
|
+
* key-agreement methods a recovery code publishes, so it matches them too.
|
|
72
|
+
*
|
|
73
|
+
* The ordinary shape is exactly one method, but the result is a SET rather
|
|
74
|
+
* than a first match on purpose: a revocation has to remove every method the
|
|
75
|
+
* marker claims, or a client with a second published key-agreement key would
|
|
76
|
+
* keep a standing wrap target after a revocation reported success.
|
|
77
|
+
*
|
|
78
|
+
* @param options {object}
|
|
79
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
80
|
+
* @param options.signingKeyMultibase {string} the client's Ed25519 signing
|
|
81
|
+
* key, as the document publishes it
|
|
82
|
+
* @returns {Array<{ id?: string, publicKeyMultibase?: string }>}
|
|
83
|
+
*/
|
|
84
|
+
export function markedKeyAgreementMethods({ doc, signingKeyMultibase }) {
|
|
85
|
+
const marker = clientKeyAgreementController({ signingKeyMultibase });
|
|
86
|
+
return resolvedKeyAgreementMethods({ doc }).filter(method => method.controller === marker);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The key multibases of the `keyAgreement` methods one client's controller
|
|
90
|
+
* marker claims -- {@link markedKeyAgreementMethods}, reduced to the
|
|
91
|
+
* multibases a roster wrap and a listing row speak in. A method carrying no
|
|
92
|
+
* `publicKeyMultibase` falls back to the fragment of its id (for a did:webvh
|
|
93
|
+
* document the two agree).
|
|
64
94
|
*
|
|
65
95
|
* @param options {object}
|
|
96
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
66
97
|
* @param options.signingKeyMultibase {string}
|
|
67
|
-
* @returns {string}
|
|
98
|
+
* @returns {string[]}
|
|
68
99
|
*/
|
|
69
|
-
export function
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
export function markedKeyAgreementMultibases({ doc, signingKeyMultibase }) {
|
|
101
|
+
const multibases = [];
|
|
102
|
+
for (const method of markedKeyAgreementMethods({
|
|
103
|
+
doc,
|
|
104
|
+
signingKeyMultibase
|
|
105
|
+
})) {
|
|
106
|
+
const multibase = method.publicKeyMultibase ??
|
|
107
|
+
(method.id ? vmFragmentOf(method.id) : undefined);
|
|
108
|
+
if (multibase) {
|
|
109
|
+
multibases.push(multibase);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return [...new Set(multibases)];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Every `keyAgreement` method the document publishes, grouped by its
|
|
116
|
+
* `controller` in one pass -- the listing's batch counterpart to
|
|
117
|
+
* {@link markedKeyAgreementMultibases}, which resolves and rescans the whole
|
|
118
|
+
* relation per client. A method carrying no `publicKeyMultibase` falls back to
|
|
119
|
+
* the fragment of its id (for a did:webvh document the two agree), and a
|
|
120
|
+
* method with no `controller` at all, or that yields no multibase, is
|
|
121
|
+
* dropped: it can never be a client's marked method.
|
|
122
|
+
*
|
|
123
|
+
* Keying by controller string is what keeps this MARKED-only without an extra
|
|
124
|
+
* filter: only a client's own methods carry a `did:key:<signing multibase>`
|
|
125
|
+
* controller marker, while the deliberately unmarked methods a recovery
|
|
126
|
+
* continuation publishes carry the account DID as controller instead, so their
|
|
127
|
+
* group is simply never looked up by {@link listEnrolledWebvhClients}.
|
|
128
|
+
*
|
|
129
|
+
* Multibases within a group are deduplicated, first-seen order preserved.
|
|
130
|
+
*
|
|
131
|
+
* @param options {object}
|
|
132
|
+
* @param options.doc {KeyAgreementDocument} a locally verified document
|
|
133
|
+
* @returns {Map<string, string[]>}
|
|
134
|
+
*/
|
|
135
|
+
function markedKeyAgreementIndex({ doc }) {
|
|
136
|
+
const index = new Map();
|
|
137
|
+
for (const method of resolvedKeyAgreementMethods({ doc })) {
|
|
138
|
+
if (!method.controller) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const multibase = method.publicKeyMultibase ??
|
|
142
|
+
(method.id ? vmFragmentOf(method.id) : undefined);
|
|
143
|
+
if (!multibase) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const group = index.get(method.controller);
|
|
147
|
+
if (group) {
|
|
148
|
+
if (!group.includes(multibase)) {
|
|
149
|
+
group.push(multibase);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
index.set(method.controller, [multibase]);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return index;
|
|
72
157
|
}
|
|
73
158
|
/**
|
|
74
159
|
* The update keys an entry newly revealed: the effective `updateKeys` at
|
|
@@ -198,6 +283,11 @@ export function listEnrolledWebvhClients({ log }) {
|
|
|
198
283
|
// The entry that published each client's verification methods -- its
|
|
199
284
|
// enrollment moment, and the attribution anchor for its update key.
|
|
200
285
|
const addIndexes = clientAddIndexes({ log });
|
|
286
|
+
// Every keyAgreement method, grouped by controller, in one pass -- keying by
|
|
287
|
+
// controller string picks up only MARKED methods (a client's own), since the
|
|
288
|
+
// account DID controller a recovery code's unmarked method carries is never
|
|
289
|
+
// looked up below.
|
|
290
|
+
const keyAgreementIndex = markedKeyAgreementIndex({ doc });
|
|
201
291
|
const clients = [];
|
|
202
292
|
for (const vmId of relationIds(doc.capabilityInvocation)) {
|
|
203
293
|
const signingKeyMultibase = vmFragmentOf(vmId);
|
|
@@ -207,9 +297,7 @@ export function listEnrolledWebvhClients({ log }) {
|
|
|
207
297
|
const addIndex = addIndexes.get(signingKeyMultibase);
|
|
208
298
|
clients.push({
|
|
209
299
|
signingKeyMultibase,
|
|
210
|
-
|
|
211
|
-
signingKeyMultibase
|
|
212
|
-
}),
|
|
300
|
+
keyAgreementKeyMultibases: keyAgreementIndex.get(clientKeyAgreementController({ signingKeyMultibase })) ?? [],
|
|
213
301
|
updateKeyMultibase: addIndex === undefined
|
|
214
302
|
? undefined
|
|
215
303
|
: attributeActiveUpdateKey({ params, addIndex }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listClients.js","sourceRoot":"","sources":["../../src/webvh/listClients.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listClients.js","sourceRoot":"","sources":["../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;QACzD,MAAM,mBAAmB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,SAAQ;QACV,CAAC;QACD,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QACpD,OAAO,CAAC,IAAI,CAAC;YACX,mBAAmB;YACnB,yBAAyB,EACvB,iBAAiB,CAAC,GAAG,CACnB,4BAA4B,CAAC,EAAE,mBAAmB,EAAE,CAAC,CACtD,IAAI,EAAE;YACT,kBAAkB,EAChB,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,wBAAwB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;YACpD,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC,WAAW;SACzE,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { DIDDoc } from '@interop/did-method-webvh';
|
|
2
|
-
import type { ClientWebvhUpdateKeys,
|
|
1
|
+
import type { DIDDoc, DIDLog } from '@interop/did-method-webvh';
|
|
2
|
+
import type { ClientWebvhUpdateKeys, WebvhIdStore } from './didWebvh.js';
|
|
3
3
|
/**
|
|
4
4
|
* The public halves of the client being revoked, as the document and log
|
|
5
|
-
* carry them: its
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* carry them: its signing-key multibase and its active update key. The
|
|
6
|
+
* staged-key hash is deliberately absent -- it is recovered from the log (see
|
|
7
|
+
* the module doc), since no other party ever held the staged key.
|
|
8
|
+
*
|
|
9
|
+
* The key-agreement half is deliberately absent too: the removal reads every
|
|
10
|
+
* key-agreement method the client's controller marker claims off the document
|
|
11
|
+
* itself, so no caller-supplied key-agreement key is ever needed to revoke the
|
|
12
|
+
* client completely.
|
|
8
13
|
*/
|
|
9
|
-
export interface RevokedClientKeys
|
|
14
|
+
export interface RevokedClientKeys {
|
|
15
|
+
signingKeyMultibase: string;
|
|
10
16
|
updateKeyMultibase: string;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
@@ -75,11 +81,14 @@ export declare class StagedCommitmentAmbiguousError extends Error {
|
|
|
75
81
|
* excluded from the staged-hash attribution
|
|
76
82
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
77
83
|
* to, from the caller's stored account pointer
|
|
78
|
-
* @returns {Promise<{ did: string, doc: DIDDoc }>} the
|
|
79
|
-
* resolved document AFTER the edit -- what the roster
|
|
80
|
-
* resolves its remaining recipients from, so the
|
|
81
|
-
* the log it just extended
|
|
82
|
-
*
|
|
84
|
+
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} the
|
|
85
|
+
* account's DID, its resolved document AFTER the edit -- what the roster
|
|
86
|
+
* rotation that follows resolves its remaining recipients from, so the
|
|
87
|
+
* caller needs no re-fetch of the log it just extended -- and the post-edit
|
|
88
|
+
* log itself, from which that rotation's controller view is built (the
|
|
89
|
+
* revocation cascade's post-edit anchoring). On the idempotent no-op path
|
|
90
|
+
* these are the already-published document and log, which state the same
|
|
91
|
+
* thing.
|
|
83
92
|
*/
|
|
84
93
|
export declare function revokeWebvhClient(options: {
|
|
85
94
|
idStore: WebvhIdStore;
|
|
@@ -90,5 +99,6 @@ export declare function revokeWebvhClient(options: {
|
|
|
90
99
|
}): Promise<{
|
|
91
100
|
did: string;
|
|
92
101
|
doc: DIDDoc;
|
|
102
|
+
log: DIDLog;
|
|
93
103
|
}>;
|
|
94
104
|
//# sourceMappingURL=revokeClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeClient.d.ts","sourceRoot":"","sources":["../../src/webvh/revokeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revokeClient.d.ts","sourceRoot":"","sources":["../../src/webvh/revokeClient.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAEP,MAAM,2BAA2B,CAAA;AAgBlC,OAAO,KAAK,EACV,qBAAqB,EAErB,YAAY,EACb,MAAM,eAAe,CAAA;AAEtB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,UAAU,EAAE,MAAM,EAAE,CAAA;gBACR,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE;CASrD;AAwKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,qBAAqB,CAAA;IACjC,aAAa,EAAE,iBAAiB,CAAA;IAChC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAErD"}
|