@pagopa/io-react-native-wallet 2.0.0-next.2 → 2.0.0-next.4
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/lib/commonjs/credential/issuance/03-start-user-authorization.js +38 -24
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +75 -57
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +6 -10
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +43 -11
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +51 -48
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +77 -45
- package/lib/commonjs/credential/issuance/const.js +1 -1
- package/lib/commonjs/credential/issuance/types.js +17 -10
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +6 -13
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +10 -11
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +1 -1
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/credential/status/README.md +0 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +11 -15
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +5 -2
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/utils.test.js +37 -0
- package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -0
- package/lib/commonjs/sd-jwt/index.js +26 -1
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +71 -8
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/utils.js +64 -0
- package/lib/commonjs/sd-jwt/utils.js.map +1 -0
- package/lib/commonjs/trust/types.js +18 -13
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/par.js +32 -22
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/pop.js +1 -1
- package/lib/commonjs/utils/pop.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +4 -1
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +38 -24
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +76 -58
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +6 -10
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +44 -12
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +51 -48
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +77 -45
- package/lib/module/credential/issuance/const.js +1 -1
- package/lib/module/credential/issuance/types.js +13 -8
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +6 -13
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +10 -11
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/types.js +1 -1
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/credential/status/README.md +0 -1
- package/lib/module/sd-jwt/__test__/index.test.js +11 -16
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +5 -2
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/utils.test.js +35 -0
- package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -0
- package/lib/module/sd-jwt/index.js +7 -1
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +70 -7
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/utils.js +57 -0
- package/lib/module/sd-jwt/utils.js.map +1 -0
- package/lib/module/trust/types.js +18 -13
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/par.js +29 -20
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/pop.js +1 -1
- package/lib/module/utils/pop.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +4 -1
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +12 -12
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +2 -2
- package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +7 -6
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +7 -14
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +10 -5
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -2
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/const.d.ts +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +49 -26
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +2 -2
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +4 -3
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +9 -5
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +3 -4
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/credential/status/types.d.ts +4 -4
- package/lib/typescript/pid/sd-jwt/types.d.ts +7 -7
- package/lib/typescript/sd-jwt/__test__/utils.test.d.ts +2 -0
- package/lib/typescript/sd-jwt/__test__/utils.test.d.ts.map +1 -0
- package/lib/typescript/sd-jwt/index.d.ts +69 -28
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +264 -31
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/utils.d.ts +18 -0
- package/lib/typescript/sd-jwt/utils.d.ts.map +1 -0
- package/lib/typescript/trust/build-chain.d.ts +30 -14
- package/lib/typescript/trust/build-chain.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +322 -158
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +29 -13
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +9 -9
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/issuance/01-start-flow.ts +2 -2
- package/src/credential/issuance/03-start-user-authorization.ts +57 -38
- package/src/credential/issuance/04-complete-user-authorization.ts +79 -85
- package/src/credential/issuance/05-authorize-access.ts +5 -11
- package/src/credential/issuance/06-obtain-credential.ts +56 -23
- package/src/credential/issuance/07-verify-and-parse-credential.ts +54 -62
- package/src/credential/issuance/README.md +77 -45
- package/src/credential/issuance/const.ts +1 -1
- package/src/credential/issuance/types.ts +19 -8
- package/src/credential/presentation/07-evaluate-dcql-query.ts +16 -17
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +19 -16
- package/src/credential/presentation/types.ts +1 -2
- package/src/credential/status/README.md +0 -1
- package/src/sd-jwt/__test__/index.test.ts +8 -29
- package/src/sd-jwt/__test__/types.test.ts +6 -2
- package/src/sd-jwt/__test__/utils.test.ts +37 -0
- package/src/sd-jwt/index.ts +7 -1
- package/src/sd-jwt/types.ts +68 -7
- package/src/sd-jwt/utils.ts +73 -0
- package/src/trust/types.ts +23 -17
- package/src/utils/par.ts +37 -21
- package/src/utils/pop.ts +1 -1
- package/src/wallet-instance-attestation/types.ts +3 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","getValueFromDisclosures","LogLevel","Logger","parseCredentialSdJwt","
|
1
|
+
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","getValueFromDisclosures","LogLevel","Logger","parseCredentialSdJwt","credentialConfig","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","format","header","typ","message","log","ERROR","claims","attrDefinitions","attrsNotInDisclosures","filter","definition","some","_ref2","name","path","missing","map","_","join","received","definedValues","Object","fromEntries","_ref3","_disclosures$find","value","find","_ref4","attrKey","display","reduce","names","_ref5","locale","undefinedValues","keys","includes","_ref6","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","payload","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref7","credentialCryptoContext","decoded","openid_credential_issuer","jwks","DEBUG","JSON","stringify","credential_configurations_supported","parsedCredential","maybeIssuedAt","expiration","Date","exp","issuedAt","verifyAndParseCredential","context","_issuerConf$openid_cr"],"sour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,CAAC;AAClC,CAAC"}
|
@@ -6,7 +6,7 @@ There's a fork in the flow which is based on the type of the credential that is
|
|
6
6
|
This is due to the fact that eID credentials require a different authorization flow than other credentials, which is accomplished by a strong authentication method like SPID or CIE.
|
7
7
|
Credentials instead require a simpler authorization flow and they require other credentials to be presented in order to be issued.
|
8
8
|
|
9
|
-
The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step.
|
9
|
+
The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step. Available credentials are identified with a unique `credential_configuration_id`, that must be used when requesting authorization. The Authorization Server returns an array of **credential identifiers** that map to the `credential_configuration_id` provided: to obtain the credential, one of the credential identifiers (or all of them) must be requested to the credential endpoint.
|
10
10
|
|
11
11
|
## Sequence Diagram
|
12
12
|
|
@@ -96,17 +96,13 @@ const walletInstanceAttestation =
|
|
96
96
|
appFetch,
|
97
97
|
});
|
98
98
|
|
99
|
-
const
|
100
|
-
|
101
|
-
const eid = {
|
99
|
+
const pid = {
|
102
100
|
credential: "example",
|
103
101
|
parsedCredential: "example"
|
104
102
|
keyTag: "example";
|
105
|
-
credentialType: "
|
103
|
+
credentialType: "PersonIdentificationData";
|
106
104
|
};
|
107
105
|
|
108
|
-
const eidCryptoContext = createCryptoContextFor(eid.keyTag);
|
109
|
-
|
110
106
|
// Create credential crypto context
|
111
107
|
const credentialKeyTag = uuidv4().toString();
|
112
108
|
await generate(credentialKeyTag); // Let's assume this function generates a new hardware-backed key pair
|
@@ -115,22 +111,26 @@ const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
|
|
115
111
|
// Start the issuance flow
|
116
112
|
const startFlow: Credential.Issuance.StartFlow = () => ({
|
117
113
|
issuerUrl: WALLET_EAA_PROVIDER_BASE_URL,
|
118
|
-
|
114
|
+
credentialId: "someCredentialId",
|
119
115
|
});
|
120
116
|
|
121
|
-
const { issuerUrl } = startFlow();
|
117
|
+
const { issuerUrl, credentialId } = startFlow();
|
122
118
|
|
123
119
|
// Evaluate issuer trust
|
124
120
|
const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(issuerUrl);
|
125
121
|
|
126
122
|
// Start user authorization
|
127
|
-
const { issuerRequestUri, clientId, codeVerifier
|
128
|
-
await Credential.Issuance.startUserAuthorization(
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
123
|
+
const { issuerRequestUri, clientId, codeVerifier } =
|
124
|
+
await Credential.Issuance.startUserAuthorization(
|
125
|
+
issuerConf,
|
126
|
+
[credentialId],
|
127
|
+
{
|
128
|
+
walletInstanceAttestation,
|
129
|
+
redirectUri: REDIRECT_URI,
|
130
|
+
wiaCryptoContext,
|
131
|
+
appFetch,
|
132
|
+
}
|
133
|
+
);
|
134
134
|
|
135
135
|
const requestObject =
|
136
136
|
await Credential.Issuance.getRequestedCredentialToBePresented(
|
@@ -140,13 +140,12 @@ const requestObject =
|
|
140
140
|
appFetch
|
141
141
|
);
|
142
142
|
|
143
|
-
// The app here should ask the user to confirm the required data contained in the requestObject
|
144
|
-
|
145
143
|
// Complete the user authorization via form_post.jwt mode
|
146
144
|
const { code } =
|
147
145
|
await Credential.Issuance.completeUserAuthorizationWithFormPostJwtMode(
|
148
146
|
requestObject,
|
149
|
-
|
147
|
+
pid.credential,
|
148
|
+
{ wiaCryptoContext, pidCryptoContext: createCryptoContextFor(pid.keyTag) }
|
150
149
|
);
|
151
150
|
|
152
151
|
// Generate the DPoP context which will be used for the whole issuance flow
|
@@ -157,7 +156,7 @@ const { accessToken } = await Credential.Issuance.authorizeAccess(
|
|
157
156
|
issuerConf,
|
158
157
|
code,
|
159
158
|
clientId,
|
160
|
-
redirectUri,
|
159
|
+
redirectUri: REDIRECT_URI,
|
161
160
|
codeVerifier,
|
162
161
|
{
|
163
162
|
walletInstanceAttestation,
|
@@ -167,12 +166,19 @@ const { accessToken } = await Credential.Issuance.authorizeAccess(
|
|
167
166
|
}
|
168
167
|
);
|
169
168
|
|
170
|
-
//
|
171
|
-
const {
|
169
|
+
// For simplicity, in this example flow we work on a single credential.
|
170
|
+
const { credential_configuration_id, credential_identifiers } =
|
171
|
+
accessToken.authorization_details[0]!;
|
172
|
+
|
173
|
+
// Obtain the credential
|
174
|
+
const { credential } = await Credential.Issuance.obtainCredential(
|
172
175
|
issuerConf,
|
173
176
|
accessToken,
|
174
177
|
clientId,
|
175
|
-
|
178
|
+
{
|
179
|
+
credential_configuration_id,
|
180
|
+
credential_identifier: credential_identifiers[0],
|
181
|
+
},
|
176
182
|
{
|
177
183
|
credentialCryptoContext,
|
178
184
|
dPopCryptoContext,
|
@@ -184,22 +190,29 @@ const { credential, format } = await Credential.Issuance.obtainCredential(
|
|
184
190
|
* Parse and verify the credential. The ignoreMissingAttributes flag must be set to false or omitted in production.
|
185
191
|
* WARNING: includeUndefinedAttributes should not be set to true in production in order to get only claims explicitly declared by the issuer.
|
186
192
|
*/
|
187
|
-
const { parsedCredential } =
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
193
|
+
const { parsedCredential } =
|
194
|
+
await Credential.Issuance.verifyAndParseCredential(
|
195
|
+
issuerConf,
|
196
|
+
credential,
|
197
|
+
credential_configuration_id,
|
198
|
+
{
|
199
|
+
credentialCryptoContext,
|
200
|
+
ignoreMissingAttributes: true,
|
201
|
+
includeUndefinedAttributes: false
|
202
|
+
}
|
203
|
+
);
|
204
|
+
|
205
|
+
const credentialType =
|
206
|
+
issuerConf.openid_credential_issuer.credential_configurations_supported[
|
207
|
+
credential_configuration_id
|
208
|
+
].scope;
|
197
209
|
|
198
210
|
return {
|
199
211
|
parsedCredential,
|
200
212
|
credential,
|
201
213
|
keyTag: credentialKeyTag,
|
202
214
|
credentialType,
|
215
|
+
credentialConfigurationId: credential_configuration_id,
|
203
216
|
};
|
204
217
|
```
|
205
218
|
|
@@ -251,11 +264,10 @@ const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
|
|
251
264
|
// Start the issuance flow
|
252
265
|
const startFlow: Credential.Issuance.StartFlow = () => ({
|
253
266
|
issuerUrl: WALLET_EID_PROVIDER_BASE_URL,
|
254
|
-
|
255
|
-
appFetch,
|
267
|
+
credentialId: "dc_sd_jwt_PersonIdentificationData",
|
256
268
|
});
|
257
269
|
|
258
|
-
const { issuerUrl } = startFlow();
|
270
|
+
const { issuerUrl, credentialId } = startFlow();
|
259
271
|
|
260
272
|
// Evaluate issuer trust
|
261
273
|
const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(
|
@@ -265,12 +277,16 @@ const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(
|
|
265
277
|
|
266
278
|
// Start user authorization
|
267
279
|
const { issuerRequestUri, clientId, codeVerifier, credentialDefinition } =
|
268
|
-
await Credential.Issuance.startUserAuthorization(
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
280
|
+
await Credential.Issuance.startUserAuthorization(
|
281
|
+
issuerConf,
|
282
|
+
[credentialId], // Request authorization for one or more credentials
|
283
|
+
{
|
284
|
+
walletInstanceAttestation,
|
285
|
+
redirectUri,
|
286
|
+
wiaCryptoContext,
|
287
|
+
appFetch,
|
288
|
+
}
|
289
|
+
);
|
274
290
|
|
275
291
|
// Complete the authorization process with query mode with the authorizationContext which opens the browser
|
276
292
|
const { code } =
|
@@ -301,12 +317,27 @@ const { accessToken } = await Credential.Issuance.authorizeAccess(
|
|
301
317
|
}
|
302
318
|
);
|
303
319
|
|
320
|
+
|
321
|
+
const [pidCredentialDefinition] = credentialDefinition;
|
322
|
+
|
323
|
+
// Extract the credential_identifier(s) from the access token
|
324
|
+
// For each one of them, a credential can be obtained by calling `obtainCredential`
|
325
|
+
const { credential_configuration_id, credential_identifiers } =
|
326
|
+
accessToken.authorization_details.find(
|
327
|
+
(authDetails) =>
|
328
|
+
authDetails.credential_configuration_id ===
|
329
|
+
pidCredentialDefinition.credential_configuration_id
|
330
|
+
);
|
331
|
+
|
304
332
|
// Obtain che eID credential
|
305
333
|
const { credential, format } = await Credential.Issuance.obtainCredential(
|
306
334
|
issuerConf,
|
307
335
|
accessToken,
|
308
336
|
clientId,
|
309
|
-
|
337
|
+
{
|
338
|
+
credential_configuration_id,
|
339
|
+
credential_identifier: credential_identifiers.at(0),
|
340
|
+
},
|
310
341
|
{
|
311
342
|
credentialCryptoContext,
|
312
343
|
dPopCryptoContext,
|
@@ -318,15 +349,16 @@ const { credential, format } = await Credential.Issuance.obtainCredential(
|
|
318
349
|
const { parsedCredential, issuedAt, expiration } = await Credential.Issuance.verifyAndParseCredential(
|
319
350
|
issuerConf,
|
320
351
|
credential,
|
321
|
-
|
352
|
+
credential_configuration_id,
|
322
353
|
{ credentialCryptoContext }
|
323
354
|
);
|
324
355
|
|
325
356
|
return {
|
326
357
|
parsedCredential,
|
327
358
|
credential,
|
359
|
+
credentialConfigurationId: credential_configuration_id
|
360
|
+
credentialType: "PersonIdentificationData",
|
328
361
|
keyTag: credentialKeyTag,
|
329
|
-
credentialType,
|
330
362
|
issuedAt,
|
331
363
|
expiration
|
332
364
|
};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as z from "zod";
|
2
2
|
export const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
3
|
-
export const SupportedCredentialFormat = z.union([z.literal("
|
3
|
+
export const SupportedCredentialFormat = z.union([z.literal("dc+sd-jwt"), z.literal("vc+mdoc-cbor")]);
|
4
4
|
//# sourceMappingURL=const.js.map
|
@@ -1,19 +1,21 @@
|
|
1
|
-
import { AuthorizationDetail } from "../../utils/par";
|
2
1
|
import * as z from "zod";
|
3
|
-
|
2
|
+
export const AuthorizationDetail = z.object({
|
3
|
+
type: z.literal("openid_credential"),
|
4
|
+
credential_configuration_id: z.string(),
|
5
|
+
credential_identifiers: z.array(z.string())
|
6
|
+
});
|
4
7
|
export const TokenResponse = z.object({
|
5
8
|
access_token: z.string(),
|
9
|
+
refresh_token: z.string().optional(),
|
6
10
|
authorization_details: z.array(AuthorizationDetail),
|
7
|
-
c_nonce: z.string(),
|
8
|
-
c_nonce_expires_in: z.number(),
|
9
11
|
expires_in: z.number(),
|
10
12
|
token_type: z.string()
|
11
13
|
});
|
12
14
|
export const CredentialResponse = z.object({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
credentials: z.array(z.object({
|
16
|
+
credential: z.string()
|
17
|
+
})),
|
18
|
+
notification_id: z.string().optional()
|
17
19
|
});
|
18
20
|
|
19
21
|
/**
|
@@ -22,4 +24,7 @@ export const CredentialResponse = z.object({
|
|
22
24
|
export const ResponseUriResultShape = z.object({
|
23
25
|
redirect_uri: z.string()
|
24
26
|
});
|
27
|
+
export const NonceResponse = z.object({
|
28
|
+
c_nonce: z.string()
|
29
|
+
});
|
25
30
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["z","AuthorizationDetail","object","type","literal","credential_configuration_id","string","credential_identifiers","array","TokenResponse","access_token","refresh_token","optional","authorization_details","expires_in","number","token_type","CredentialResponse","credentials","credential","notification_id","ResponseUriResultShape","redirect_uri","NonceResponse","c_nonce"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AAGxB,OAAO,MAAMC,mBAAmB,GAAGD,CAAC,CAACE,MAAM,CAAC;EAC1CC,IAAI,EAAEH,CAAC,CAACI,OAAO,CAAC,mBAAmB,CAAC;EACpCC,2BAA2B,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC;EACvCC,sBAAsB,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACM,MAAM,CAAC,CAAC;AAC5C,CAAC,CAAC;AAIF,OAAO,MAAMG,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCQ,YAAY,EAAEV,CAAC,CAACM,MAAM,CAAC,CAAC;EACxBK,aAAa,EAAEX,CAAC,CAACM,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC,CAAC;EACpCC,qBAAqB,EAAEb,CAAC,CAACQ,KAAK,CAACP,mBAAmB,CAAC;EACnDa,UAAU,EAAEd,CAAC,CAACe,MAAM,CAAC,CAAC;EACtBC,UAAU,EAAEhB,CAAC,CAACM,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMW,kBAAkB,GAAGjB,CAAC,CAACE,MAAM,CAAC;EACzCgB,WAAW,EAAElB,CAAC,CAACQ,KAAK,CAClBR,CAAC,CAACE,MAAM,CAAC;IACPiB,UAAU,EAAEnB,CAAC,CAACM,MAAM,CAAC;EACvB,CAAC,CACH,CAAC;EACDc,eAAe,EAAEpB,CAAC,CAACM,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC;AACvC,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMS,sBAAsB,GAAGrB,CAAC,CAACE,MAAM,CAAC;EAC7CoB,YAAY,EAAEtB,CAAC,CAACM,MAAM,CAAC;AACzB,CAAC,CAAC;AAKF,OAAO,MAAMiB,aAAa,GAAGvB,CAAC,CAACE,MAAM,CAAC;EACpCsB,OAAO,EAAExB,CAAC,CAACM,MAAM,CAAC;AACpB,CAAC,CAAC"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { DcqlQuery, DcqlError } from "dcql";
|
2
2
|
import { isValiError } from "valibot";
|
3
3
|
import { decode, prepareVpToken } from "../../sd-jwt";
|
4
|
-
import { createCryptoContextFor } from "../../utils/crypto";
|
5
4
|
import { CredentialsNotFoundError } from "./errors";
|
6
5
|
|
7
6
|
/**
|
@@ -18,11 +17,6 @@ const mapCredentialToObject = jwt => {
|
|
18
17
|
disclosures
|
19
18
|
} = decode(jwt);
|
20
19
|
const credentialFormat = sdJwt.header.typ;
|
21
|
-
|
22
|
-
// TODO [SIW-2082]: support MDOC credentials
|
23
|
-
if (credentialFormat !== "vc+sd-jwt") {
|
24
|
-
throw new Error(`Unsupported credential format: ${credentialFormat}`);
|
25
|
-
}
|
26
20
|
return {
|
27
21
|
vct: sdJwt.payload.vct,
|
28
22
|
credential_format: credentialFormat,
|
@@ -59,7 +53,7 @@ const extractMissingCredentials = (queryResult, originalQuery) => {
|
|
59
53
|
var _credential$meta;
|
60
54
|
let [id] = _ref3;
|
61
55
|
const credential = originalQuery.credentials.find(c => c.id === id);
|
62
|
-
if ((credential === null || credential === void 0 ? void 0 : credential.format) !== "vc+sd-jwt") {
|
56
|
+
if ((credential === null || credential === void 0 ? void 0 : credential.format) !== "dc+sd-jwt" && (credential === null || credential === void 0 ? void 0 : credential.format) !== "vc+sd-jwt") {
|
63
57
|
throw new Error("Unsupported format"); // TODO [SIW-2082]: support MDOC credentials
|
64
58
|
}
|
65
59
|
|
@@ -91,7 +85,7 @@ export const evaluateDcqlQuery = (credentialsSdJwt, query) => {
|
|
91
85
|
return getDcqlQueryMatches(queryResult).map(_ref5 => {
|
92
86
|
var _queryResult$credenti;
|
93
87
|
let [id, match] = _ref5;
|
94
|
-
if (match.output.credential_format !== "vc+sd-jwt") {
|
88
|
+
if (match.output.credential_format !== "dc+sd-jwt" && match.output.credential_format !== "vc+sd-jwt") {
|
95
89
|
throw new Error("Unsupported format"); // TODO [SIW-2082]: support MDOC credentials
|
96
90
|
}
|
97
91
|
|
@@ -109,12 +103,12 @@ export const evaluateDcqlQuery = (credentialsSdJwt, query) => {
|
|
109
103
|
required: Boolean(credentialSet.required)
|
110
104
|
};
|
111
105
|
});
|
112
|
-
const [
|
106
|
+
const [cryptoContext, credential] = credentialsSdJwtByVct[vct];
|
113
107
|
const requiredDisclosures = Object.values(claims);
|
114
108
|
return {
|
115
109
|
id,
|
116
110
|
vct,
|
117
|
-
|
111
|
+
cryptoContext,
|
118
112
|
credential,
|
119
113
|
requiredDisclosures,
|
120
114
|
// When it is a match but no credential_sets are found, the credential is required by default
|
@@ -142,12 +136,11 @@ export const prepareRemotePresentations = async (credentials, nonce, clientId) =
|
|
142
136
|
return Promise.all(credentials.map(async item => {
|
143
137
|
const {
|
144
138
|
vp_token
|
145
|
-
} = await prepareVpToken(nonce, clientId, [item.credential, item.requestedClaims,
|
139
|
+
} = await prepareVpToken(nonce, clientId, [item.credential, item.requestedClaims, item.cryptoContext]);
|
146
140
|
return {
|
147
141
|
credentialId: item.id,
|
148
142
|
requestedClaims: item.requestedClaims,
|
149
|
-
vpToken: vp_token
|
150
|
-
format: "vc+sd-jwt"
|
143
|
+
vpToken: vp_token
|
151
144
|
};
|
152
145
|
}));
|
153
146
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["DcqlQuery","DcqlError","isValiError","decode","prepareVpToken","
|
1
|
+
{"version":3,"names":["DcqlQuery","DcqlError","isValiError","decode","prepareVpToken","CredentialsNotFoundError","mapCredentialToObject","jwt","sdJwt","disclosures","credentialFormat","header","typ","vct","payload","credential_format","claims","reduce","acc","disclosure","decoded","getDcqlQueryMatches","result","Object","entries","credential_matches","filter","_ref","match","success","getDcqlQueryFailedMatches","_ref2","extractMissingCredentials","queryResult","originalQuery","map","_ref3","_credential$meta","id","credential","credentials","find","c","format","Error","vctValues","meta","vct_values","evaluateDcqlQuery","credentialsSdJwt","query","_ref4","parsedQuery","parse","validate","canBeSatisfied","credentialsSdJwtByVct","i","_ref5","_queryResult$credenti","output","purposes","credential_sets","set","_set$matching_options","matching_options","flat","includes","credentialSet","_credentialSet$purpos","description","purpose","toString","required","Boolean","cryptoContext","requiredDisclosures","values","error","message","code","cause","issues","prepareRemotePresentations","nonce","clientId","Promise","all","item","vp_token","requestedClaims","credentialId","vpToken"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-dcql-query.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,SAAS,QAAyB,MAAM;AAC5D,SAASC,WAAW,QAAQ,SAAS;AACrC,SAASC,MAAM,EAAEC,cAAc,QAAQ,cAAc;AAGrD,SAASC,wBAAwB,QAA6B,UAAU;;AAGxE;AACA;AACA;;AAuCA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OAAO;QACLsB,EAAE;QACFzB,GAAG;QACH8D,aAAa;QACbpC,UAAU;QACVqC,mBAAmB;QACnB;QACA;QACAf,QAAQ,EAAEA,QAAQ,IAAI,CAAC;UAAEY,QAAQ,EAAE;QAAK,CAAC;MAC3C,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOK,KAAK,EAAE;IACd;IACA,IAAI5E,WAAW,CAAC4E,KAAK,CAAC,EAAE;MACtB,MAAM,IAAI7E,SAAS,CAAC;QAClB8E,OAAO,EAAE,yCAAyC;QAClDC,IAAI,EAAE,aAAa;QACnBC,KAAK,EAAEH,KAAK,CAACI;MACf,CAAC,CAAC;IACJ;;IAEA;IACA,MAAMJ,KAAK;EACb;AACF,CAAC;AAED,OAAO,MAAMK,0BAAsD,GAAG,MAAAA,CACpE3C,WAAW,EACX4C,KAAK,EACLC,QAAQ,KACL;EACH,OAAOC,OAAO,CAACC,GAAG,CAChB/C,WAAW,CAACL,GAAG,CAAC,MAAOqD,IAAI,IAAK;IAC9B,MAAM;MAAEC;IAAS,CAAC,GAAG,MAAMrF,cAAc,CAACgF,KAAK,EAAEC,QAAQ,EAAE,CACzDG,IAAI,CAACjD,UAAU,EACfiD,IAAI,CAACE,eAAe,EACpBF,IAAI,CAACb,aAAa,CACnB,CAAC;IAEF,OAAO;MACLgB,YAAY,EAAEH,IAAI,CAAClD,EAAE;MACrBoD,eAAe,EAAEF,IAAI,CAACE,eAAe;MACrCE,OAAO,EAAEH;IACX,CAAC;EACH,CAAC,CACH,CAAC;AACH,CAAC"}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { decode, prepareVpToken } from "../../sd-jwt";
|
2
|
-
import { createCryptoContextFor } from "../../utils/crypto";
|
3
2
|
import { JSONPath } from "jsonpath-plus";
|
4
3
|
import { CredentialsNotFoundError, MissingDataError } from "./errors";
|
5
4
|
import Ajv from "ajv";
|
@@ -177,7 +176,7 @@ export const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCrede
|
|
177
176
|
*/
|
178
177
|
export const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) => {
|
179
178
|
for (const {
|
180
|
-
|
179
|
+
cryptoContext,
|
181
180
|
credential,
|
182
181
|
sdJwt,
|
183
182
|
disclosures
|
@@ -186,7 +185,7 @@ export const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) =>
|
|
186
185
|
const evaluatedDisclosure = evaluateInputDescriptorForSdJwt4VC(inputDescriptor, sdJwt.payload, disclosures);
|
187
186
|
return {
|
188
187
|
matchedEvaluation: evaluatedDisclosure,
|
189
|
-
|
188
|
+
cryptoContext,
|
190
189
|
matchedCredential: credential
|
191
190
|
};
|
192
191
|
} catch {
|
@@ -217,13 +216,13 @@ export const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) =>
|
|
217
216
|
export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt) => {
|
218
217
|
// We need decode SD-JWT credentials for evaluation
|
219
218
|
const decodedSdJwtCredentials = (credentialsSdJwt === null || credentialsSdJwt === void 0 ? void 0 : credentialsSdJwt.map(_ref2 => {
|
220
|
-
let [
|
219
|
+
let [cryptoContext, credential] = _ref2;
|
221
220
|
const {
|
222
221
|
sdJwt,
|
223
222
|
disclosures
|
224
223
|
} = decode(credential);
|
225
224
|
return {
|
226
|
-
|
225
|
+
cryptoContext,
|
227
226
|
credential,
|
228
227
|
sdJwt,
|
229
228
|
disclosures
|
@@ -231,7 +230,7 @@ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJw
|
|
231
230
|
})) || [];
|
232
231
|
return Promise.all(inputDescriptors.map(async descriptor => {
|
233
232
|
var _descriptor$format;
|
234
|
-
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["
|
233
|
+
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["dc+sd-jwt"]) {
|
235
234
|
if (!decodedSdJwtCredentials.length) {
|
236
235
|
throw new CredentialsNotFoundError([{
|
237
236
|
id: descriptor.id,
|
@@ -240,14 +239,14 @@ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJw
|
|
240
239
|
}
|
241
240
|
const {
|
242
241
|
matchedEvaluation,
|
243
|
-
|
242
|
+
cryptoContext,
|
244
243
|
matchedCredential
|
245
244
|
} = findCredentialSdJwt(descriptor, decodedSdJwtCredentials);
|
246
245
|
return {
|
247
246
|
evaluatedDisclosure: matchedEvaluation,
|
248
247
|
inputDescriptor: descriptor,
|
249
248
|
credential: matchedCredential,
|
250
|
-
|
249
|
+
cryptoContext
|
251
250
|
};
|
252
251
|
}
|
253
252
|
throw new CredentialsNotFoundError([{
|
@@ -277,15 +276,15 @@ export const prepareLegacyRemotePresentations = async (credentialAndDescriptors,
|
|
277
276
|
return Promise.all(credentialAndDescriptors.map(async item => {
|
278
277
|
var _descriptor$format2;
|
279
278
|
const descriptor = item.inputDescriptor;
|
280
|
-
if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["
|
279
|
+
if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["dc+sd-jwt"]) {
|
281
280
|
const {
|
282
281
|
vp_token
|
283
|
-
} = await prepareVpToken(nonce, client_id, [item.credential, item.requestedClaims,
|
282
|
+
} = await prepareVpToken(nonce, client_id, [item.credential, item.requestedClaims, item.cryptoContext]);
|
284
283
|
return {
|
285
284
|
requestedClaims: item.requestedClaims,
|
286
285
|
inputDescriptor: descriptor,
|
287
286
|
vpToken: vp_token,
|
288
|
-
format: "
|
287
|
+
format: "dc+sd-jwt"
|
289
288
|
};
|
290
289
|
}
|
291
290
|
throw new CredentialsNotFoundError([{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["decode","prepareVpToken","
|
1
|
+
{"version":3,"names":["decode","prepareVpToken","JSONPath","CredentialsNotFoundError","MissingDataError","Ajv","ajv","allErrors","INDEX_CLAIM_NAME","mapDisclosuresToObject","disclosures","reduce","obj","_ref","decoded","claimName","claimValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","path","json","length","error","extractClaimName","regex","match","Error","evaluateInputDescriptorForSdJwt4VC","inputDescriptor","payloadCredential","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","unrequestedDisclosures","requiredClaimNames","optionalClaimNames","disclosuresAsPayload","allFieldsValid","every","field","optional","push","filter","validateSchema","compile","disclosure","includes","isNotLimitDisclosure","limit_disclosure","findCredentialSdJwt","decodedSdJwtCredentials","cryptoContext","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedCredential","id","reason","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","map","_ref2","Promise","all","descriptor","_descriptor$format","format","prepareLegacyRemotePresentations","credentialAndDescriptors","nonce","client_id","item","_descriptor$format2","vp_token","requestedClaims","vpToken"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":"AAEA,SAASA,MAAM,EAAEC,cAAc,QAAQ,cAAc;AACrD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,UAAU;AACrE,OAAOC,GAAG,MAAM,KAAK;AAGrB,MAAMC,GAAG,GAAG,IAAID,GAAG,CAAC;EAAEE,SAAS,EAAE;AAAK,CAAC,CAAC;AACxC,MAAMC,gBAAgB,GAAG,CAAC;;AA6B1B;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAACC,GAAG,EAAAC,IAAA,KAAkB;IAAA,IAAhB;MAAEC;IAAQ,CAAC,GAAAD,IAAA;IACf,MAAM,GAAGE,SAAS,EAAEC,UAAU,CAAC,GAAGF,OAAO;IACzCF,GAAG,CAACG,SAAS,CAAC,GAAGC,UAAU;IAC3B,OAAOJ,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AAC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MACjBC,MAAM,EAAG,GAAEQ,UAAU,CAACE,MAAO;IAC/B,CAAC,CACF,CAAC;EACJ,CAAC,CACH,CAAC;AACH,CAAC"}
|
@@ -86,7 +86,7 @@ export const RequestObject = z.object({
|
|
86
86
|
state: z.string().optional(),
|
87
87
|
nonce: z.string(),
|
88
88
|
response_uri: z.string(),
|
89
|
-
|
89
|
+
request_uri_method: z.string().optional(),
|
90
90
|
response_type: z.literal("vp_token"),
|
91
91
|
response_mode: z.literal("direct_post.jwt"),
|
92
92
|
client_id: z.string(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnixTime","z","Fields","object","path","array","string","min","id","optional","purpose","name","filter","any","boolean","intent_to_retain","Constraints","fields","limit_disclosure","enum","InputDescriptor","format","record","constraints","group","SubmissionRequirement","rule","from","from_nested","count","number","PresentationDefinition","input_descriptors","submission_requirements","RequestObject","iss","iat","exp","state","nonce","response_uri","
|
1
|
+
{"version":3,"names":["UnixTime","z","Fields","object","path","array","string","min","id","optional","purpose","name","filter","any","boolean","intent_to_retain","Constraints","fields","limit_disclosure","enum","InputDescriptor","format","record","constraints","group","SubmissionRequirement","rule","from","from_nested","count","number","PresentationDefinition","input_descriptors","submission_requirements","RequestObject","iss","iat","exp","state","nonce","response_uri","request_uri_method","response_type","literal","response_mode","client_id","dcql_query","scope","presentation_definition","WalletMetadata","presentation_definition_uri_supported","client_id_schemes_supported","request_object_signing_alg_values_supported","vp_formats_supported","RequestObjectWalletCapabilities","wallet_metadata","wallet_nonce","ErrorResponse","LegacyDirectAuthorizationBodyPayload","vp_token","union","presentation_submission","unknown","DirectAuthorizationBodyPayload","error","error_description"],"sourceRoot":"../../../../src","sources":["credential/presentation/types.ts"],"mappings":"AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAO,KAAKC,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAOA,MAAMC,MAAM,GAAGD,C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