@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/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Request exchange: everything between "the user scanned or pasted something" and
|
|
|
38
38
|
response presentation, embedding any grants before signing so the DIDAuth
|
|
39
39
|
proof covers them; `presentationSuite.ts` negotiates the cryptosuite.
|
|
40
40
|
- **The App Connect app-key credential** -- `appKey.ts`: matching, minting, the
|
|
41
|
-
store-time refusal policy
|
|
41
|
+
store-time refusal policy.
|
|
42
42
|
- **The `WalletOnboardingQuery` transport vocabulary** -- `onboarding.ts`: the
|
|
43
43
|
inviter's compose helper and the enrollee's classification, over a query
|
|
44
44
|
carrying the account pointer and controller.
|
package/dist/appKey.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const APP_KEY_KEY_NAME = "app-key";
|
|
|
20
20
|
* internal consistency, never its provenance (a fully attacker-generated
|
|
21
21
|
* credential binds perfectly). That is exactly why external ingest refuses on
|
|
22
22
|
* the marker alone, binding or not ({@link assertStorableAppKey}): app keys
|
|
23
|
-
* are wallet-minted,
|
|
23
|
+
* are wallet-minted only, and are not imported.
|
|
24
24
|
*/
|
|
25
25
|
export declare const APP_KEY_CREDENTIAL_TYPE = "AppKeyCredential";
|
|
26
26
|
/**
|
|
@@ -67,7 +67,7 @@ export declare class AppKeyRefusedError extends Error {
|
|
|
67
67
|
* app's `origin` and `appUrl`, self-issued), and storing it would make its
|
|
68
68
|
* DID the controller the wallet delegates the user's storage to. So there is
|
|
69
69
|
* no "binds, so it stores" carve-out here: app-key credentials are
|
|
70
|
-
* wallet-minted,
|
|
70
|
+
* wallet-minted only, not imported, and only the wallet's own mint path may
|
|
71
71
|
* store one.
|
|
72
72
|
*
|
|
73
73
|
* A credential with no marker is left alone, so an ordinary credential that
|
|
@@ -125,22 +125,16 @@ export declare function assertMintedAppKey(credential: IVerifiableCredential): P
|
|
|
125
125
|
* requesting origin. Sorting here (rather than after the binding check) lets
|
|
126
126
|
* {@link findAppKeyCredential} stop at the newest credential that binds.
|
|
127
127
|
*
|
|
128
|
-
* The legacy path ({@link findLegacyAppKeyCredential}) is the same chain
|
|
129
|
-
* with `appUrl` undefined: it selects the credentials carrying no
|
|
130
|
-
* `credentialSubject.appUrl` claim, so one predicate set and one sort serve
|
|
131
|
-
* both paths and a hardening applied here reaches the legacy path too.
|
|
132
|
-
*
|
|
133
128
|
* @param options {object}
|
|
134
129
|
* @param options.credentials {IVerifiableCredential[]}
|
|
135
|
-
* @param
|
|
136
|
-
*
|
|
137
|
-
* `appUrl` claim.
|
|
130
|
+
* @param options.appUrl {string} - The request's `app.appUrl` in serialized
|
|
131
|
+
* form.
|
|
138
132
|
* @param options.origin {string} - The attested requesting origin.
|
|
139
133
|
* @returns {IVerifiableCredential[]}
|
|
140
134
|
*/
|
|
141
135
|
export declare function appKeyCandidates({ credentials, appUrl, origin }: {
|
|
142
136
|
credentials: IVerifiableCredential[];
|
|
143
|
-
appUrl: string
|
|
137
|
+
appUrl: string;
|
|
144
138
|
origin: string;
|
|
145
139
|
}): IVerifiableCredential[];
|
|
146
140
|
/**
|
|
@@ -165,9 +159,9 @@ export declare function findAppKeyCredential({ credentials, appUrl, origin }: {
|
|
|
165
159
|
* the fixed two-entry type array, the hosted App Connect context URL, issuer
|
|
166
160
|
* and subject both the seed-derived DID, and the `seed` / `appUrl` / `origin`
|
|
167
161
|
* claims. `vc.issue` auto-fills `issuanceDate` in the canonical UTC form the
|
|
168
|
-
* ranking expects.
|
|
169
|
-
*
|
|
170
|
-
*
|
|
162
|
+
* ranking expects. Behind the fresh mint, and exported for an application's
|
|
163
|
+
* own self-issue path (dev-grant provisioning, tests), so the credential's
|
|
164
|
+
* shape is maintained in one place.
|
|
171
165
|
*
|
|
172
166
|
* @param options {object}
|
|
173
167
|
* @param options.seedBytes {Uint8Array} - The 32-byte master seed; the
|
|
@@ -177,18 +171,15 @@ export declare function findAppKeyCredential({ credentials, appUrl, origin }: {
|
|
|
177
171
|
* @param options.appUrl {string} - The app's canonical URL, already in
|
|
178
172
|
* serialized form.
|
|
179
173
|
* @param options.origin {string} - The attested requesting origin.
|
|
180
|
-
* @param [options.description] {string} - Overrides the default consent
|
|
181
|
-
* sentence (the legacy re-issue carries the old credential's forward).
|
|
182
174
|
* @param [options.documentLoader] {IDocumentLoader} - JSON-LD loader; defaults
|
|
183
175
|
* to the shared security loader.
|
|
184
176
|
* @returns {Promise<{ credential: IVerifiableCredential; subjectDid: string }>}
|
|
185
177
|
*/
|
|
186
|
-
export declare function issueAppKeyCredential({ seedBytes, appName, appUrl, origin,
|
|
178
|
+
export declare function issueAppKeyCredential({ seedBytes, appName, appUrl, origin, documentLoader: loader }: {
|
|
187
179
|
seedBytes: Uint8Array;
|
|
188
180
|
appName: string;
|
|
189
181
|
appUrl: string;
|
|
190
182
|
origin: string;
|
|
191
|
-
description?: string;
|
|
192
183
|
documentLoader?: IDocumentLoader;
|
|
193
184
|
}): Promise<{
|
|
194
185
|
credential: IVerifiableCredential;
|
|
@@ -217,57 +208,6 @@ export declare function mintAppKeyCredential({ app, origin }: {
|
|
|
217
208
|
credential: IVerifiableCredential;
|
|
218
209
|
subjectDid: string;
|
|
219
210
|
}>;
|
|
220
|
-
/**
|
|
221
|
-
* The latest legacy app-key credential for an origin, or undefined. A legacy
|
|
222
|
-
* credential predates the `appUrl` model: it carries the marker and a
|
|
223
|
-
* per-app third type entry, but no `credentialSubject.appUrl` claim. Its
|
|
224
|
-
* identity was scoped to (origin, `credentialType`), and the request no
|
|
225
|
-
* longer carries a `credentialType` to select on, so the mapping is
|
|
226
|
-
* recoverable only when it is unambiguous: when the binding legacy candidates
|
|
227
|
-
* for the origin all name one subject DID. Two distinct legacy identities on
|
|
228
|
-
* one origin yield undefined rather than a guess -- re-issuing the wrong one
|
|
229
|
-
* would hand one application another's identity, which is worse than the
|
|
230
|
-
* caller treating the connect as a first run.
|
|
231
|
-
*
|
|
232
|
-
* @param options {object}
|
|
233
|
-
* @param options.credentials {IVerifiableCredential[]}
|
|
234
|
-
* @param options.origin {string} - The attested requesting origin.
|
|
235
|
-
* @returns {Promise<IVerifiableCredential | undefined>}
|
|
236
|
-
*/
|
|
237
|
-
export declare function findLegacyAppKeyCredential({ credentials, origin }: {
|
|
238
|
-
credentials: IVerifiableCredential[];
|
|
239
|
-
origin: string;
|
|
240
|
-
}): Promise<IVerifiableCredential | undefined>;
|
|
241
|
-
/**
|
|
242
|
-
* Re-issues a legacy app-key credential in place under the `appUrl` model:
|
|
243
|
-
* the same seed (so the same derived DID -- the app's identity and its
|
|
244
|
-
* encrypted-data access are preserved), the fixed two-entry type array, the
|
|
245
|
-
* hosted App Connect context URL, and the `credentialSubject.appUrl` claim set
|
|
246
|
-
* from the validated request value. A fresh mint would roll the seed and orphan
|
|
247
|
-
* the identity, and must never be the migration path. The fresh
|
|
248
|
-
* `issuanceDate` ranks the re-issued credential ahead of the legacy one, so
|
|
249
|
-
* subsequent connects match it directly.
|
|
250
|
-
*
|
|
251
|
-
* Does NOT store the result; the caller stores it through the mint door
|
|
252
|
-
* (it satisfies {@link assertMintedAppKey}) and may retire the legacy record.
|
|
253
|
-
*
|
|
254
|
-
* @param options {object}
|
|
255
|
-
* @param options.credential {IVerifiableCredential} - The legacy credential;
|
|
256
|
-
* it must bind per {@link appKeySeedBindsSubject} and be bound to `origin`,
|
|
257
|
-
* else this throws {@link AppKeyMintInvariantError}.
|
|
258
|
-
* @param options.app {IAppConnectApp} - The validated app identity; its
|
|
259
|
-
* `appUrl` must already be in serialized form.
|
|
260
|
-
* @param options.origin {string} - The attested requesting origin.
|
|
261
|
-
* @returns {Promise<{ credential: IVerifiableCredential; subjectDid: string }>}
|
|
262
|
-
*/
|
|
263
|
-
export declare function reissueAppKeyCredential({ credential, app, origin }: {
|
|
264
|
-
credential: IVerifiableCredential;
|
|
265
|
-
app: IAppConnectApp;
|
|
266
|
-
origin: string;
|
|
267
|
-
}): Promise<{
|
|
268
|
-
credential: IVerifiableCredential;
|
|
269
|
-
subjectDid: string;
|
|
270
|
-
}>;
|
|
271
211
|
/**
|
|
272
212
|
* The subject DID (`credentialSubject.id`) of an app-key credential, or
|
|
273
213
|
* undefined. For a valid app-key credential this equals the issuer.
|
|
@@ -286,7 +226,7 @@ export declare function appKeySubjectDid(credential: IVerifiableCredential): str
|
|
|
286
226
|
export declare function appKeyOrigin(credential: IVerifiableCredential): string | undefined;
|
|
287
227
|
/**
|
|
288
228
|
* The application URL (`credentialSubject.appUrl`) an app-key credential is
|
|
289
|
-
* scoped to, when present.
|
|
229
|
+
* scoped to, when present.
|
|
290
230
|
*
|
|
291
231
|
* @param credential {IVerifiableCredential}
|
|
292
232
|
* @returns {string | undefined}
|
package/dist/appKey.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../src/appKey.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,8BAA8B,CAAA;AAMrC,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAShD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAA;AAIzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAG9C,CAAA;AAEF;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAOlC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,qBAAqB,GAAG,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M,EACP,EAAE;IACD,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,qBAAqB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAQrE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,qBAAqB,GAChC,MAAM,GAAG,SAAS,CAEpB;AAqDD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,qBAAqB,GAChC,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,qBAAqB,GAChC,MAAM,GAAG,SAAS,CAEpB"}
|
package/dist/appKey.js
CHANGED
|
@@ -57,7 +57,7 @@ const VC_1_CONTEXT_URL = 'https://www.w3.org/2018/credentials/v1';
|
|
|
57
57
|
* internal consistency, never its provenance (a fully attacker-generated
|
|
58
58
|
* credential binds perfectly). That is exactly why external ingest refuses on
|
|
59
59
|
* the marker alone, binding or not ({@link assertStorableAppKey}): app keys
|
|
60
|
-
* are wallet-minted,
|
|
60
|
+
* are wallet-minted only, and are not imported.
|
|
61
61
|
*/
|
|
62
62
|
export const APP_KEY_CREDENTIAL_TYPE = 'AppKeyCredential';
|
|
63
63
|
/**
|
|
@@ -117,7 +117,7 @@ export class AppKeyRefusedError extends Error {
|
|
|
117
117
|
* app's `origin` and `appUrl`, self-issued), and storing it would make its
|
|
118
118
|
* DID the controller the wallet delegates the user's storage to. So there is
|
|
119
119
|
* no "binds, so it stores" carve-out here: app-key credentials are
|
|
120
|
-
* wallet-minted,
|
|
120
|
+
* wallet-minted only, not imported, and only the wallet's own mint path may
|
|
121
121
|
* store one.
|
|
122
122
|
*
|
|
123
123
|
* A credential with no marker is left alone, so an ordinary credential that
|
|
@@ -206,7 +206,7 @@ function isSelfIssued(credential) {
|
|
|
206
206
|
* The instant a credential's `issuanceDate` denotes, or NaN when it is
|
|
207
207
|
* absent, not a string, or does not parse. Ranking is over instants, not raw
|
|
208
208
|
* strings: the ranking decides which DID the wallet delegates to, so a
|
|
209
|
-
* comparison manipulable by the
|
|
209
|
+
* comparison manipulable by the serialization of a date (a numeric offset,
|
|
210
210
|
* differing fractional-second precision) would reopen the planted-credential
|
|
211
211
|
* path in a narrower form.
|
|
212
212
|
*/
|
|
@@ -245,16 +245,10 @@ function byIssuanceInstantDesc(first, second) {
|
|
|
245
245
|
* requesting origin. Sorting here (rather than after the binding check) lets
|
|
246
246
|
* {@link findAppKeyCredential} stop at the newest credential that binds.
|
|
247
247
|
*
|
|
248
|
-
* The legacy path ({@link findLegacyAppKeyCredential}) is the same chain
|
|
249
|
-
* with `appUrl` undefined: it selects the credentials carrying no
|
|
250
|
-
* `credentialSubject.appUrl` claim, so one predicate set and one sort serve
|
|
251
|
-
* both paths and a hardening applied here reaches the legacy path too.
|
|
252
|
-
*
|
|
253
248
|
* @param options {object}
|
|
254
249
|
* @param options.credentials {IVerifiableCredential[]}
|
|
255
|
-
* @param
|
|
256
|
-
*
|
|
257
|
-
* `appUrl` claim.
|
|
250
|
+
* @param options.appUrl {string} - The request's `app.appUrl` in serialized
|
|
251
|
+
* form.
|
|
258
252
|
* @param options.origin {string} - The attested requesting origin.
|
|
259
253
|
* @returns {IVerifiableCredential[]}
|
|
260
254
|
*/
|
|
@@ -302,9 +296,9 @@ function defaultAppKeyDescription(appName) {
|
|
|
302
296
|
* the fixed two-entry type array, the hosted App Connect context URL, issuer
|
|
303
297
|
* and subject both the seed-derived DID, and the `seed` / `appUrl` / `origin`
|
|
304
298
|
* claims. `vc.issue` auto-fills `issuanceDate` in the canonical UTC form the
|
|
305
|
-
* ranking expects.
|
|
306
|
-
*
|
|
307
|
-
*
|
|
299
|
+
* ranking expects. Behind the fresh mint, and exported for an application's
|
|
300
|
+
* own self-issue path (dev-grant provisioning, tests), so the credential's
|
|
301
|
+
* shape is maintained in one place.
|
|
308
302
|
*
|
|
309
303
|
* @param options {object}
|
|
310
304
|
* @param options.seedBytes {Uint8Array} - The 32-byte master seed; the
|
|
@@ -314,13 +308,11 @@ function defaultAppKeyDescription(appName) {
|
|
|
314
308
|
* @param options.appUrl {string} - The app's canonical URL, already in
|
|
315
309
|
* serialized form.
|
|
316
310
|
* @param options.origin {string} - The attested requesting origin.
|
|
317
|
-
* @param [options.description] {string} - Overrides the default consent
|
|
318
|
-
* sentence (the legacy re-issue carries the old credential's forward).
|
|
319
311
|
* @param [options.documentLoader] {IDocumentLoader} - JSON-LD loader; defaults
|
|
320
312
|
* to the shared security loader.
|
|
321
313
|
* @returns {Promise<{ credential: IVerifiableCredential; subjectDid: string }>}
|
|
322
314
|
*/
|
|
323
|
-
export async function issueAppKeyCredential({ seedBytes, appName, appUrl, origin,
|
|
315
|
+
export async function issueAppKeyCredential({ seedBytes, appName, appUrl, origin, documentLoader: loader = documentLoader }) {
|
|
324
316
|
const agent = await CapabilityAgent.fromSeed({
|
|
325
317
|
seed: seedBytes,
|
|
326
318
|
handle: APP_KEY_HANDLE,
|
|
@@ -332,7 +324,7 @@ export async function issueAppKeyCredential({ seedBytes, appName, appUrl, origin
|
|
|
332
324
|
id: `urn:uuid:${crypto.randomUUID()}`,
|
|
333
325
|
type: [...APP_KEY_TYPE_ARRAY],
|
|
334
326
|
name: `${appName} app key`,
|
|
335
|
-
description,
|
|
327
|
+
description: defaultAppKeyDescription(appName),
|
|
336
328
|
issuer: controllerDid,
|
|
337
329
|
credentialSubject: {
|
|
338
330
|
id: controllerDid,
|
|
@@ -374,85 +366,6 @@ export async function mintAppKeyCredential({ app, origin }) {
|
|
|
374
366
|
origin
|
|
375
367
|
});
|
|
376
368
|
}
|
|
377
|
-
/**
|
|
378
|
-
* The latest legacy app-key credential for an origin, or undefined. A legacy
|
|
379
|
-
* credential predates the `appUrl` model: it carries the marker and a
|
|
380
|
-
* per-app third type entry, but no `credentialSubject.appUrl` claim. Its
|
|
381
|
-
* identity was scoped to (origin, `credentialType`), and the request no
|
|
382
|
-
* longer carries a `credentialType` to select on, so the mapping is
|
|
383
|
-
* recoverable only when it is unambiguous: when the binding legacy candidates
|
|
384
|
-
* for the origin all name one subject DID. Two distinct legacy identities on
|
|
385
|
-
* one origin yield undefined rather than a guess -- re-issuing the wrong one
|
|
386
|
-
* would hand one application another's identity, which is worse than the
|
|
387
|
-
* caller treating the connect as a first run.
|
|
388
|
-
*
|
|
389
|
-
* @param options {object}
|
|
390
|
-
* @param options.credentials {IVerifiableCredential[]}
|
|
391
|
-
* @param options.origin {string} - The attested requesting origin.
|
|
392
|
-
* @returns {Promise<IVerifiableCredential | undefined>}
|
|
393
|
-
*/
|
|
394
|
-
export async function findLegacyAppKeyCredential({ credentials, origin }) {
|
|
395
|
-
const candidates = appKeyCandidates({
|
|
396
|
-
credentials,
|
|
397
|
-
appUrl: undefined,
|
|
398
|
-
origin
|
|
399
|
-
});
|
|
400
|
-
const bound = [];
|
|
401
|
-
for (const candidate of candidates) {
|
|
402
|
-
if (await appKeySeedBindsSubject(candidate)) {
|
|
403
|
-
bound.push(candidate);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (bound.length === 0) {
|
|
407
|
-
return undefined;
|
|
408
|
-
}
|
|
409
|
-
const subjects = new Set(bound.map(credential => subjectId(credential)));
|
|
410
|
-
if (subjects.size > 1) {
|
|
411
|
-
return undefined;
|
|
412
|
-
}
|
|
413
|
-
return bound[0];
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Re-issues a legacy app-key credential in place under the `appUrl` model:
|
|
417
|
-
* the same seed (so the same derived DID -- the app's identity and its
|
|
418
|
-
* encrypted-data access are preserved), the fixed two-entry type array, the
|
|
419
|
-
* hosted App Connect context URL, and the `credentialSubject.appUrl` claim set
|
|
420
|
-
* from the validated request value. A fresh mint would roll the seed and orphan
|
|
421
|
-
* the identity, and must never be the migration path. The fresh
|
|
422
|
-
* `issuanceDate` ranks the re-issued credential ahead of the legacy one, so
|
|
423
|
-
* subsequent connects match it directly.
|
|
424
|
-
*
|
|
425
|
-
* Does NOT store the result; the caller stores it through the mint door
|
|
426
|
-
* (it satisfies {@link assertMintedAppKey}) and may retire the legacy record.
|
|
427
|
-
*
|
|
428
|
-
* @param options {object}
|
|
429
|
-
* @param options.credential {IVerifiableCredential} - The legacy credential;
|
|
430
|
-
* it must bind per {@link appKeySeedBindsSubject} and be bound to `origin`,
|
|
431
|
-
* else this throws {@link AppKeyMintInvariantError}.
|
|
432
|
-
* @param options.app {IAppConnectApp} - The validated app identity; its
|
|
433
|
-
* `appUrl` must already be in serialized form.
|
|
434
|
-
* @param options.origin {string} - The attested requesting origin.
|
|
435
|
-
* @returns {Promise<{ credential: IVerifiableCredential; subjectDid: string }>}
|
|
436
|
-
*/
|
|
437
|
-
export async function reissueAppKeyCredential({ credential, app, origin }) {
|
|
438
|
-
if (!(await appKeySeedBindsSubject(credential)) ||
|
|
439
|
-
appKeyOrigin(credential) !== origin) {
|
|
440
|
-
throw new AppKeyMintInvariantError();
|
|
441
|
-
}
|
|
442
|
-
const seedBytes = appKeySeedBytes(credential);
|
|
443
|
-
if (!seedBytes) {
|
|
444
|
-
throw new AppKeyMintInvariantError();
|
|
445
|
-
}
|
|
446
|
-
const legacyDescription = credential
|
|
447
|
-
.description;
|
|
448
|
-
return issueAppKeyCredential({
|
|
449
|
-
seedBytes,
|
|
450
|
-
appName: app.name,
|
|
451
|
-
appUrl: app.appUrl,
|
|
452
|
-
origin,
|
|
453
|
-
description: typeof legacyDescription === 'string' ? legacyDescription : undefined
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
369
|
/**
|
|
457
370
|
* The subject DID (`credentialSubject.id`) of an app-key credential, or
|
|
458
371
|
* undefined. For a valid app-key credential this equals the issuer.
|
|
@@ -468,25 +381,40 @@ export function appKeySubjectDid(credential) {
|
|
|
468
381
|
* (`credentialSubject.seed`, base64url-no-pad), or undefined when it is absent
|
|
469
382
|
* or malformed. This is the app's client secret, the root of its identity and
|
|
470
383
|
* of the keys it encrypts its own data with. The wallet reads it only to
|
|
471
|
-
* re-derive the credential's subject DID ({@link appKeySeedBindsSubject})
|
|
472
|
-
*
|
|
473
|
-
*
|
|
384
|
+
* re-derive the credential's subject DID ({@link appKeySeedBindsSubject});
|
|
385
|
+
* nothing downstream of the match takes the seed, so it never reaches the
|
|
386
|
+
* grant path.
|
|
474
387
|
*
|
|
475
388
|
* @param credential {IVerifiableCredential}
|
|
476
389
|
* @returns {Uint8Array | undefined}
|
|
477
390
|
*/
|
|
478
391
|
function appKeySeedBytes(credential) {
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
392
|
+
const seed = subjectStringField({ credential, field: 'seed' });
|
|
393
|
+
if (seed === undefined) {
|
|
481
394
|
return undefined;
|
|
482
395
|
}
|
|
483
396
|
try {
|
|
484
|
-
return base64urlnopad.decode(
|
|
397
|
+
return base64urlnopad.decode(seed);
|
|
485
398
|
}
|
|
486
399
|
catch {
|
|
487
400
|
return undefined;
|
|
488
401
|
}
|
|
489
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* A `credentialSubject` claim narrowed to a string, or undefined when the
|
|
405
|
+
* subject is not an object or the claim is absent or not a string. The one
|
|
406
|
+
* reader behind the `seed`, `origin`, and `appUrl` accessors.
|
|
407
|
+
*
|
|
408
|
+
* @param options {object}
|
|
409
|
+
* @param options.credential {IVerifiableCredential}
|
|
410
|
+
* @param options.field {string}
|
|
411
|
+
* @returns {string | undefined}
|
|
412
|
+
*/
|
|
413
|
+
function subjectStringField({ credential, field }) {
|
|
414
|
+
const subject = credential.credentialSubject;
|
|
415
|
+
const value = subject && typeof subject === 'object' ? subject[field] : undefined;
|
|
416
|
+
return typeof value === 'string' ? value : undefined;
|
|
417
|
+
}
|
|
490
418
|
/**
|
|
491
419
|
* The origin (`credentialSubject.origin`) an app-key credential is bound to,
|
|
492
420
|
* when present.
|
|
@@ -495,22 +423,16 @@ function appKeySeedBytes(credential) {
|
|
|
495
423
|
* @returns {string | undefined}
|
|
496
424
|
*/
|
|
497
425
|
export function appKeyOrigin(credential) {
|
|
498
|
-
|
|
499
|
-
return subject && typeof subject.origin === 'string'
|
|
500
|
-
? subject.origin
|
|
501
|
-
: undefined;
|
|
426
|
+
return subjectStringField({ credential, field: 'origin' });
|
|
502
427
|
}
|
|
503
428
|
/**
|
|
504
429
|
* The application URL (`credentialSubject.appUrl`) an app-key credential is
|
|
505
|
-
* scoped to, when present.
|
|
430
|
+
* scoped to, when present.
|
|
506
431
|
*
|
|
507
432
|
* @param credential {IVerifiableCredential}
|
|
508
433
|
* @returns {string | undefined}
|
|
509
434
|
*/
|
|
510
435
|
export function appKeyAppUrl(credential) {
|
|
511
|
-
|
|
512
|
-
return subject && typeof subject.appUrl === 'string'
|
|
513
|
-
? subject.appUrl
|
|
514
|
-
: undefined;
|
|
436
|
+
return subjectStringField({ credential, field: 'appUrl' });
|
|
515
437
|
}
|
|
516
438
|
//# sourceMappingURL=appKey.js.map
|
package/dist/appKey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appKey.js","sourceRoot":"","sources":["../src/appKey.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAKjE,OAAO,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACV,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C;;;;GAIG;AACH,MAAM,cAAc,GAAG,oBAAoB,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,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26
26
|
* echoes in its response presentation
|
|
27
27
|
* @param [options.agent] {{ name: string }} the requester's self-declared
|
|
28
28
|
* display name, carried as the VPR's root `agent` member; shown at consent
|
|
29
|
-
* as what the agent calls itself,
|
|
29
|
+
* as what the agent calls itself, not as verified identity. Validated by
|
|
30
30
|
* `normalizeAgentName` (trimmed, 1 to 64 characters, no control
|
|
31
31
|
* characters), so a name the wallet would refuse fails here first.
|
|
32
32
|
* @returns {IVPRDetails}
|
|
@@ -12,7 +12,7 @@ import { normalizeAgentName } from './classify.js';
|
|
|
12
12
|
* echoes in its response presentation
|
|
13
13
|
* @param [options.agent] {{ name: string }} the requester's self-declared
|
|
14
14
|
* display name, carried as the VPR's root `agent` member; shown at consent
|
|
15
|
-
* as what the agent calls itself,
|
|
15
|
+
* as what the agent calls itself, not as verified identity. Validated by
|
|
16
16
|
* `normalizeAgentName` (trimmed, 1 to 64 characters, no control
|
|
17
17
|
* characters), so a name the wallet would refuse fails here first.
|
|
18
18
|
* @returns {IVPRDetails}
|
package/dist/classify.d.ts
CHANGED
|
@@ -98,8 +98,8 @@ export declare function zcapQueriesOf(queries: IVPRQuery[]): ICapabilityQueryDet
|
|
|
98
98
|
* and returns its serialized form. The value must parse as an absolute URL,
|
|
99
99
|
* must not carry a fragment, and its origin must equal the attested origin;
|
|
100
100
|
* any violation throws (the query is malformed). All storage and comparison
|
|
101
|
-
* downstream uses the returned serialization, so
|
|
102
|
-
*
|
|
101
|
+
* downstream uses the returned serialization, so forms differing only in a
|
|
102
|
+
* default port, percent-encoding case, or dot-segments do not name distinct
|
|
103
103
|
* applications.
|
|
104
104
|
*
|
|
105
105
|
* The rule is the origin's, with no scheme constraint of its own: an `appUrl`
|
package/dist/classify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,eAA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AAE,EACpB,kBAAkB,GAAE,SAAS,MAAM,EAAoC,GACtE,OAAO,CAYT"}
|
package/dist/classify.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { typeArray } from '@interop/data-integrity-core/guards';
|
|
2
|
-
import { exclusiveQueryOf, isZcapQuery, parsedAbsoluteUrl } from './queryPredicates.js';
|
|
2
|
+
import { exclusiveQueryOf, isZcapQuery, parsedAbsoluteUrl, singleQueryOfType, toArray } from './queryPredicates.js';
|
|
3
3
|
export { isZcapQuery };
|
|
4
4
|
const VC_1_CONTEXT_URL = 'https://www.w3.org/2018/credentials/v1';
|
|
5
5
|
const VC_2_CONTEXT_URL = 'https://www.w3.org/ns/credentials/v2';
|
|
@@ -28,9 +28,7 @@ function asRecord(value) {
|
|
|
28
28
|
*/
|
|
29
29
|
export function presentationVersionFor(credentials) {
|
|
30
30
|
const isV2 = credentials.some(credential => {
|
|
31
|
-
|
|
32
|
-
const contextArray = Array.isArray(contexts) ? contexts : [contexts];
|
|
33
|
-
return contextArray.includes(VC_2_CONTEXT_URL);
|
|
31
|
+
return toArray(credential?.['@context']).includes(VC_2_CONTEXT_URL);
|
|
34
32
|
});
|
|
35
33
|
return isV2 ? 2.0 : 1.0;
|
|
36
34
|
}
|
|
@@ -83,13 +81,7 @@ function offeredPresentation({ dataType, data }) {
|
|
|
83
81
|
* @returns {IVerifiableCredential[]}
|
|
84
82
|
*/
|
|
85
83
|
export function credentialsOf(presentation) {
|
|
86
|
-
|
|
87
|
-
if (!verifiableCredential) {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
return Array.isArray(verifiableCredential)
|
|
91
|
-
? verifiableCredential
|
|
92
|
-
: [verifiableCredential];
|
|
84
|
+
return toArray(presentation.verifiableCredential);
|
|
93
85
|
}
|
|
94
86
|
/**
|
|
95
87
|
* Wraps a CHAPI get event as an `IVPRequest`.
|
|
@@ -129,11 +121,7 @@ export function classifyCHAPIStoreEvent(event) {
|
|
|
129
121
|
* @returns {boolean}
|
|
130
122
|
*/
|
|
131
123
|
export function isDIDAuthRequested({ queries }) {
|
|
132
|
-
|
|
133
|
-
if (didAuthRequests.length > 1) {
|
|
134
|
-
throw new Error('More than one DIDAuthentication request found, exiting.');
|
|
135
|
-
}
|
|
136
|
-
return didAuthRequests.length === 1;
|
|
124
|
+
return singleQueryOfType({ queries, typeName: 'DIDAuthentication' }) !== null;
|
|
137
125
|
}
|
|
138
126
|
/**
|
|
139
127
|
* Normalizes a VPR's `query` (which may be a single object or an array) to an
|
|
@@ -146,9 +134,7 @@ export function isDIDAuthRequested({ queries }) {
|
|
|
146
134
|
* @returns {IVPRQuery[]}
|
|
147
135
|
*/
|
|
148
136
|
export function queriesOf(request) {
|
|
149
|
-
|
|
150
|
-
const queries = Array.isArray(query) ? query : [query];
|
|
151
|
-
return queries.filter((entry) => !!entry &&
|
|
137
|
+
return toArray(request.query).filter((entry) => !!entry &&
|
|
152
138
|
typeof entry === 'object' &&
|
|
153
139
|
typeof entry.type === 'string');
|
|
154
140
|
}
|
|
@@ -160,11 +146,7 @@ export function queriesOf(request) {
|
|
|
160
146
|
* @returns {ICredentialQuery[]}
|
|
161
147
|
*/
|
|
162
148
|
export function credentialQueriesOf(query) {
|
|
163
|
-
|
|
164
|
-
if (!credentialQuery) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
return Array.isArray(credentialQuery) ? credentialQuery : [credentialQuery];
|
|
149
|
+
return toArray(query.credentialQuery);
|
|
168
150
|
}
|
|
169
151
|
/**
|
|
170
152
|
* Collects the requested capabilities from a query set: filters the two zcap
|
|
@@ -180,9 +162,10 @@ export function credentialQueriesOf(query) {
|
|
|
180
162
|
*/
|
|
181
163
|
export function zcapQueriesOf(queries) {
|
|
182
164
|
return queries.filter(isZcapQuery).flatMap(({ type, capabilityQuery }) => {
|
|
183
|
-
const detailEntries =
|
|
184
|
-
|
|
185
|
-
|
|
165
|
+
const detailEntries = toArray(capabilityQuery);
|
|
166
|
+
if (capabilityQuery === undefined) {
|
|
167
|
+
throw new Error(`A "${type}" query is missing its capabilityQuery detail.`);
|
|
168
|
+
}
|
|
186
169
|
for (const detail of detailEntries) {
|
|
187
170
|
if (!detail || typeof detail !== 'object') {
|
|
188
171
|
throw new Error(`A "${type}" query is missing its capabilityQuery detail.`);
|
|
@@ -196,8 +179,8 @@ export function zcapQueriesOf(queries) {
|
|
|
196
179
|
* and returns its serialized form. The value must parse as an absolute URL,
|
|
197
180
|
* must not carry a fragment, and its origin must equal the attested origin;
|
|
198
181
|
* any violation throws (the query is malformed). All storage and comparison
|
|
199
|
-
* downstream uses the returned serialization, so
|
|
200
|
-
*
|
|
182
|
+
* downstream uses the returned serialization, so forms differing only in a
|
|
183
|
+
* default port, percent-encoding case, or dot-segments do not name distinct
|
|
201
184
|
* applications.
|
|
202
185
|
*
|
|
203
186
|
* The rule is the origin's, with no scheme constraint of its own: an `appUrl`
|
|
@@ -274,12 +257,7 @@ export function appConnectRequestOf({ queries, origin }) {
|
|
|
274
257
|
throw new Error('An AppConnectQuery is missing its app name / appUrl.');
|
|
275
258
|
}
|
|
276
259
|
const appUrl = serializedAppUrl({ appUrl: app.appUrl, origin });
|
|
277
|
-
const
|
|
278
|
-
? []
|
|
279
|
-
: Array.isArray(capabilityQuery)
|
|
280
|
-
? capabilityQuery
|
|
281
|
-
: [capabilityQuery];
|
|
282
|
-
const capabilityQueries = rawQueries.map(detail => {
|
|
260
|
+
const capabilityQueries = toArray(capabilityQuery).map(detail => {
|
|
283
261
|
if (!detail || typeof detail !== 'object') {
|
|
284
262
|
throw new Error('An AppConnectQuery carries a malformed capabilityQuery entry.');
|
|
285
263
|
}
|
package/dist/classify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC/D,OAAO,EACL,gBAAgB,EAChB,WAAW,EAC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