@credo-ts/openid4vc 0.6.0-pr-2134-20241217213340 → 0.6.0-pr-2195-20250217170804

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.
Files changed (85) hide show
  1. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +61 -11
  2. package/build/openid4vc-holder/OpenId4VcHolderApi.js +17 -19
  3. package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
  4. package/build/openid4vc-holder/OpenId4VcHolderModule.js +1 -1
  5. package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -1
  6. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +7 -8
  7. package/build/openid4vc-holder/OpenId4VciHolderService.js +60 -45
  8. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
  9. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +3 -3
  10. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +1 -1
  11. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +1 -1
  12. package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +59 -13
  13. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +232 -172
  14. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +1 -1
  15. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +18 -1
  16. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +196 -46
  17. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +8 -19
  18. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js.map +1 -1
  19. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +3 -3
  20. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +1 -1
  21. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +13 -13
  22. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +19 -40
  23. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -1
  24. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +198 -48
  25. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +45 -37
  26. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
  27. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +8 -3
  28. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +1 -1
  29. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +26 -12
  30. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
  31. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +19 -22
  32. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
  33. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +11 -9
  34. package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -1
  35. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +17 -6
  36. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
  37. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js +1 -1
  38. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js.map +1 -1
  39. package/build/openid4vc-issuer/router/credentialEndpoint.js +11 -9
  40. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
  41. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js +7 -3
  42. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js.map +1 -1
  43. package/build/openid4vc-issuer/util/txCode.js +2 -3
  44. package/build/openid4vc-issuer/util/txCode.js.map +1 -1
  45. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +21 -7
  46. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +499 -263
  47. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +1 -1
  48. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +23 -3
  49. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +3 -3
  50. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +11 -18
  51. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
  52. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +3 -3
  53. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
  54. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +11 -8
  55. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +1 -1
  56. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +23 -4
  57. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +25 -29
  58. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +1 -1
  59. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +4 -6
  60. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +1 -1
  61. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +11 -6
  62. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -1
  63. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js +7 -5
  64. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js.map +1 -1
  65. package/build/openid4vc-verifier/router/authorizationEndpoint.js +5 -104
  66. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
  67. package/build/shared/callbacks.d.ts +16 -5
  68. package/build/shared/callbacks.js +120 -24
  69. package/build/shared/callbacks.js.map +1 -1
  70. package/build/shared/issuerMetadataUtils.d.ts +102 -144
  71. package/build/shared/models/index.d.ts +10 -8
  72. package/build/shared/models/index.js +5 -5
  73. package/build/shared/models/index.js.map +1 -1
  74. package/build/shared/router/context.d.ts +2 -2
  75. package/build/shared/router/context.js +5 -5
  76. package/build/shared/router/context.js.map +1 -1
  77. package/build/shared/router/tenants.js +1 -2
  78. package/build/shared/router/tenants.js.map +1 -1
  79. package/build/shared/utils.d.ts +6 -6
  80. package/build/shared/utils.js +22 -61
  81. package/build/shared/utils.js.map +1 -1
  82. package/package.json +7 -6
  83. package/build/shared/transform.d.ts +0 -5
  84. package/build/shared/transform.js +0 -73
  85. package/build/shared/transform.js.map +0 -1
@@ -11,179 +11,292 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OpenId4VcSiopHolderService = void 0;
13
13
  const core_1 = require("@credo-ts/core");
14
- const did_auth_siop_1 = require("@sphereon/did-auth-siop");
15
- const transform_1 = require("../shared/transform");
14
+ const oid4vp_1 = require("@openid4vc/oid4vp");
15
+ const callbacks_1 = require("../shared/callbacks");
16
16
  const utils_1 = require("../shared/utils");
