@credo-ts/openid4vc 0.6.0-pr-2195-20250226100854 → 0.6.0-pr-2195-20250321180923
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/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +29 -29
- package/build/openid4vc-holder/OpenId4VcHolderApi.js +16 -16
- package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderModule.js +2 -2
- package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +2 -2
- package/build/openid4vc-holder/OpenId4VciHolderService.js +6 -6
- package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +1 -1
- package/build/openid4vc-holder/{OpenId4vcSiopHolderService.d.ts → OpenId4vpHolderService.d.ts} +21 -22
- package/build/openid4vc-holder/OpenId4vpHolderService.js +317 -0
- package/build/openid4vc-holder/OpenId4vpHolderService.js.map +1 -0
- package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.ts +81 -0
- package/build/openid4vc-holder/{OpenId4vcSiopHolderServiceOptions.js → OpenId4vpHolderServiceOptions.js} +1 -1
- package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.js.map +1 -0
- package/build/openid4vc-holder/index.d.ts +2 -2
- package/build/openid4vc-holder/index.js +2 -2
- package/build/openid4vc-holder/index.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +2 -3
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js +13 -16
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +8 -8
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +11 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +3 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +1 -1
- package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +2 -2
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.js +1 -0
- package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +15 -0
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/util/txCode.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +13 -26
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +16 -25
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +4 -4
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +30 -7
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +16 -12
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +1 -1
- package/build/openid4vc-verifier/{OpenId4VcSiopVerifierService.d.ts → OpenId4VpVerifierService.d.ts} +17 -33
- package/build/openid4vc-verifier/OpenId4VpVerifierService.js +765 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierService.js.map +1 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.ts +146 -0
- package/build/openid4vc-verifier/{OpenId4VcSiopVerifierServiceOptions.js → OpenId4VpVerifierServiceOptions.js} +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.js.map +1 -0
- package/build/openid4vc-verifier/index.d.ts +2 -2
- package/build/openid4vc-verifier/index.js +2 -2
- package/build/openid4vc-verifier/index.js.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +25 -9
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +21 -2
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +3 -3
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +1 -1
- package/build/openid4vc-verifier/router/authorizationEndpoint.d.ts +2 -10
- package/build/openid4vc-verifier/router/authorizationEndpoint.js +94 -7
- package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +2 -10
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +18 -6
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -1
- package/build/shared/callbacks.d.ts +2 -2
- package/build/shared/callbacks.js +10 -7
- package/build/shared/callbacks.js.map +1 -1
- package/build/shared/models/index.d.ts +4 -4
- package/build/shared/models/index.js.map +1 -1
- package/build/shared/router/context.d.ts +2 -2
- package/build/shared/router/context.js +9 -5
- package/build/shared/router/context.js.map +1 -1
- package/build/shared/router/express.js +1 -2
- package/build/shared/router/express.js.map +1 -1
- package/build/shared/transactionData.d.ts +5 -0
- package/build/shared/transactionData.js +22 -0
- package/build/shared/transactionData.js.map +1 -0
- package/build/shared/utils.d.ts +1 -1
- package/build/shared/utils.js +3 -3
- package/build/shared/utils.js.map +1 -1
- package/package.json +7 -6
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +0 -306
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +0 -1
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +0 -54
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +0 -806
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +0 -93
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js.map +0 -1
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.OpenId4VcSiopHolderService = void 0;
|
|
13
|
-
const core_1 = require("@credo-ts/core");
|
|
14
|
-
const openid4vp_1 = require("@openid4vc/openid4vp");
|
|
15
|
-
const callbacks_1 = require("../shared/callbacks");
|
|
16
|
-
let OpenId4VcSiopHolderService = class OpenId4VcSiopHolderService {
|
|
17
|
-
constructor(presentationExchangeService, dcqlService) {
|
|
18
|
-
this.presentationExchangeService = presentationExchangeService;
|
|
19
|
-
this.dcqlService = dcqlService;
|
|
20
|
-
}
|
|
21
|
-
getOpenid4vpClient(agentContext, trustedCertificates) {
|
|
22
|
-
const callbacks = (0, callbacks_1.getOid4vcCallbacks)(agentContext, trustedCertificates);
|
|
23
|
-
return new openid4vp_1.Openid4vpClient({ callbacks });
|
|
24
|
-
}
|
|
25
|
-
async handlePresentationExchangeRequest(agentContext, _presentationDefinition, transactionData) {
|
|
26
|
-
const presentationDefinition = _presentationDefinition;
|
|
27
|
-
this.presentationExchangeService.validatePresentationDefinition(presentationDefinition);
|
|
28
|
-
const presentationExchange = {
|
|
29
|
-
definition: presentationDefinition,
|
|
30
|
-
credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(agentContext, presentationDefinition),
|
|
31
|
-
};
|
|
32
|
-
let credentialsForTransactionData = undefined;
|
|
33
|
-
// for each transaction data entry, get all submission entries that can be used to sign the respective transaction
|
|
34
|
-
if (transactionData) {
|
|
35
|
-
credentialsForTransactionData = [];
|
|
36
|
-
for (const transactionDataEntry of transactionData) {
|
|
37
|
-
for (const requirement of presentationExchange.credentialsForRequest.requirements) {
|
|
38
|
-
const recordSet = new Set();
|
|
39
|
-
const filtered = requirement.submissionEntry.filter((submission) => transactionDataEntry.credential_ids.includes(submission.inputDescriptorId));
|
|
40
|
-
for (const submission of filtered) {
|
|
41
|
-
for (const credential of submission.verifiableCredentials) {
|
|
42
|
-
recordSet.add(credential);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (recordSet.size === 0) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
credentialsForTransactionData.push({
|
|
49
|
-
transactionDataEntry,
|
|
50
|
-
submissionEntry: { ...filtered[0], verifiableCredentials: Array.from(recordSet) },
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return { pex: { ...presentationExchange, transactionData: credentialsForTransactionData } };
|
|
56
|
-
}
|
|
57
|
-
async handleDcqlRequest(agentContext, dcql, transactionData) {
|
|
58
|
-
const dcqlQuery = this.dcqlService.validateDcqlQuery(dcql);
|
|
59
|
-
const dcqlQueryResult = await this.dcqlService.getCredentialsForRequest(agentContext, dcqlQuery);
|
|
60
|
-
let credentialsForTransactionData = undefined;
|
|
61
|
-
// for each transaction data entry, get all submission entries that can be used to sign the respective transaction
|
|
62
|
-
if (transactionData) {
|
|
63
|
-
credentialsForTransactionData = [];
|
|
64
|
-
for (const transactionDataEntry of transactionData) {
|
|
65
|
-
const result = transactionDataEntry.credential_ids
|
|
66
|
-
.map((credentialId) => {
|
|
67
|
-
const match = dcqlQueryResult.credential_matches[credentialId];
|
|
68
|
-
if (!match.success)
|
|
69
|
-
return undefined;
|
|
70
|
-
return {
|
|
71
|
-
transactionDataEntry,
|
|
72
|
-
dcql: {
|
|
73
|
-
record: match.record,
|
|
74
|
-
credentialQueryId: match.input_credential_index,
|
|
75
|
-
claimSetId: match.claim_set_index,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
})
|
|
79
|
-
.filter((r) => r !== undefined);
|
|
80
|
-
credentialsForTransactionData.push(...result);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return { dcql: { queryResult: dcqlQueryResult, transactionData: credentialsForTransactionData } };
|
|
84
|
-
}
|
|
85
|
-
async resolveAuthorizationRequest(agentContext,
|
|
86
|
-
/**
|
|
87
|
-
* Can be:
|
|
88
|
-
* - JWT
|
|
89
|
-
* - URI containing request or request_uri param
|
|
90
|
-
* - Request payload
|
|
91
|
-
*/
|
|
92
|
-
request, options) {
|
|
93
|
-
const openid4vpClient = this.getOpenid4vpClient(agentContext, options?.trustedCertificates);
|
|
94
|
-
const { params } = openid4vpClient.parseOpenid4vpAuthorizationRequestPayload({ authorizationRequest: request });
|
|
95
|
-
const verifiedAuthRequest = await openid4vpClient.resolveOpenId4vpAuthorizationRequest({
|
|
96
|
-
request: params,
|
|
97
|
-
origin: options?.origin,
|
|
98
|
-
});
|
|
99
|
-
const { client, pex, transactionData, dcql } = verifiedAuthRequest;
|
|
100
|
-
if (client.scheme !== 'x509_san_dns' &&
|
|
101
|
-
client.scheme !== 'x509_san_uri' &&
|
|
102
|
-
client.scheme !== 'did' &&
|
|
103
|
-
client.scheme !== 'web-origin') {
|
|
104
|
-
throw new core_1.CredoError(`Client scheme '${client.scheme}' is not supported`);
|
|
105
|
-
}
|
|
106
|
-
const { pex: pexResult } = pex?.presentation_definition
|
|
107
|
-
? await this.handlePresentationExchangeRequest(agentContext, pex.presentation_definition, transactionData)
|
|
108
|
-
: { pex: undefined };
|
|
109
|
-
const { dcql: dcqlResult } = dcql?.query
|
|
110
|
-
? await this.handleDcqlRequest(agentContext, dcql.query, transactionData)
|
|
111
|
-
: { dcql: undefined };
|
|
112
|
-
agentContext.config.logger.debug(`verified Authorization Request`);
|
|
113
|
-
agentContext.config.logger.debug(`request '${request}'`);
|
|
114
|
-
return {
|
|
115
|
-
authorizationRequest: verifiedAuthRequest,
|
|
116
|
-
presentationExchange: pexResult,
|
|
117
|
-
dcql: dcqlResult,
|
|
118
|
-
origin: options?.origin,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
async getCredentialQueryIdsToSignTransactionData(dcql, transactionData) {
|
|
122
|
-
// check if all credentials are present for the transaction data
|
|
123
|
-
// This needs a deep integration into pex and out pex requirements
|
|
124
|
-
const dcqlCredentialQueryIds = [];
|
|
125
|
-
for (const tdEntry of transactionData) {
|
|
126
|
-
// find a inputDescriptor in the credential_ids which is present in the response
|
|
127
|
-
// and use it to sign of the transaction
|
|
128
|
-
const dcqlCredentialForRequest = tdEntry.credential_ids.find((credentialId) => dcql.credentials[credentialId]);
|
|
129
|
-
if (!dcqlCredentialForRequest) {
|
|
130
|
-
throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
|
|
131
|
-
}
|
|
132
|
-
dcqlCredentialQueryIds.push(dcqlCredentialForRequest);
|
|
133
|
-
}
|
|
134
|
-
return dcqlCredentialQueryIds;
|
|
135
|
-
}
|
|
136
|
-
async getInputDescriptorsToSignTransactionData(presentationExchange, transactionData) {
|
|
137
|
-
// check if all credentials are present for the transaction data
|
|
138
|
-
// This needs a deep integration into pex and out pex requirements
|
|
139
|
-
const inputDescriptorsToSignTransactionData = [];
|
|
140
|
-
for (const tdEntry of transactionData) {
|
|
141
|
-
// find a inputDescriptor in the credential_ids which is present in the response
|
|
142
|
-
// and use it to sign of the transaction
|
|
143
|
-
const inputDescriptorForCredential = tdEntry.credential_ids.find((credentialId) => presentationExchange.credentials[credentialId]);
|
|
144
|
-
if (!inputDescriptorForCredential) {
|
|
145
|
-
throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
|
|
146
|
-
}
|
|
147
|
-
inputDescriptorsToSignTransactionData.push(inputDescriptorForCredential);
|
|
148
|
-
}
|
|
149
|
-
return inputDescriptorsToSignTransactionData;
|
|
150
|
-
}
|
|
151
|
-
async acceptAuthorizationRequest(agentContext, options) {
|
|
152
|
-
const { authorizationRequest, presentationExchange, dcql } = options;
|
|
153
|
-
const authorizationResponseNonce = await agentContext.wallet.generateNonce();
|
|
154
|
-
const nonce = authorizationRequest.payload.nonce;
|
|
155
|
-
const clientId = authorizationRequest.client.originalValue;
|
|
156
|
-
let openid4vpOptions;
|
|
157
|
-
if ((0, openid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
|
|
158
|
-
if (!options.origin) {
|
|
159
|
-
throw new core_1.CredoError('Missing required parameter `origin` parameter for accepting openid4vp dc api requests.');
|
|
160
|
-
}
|
|
161
|
-
openid4vpOptions = { type: 'openId4VpDcApi', clientId, origin: options.origin, verifierGeneratedNonce: nonce };
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
const responseUri = authorizationRequest.payload.response_uri ?? authorizationRequest.payload.redirect_uri;
|
|
165
|
-
if (!responseUri) {
|
|
166
|
-
throw new core_1.CredoError('Missing required parameter `response_uri` or `redirect_uri` in the authorization request.');
|
|
167
|
-
}
|
|
168
|
-
openid4vpOptions = {
|
|
169
|
-
type: 'openId4Vp',
|
|
170
|
-
mdocGeneratedNonce: authorizationResponseNonce,
|
|
171
|
-
responseUri,
|
|
172
|
-
clientId,
|
|
173
|
-
verifierGeneratedNonce: nonce,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
let vpToken;
|
|
177
|
-
let presentationSubmission = undefined;
|
|
178
|
-
// Handle presentation exchange part
|
|
179
|
-
if (authorizationRequest.pex || presentationExchange) {
|
|
180
|
-
if (!presentationExchange) {
|
|
181
|
-
throw new core_1.CredoError('Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.');
|
|
182
|
-
}
|
|
183
|
-
if (!authorizationRequest.pex) {
|
|
184
|
-
throw new core_1.CredoError('`presentationExchange` was supplied, but no presentation definition was found in the presentation request.');
|
|
185
|
-
}
|
|
186
|
-
const { presentationSubmission: _presentationSubmission, encodedVerifiablePresentations } = await this.presentationExchangeService.createPresentation(agentContext, {
|
|
187
|
-
credentialsForInputDescriptor: presentationExchange.credentials,
|
|
188
|
-
transactionDataAuthorization: authorizationRequest.transactionData
|
|
189
|
-
? {
|
|
190
|
-
credentials: await this.getInputDescriptorsToSignTransactionData(presentationExchange, authorizationRequest.transactionData),
|
|
191
|
-
transactionData: authorizationRequest.transactionData,
|
|
192
|
-
}
|
|
193
|
-
: undefined,
|
|
194
|
-
presentationDefinition: authorizationRequest.pex
|
|
195
|
-
.presentation_definition,
|
|
196
|
-
challenge: nonce,
|
|
197
|
-
domain: clientId,
|
|
198
|
-
presentationSubmissionLocation: core_1.DifPresentationExchangeSubmissionLocation.EXTERNAL,
|
|
199
|
-
openid4vp: openid4vpOptions,
|
|
200
|
-
});
|
|
201
|
-
vpToken =
|
|
202
|
-
encodedVerifiablePresentations.length === 1 && _presentationSubmission?.descriptor_map[0]?.path === '$'
|
|
203
|
-
? encodedVerifiablePresentations[0]
|
|
204
|
-
: encodedVerifiablePresentations;
|
|
205
|
-
presentationSubmission = _presentationSubmission;
|
|
206
|
-
}
|
|
207
|
-
else if (authorizationRequest.dcql || dcql) {
|
|
208
|
-
if (!authorizationRequest.dcql) {
|
|
209
|
-
throw new core_1.CredoError('`dcql` was supplied, but no dcql request was found in the presentation request.');
|
|
210
|
-
}
|
|
211
|
-
if (!dcql) {
|
|
212
|
-
throw new core_1.CredoError('Authorization request included dcql request. `dcql` MUST be supplied to accept authorization requests.');
|
|
213
|
-
}
|
|
214
|
-
const { encodedDcqlPresentation } = await this.dcqlService.createPresentation(agentContext, {
|
|
215
|
-
credentialQueryToCredential: dcql.credentials,
|
|
216
|
-
transactionDataAuthorization: authorizationRequest.transactionData
|
|
217
|
-
? {
|
|
218
|
-
credentials: await this.getCredentialQueryIdsToSignTransactionData(dcql, authorizationRequest.transactionData),
|
|
219
|
-
transactionData: authorizationRequest.transactionData,
|
|
220
|
-
}
|
|
221
|
-
: undefined,
|
|
222
|
-
challenge: nonce,
|
|
223
|
-
domain: clientId,
|
|
224
|
-
openid4vp: openid4vpOptions,
|
|
225
|
-
});
|
|
226
|
-
vpToken = encodedDcqlPresentation;
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
throw new core_1.CredoError('Either pex or dcql must be provided');
|
|
230
|
-
}
|
|
231
|
-
const openid4vpClient = this.getOpenid4vpClient(agentContext);
|
|
232
|
-
const response = await openid4vpClient.createOpenid4vpAuthorizationResponse({
|
|
233
|
-
requestParams: authorizationRequest.payload,
|
|
234
|
-
responseParams: {
|
|
235
|
-
vp_token: vpToken,
|
|
236
|
-
presentation_submission: presentationSubmission,
|
|
237
|
-
},
|
|
238
|
-
jarm: authorizationRequest.payload.response_mode && (0, openid4vp_1.isJarmResponseMode)(authorizationRequest.payload.response_mode)
|
|
239
|
-
? {
|
|
240
|
-
encryption: { nonce: authorizationResponseNonce },
|
|
241
|
-
serverMetadata: {
|
|
242
|
-
authorization_signing_alg_values_supported: ['RS256'],
|
|
243
|
-
authorization_encryption_alg_values_supported: ['ECDH-ES'],
|
|
244
|
-
authorization_encryption_enc_values_supported: ['A128GCM', 'A256GCM', 'A128CBC-HS256'],
|
|
245
|
-
},
|
|
246
|
-
}
|
|
247
|
-
: undefined,
|
|
248
|
-
});
|
|
249
|
-
const authorizationResponsePayload = response.responseParams;
|
|
250
|
-
const authorizationResponse = response.jarm?.responseJwt
|
|
251
|
-
? { response: response.jarm.responseJwt }
|
|
252
|
-
: authorizationResponsePayload;
|
|
253
|
-
// TODO: we should include more typing here that the user
|
|
254
|
-
// still needs to submit the resposne. or as we discussed, split
|
|
255
|
-
// this method up in create and submit
|
|
256
|
-
if ((0, openid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
|
|
257
|
-
return {
|
|
258
|
-
ok: true,
|
|
259
|
-
authorizationResponse,
|
|
260
|
-
authorizationResponsePayload,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
const result = await openid4vpClient.submitOpenid4vpAuthorizationResponse({
|
|
264
|
-
request: authorizationRequest.payload,
|
|
265
|
-
response: response.responseParams,
|
|
266
|
-
jarm: response.jarm ? { responseJwt: response.jarm.responseJwt } : undefined,
|
|
267
|
-
});
|
|
268
|
-
const responseText = await result.response
|
|
269
|
-
.clone()
|
|
270
|
-
.text()
|
|
271
|
-
.catch(() => null);
|
|
272
|
-
const responseJson = (await result.response
|
|
273
|
-
.clone()
|
|
274
|
-
.json()
|
|
275
|
-
.catch(() => null));
|
|
276
|
-
if (!result.response.ok) {
|
|
277
|
-
return {
|
|
278
|
-
ok: false,
|
|
279
|
-
serverResponse: {
|
|
280
|
-
status: result.response.status,
|
|
281
|
-
body: responseJson ?? responseText,
|
|
282
|
-
},
|
|
283
|
-
authorizationResponse,
|
|
284
|
-
authorizationResponsePayload,
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
return {
|
|
288
|
-
ok: true,
|
|
289
|
-
serverResponse: {
|
|
290
|
-
status: result.response.status,
|
|
291
|
-
body: responseJson ?? {},
|
|
292
|
-
},
|
|
293
|
-
authorizationResponse,
|
|
294
|
-
authorizationResponsePayload,
|
|
295
|
-
redirectUri: responseJson?.redirect_uri,
|
|
296
|
-
presentationDuringIssuanceSession: responseJson?.presentation_during_issuance_session,
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService;
|
|
301
|
-
exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService = __decorate([
|
|
302
|
-
(0, core_1.injectable)(),
|
|
303
|
-
__metadata("design:paramtypes", [core_1.DifPresentationExchangeService,
|
|
304
|
-
core_1.DcqlService])
|
|
305
|
-
], OpenId4VcSiopHolderService);
|
|
306
|
-
//# sourceMappingURL=OpenId4vcSiopHolderService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4vcSiopHolderService.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4vcSiopHolderService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yCAMuB;AACvB,oDAAgH;AAEhH,mDAAwD;AAGjD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACU,2BAA2D,EAC3D,WAAwB;QADxB,gCAA2B,GAA3B,2BAA2B,CAAgC;QAC3D,gBAAW,GAAX,WAAW,CAAa;IA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AK,EAAE;aACP,IAAI,EAAE;aACN,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QAEpB,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,QAAQ;aACxC,KAAK,EAAE;aACP,IAAI,EAAE;aACN,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAmC,CAAA;QAEvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACxB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,cAAc,EAAE;oBACd,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;oBAC9B,IAAI,EAAE,YAAY,IAAI,YAAY;iBACnC;gBACD,qBAAqB;gBACrB,4BAA4B;aACpB,CAAA;QACZ,CAAC;QAED,OAAO;YACL,EAAE,EAAE,IAAI;YACR,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;gBAC9B,IAAI,EAAE,YAAY,IAAI,EAAE;aACzB;YACD,qBAAqB;YACrB,4BAA4B;YAC5B,WAAW,EAAE,YAAY,EAAE,YAAkC;YAC7D,iCAAiC,EAAE,YAAY,EAAE,oCAA0D;SACnG,CAAA;IACZ,CAAC;CACF,CAAA;AArXY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,iBAAU,GAAE;qCAG4B,qCAA8B;QAC9C,kBAAW;GAHvB,0BAA0B,CAqXtC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { OpenId4VcSiopVerifiedAuthorizationRequest } from '../shared';
|
|
2
|
-
import type { DcqlCredentialsForRequest, DcqlQueryResult, DcqlTransactionDataRequest, DifPexCredentialsForRequest, DifPexInputDescriptorToCredentials, DifPresentationExchangeDefinition, EncodedX509Certificate, TransactionDataRequest } from '@credo-ts/core';
|
|
3
|
-
export interface ResolveSiopAuthorizationRequestOptions {
|
|
4
|
-
trustedCertificates?: EncodedX509Certificate[];
|
|
5
|
-
origin?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface OpenId4VcSiopResolvedAuthorizationRequest {
|
|
8
|
-
/**
|
|
9
|
-
* Parameters related to DIF Presentation Exchange. Only defined when
|
|
10
|
-
* the request included
|
|
11
|
-
*/
|
|
12
|
-
presentationExchange?: {
|
|
13
|
-
definition: DifPresentationExchangeDefinition;
|
|
14
|
-
credentialsForRequest: DifPexCredentialsForRequest;
|
|
15
|
-
transactionData?: TransactionDataRequest;
|
|
16
|
-
};
|
|
17
|
-
dcql?: {
|
|
18
|
-
queryResult: DcqlQueryResult;
|
|
19
|
-
transactionData?: DcqlTransactionDataRequest;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* The verified authorization request.
|
|
23
|
-
*/
|
|
24
|
-
authorizationRequest: OpenId4VcSiopVerifiedAuthorizationRequest;
|
|
25
|
-
/**
|
|
26
|
-
* Origin of the request, to be used with Digital Credentials API
|
|
27
|
-
*/
|
|
28
|
-
origin?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface OpenId4VcSiopAcceptAuthorizationRequestOptions {
|
|
31
|
-
/**
|
|
32
|
-
* Parameters related to DIF Presentation Exchange. MUST be present when the resolved
|
|
33
|
-
* authorization request included a `presentationExchange` parameter.
|
|
34
|
-
*/
|
|
35
|
-
presentationExchange?: {
|
|
36
|
-
credentials: DifPexInputDescriptorToCredentials;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Parameters related to Dcql. MUST be present when the resolved
|
|
40
|
-
* authorization request included a `dcql` parameter.
|
|
41
|
-
*/
|
|
42
|
-
dcql?: {
|
|
43
|
-
credentials: DcqlCredentialsForRequest;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The verified authorization request.
|
|
47
|
-
*/
|
|
48
|
-
authorizationRequest: OpenId4VcSiopVerifiedAuthorizationRequest;
|
|
49
|
-
/**
|
|
50
|
-
* The origin of the verifier that is making the request.
|
|
51
|
-
* Required in combination with the DC Api
|
|
52
|
-
*/
|
|
53
|
-
origin?: string;
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4vcSiopHolderServiceOptions.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.ts"],"names":[],"mappings":""}
|