@interop/wallet-request 0.1.0 → 0.2.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 +1 -1
- package/dist/appKey.d.ts +10 -70
- package/dist/appKey.d.ts.map +1 -1
- package/dist/appKey.js +34 -112
- package/dist/appKey.js.map +1 -1
- package/dist/capabilityRequest.d.ts +1 -1
- package/dist/capabilityRequest.js +1 -1
- package/dist/classify.d.ts +2 -2
- package/dist/classify.d.ts.map +1 -1
- package/dist/classify.js +13 -35
- package/dist/classify.js.map +1 -1
- package/dist/composeVp.d.ts +0 -5
- package/dist/composeVp.d.ts.map +1 -1
- package/dist/composeVp.js +4 -7
- package/dist/composeVp.js.map +1 -1
- package/dist/ephemeralExchange.d.ts +22 -6
- package/dist/ephemeralExchange.d.ts.map +1 -1
- package/dist/ephemeralExchange.js +43 -16
- package/dist/ephemeralExchange.js.map +1 -1
- package/dist/exchangeClient.d.ts +7 -4
- package/dist/exchangeClient.d.ts.map +1 -1
- package/dist/exchangeClient.js +9 -18
- package/dist/exchangeClient.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/interactionUrl.d.ts +1 -1
- package/dist/interactionUrl.d.ts.map +1 -1
- package/dist/interactionUrl.js +17 -9
- package/dist/interactionUrl.js.map +1 -1
- package/dist/matching.d.ts.map +1 -1
- package/dist/matching.js +3 -18
- package/dist/matching.js.map +1 -1
- package/dist/onboarding.d.ts +1 -1
- package/dist/onboarding.js +1 -1
- package/dist/onboarding.js.map +1 -1
- package/dist/parse.d.ts +20 -7
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +41 -17
- package/dist/parse.js.map +1 -1
- package/dist/processRequest.d.ts +16 -1
- package/dist/processRequest.d.ts.map +1 -1
- package/dist/processRequest.js +29 -3
- package/dist/processRequest.js.map +1 -1
- package/dist/queryPredicates.d.ts +44 -33
- package/dist/queryPredicates.d.ts.map +1 -1
- package/dist/queryPredicates.js +56 -45
- package/dist/queryPredicates.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/walletInput.d.ts +22 -7
- package/dist/walletInput.d.ts.map +1 -1
- package/dist/walletInput.js +61 -14
- package/dist/walletInput.js.map +1 -1
- package/package.json +3 -2
package/dist/parse.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { IVPRQuery, IZcapQuery, WalletApiMessage } from './types.js';
|
|
2
2
|
export { isDIDAuthRequested as isDidAuthRequested } from './classify.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* invitation, a presentation request, a presentation
|
|
6
|
-
* request
|
|
4
|
+
* The parsed object behind a JSON string when it is a recognized wallet API
|
|
5
|
+
* message (an exchange invitation, a presentation request, a presentation
|
|
6
|
+
* offer, or an issuance request), or `undefined` when it is not. Malformed
|
|
7
|
+
* JSON is not a message. Parses once, so a caller that goes on to
|
|
8
|
+
* `parseWalletApiMessage` the object does not parse the text again.
|
|
9
|
+
*
|
|
10
|
+
* @param text {string}
|
|
11
|
+
* @returns {object | undefined}
|
|
12
|
+
*/
|
|
13
|
+
export declare function walletApiMessageObjectOf(text: string): object | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a JSON string is a recognized wallet API message.
|
|
7
16
|
*
|
|
8
17
|
* @param text {string}
|
|
9
18
|
* @returns {boolean}
|
|
@@ -25,7 +34,10 @@ export declare function parseWalletApiMessage({ messageObject }: {
|
|
|
25
34
|
/**
|
|
26
35
|
* Extracts and parses the wallet API message carried in a deep-link URL's
|
|
27
36
|
* `request` query parameter (`dccrequest://...?request=<json>`). Returns
|
|
28
|
-
* `undefined` when the parameter is absent
|
|
37
|
+
* `undefined` when the parameter is absent, its value is not valid JSON, or the
|
|
38
|
+
* JSON is not an object. None of those is an error: a link on an unregistered
|
|
39
|
+
* scheme routinely carries an unrelated `request` parameter, and the caller
|
|
40
|
+
* simply goes on to the next classification branch.
|
|
29
41
|
*
|
|
30
42
|
* @param options {object}
|
|
31
43
|
* @param options.url {string}
|
|
@@ -50,9 +62,10 @@ export declare function zcapsRequested({ queries }: {
|
|
|
50
62
|
};
|
|
51
63
|
/**
|
|
52
64
|
* Returns true if the message is a VPR whose only query type is
|
|
53
|
-
* `DIDAuthentication` (i.e. no credential sharing is involved).
|
|
54
|
-
* is
|
|
55
|
-
*
|
|
65
|
+
* `DIDAuthentication` (i.e. no credential sharing is involved). A request whose
|
|
66
|
+
* `verifiablePresentationRequest` is not an object has no query set and is not
|
|
67
|
+
* DID-Auth-only. The query set is read through `queriesOf`, so a `null` or
|
|
68
|
+
* untyped entry is skipped here exactly as classification skips it. Throws when the query set names
|
|
56
69
|
* `DIDAuthentication` more than once, matching what classification would
|
|
57
70
|
* otherwise reject after the request was accepted.
|
|
58
71
|
*
|
package/dist/parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAKV,SAAS,EACT,UAAU,EACV,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAExE
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAKV,SAAS,EACT,UAAU,EACV,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAExE;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAezE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAoBD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,aAAa,EACd,EAAE;IACD,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,gBAAgB,GAAG,SAAS,CAiB/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAyBtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG;IACrE,YAAY,CAAC,EAAE,UAAU,EAAE,CAAA;CAC5B,CAMA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAcvE"}
|
package/dist/parse.js
CHANGED
|
@@ -14,27 +14,39 @@ import { isDIDAuthRequested, isZcapQuery, queriesOf } from './classify.js';
|
|
|
14
14
|
// DCW imported it as `isDidAuthRequested`. Both names resolve to one function.
|
|
15
15
|
export { isDIDAuthRequested as isDidAuthRequested } from './classify.js';
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* invitation, a presentation request, a presentation
|
|
19
|
-
* request
|
|
17
|
+
* The parsed object behind a JSON string when it is a recognized wallet API
|
|
18
|
+
* message (an exchange invitation, a presentation request, a presentation
|
|
19
|
+
* offer, or an issuance request), or `undefined` when it is not. Malformed
|
|
20
|
+
* JSON is not a message. Parses once, so a caller that goes on to
|
|
21
|
+
* `parseWalletApiMessage` the object does not parse the text again.
|
|
20
22
|
*
|
|
21
23
|
* @param text {string}
|
|
22
|
-
* @returns {
|
|
24
|
+
* @returns {object | undefined}
|
|
23
25
|
*/
|
|
24
|
-
export function
|
|
26
|
+
export function walletApiMessageObjectOf(text) {
|
|
25
27
|
let messageObject;
|
|
26
28
|
try {
|
|
27
29
|
messageObject = JSON.parse(text);
|
|
28
30
|
}
|
|
29
|
-
catch
|
|
30
|
-
return
|
|
31
|
+
catch {
|
|
32
|
+
return undefined;
|
|
31
33
|
}
|
|
32
|
-
|
|
34
|
+
const isMessage = !!messageObject &&
|
|
33
35
|
typeof messageObject === 'object' &&
|
|
34
36
|
('protocols' in messageObject ||
|
|
35
37
|
'verifiablePresentationRequest' in messageObject ||
|
|
36
38
|
'verifiablePresentation' in messageObject ||
|
|
37
|
-
'issueRequest' in messageObject)
|
|
39
|
+
'issueRequest' in messageObject);
|
|
40
|
+
return isMessage ? messageObject : undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Whether a JSON string is a recognized wallet API message.
|
|
44
|
+
*
|
|
45
|
+
* @param text {string}
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
export function isWalletApiMessage(text) {
|
|
49
|
+
return walletApiMessageObjectOf(text) !== undefined;
|
|
38
50
|
}
|
|
39
51
|
/**
|
|
40
52
|
* Rejects a presentation request whose query set names `DIDAuthentication` more
|
|
@@ -84,7 +96,10 @@ export function parseWalletApiMessage({ messageObject }) {
|
|
|
84
96
|
/**
|
|
85
97
|
* Extracts and parses the wallet API message carried in a deep-link URL's
|
|
86
98
|
* `request` query parameter (`dccrequest://...?request=<json>`). Returns
|
|
87
|
-
* `undefined` when the parameter is absent
|
|
99
|
+
* `undefined` when the parameter is absent, its value is not valid JSON, or the
|
|
100
|
+
* JSON is not an object. None of those is an error: a link on an unregistered
|
|
101
|
+
* scheme routinely carries an unrelated `request` parameter, and the caller
|
|
102
|
+
* simply goes on to the next classification branch.
|
|
88
103
|
*
|
|
89
104
|
* @param options {object}
|
|
90
105
|
* @param options.url {string}
|
|
@@ -102,17 +117,21 @@ export function parseWalletApiUrl({ url }) {
|
|
|
102
117
|
// URL does not contain a "request" parameter.
|
|
103
118
|
return undefined;
|
|
104
119
|
}
|
|
120
|
+
let parsed;
|
|
105
121
|
try {
|
|
106
122
|
// `URLSearchParams.get` has already percent-decoded the value.
|
|
107
|
-
|
|
123
|
+
parsed = JSON.parse(messageText);
|
|
108
124
|
}
|
|
109
125
|
catch (err) {
|
|
110
|
-
log.
|
|
111
|
-
messageText,
|
|
126
|
+
log.debug('The "request" parameter is not JSON; not a wallet API URL', {
|
|
112
127
|
err
|
|
113
128
|
});
|
|
114
129
|
return undefined;
|
|
115
130
|
}
|
|
131
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
return parsed;
|
|
116
135
|
}
|
|
117
136
|
/**
|
|
118
137
|
* Filters an incoming VCALM query set for capability (zcap) requests, returning
|
|
@@ -132,9 +151,10 @@ export function zcapsRequested({ queries }) {
|
|
|
132
151
|
}
|
|
133
152
|
/**
|
|
134
153
|
* Returns true if the message is a VPR whose only query type is
|
|
135
|
-
* `DIDAuthentication` (i.e. no credential sharing is involved).
|
|
136
|
-
* is
|
|
137
|
-
*
|
|
154
|
+
* `DIDAuthentication` (i.e. no credential sharing is involved). A request whose
|
|
155
|
+
* `verifiablePresentationRequest` is not an object has no query set and is not
|
|
156
|
+
* DID-Auth-only. The query set is read through `queriesOf`, so a `null` or
|
|
157
|
+
* untyped entry is skipped here exactly as classification skips it. Throws when the query set names
|
|
138
158
|
* `DIDAuthentication` more than once, matching what classification would
|
|
139
159
|
* otherwise reject after the request was accepted.
|
|
140
160
|
*
|
|
@@ -145,8 +165,12 @@ export function isDIDAuthOnlyRequest(message) {
|
|
|
145
165
|
if (!('verifiablePresentationRequest' in message)) {
|
|
146
166
|
return false;
|
|
147
167
|
}
|
|
168
|
+
const details = message.verifiablePresentationRequest;
|
|
169
|
+
if (!details || typeof details !== 'object') {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
148
172
|
assertSingleDIDAuthQuery(message);
|
|
149
|
-
const queries = queriesOf(
|
|
173
|
+
const queries = queriesOf(details);
|
|
150
174
|
return (queries.length > 0 &&
|
|
151
175
|
queries.every(entry => entry.type === 'DIDAuthentication'));
|
|
152
176
|
}
|
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAW9B,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE1E,8EAA8E;AAC9E,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAExE
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAW9B,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE1E,8EAA8E;AAC9E,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAExE;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,IAAI,aAAsB,CAAA;IAC1B,IAAI,CAAC;QACH,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,SAAS,GACb,CAAC,CAAC,aAAa;QACf,OAAO,aAAa,KAAK,QAAQ;QACjC,CAAC,WAAW,IAAI,aAAa;YAC3B,+BAA+B,IAAI,aAAa;YAChD,wBAAwB,IAAI,aAAa;YACzC,cAAc,IAAI,aAAa,CAAC,CAAA;IACpC,OAAO,SAAS,CAAC,CAAC,CAAE,aAAwB,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1D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AK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAC3D,CAAA;AACH,CAAC"}
|
package/dist/processRequest.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ExclusiveQueryType } from './queryPredicates.js';
|
|
1
2
|
import type { IVerifiableCredential, IVPRDetails, PresentationSigner, RequestProcessors, WalletResponse } from './types.js';
|
|
2
3
|
/**
|
|
3
|
-
* Domain-binding check (VCALM
|
|
4
|
+
* Domain-binding check (VCALM section 3.4.3 advisement): a DID-Auth `domain` MUST match
|
|
4
5
|
* the channel the request arrived on, otherwise a dishonest verifier could relay
|
|
5
6
|
* the challenge from another origin and replay the response.
|
|
6
7
|
*
|
|
@@ -14,6 +15,20 @@ export declare function domainMatchesOrigin({ domain, origin }: {
|
|
|
14
15
|
domain: string;
|
|
15
16
|
origin?: string;
|
|
16
17
|
}): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Raised by {@link processRequest} when the request carries an exclusive query
|
|
20
|
+
* type it has no processor for (today the `WalletOnboardingQuery`, which a
|
|
21
|
+
* wallet routes to its own flow before calling in). The `queryType` rides
|
|
22
|
+
* along so a caller can dispatch to that flow. Dispatch on `err.name` rather
|
|
23
|
+
* than `instanceof`, as with the package's other errors: the caller may hold a
|
|
24
|
+
* different copy of this package, which makes the name the stable contract.
|
|
25
|
+
*/
|
|
26
|
+
export declare class ExclusiveQueryUnsupportedError extends Error {
|
|
27
|
+
readonly queryType: ExclusiveQueryType;
|
|
28
|
+
constructor({ queryType }: {
|
|
29
|
+
queryType: ExclusiveQueryType;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
17
32
|
/**
|
|
18
33
|
* Processes a Verifiable Presentation Request and composes the wallet's
|
|
19
34
|
* response. Assumes the user has already consented and (for VC sharing) picked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.d.ts","sourceRoot":"","sources":["../src/processRequest.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EAEX,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAA;AAkBnB;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,OAAO,CAOV;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,kBAAkB,EAClB,WAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,WAAW,EACZ,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,WAAW,CAAC,EAAE,qBAAqB,EAAE,CAAA;IACrC,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"processRequest.d.ts","sourceRoot":"","sources":["../src/processRequest.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EAEX,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAA;AAkBnB;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,OAAO,CAOV;AAED;;;;;;;GAOG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAA;gBAE1B,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,kBAAkB,CAAA;KAAE;CAQ7D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,kBAAkB,EAClB,WAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,WAAW,EACZ,EAAE;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,WAAW,CAAC,EAAE,qBAAqB,EAAE,CAAA;IACrC,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC,cAAc,CAAC,CAyF1B"}
|
package/dist/processRequest.js
CHANGED
|
@@ -19,7 +19,7 @@ import { log } from './log.js';
|
|
|
19
19
|
import { appConnectRequestOf, classifyRequest, queriesOf } from './classify.js';
|
|
20
20
|
import { composeVp } from './composeVp.js';
|
|
21
21
|
import { negotiateCryptosuite } from './presentationSuite.js';
|
|
22
|
-
import {
|
|
22
|
+
import { exclusiveQueryTypeOf } from './queryPredicates.js';
|
|
23
23
|
/**
|
|
24
24
|
* Extracts the host (`host:port`) from a value that may be a full URL or a bare
|
|
25
25
|
* host / host:port. Returns undefined if it cannot be parsed.
|
|
@@ -37,7 +37,7 @@ function hostOf(value) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Domain-binding check (VCALM
|
|
40
|
+
* Domain-binding check (VCALM section 3.4.3 advisement): a DID-Auth `domain` MUST match
|
|
41
41
|
* the channel the request arrived on, otherwise a dishonest verifier could relay
|
|
42
42
|
* the challenge from another origin and replay the response.
|
|
43
43
|
*
|
|
@@ -55,6 +55,23 @@ export function domainMatchesOrigin({ domain, origin }) {
|
|
|
55
55
|
const domainHost = hostOf(domain);
|
|
56
56
|
return !!originHost && originHost === domainHost;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Raised by {@link processRequest} when the request carries an exclusive query
|
|
60
|
+
* type it has no processor for (today the `WalletOnboardingQuery`, which a
|
|
61
|
+
* wallet routes to its own flow before calling in). The `queryType` rides
|
|
62
|
+
* along so a caller can dispatch to that flow. Dispatch on `err.name` rather
|
|
63
|
+
* than `instanceof`, as with the package's other errors: the caller may hold a
|
|
64
|
+
* different copy of this package, which makes the name the stable contract.
|
|
65
|
+
*/
|
|
66
|
+
export class ExclusiveQueryUnsupportedError extends Error {
|
|
67
|
+
queryType;
|
|
68
|
+
constructor({ queryType }) {
|
|
69
|
+
super(`A ${queryType} request has no processor in processRequest; ` +
|
|
70
|
+
'the wallet handles it in its own flow.');
|
|
71
|
+
this.name = 'ExclusiveQueryUnsupportedError';
|
|
72
|
+
this.queryType = queryType;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
58
75
|
/**
|
|
59
76
|
* Processes a Verifiable Presentation Request and composes the wallet's
|
|
60
77
|
* response. Assumes the user has already consented and (for VC sharing) picked
|
|
@@ -90,13 +107,22 @@ export async function processRequest({ request, presentationSigner, selectedVCs
|
|
|
90
107
|
throw new Error(`DID Auth domain "${domain}" does not match request origin ` +
|
|
91
108
|
`"${credentialRequestOrigin}".`);
|
|
92
109
|
}
|
|
110
|
+
// An exclusive query type stands alone in a request (`exclusiveQueryTypeOf`
|
|
111
|
+
// throws on a mixture). App Connect is the one this function has a processor
|
|
112
|
+
// for; any other (a `WalletOnboardingQuery`) is routed by the wallet to its
|
|
113
|
+
// own flow before it gets here, so reaching this point with one is a refusal,
|
|
114
|
+
// not an empty generic response.
|
|
115
|
+
const exclusiveType = exclusiveQueryTypeOf(queries);
|
|
116
|
+
if (exclusiveType !== undefined && exclusiveType !== 'AppConnectQuery') {
|
|
117
|
+
throw new ExclusiveQueryUnsupportedError({ queryType: exclusiveType });
|
|
118
|
+
}
|
|
93
119
|
// An App Connect request takes its own single-round branch, handled by the
|
|
94
120
|
// injected processor. The requesting origin is what the app key is bound to
|
|
95
121
|
// (and what the query's `appUrl` is validated against), so it is required;
|
|
96
122
|
// the query itself is validated here (`appConnectRequestOf` throws on a
|
|
97
123
|
// malformed `app` block), so the processor only ever sees a well-formed
|
|
98
124
|
// request whose `appUrl` is already in serialized form.
|
|
99
|
-
if (
|
|
125
|
+
if (exclusiveType === 'AppConnectQuery') {
|
|
100
126
|
if (!processors?.processAppConnect) {
|
|
101
127
|
throw new Error('An App Connect request was received but no processAppConnect ' +
|
|
102
128
|
'processor was provided.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../src/processRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../src/processRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAW3D;;;GAGG;AACH,SAAS,MAAM,CAAC,KAAa;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC/B,CAAC,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CAAA;QAChE,CAAC;QACD,OAAO,UAAU,CAAC,iBAAiB,CAAC;YAClC,OAAO;YACP,UAAU;YACV,MAAM,EAAE,uBAAuB;YAC/B,SAAS;YACT,MAAM;YACN,gBAAgB,EAAE,OAAO;YACzB,WAAW,EAAE,qBAAqB;SACnC,CAAC,CAAA;IACJ,CAAC;IAED,uEAAuE;IACvE,MAAM,KAAK,GACT,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,EAAE,YAAY;QACjD,CAAC,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;QACjD,CAAC,CAAC,EAAE,CAAA;IAER,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/D,mEAAmE;QACnE,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,sBAAsB,GAAG,MAAM,SAAS,CAAC;QAC7C,kBAAkB;QAClB,WAAW,EAAE,WAAW;QACxB,SAAS;QACT,MAAM;QACN,gBAAgB,EAAE,OAAO;QACzB,WAAW,EAAE,qBAAqB;QAClC,KAAK;KACN,CAAC,CAAA;IACF,2EAA2E;IAC3E,6EAA6E;IAC7E,uBAAuB;IACvB,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAA;AAC1C,CAAC"}
|
|
@@ -9,9 +9,18 @@
|
|
|
9
9
|
* `WalletOnboardingQuery` without pulling `classify.ts`'s heavier graph.
|
|
10
10
|
*/
|
|
11
11
|
import type { IVPRQuery, IZcapQuery } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Normalizes a value that a wire format allows as either a single entry or an
|
|
14
|
+
* array of entries (a VPR `query`, a `credentialQuery`, a `capabilityQuery`,
|
|
15
|
+
* a JSON-LD `@context`) to an array. An absent value yields `[]`.
|
|
16
|
+
*
|
|
17
|
+
* @param value {T | T[] | undefined}
|
|
18
|
+
* @returns {T[]}
|
|
19
|
+
*/
|
|
20
|
+
export declare function toArray<T>(value: T | T[] | undefined): T[];
|
|
12
21
|
/**
|
|
13
22
|
* Whether a query is a standalone capability query, under either type string:
|
|
14
|
-
* `AuthorizationCapabilityQuery` (the canonical VCALM
|
|
23
|
+
* `AuthorizationCapabilityQuery` (the canonical VCALM name) or the legacy
|
|
15
24
|
* `ZcapQuery`.
|
|
16
25
|
*
|
|
17
26
|
* The one reader of that alias pair. Both exclusivity checks and both
|
|
@@ -22,6 +31,21 @@ import type { IVPRQuery, IZcapQuery } from './types.js';
|
|
|
22
31
|
* @returns {boolean}
|
|
23
32
|
*/
|
|
24
33
|
export declare function isZcapQuery(query: IVPRQuery): query is IZcapQuery;
|
|
34
|
+
/**
|
|
35
|
+
* The queries of a set carrying the given `type` string, when the request may
|
|
36
|
+
* carry at most one: returns `null` for none, the one query for exactly one,
|
|
37
|
+
* and throws for more. The one home of the at-most-one rule, shared by the
|
|
38
|
+
* `DIDAuthentication` check and the exclusive-type check.
|
|
39
|
+
*
|
|
40
|
+
* @param options {object}
|
|
41
|
+
* @param options.queries {IVPRQuery[]}
|
|
42
|
+
* @param options.typeName {string}
|
|
43
|
+
* @returns {IVPRQuery | null}
|
|
44
|
+
*/
|
|
45
|
+
export declare function singleQueryOfType({ queries, typeName }: {
|
|
46
|
+
queries: IVPRQuery[];
|
|
47
|
+
typeName: string;
|
|
48
|
+
}): IVPRQuery | null;
|
|
25
49
|
/**
|
|
26
50
|
* The query types that stand alone in a request under the
|
|
27
51
|
* one-mental-model-per-exchange rule: a screen that asks the person to
|
|
@@ -37,34 +61,6 @@ export declare const EXCLUSIVE_QUERY_TYPES: readonly ["AppConnectQuery", "Wallet
|
|
|
37
61
|
* A member of {@link EXCLUSIVE_QUERY_TYPES}.
|
|
38
62
|
*/
|
|
39
63
|
export type ExclusiveQueryType = (typeof EXCLUSIVE_QUERY_TYPES)[number];
|
|
40
|
-
/**
|
|
41
|
-
* Whether a query is an `AppConnectQuery`. Callers filtering on this still
|
|
42
|
-
* cast the result to `IAppConnectQuery[]` (see {@link isQueryOfType}).
|
|
43
|
-
*
|
|
44
|
-
* @param query {IVPRQuery}
|
|
45
|
-
* @returns {boolean}
|
|
46
|
-
*/
|
|
47
|
-
export declare function isAppConnectQuery(query: IVPRQuery): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Whether a query set carries an `AppConnectQuery` at all: the gate
|
|
50
|
-
* `processRequest` takes its App Connect branch on, and the presence half of
|
|
51
|
-
* `appConnectRequestOf`'s extraction. The gate cannot simply run the
|
|
52
|
-
* extractor, since the extractor needs the requesting origin whose absence
|
|
53
|
-
* the gate must report, so the two share this predicate instead of each
|
|
54
|
-
* filtering on the type string.
|
|
55
|
-
*
|
|
56
|
-
* @param queries {IVPRQuery[]}
|
|
57
|
-
* @returns {boolean}
|
|
58
|
-
*/
|
|
59
|
-
export declare function hasAppConnectQuery(queries: IVPRQuery[]): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Whether a query is a `WalletOnboardingQuery`. Matched the same way as
|
|
62
|
-
* {@link isAppConnectQuery}.
|
|
63
|
-
*
|
|
64
|
-
* @param query {IVPRQuery}
|
|
65
|
-
* @returns {boolean}
|
|
66
|
-
*/
|
|
67
|
-
export declare function isWalletOnboardingQuery(query: IVPRQuery): boolean;
|
|
68
64
|
/**
|
|
69
65
|
* The singleton query of a set for one of the {@link EXCLUSIVE_QUERY_TYPES}.
|
|
70
66
|
* Returns `null` when no query of the type is present, the one query when
|
|
@@ -72,17 +68,32 @@ export declare function isWalletOnboardingQuery(query: IVPRQuery): boolean;
|
|
|
72
68
|
* mutually exclusive type sits beside it: `QueryByExample`, a standalone
|
|
73
69
|
* capability query, or any other exclusive type. The exclusion list is
|
|
74
70
|
* derived from the shared set rather than written per caller, so no type can
|
|
75
|
-
* be excluded from one direction only.
|
|
71
|
+
* be excluded from one direction only. The type parameter names the extension
|
|
72
|
+
* query shape the caller reads (see {@link isQueryOfType} for why it is an
|
|
73
|
+
* upcast rather than a narrowing).
|
|
76
74
|
*
|
|
77
75
|
* @param options {object}
|
|
78
76
|
* @param options.queries {IVPRQuery[]} the request's query set
|
|
79
77
|
* @param options.typeName {ExclusiveQueryType} the singleton's type
|
|
80
|
-
* @returns {
|
|
78
|
+
* @returns {Query | null}
|
|
81
79
|
*/
|
|
82
|
-
export declare function exclusiveQueryOf({ queries, typeName }: {
|
|
80
|
+
export declare function exclusiveQueryOf<Query = IVPRQuery>({ queries, typeName }: {
|
|
83
81
|
queries: IVPRQuery[];
|
|
84
82
|
typeName: ExclusiveQueryType;
|
|
85
|
-
}):
|
|
83
|
+
}): Query | null;
|
|
84
|
+
/**
|
|
85
|
+
* Which of the {@link EXCLUSIVE_QUERY_TYPES} a query set carries, or
|
|
86
|
+
* `undefined` when none. Runs {@link exclusiveQueryOf} for every member, so a
|
|
87
|
+
* set that mixes an exclusive type with `QueryByExample`, a standalone
|
|
88
|
+
* capability query, or another exclusive type throws here whichever type is
|
|
89
|
+
* asked about. `processRequest` dispatches on the result: the one type it has
|
|
90
|
+
* a processor for takes its own branch, and any other is refused rather than
|
|
91
|
+
* answered on the generic half of the request.
|
|
92
|
+
*
|
|
93
|
+
* @param queries {IVPRQuery[]}
|
|
94
|
+
* @returns {ExclusiveQueryType | undefined}
|
|
95
|
+
*/
|
|
96
|
+
export declare function exclusiveQueryTypeOf(queries: IVPRQuery[]): ExclusiveQueryType | undefined;
|
|
86
97
|
/**
|
|
87
98
|
* Parses a wire value as an absolute URL with no fragment: the shared core
|
|
88
99
|
* every request field that copies a URL verbatim from an untrusted body
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryPredicates.d.ts","sourceRoot":"","sources":["../src/queryPredicates.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,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nB,kBAAkB,GAAG,SAAS,CAIhC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,kBAAkB,EAClB,eAAe,EAChB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,GAAG,CAWN"}
|
package/dist/queryPredicates.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a value that a wire format allows as either a single entry or an
|
|
3
|
+
* array of entries (a VPR `query`, a `credentialQuery`, a `capabilityQuery`,
|
|
4
|
+
* a JSON-LD `@context`) to an array. An absent value yields `[]`.
|
|
5
|
+
*
|
|
6
|
+
* @param value {T | T[] | undefined}
|
|
7
|
+
* @returns {T[]}
|
|
8
|
+
*/
|
|
9
|
+
export function toArray(value) {
|
|
10
|
+
if (value === undefined) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
return Array.isArray(value) ? value : [value];
|
|
14
|
+
}
|
|
1
15
|
/**
|
|
2
16
|
* Whether a query is a standalone capability query, under either type string:
|
|
3
|
-
* `AuthorizationCapabilityQuery` (the canonical VCALM
|
|
17
|
+
* `AuthorizationCapabilityQuery` (the canonical VCALM name) or the legacy
|
|
4
18
|
* `ZcapQuery`.
|
|
5
19
|
*
|
|
6
20
|
* The one reader of that alias pair. Both exclusivity checks and both
|
|
@@ -13,6 +27,24 @@
|
|
|
13
27
|
export function isZcapQuery(query) {
|
|
14
28
|
return (query.type === 'AuthorizationCapabilityQuery' || query.type === 'ZcapQuery');
|
|
15
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The queries of a set carrying the given `type` string, when the request may
|
|
32
|
+
* carry at most one: returns `null` for none, the one query for exactly one,
|
|
33
|
+
* and throws for more. The one home of the at-most-one rule, shared by the
|
|
34
|
+
* `DIDAuthentication` check and the exclusive-type check.
|
|
35
|
+
*
|
|
36
|
+
* @param options {object}
|
|
37
|
+
* @param options.queries {IVPRQuery[]}
|
|
38
|
+
* @param options.typeName {string}
|
|
39
|
+
* @returns {IVPRQuery | null}
|
|
40
|
+
*/
|
|
41
|
+
export function singleQueryOfType({ queries, typeName }) {
|
|
42
|
+
const matches = queries.filter(query => isQueryOfType({ query, typeName }));
|
|
43
|
+
if (matches.length > 1) {
|
|
44
|
+
throw new Error(`More than one ${typeName} found, exiting.`);
|
|
45
|
+
}
|
|
46
|
+
return matches[0] ?? null;
|
|
47
|
+
}
|
|
16
48
|
/**
|
|
17
49
|
* The query types that stand alone in a request under the
|
|
18
50
|
* one-mental-model-per-exchange rule: a screen that asks the person to
|
|
@@ -28,8 +60,7 @@ export const EXCLUSIVE_QUERY_TYPES = [
|
|
|
28
60
|
'WalletOnboardingQuery'
|
|
29
61
|
];
|
|
30
62
|
/**
|
|
31
|
-
* Whether a query carries the given `type` string.
|
|
32
|
-
* type test in this file runs through: `AppConnectQuery` and
|
|
63
|
+
* Whether a query carries the given `type` string. `AppConnectQuery` and
|
|
33
64
|
* `WalletOnboardingQuery` extend the spec query union rather than being part
|
|
34
65
|
* of it, so they are matched by `type` string and upcast rather than narrowed
|
|
35
66
|
* via a type predicate.
|
|
@@ -42,40 +73,6 @@ export const EXCLUSIVE_QUERY_TYPES = [
|
|
|
42
73
|
function isQueryOfType({ query, typeName }) {
|
|
43
74
|
return query.type === typeName;
|
|
44
75
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Whether a query is an `AppConnectQuery`. Callers filtering on this still
|
|
47
|
-
* cast the result to `IAppConnectQuery[]` (see {@link isQueryOfType}).
|
|
48
|
-
*
|
|
49
|
-
* @param query {IVPRQuery}
|
|
50
|
-
* @returns {boolean}
|
|
51
|
-
*/
|
|
52
|
-
export function isAppConnectQuery(query) {
|
|
53
|
-
return isQueryOfType({ query, typeName: 'AppConnectQuery' });
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Whether a query set carries an `AppConnectQuery` at all: the gate
|
|
57
|
-
* `processRequest` takes its App Connect branch on, and the presence half of
|
|
58
|
-
* `appConnectRequestOf`'s extraction. The gate cannot simply run the
|
|
59
|
-
* extractor, since the extractor needs the requesting origin whose absence
|
|
60
|
-
* the gate must report, so the two share this predicate instead of each
|
|
61
|
-
* filtering on the type string.
|
|
62
|
-
*
|
|
63
|
-
* @param queries {IVPRQuery[]}
|
|
64
|
-
* @returns {boolean}
|
|
65
|
-
*/
|
|
66
|
-
export function hasAppConnectQuery(queries) {
|
|
67
|
-
return queries.some(isAppConnectQuery);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Whether a query is a `WalletOnboardingQuery`. Matched the same way as
|
|
71
|
-
* {@link isAppConnectQuery}.
|
|
72
|
-
*
|
|
73
|
-
* @param query {IVPRQuery}
|
|
74
|
-
* @returns {boolean}
|
|
75
|
-
*/
|
|
76
|
-
export function isWalletOnboardingQuery(query) {
|
|
77
|
-
return isQueryOfType({ query, typeName: 'WalletOnboardingQuery' });
|
|
78
|
-
}
|
|
79
76
|
/**
|
|
80
77
|
* The indefinite article a type name takes in a refusal message.
|
|
81
78
|
*
|
|
@@ -92,21 +89,20 @@ function articleFor(typeName) {
|
|
|
92
89
|
* mutually exclusive type sits beside it: `QueryByExample`, a standalone
|
|
93
90
|
* capability query, or any other exclusive type. The exclusion list is
|
|
94
91
|
* derived from the shared set rather than written per caller, so no type can
|
|
95
|
-
* be excluded from one direction only.
|
|
92
|
+
* be excluded from one direction only. The type parameter names the extension
|
|
93
|
+
* query shape the caller reads (see {@link isQueryOfType} for why it is an
|
|
94
|
+
* upcast rather than a narrowing).
|
|
96
95
|
*
|
|
97
96
|
* @param options {object}
|
|
98
97
|
* @param options.queries {IVPRQuery[]} the request's query set
|
|
99
98
|
* @param options.typeName {ExclusiveQueryType} the singleton's type
|
|
100
|
-
* @returns {
|
|
99
|
+
* @returns {Query | null}
|
|
101
100
|
*/
|
|
102
101
|
export function exclusiveQueryOf({ queries, typeName }) {
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
102
|
+
const match = singleQueryOfType({ queries, typeName });
|
|
103
|
+
if (match === null) {
|
|
105
104
|
return null;
|
|
106
105
|
}
|
|
107
|
-
if (matches.length > 1) {
|
|
108
|
-
throw new Error(`More than one ${typeName} found, exiting.`);
|
|
109
|
-
}
|
|
110
106
|
const otherTypes = EXCLUSIVE_QUERY_TYPES.filter(other => other !== typeName);
|
|
111
107
|
const isExcluded = (query) => query.type === 'QueryByExample' ||
|
|
112
108
|
isZcapQuery(query) ||
|
|
@@ -118,7 +114,22 @@ export function exclusiveQueryOf({ queries, typeName }) {
|
|
|
118
114
|
throw new Error(`${capitalized} ${typeName} cannot be combined with QueryByExample, ` +
|
|
119
115
|
`standalone capability queries, or ${others.join(', or ')}.`);
|
|
120
116
|
}
|
|
121
|
-
return
|
|
117
|
+
return match;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Which of the {@link EXCLUSIVE_QUERY_TYPES} a query set carries, or
|
|
121
|
+
* `undefined` when none. Runs {@link exclusiveQueryOf} for every member, so a
|
|
122
|
+
* set that mixes an exclusive type with `QueryByExample`, a standalone
|
|
123
|
+
* capability query, or another exclusive type throws here whichever type is
|
|
124
|
+
* asked about. `processRequest` dispatches on the result: the one type it has
|
|
125
|
+
* a processor for takes its own branch, and any other is refused rather than
|
|
126
|
+
* answered on the generic half of the request.
|
|
127
|
+
*
|
|
128
|
+
* @param queries {IVPRQuery[]}
|
|
129
|
+
* @returns {ExclusiveQueryType | undefined}
|
|
130
|
+
*/
|
|
131
|
+
export function exclusiveQueryTypeOf(queries) {
|
|
132
|
+
return EXCLUSIVE_QUERY_TYPES.find(typeName => exclusiveQueryOf({ queries, typeName }) !== null);
|
|
122
133
|
}
|
|
123
134
|
/**
|
|
124
135
|
* Parses a wire value as an absolute URL with no fragment: the shared core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryPredicates.js","sourceRoot":"","sources":["../src/queryPredicates.ts"],"names":[],"mappings":"AAYA
|
|
1
|
+
{"version":3,"file":"queryPredicates.js","sourceRoot":"","sources":["../src/queryPredicates.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAI,KAA0B;IACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAA;IACX,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,KAAgB;IAC1C,OAAO,CACL,KAAK,CAAC,IAAI,KAAK,8BAA8B,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAC5E,CAAA;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,OAAO,EACP,QAAQ,EAIT;IACC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;IAC3E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,kBAAkB,CAAC,CAAA;IAC9D,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB;IACjB,uBAAuB;CACf,CAAA;AAOV;;;;;;;;;;GAUG;AACH,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,QAAQ,EAIT;IACC,OAAQ,KAAK,CAAC,IAAe,KAAK,QAAQ,CAAA;AAC5C,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CA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H,MAAM,UAAU,oBAAoB,CAClC,OAAoB;IAEpB,OAAO,qBAAqB,CAAC,IAAI,CAC/B,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,IAAI,CAC7D,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,kBAAkB,EAClB,eAAe,EAKhB;IACC,IAAI,GAAQ,CAAA;IACZ,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACrD,CAAC;IACD,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import type { ISigner } from '@interop/data-integrity-core';
|
|
26
26
|
import type { IVerifiableCredential, IVerifiablePresentation, IZcap } from '@interop/data-integrity-core';
|
|
27
27
|
import type { ICapabilityQueryDetail, IQueryByExample, IVPRDetails as ISpecVPRDetails, WalletResponse } from '@interop/data-integrity-core/vpr';
|
|
28
|
-
export type { IVPRequest, IVPOffer, IIssueRequest, IExchangeInvitation, IOid4VCIOffer, IVPRInteract, IVPRQuery, IQueryByExample, ICredentialQuery, IAcceptedCryptosuites, IDIDAuthenticationQuery, IZcapQuery, ICapabilityQueryDetail, IInvocationTarget, IAllowedAction, WalletApiMessage, WalletResponse
|
|
28
|
+
export type { IVPRequest, IVPOffer, IIssueRequest, IExchangeInvitation, IOid4VCIOffer, IVPRInteract, IVPRQuery, IQueryByExample, ICredentialQuery, IAcceptedCryptosuites, IDIDAuthenticationQuery, IZcapQuery, ICapabilityQueryDetail, IInvocationTarget, IAllowedAction, WalletApiMessage, WalletResponse } from '@interop/data-integrity-core/vpr';
|
|
29
29
|
export type { IVerifiableCredential, IVerifiablePresentation, IZcap } from '@interop/data-integrity-core';
|
|
30
30
|
/**
|
|
31
31
|
* The protocol handles a verifier offers alongside a CHAPI request. Only
|
|
@@ -135,7 +135,7 @@ export interface WalletRequestProfile {
|
|
|
135
135
|
export type IAppConnectCapabilityQuery = Omit<ICapabilityQueryDetail, 'controller' | 'reason'>;
|
|
136
136
|
/**
|
|
137
137
|
* The app identity an App Connect request presents: a display `name` for the
|
|
138
|
-
* consent surface (attacker-controlled free text,
|
|
138
|
+
* consent surface (attacker-controlled free text, not evidence of identity)
|
|
139
139
|
* and the application's canonical `appUrl`, which scopes the app-key identity
|
|
140
140
|
* within the requesting origin. Validated by `appConnectRequestOf`: the
|
|
141
141
|
* `appUrl` must parse as an absolute URL, carry no fragment, and be
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,EACN,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,WAAW,IAAI,eAAe,EAC9B,cAAc,EACf,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA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