17
17
  let OpenId4VcSiopHolderService = class OpenId4VcSiopHolderService {
18
- constructor(presentationExchangeService) {
18
+ constructor(presentationExchangeService, dcqlService) {
19
19
  this.presentationExchangeService = presentationExchangeService;
20
+ this.dcqlService = dcqlService;
20
21
  }
21
- async resolveAuthorizationRequest(agentContext, requestJwtOrUri) {
22
- var _a, _b;
23
- const openidProvider = await this.getOpenIdProvider(agentContext);
24
- // parsing happens automatically in verifyAuthorizationRequest
25
- const verifiedAuthorizationRequest = await openidProvider.verifyAuthorizationRequest(requestJwtOrUri);
26
- agentContext.config.logger.debug(`verified SIOP Authorization Request for issuer '${verifiedAuthorizationRequest.issuer}'`);
27
- agentContext.config.logger.debug(`requestJwtOrUri '${requestJwtOrUri}'`);
28
- if (verifiedAuthorizationRequest.presentationDefinitions &&
29
- verifiedAuthorizationRequest.presentationDefinitions.length > 1) {
30
- throw new core_1.CredoError('Only a single presentation definition is supported.');
22
+ getOid4vpClient(agentContext, trustedCertificates) {
23
+ const callbacks = (0, callbacks_1.getOid4vcCallbacks)(agentContext, trustedCertificates);
24
+ return new oid4vp_1.Oid4vpClient({ callbacks });
25
+ }
26
+ async handlePresentationExchangeRequest(agentContext, _presentationDefinition, transactionData) {
27
+ const presentationDefinition = _presentationDefinition;
28
+ this.presentationExchangeService.validatePresentationDefinition(presentationDefinition);
29
+ const presentationExchange = {
30
+ definition: presentationDefinition,
31
+ credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(agentContext, presentationDefinition),
32
+ };
33
+ let credentialsForTransactionData = undefined;
34
+ // for each transaction data entry, get all submission entries that can be used to sign the respective transaction
35
+ if (transactionData) {
36
+ credentialsForTransactionData = [];
37
+ for (const transactionDataEntry of transactionData) {
38
+ for (const requirement of presentationExchange.credentialsForRequest.requirements) {
39
+ const recordSet = new Set();
40
+ const filtered = requirement.submissionEntry.filter((submission) => transactionDataEntry.credential_ids.includes(submission.inputDescriptorId));
41
+ for (const submission of filtered) {
42
+ for (const credential of submission.verifiableCredentials) {
43
+ recordSet.add(credential);
44
+ }
45
+ }
46
+ if (recordSet.size === 0) {
47
+ continue;
48
+ }
49
+ credentialsForTransactionData.push({
50
+ transactionDataEntry,
51
+ submissionEntry: { ...filtered[0], verifiableCredentials: Array.from(recordSet) },
52
+ });
53
+ }
54
+ }
31
55
  }
32
- const presentationDefinition = (_b = (_a = verifiedAuthorizationRequest.presentationDefinitions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.definition;
56
+ return { pex: { ...presentationExchange, transactionData: credentialsForTransactionData } };
57
+ }
58
+ async handleDcqlRequest(agentContext, dcql, transactionData) {
59
+ const dcqlQuery = this.dcqlService.validateDcqlQuery(dcql);
60
+ const dcqlQueryResult = await this.dcqlService.getCredentialsForRequest(agentContext, dcqlQuery);
61
+ let credentialsForTransactionData = undefined;
62
+ // for each transaction data entry, get all submission entries that can be used to sign the respective transaction
63
+ if (transactionData) {
64
+ credentialsForTransactionData = [];
65
+ for (const transactionDataEntry of transactionData) {
66
+ const result = transactionDataEntry.credential_ids
67
+ .map((credentialId) => {
68
+ const match = dcqlQueryResult.credential_matches[credentialId];
69
+ if (!match.success)
70
+ return undefined;
71
+ return {
72
+ transactionDataEntry,
73
+ dcql: {
74
+ record: match.record,
75
+ credentialQueryId: match.input_credential_index,
76
+ claimSetId: match.claim_set_index,
77
+ },
78
+ };
79
+ })
80
+ .filter((r) => r !== undefined);
81
+ credentialsForTransactionData.push(...result);
82
+ }
83
+ }
84
+ return { dcql: { queryResult: dcqlQueryResult, transactionData: credentialsForTransactionData } };
85
+ }
86
+ async resolveAuthorizationRequest(agentContext, requestJwtOrUri, trustedCertificates, origin) {
87
+ const openid4vpClient = this.getOid4vpClient(agentContext, trustedCertificates);
88
+ const { params } = openid4vpClient.parseOpenid4vpAuthorizationRequestPayload({ requestPayload: requestJwtOrUri });
89
+ const verifiedAuthRequest = await openid4vpClient.resolveOpenId4vpAuthorizationRequest({ request: params, origin });
90
+ const { client, pex, transactionData, dcql } = verifiedAuthRequest;
91
+ if (client.scheme !== 'x509_san_dns' &&
92
+ client.scheme !== 'x509_san_uri' &&
93
+ client.scheme !== 'did' &&
94
+ client.scheme !== 'web-origin') {
95
+ throw new core_1.CredoError(`Client scheme '${client.scheme}' is not supported`);
96
+ }
97
+ const { pex: pexResult } = pex?.presentation_definition
98
+ ? await this.handlePresentationExchangeRequest(agentContext, pex.presentation_definition, transactionData)
99
+ : { pex: undefined };
100
+ const { dcql: dcqlResult } = dcql?.query
101
+ ? await this.handleDcqlRequest(agentContext, dcql.query, transactionData)
102
+ : { dcql: undefined };
103
+ agentContext.config.logger.debug(`verified SIOP Authorization Request`);
104
+ agentContext.config.logger.debug(`requestJwtOrUri '${requestJwtOrUri}'`);
33
105
  return {
34
- authorizationRequest: verifiedAuthorizationRequest,
35
- // Parameters related to DIF Presentation Exchange
36
- presentationExchange: presentationDefinition
37
- ? {
38
- definition: presentationDefinition,
39
- credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(agentContext, presentationDefinition),
40
- }
41
- : undefined,
106
+ authorizationRequest: verifiedAuthRequest,
107
+ presentationExchange: pexResult,
108
+ dcql: dcqlResult,
42
109
  };
43
110
  }
111
+ async getCredentialQueryIdsToSignTransactionData(dcql, transactionData) {
112
+ // check if all credentials are present for the transaction data
113
+ // This needs a deep integration into pex and out pex requirements
114
+ const dcqlCredentialQueryIds = [];
115
+ for (const tdEntry of transactionData) {
116
+ // find a inputDescriptor in the credential_ids which is present in the response
117
+ // and use it to sign of the transaction
118
+ const dcqlCredentialForRequest = tdEntry.credential_ids.find((credentialId) => dcql.credentials[credentialId]);
119
+ if (!dcqlCredentialForRequest) {
120
+ throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
121
+ }
122
+ dcqlCredentialQueryIds.push(dcqlCredentialForRequest);
123
+ }
124
+ return dcqlCredentialQueryIds;
125
+ }
126
+ async getInputDescriptorsToSignTransactionData(presentationExchange, transactionData) {
127
+ // check if all credentials are present for the transaction data
128
+ // This needs a deep integration into pex and out pex requirements
129
+ const inputDescriptorsToSignTransactionData = [];
130
+ for (const tdEntry of transactionData) {
131
+ // find a inputDescriptor in the credential_ids which is present in the response
132
+ // and use it to sign of the transaction
133
+ const inputDescriptorForCredential = tdEntry.credential_ids.find((credentialId) => presentationExchange.credentials[credentialId]);
134
+ if (!inputDescriptorForCredential) {
135
+ throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
136
+ }
137
+ inputDescriptorsToSignTransactionData.push(inputDescriptorForCredential);
138
+ }
139
+ return inputDescriptorsToSignTransactionData;
140
+ }
44
141
  async acceptAuthorizationRequest(agentContext, options) {
45
- var _a;
46
- const { authorizationRequest, presentationExchange } = options;
142
+ const { authorizationRequest, presentationExchange, dcql } = options;
47
143
  let openIdTokenIssuer = options.openIdTokenIssuer;
48
144
  let presentationExchangeOptions = undefined;
49
- const wantsIdToken = await authorizationRequest.authorizationRequest.containsResponseType(did_auth_siop_1.ResponseType.ID_TOKEN);
145
+ let dcqlOptions = undefined;
146
+ const nonce = authorizationRequest.payload.nonce;
147
+ const clientId = authorizationRequest.payload.client_id;
148
+ let responseUri;
149
+ if ((0, oid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
150
+ const _responseUri = authorizationRequest.client.identifier ?? options.origin;
151
+ if (!_responseUri) {
152
+ throw new core_1.CredoError('Missing required parameter `origin` parameter for accepting openid4vp dc api requests.');
153
+ }
154
+ responseUri = _responseUri;
155
+ }
156
+ else {
157
+ const _responseUri = authorizationRequest.payload.response_uri ?? authorizationRequest.payload.redirect_uri;
158
+ if (!_responseUri) {
159
+ throw new core_1.CredoError('Missing required parameter `response_uri` or `redirect_uri` in the authorization request.');
160
+ }
161
+ responseUri = _responseUri;
162
+ }
163
+ const wantsIdToken = authorizationRequest.payload.response_type.includes('id_token');
50
164
  const authorizationResponseNonce = await agentContext.wallet.generateNonce();
51
165
  // Handle presentation exchange part
52
- if (authorizationRequest.presentationDefinitions && authorizationRequest.presentationDefinitions.length > 0) {
166
+ if (authorizationRequest.pex) {
53
167
  if (!presentationExchange) {
54
168
  throw new core_1.CredoError('Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.');
55
169
  }
56
- const nonce = await authorizationRequest.authorizationRequest.getMergedProperty('nonce');
57
- if (!nonce) {
58
- throw new core_1.CredoError("Unable to extract 'nonce' from authorization request");
170
+ let inputDescriptorsToSignTransactionData = undefined;
171
+ if (authorizationRequest.transactionData && presentationExchange) {
172
+ inputDescriptorsToSignTransactionData = await this.getInputDescriptorsToSignTransactionData(presentationExchange, authorizationRequest.transactionData);
59
173
  }
60
- const clientId = await authorizationRequest.authorizationRequest.getMergedProperty('client_id');
61
- if (!clientId) {
62
- throw new core_1.CredoError("Unable to extract 'client_id' from authorization request");
63
- }
64
- const responseUri = (_a = (await authorizationRequest.authorizationRequest.getMergedProperty('response_uri'))) !== null && _a !== void 0 ? _a : (await authorizationRequest.authorizationRequest.getMergedProperty('redirect_uri'));
65
- if (!responseUri) {
66
- throw new core_1.CredoError("Unable to extract 'response_uri' from authorization request");
67
- }
68
- const { verifiablePresentations, presentationSubmission } = await this.presentationExchangeService.createPresentation(agentContext, {
174
+ const { presentationSubmission, encodedVerifiablePresentations, verifiablePresentations } = await this.presentationExchangeService.createPresentation(agentContext, {
69
175
  credentialsForInputDescriptor: presentationExchange.credentials,
70
- presentationDefinition: authorizationRequest.presentationDefinitions[0].definition,
176
+ transactionDataAuthorization: authorizationRequest.transactionData && inputDescriptorsToSignTransactionData
177
+ ? {
178
+ credentials: inputDescriptorsToSignTransactionData,
179
+ transactionData: authorizationRequest.transactionData,
180
+ }
181
+ : undefined,
182
+ presentationDefinition: authorizationRequest.pex
183
+ .presentation_definition,
71
184
  challenge: nonce,
72
185
  domain: clientId,
73
186
  presentationSubmissionLocation: core_1.DifPresentationExchangeSubmissionLocation.EXTERNAL,
74
- openid4vp: {
75
- mdocGeneratedNonce: authorizationResponseNonce,
76
- responseUri,
77
- },
187
+ openid4vp: { mdocGeneratedNonce: authorizationResponseNonce, responseUri },
78
188
  });
79
- presentationExchangeOptions = {
80
- verifiablePresentations: verifiablePresentations.map((vp) => (0, transform_1.getSphereonVerifiablePresentation)(vp)),
81
- presentationSubmission,
82
- vpTokenLocation: did_auth_siop_1.VPTokenLocation.AUTHORIZATION_RESPONSE,
83
- };
84
- if (wantsIdToken && !openIdTokenIssuer) {
85
- openIdTokenIssuer = this.getOpenIdTokenIssuerFromVerifiablePresentation(verifiablePresentations[0]);
86
- }
189
+ presentationExchangeOptions = { verifiablePresentations, encodedVerifiablePresentations, presentationSubmission };
87
190
  }
88
191
  else if (options.presentationExchange) {
89
192
  throw new core_1.CredoError('`presentationExchange` was supplied, but no presentation definition was found in the presentation request.');
90
193
  }
194
+ if (authorizationRequest.dcql) {
195
+ if (!dcql) {
196
+ throw new core_1.CredoError('Authorization request included dcql request. `dcql` MUST be supplied to accept authorization requests.');
197
+ }
198
+ let credentialQuerIdsToSignTd = undefined;
199
+ if (authorizationRequest.transactionData) {
200
+ credentialQuerIdsToSignTd = await this.getCredentialQueryIdsToSignTransactionData(dcql, authorizationRequest.transactionData);
201
+ }
202
+ const { dcqlPresentation, encodedDcqlPresentation } = await this.dcqlService.createPresentation(agentContext, {
203
+ credentialQueryToCredential: dcql.credentials,
204
+ transactionDataAuthorization: authorizationRequest.transactionData && credentialQuerIdsToSignTd
205
+ ? {
206
+ credentials: credentialQuerIdsToSignTd,
207
+ transactionData: authorizationRequest.transactionData,
208
+ }
209
+ : undefined,
210
+ challenge: nonce,
211
+ domain: clientId,
212
+ openid4vp: { mdocGeneratedNonce: authorizationResponseNonce, responseUri },
213
+ });
214
+ dcqlOptions = {
215
+ verifiablePresentations: dcqlPresentation,
216
+ encodedVerifiablePresentations: encodedDcqlPresentation,
217
+ };
218
+ }
219
+ else if (options.dcql) {
220
+ throw new core_1.CredoError('`dcql` was supplied, but no dcql request was found in the presentation request.');
221
+ }
91
222
  if (wantsIdToken) {
223
+ const presentations = presentationExchangeOptions?.verifiablePresentations ??
224
+ (dcqlOptions?.verifiablePresentations ? Object.values(dcqlOptions.verifiablePresentations) : []) ??
225
+ [];
226
+ const nonMdocPresentation = presentations.find((presentation) => presentation instanceof core_1.MdocDeviceResponse === false);
227
+ if (nonMdocPresentation) {
228
+ openIdTokenIssuer = this.getOpenIdTokenIssuerFromVerifiablePresentation(nonMdocPresentation);
229
+ }
92
230
  if (!openIdTokenIssuer) {
93
231
  throw new core_1.CredoError('Unable to create authorization response. openIdTokenIssuer MUST be supplied when no presentation is active and the ResponseType includes id_token.');
94
232
  }
95
- this.assertValidTokenIssuer(authorizationRequest, openIdTokenIssuer);
96
233
  }
97
234
  const jwtIssuer = wantsIdToken && openIdTokenIssuer
98
235
  ? await (0, utils_1.openIdTokenIssuerToJwtIssuer)(agentContext, openIdTokenIssuer)
99
236
  : undefined;
100
- const openidProvider = await this.getOpenIdProvider(agentContext);
101
- const authorizationResponseWithCorrelationId = await openidProvider.createAuthorizationResponse(authorizationRequest, {
102
- jwtIssuer,
103
- presentationExchange: presentationExchangeOptions,
104
- // https://openid.net/specs/openid-connect-self-issued-v2-1_0.html#name-aud-of-a-request-object
105
- audience: authorizationRequest.authorizationRequestPayload.client_id,
106
- });
107
- const getCreateJarmResponseCallback = (authorizationResponseNonce) => {
108
- return async (opts) => {
109
- var _a;
110
- const { authorizationResponsePayload, requestObjectPayload } = opts;
111
- const jwk = await did_auth_siop_1.OP.extractEncJwksFromClientMetadata(requestObjectPayload.client_metadata);
112
- if (!jwk.kty) {
113
- throw new core_1.CredoError('Missing kty in jwk.');
114
- }
115
- const validatedMetadata = did_auth_siop_1.OP.validateJarmMetadata({
116
- client_metadata: requestObjectPayload.client_metadata,
117
- server_metadata: {
237
+ let vpToken = presentationExchangeOptions?.encodedVerifiablePresentations.length === 1 &&
238
+ presentationExchangeOptions.presentationSubmission?.descriptor_map[0]?.path === '$'
239
+ ? presentationExchangeOptions.encodedVerifiablePresentations[0]
240
+ : presentationExchangeOptions?.encodedVerifiablePresentations;
241
+ if (dcqlOptions?.encodedVerifiablePresentations) {
242
+ vpToken = dcqlOptions.encodedVerifiablePresentations;
243
+ }
244
+ const openid4vpClient = this.getOid4vpClient(agentContext);
245
+ const response = await openid4vpClient.createOpenid4vpAuthorizationResponse({
246
+ requestParams: authorizationRequest.payload,
247
+ responseParams: {
248
+ vp_token: vpToken,
249
+ presentation_submission: presentationExchangeOptions?.presentationSubmission,
250
+ },
251
+ jarm: authorizationRequest.payload.response_mode && (0, oid4vp_1.isJarmResponseMode)(authorizationRequest.payload.response_mode)
252
+ ? {
253
+ jwtSigner: jwtIssuer,
254
+ encryption: { nonce: authorizationResponseNonce },
255
+ serverMetadata: {
256
+ authorization_signing_alg_values_supported: ['RS256'],
118
257
  authorization_encryption_alg_values_supported: ['ECDH-ES'],
119
258
  authorization_encryption_enc_values_supported: ['A256GCM'],
120
259
  },
121
- });
122
- if (validatedMetadata.type !== 'encrypted') {
123
- throw new core_1.CredoError('Only encrypted JARM responses are supported.');
124
260
  }
125
- // Extract nonce from the request, we use this as the `apv`
126
- const nonce = (_a = authorizationRequest.payload) === null || _a === void 0 ? void 0 : _a.nonce;
127
- if (!nonce || typeof nonce !== 'string') {
128
- throw new core_1.CredoError('Missing nonce in authorization request payload');
129
- }
130
- const jwe = await this.encryptJarmResponse(agentContext, {
131
- jwkJson: jwk,
132
- payload: authorizationResponsePayload,
133
- authorizationRequestNonce: nonce,
134
- alg: validatedMetadata.client_metadata.authorization_encrypted_response_alg,
135
- enc: validatedMetadata.client_metadata.authorization_encrypted_response_enc,
136
- authorizationResponseNonce,
137
- });
138
- return { response: jwe };
139
- };
140
- };
141
- const response = await openidProvider.submitAuthorizationResponse(authorizationResponseWithCorrelationId, getCreateJarmResponseCallback(authorizationResponseNonce));
142
- const responseText = await response
261
+ : undefined,
262
+ });
263
+ if ((0, oid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
264
+ throw new core_1.CredoError('Submission of DC API responses is not yet supported.');
265
+ }
266
+ const result = await openid4vpClient.submitOpenid4vpAuthorizationResponse({
267
+ request: authorizationRequest.payload,
268
+ response: response.responseParams,
269
+ jarm: response.jarm ? { responseJwt: response.jarm.responseJwt } : undefined,
270
+ });
271
+ const responseText = await result.response
143
272
  .clone()
144
273
  .text()
145
274
  .catch(() => null);
146
- const responseJson = (await response
275
+ const responseJson = (await result.response
147
276
  .clone()
148
277
  .json()
149
278
  .catch(() => null));
150
- if (!response.ok) {
279
+ if (!result.response.ok) {
151
280
  return {
152
281
  ok: false,
153
282
  serverResponse: {
154
- status: response.status,
155
- body: responseJson !== null && responseJson !== void 0 ? responseJson : responseText,
283
+ status: result.response.status,
284
+ body: responseJson ?? responseText,
156
285
  },
157
- submittedResponse: authorizationResponseWithCorrelationId.response.payload,
286
+ submittedResponse: response.responseParams,
158
287
  };
159
288
  }
160
289
  return {
161
290
  ok: true,
162
291
  serverResponse: {
163
- status: response.status,
164
- body: responseJson !== null && responseJson !== void 0 ? responseJson : {},
292
+ status: result.response.status,
293
+ body: responseJson ?? {},
165
294
  },
166
- submittedResponse: authorizationResponseWithCorrelationId.response.payload,
167
- redirectUri: responseJson === null || responseJson === void 0 ? void 0 : responseJson.redirect_uri,
168
- presentationDuringIssuanceSession: responseJson === null || responseJson === void 0 ? void 0 : responseJson.presentation_during_issuance_session,
295
+ submittedResponse: response.responseParams,
296
+ redirectUri: responseJson?.redirect_uri,
297
+ presentationDuringIssuanceSession: responseJson?.presentation_during_issuance_session,
169
298
  };
170
299
  }
171
- async getOpenIdProvider(agentContext) {
172
- const builder = did_auth_siop_1.OP.builder()
173
- .withExpiresIn(6000)
174
- .withIssuer(did_auth_siop_1.ResponseIss.SELF_ISSUED_V2)
175
- .withResponseMode(did_auth_siop_1.ResponseMode.POST)
176
- .withSupportedVersions([
177
- did_auth_siop_1.SupportedVersion.SIOPv2_D11,
178
- did_auth_siop_1.SupportedVersion.SIOPv2_D12_OID4VP_D18,
179
- did_auth_siop_1.SupportedVersion.SIOPv2_D12_OID4VP_D20,
180
- ])
181
- .withCreateJwtCallback((0, utils_1.getCreateJwtCallback)(agentContext))
182
- .withVerifyJwtCallback((0, utils_1.getVerifyJwtCallback)(agentContext))
183
- .withHasher(core_1.Hasher.hash);
184
- const openidProvider = builder.build();
185
- return openidProvider;
186
- }
187
300
  getOpenIdTokenIssuerFromVerifiablePresentation(verifiablePresentation) {
188
301
  let openIdTokenIssuer;
189
302
  if (verifiablePresentation instanceof core_1.W3cJsonLdVerifiablePresentation) {
@@ -239,64 +352,11 @@ let OpenId4VcSiopHolderService = class OpenId4VcSiopHolderService {
239
352
  }
240
353
  return openIdTokenIssuer;
241
354
  }
242
- assertValidTokenIssuer(authorizationRequest, openIdTokenIssuer) {
243
- const subjectSyntaxTypesSupported = authorizationRequest.registrationMetadataPayload.subject_syntax_types_supported;
244
- if (!subjectSyntaxTypesSupported) {
245
- throw new core_1.CredoError('subject_syntax_types_supported is not supplied in the registration metadata. subject_syntax_types is REQUIRED.');
246
- }
247
- let allowedSubjectSyntaxTypes = [];
248
- if (openIdTokenIssuer.method === 'did') {
249
- const parsedDid = (0, core_1.parseDid)(openIdTokenIssuer.didUrl);
250
- // Either did:<method> or did (for all did methods) is allowed
251
- allowedSubjectSyntaxTypes = [`did:${parsedDid.method}`, 'did'];
252
- }
253
- else if (openIdTokenIssuer.method === 'jwk') {
254
- allowedSubjectSyntaxTypes = ['urn:ietf:params:oauth:jwk-thumbprint'];
255
- }
256
- else {
257
- throw new core_1.CredoError("Only 'did' and 'jwk' are supported as openIdTokenIssuer at the moment");
258
- }
259
- // At least one of the allowed subject syntax types must be supported by the RP
260
- if (!allowedSubjectSyntaxTypes.some((allowed) => subjectSyntaxTypesSupported.includes(allowed))) {
261
- throw new core_1.CredoError([
262
- 'The provided openIdTokenIssuer is not supported by the relying party.',
263
- `Supported subject syntax types: '${subjectSyntaxTypesSupported.join(', ')}'`,
264
- ].join('\n'));
265
- }
266
- }
267
- async encryptJarmResponse(agentContext, options) {
268
- const { payload, jwkJson } = options;
269
- const jwk = (0, core_1.getJwkFromJson)(jwkJson);
270
- const key = jwk.key;
271
- if (!agentContext.wallet.directEncryptCompactJweEcdhEs) {
272
- throw new core_1.CredoError('Cannot decrypt Jarm Response, wallet does not support directEncryptCompactJweEcdhEs. You need to upgrade your wallet implementation.');
273
- }
274
- if (options.alg !== 'ECDH-ES') {
275
- throw new core_1.CredoError("Only 'ECDH-ES' is supported as 'alg' value for JARM response encryption");
276
- }
277
- if (options.enc !== 'A256GCM') {
278
- throw new core_1.CredoError("Only 'A256GCM' is supported as 'enc' value for JARM response encryption");
279
- }
280
- if (key.keyType !== core_1.KeyType.P256) {
281
- throw new core_1.CredoError(`Only '${core_1.KeyType.P256}' key type is supported for JARM response encryption`);
282
- }
283
- const data = core_1.Buffer.from(JSON.stringify(payload));
284
- const jwe = await agentContext.wallet.directEncryptCompactJweEcdhEs({
285
- data,
286
- recipientKey: key,
287
- header: {
288
- kid: jwkJson.kid,
289
- },
290
- encryptionAlgorithm: options.enc,
291
- apu: core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(options.authorizationResponseNonce)),
292
- apv: core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(options.authorizationRequestNonce)),
293
- });
294
- return jwe;
295
- }
296
355
  };
297
356
  exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService;
298
357
  exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService = __decorate([
299
358
  (0, core_1.injectable)(),
300
- __metadata("design:paramtypes", [core_1.DifPresentationExchangeService])
359
+ __metadata("design:paramtypes", [core_1.DifPresentationExchangeService,
360
+ core_1.DcqlService])
301
361
  ], OpenId4VcSiopHolderService);
302
362
  //# sourceMappingURL=OpenId4vcSiopHolderService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4vcSiopHolderService.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4vcSiopHolderService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,yCAeuB;AACvB,2DAAwH;AAExH,mDAAuE;AACvE,2CAA0G;AAGnG,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YAA2B,2BAA2D;QAA3D,gCAA2B,GAA3B,2BAA2B,CAAgC;IAAG,CAAC;IAEnF,KAAK,CAAC,2BAA2B,CACtC,YAA0B,EAC1B,eAAuB;;QAEvB,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;QAEjE,8DAA8D;QAC9D,MAAM,4BAA4B,GAAG,MAAM,cAAc,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAA;QAErG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAC9B,mDAAmD,4BAA4B,CAAC,MAAM,GAAG,CAC1F,CAAA;QACD,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,eAAe,GAAG,CAAC,CAAA;QAExE,IACE,4BAA4B,CAAC,uBAAuB;YACpD,4BAA4B,CAAC,uBAAuB,CAAC,MAAM,GAA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AAC;iBAAM,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAClC,iBAAiB,GAAG;oBAClB,MAAM,EAAE,GAAG;oBACX,MAAM,EAAE,KAAK;iBACd,CAAA;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,iBAAU,CAClB,4IAA4I,CAC7I,CAAA;YACH,CAAC;QACH,CAAC;aAAM,IAAI,sBAAsB,YAAY,yBAAkB,EAAE,CAAC;YAChE,MAAM,IAAI,iBAAU,CAAC,qDAAqD,CAAC,CAAA;QAC7E,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAA;YAC9C,qFAAqF;YACrF,IACE,CAAC,GAAG;gBACJ,OAAO,GAAG,KAAK,QAAQ;gBACvB,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC;gBACf,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ;gBAC3B,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC3B,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EACtB,CAAC;gBACD,MAAM,IAAI,iBAAU,CAClB,+LAA+L,CAChM,CAAA;YACH,CAAC;YAED,iBAAiB,GAAG;gBAClB,MAAM,EAAE,GAAG,CAAC,GAAG;gBACf,MAAM,EAAE,KAAK;aACd,CAAA;QACH,CAAC;QAED,OAAO,iBAAiB,CAAA;IAC1B,CAAC;CACF,CAAA;AA5dY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,iBAAU,GAAE;qCAG4B,qCAA8B;QAC9C,kBAAW;GAHvB,0BAA0B,CA4dtC"}
@@ -1,5 +1,5 @@
1
+ import type { DcqlCredentialsForRequest, DcqlQueryResult, DcqlTransactionDataRequest, DifPexCredentialsForRequest, DifPexInputDescriptorToCredentials, DifPresentationExchangeDefinition, TransactionDataRequest } from '@credo-ts/core';
1
2
  import type { OpenId4VcJwtIssuer, OpenId4VcSiopVerifiedAuthorizationRequest } from '../shared';
2
- import type { DifPexCredentialsForRequest, DifPexInputDescriptorToCredentials, DifPresentationExchangeDefinition } from '@credo-ts/core';
3
3
  export interface OpenId4VcSiopResolvedAuthorizationRequest {
4
4
  /**
5
5
  * Parameters related to DIF Presentation Exchange. Only defined when
@@ -8,6 +8,11 @@ export interface OpenId4VcSiopResolvedAuthorizationRequest {
8
8
  presentationExchange?: {
9
9
  definition: DifPresentationExchangeDefinition;
10
10
  credentialsForRequest: DifPexCredentialsForRequest;
11
+ transactionData?: TransactionDataRequest;
12
+ };
13
+ dcql?: {
14
+ queryResult: DcqlQueryResult;
15
+ transactionData?: DcqlTransactionDataRequest;
11
16
  };
12
17
  /**
13
18
  * The verified authorization request.
@@ -22,6 +27,13 @@ export interface OpenId4VcSiopAcceptAuthorizationRequestOptions {
22
27
  presentationExchange?: {
23
28
  credentials: DifPexInputDescriptorToCredentials;
24
29
  };
30
+ /**
31
+ * Parameters related to Dcql. MUST be present when the resolved
32
+ * authorization request included a `dcql` parameter.
33
+ */
34
+ dcql?: {
35
+ credentials: DcqlCredentialsForRequest;
36
+ };
25
37
  /**
26
38
  * The issuer of the ID Token.
27
39
  *
@@ -35,4 +47,9 @@ export interface OpenId4VcSiopAcceptAuthorizationRequestOptions {
35
47
  * The verified authorization request.
36
48
  */
37
49
  authorizationRequest: OpenId4VcSiopVerifiedAuthorizationRequest;
50
+ /**
51
+ * The origin of the verifier that is making the request.
52
+ * Required in combination with the DC Api
53
+ */
54
+ origin?: string;
38
55
  }