@credo-ts/openid4vc 0.6.0-pr-2392-20251010173905 → 0.6.0-pr-2457-20251016083534
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/OpenId4VcApi.d.mts +1 -1
- package/build/OpenId4VcApi.d.ts +1 -1
- package/build/OpenId4VcApi.js +2 -2
- package/build/OpenId4VcApi.mjs +2 -2
- package/build/OpenId4VcModule.d.mts +1 -1
- package/build/OpenId4VcModule.d.ts +1 -1
- package/build/OpenId4VcModule.js +2 -2
- package/build/OpenId4VcModule.mjs +2 -2
- package/build/OpenId4VcModuleConfig.js +1 -1
- package/build/OpenId4VcModuleConfig.mjs +1 -1
- package/build/index.d.mts +15 -14
- package/build/index.d.ts +15 -14
- package/build/index.js +22 -15
- package/build/index.mjs +18 -17
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts.map +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderApi.mjs.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.ts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.js +11 -8
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs +11 -8
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs.map +1 -1
- package/build/openid4vc-holder/OpenId4vpHolderService.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4vpHolderService.d.ts.map +1 -1
- package/build/openid4vc-holder/OpenId4vpHolderService.js +4 -4
- package/build/openid4vc-holder/OpenId4vpHolderService.mjs +4 -4
- package/build/openid4vc-holder/OpenId4vpHolderService.mjs.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts +5 -214
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +5 -214
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +7 -7
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs +7 -7
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts +8 -218
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +8 -218
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js +18 -18
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs +19 -19
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +1 -1
- package/build/openid4vc-issuer/index.js +2 -2
- package/build/openid4vc-issuer/index.mjs +2 -2
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs.map +1 -1
- package/build/openid4vc-issuer/repository/index.js +2 -2
- package/build/openid4vc-issuer/repository/index.mjs +2 -2
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js +3 -4
- package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs +3 -4
- package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +5 -6
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs +6 -7
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.js +5 -6
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs +5 -6
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +2 -4
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs +3 -4
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/deferredCredentialEndpoint.js +2 -4
- package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs +3 -4
- package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/index.js +4 -4
- package/build/openid4vc-issuer/router/index.mjs +4 -4
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/jwksEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/nonceEndpoint.mjs.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +2 -2
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs +2 -2
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts +3 -3
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.ts +3 -3
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.ts.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierService.js +17 -17
- package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs +17 -17
- package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.ts +1 -1
- package/build/openid4vc-verifier/index.js +3 -3
- package/build/openid4vc-verifier/index.mjs +3 -3
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs.map +1 -1
- package/build/openid4vc-verifier/repository/index.js +2 -2
- package/build/openid4vc-verifier/repository/index.mjs +2 -2
- package/build/openid4vc-verifier/router/authorizationEndpoint.js +1 -1
- package/build/openid4vc-verifier/router/authorizationEndpoint.mjs +1 -1
- package/build/openid4vc-verifier/router/authorizationEndpoint.mjs.map +1 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +1 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs +1 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs.map +1 -1
- package/build/shared/callbacks.d.mts +46 -0
- package/build/shared/callbacks.d.mts.map +1 -0
- package/build/shared/callbacks.d.ts +46 -0
- package/build/shared/callbacks.d.ts.map +1 -0
- package/build/shared/callbacks.js +5 -1
- package/build/shared/callbacks.mjs +1 -1
- package/build/shared/callbacks.mjs.map +1 -1
- package/build/shared/index.js +2 -1
- package/build/shared/index.mjs +2 -1
- package/build/shared/issuerMetadataUtils.d.mts +2 -258
- package/build/shared/issuerMetadataUtils.d.mts.map +1 -1
- package/build/shared/issuerMetadataUtils.d.ts +2 -258
- package/build/shared/issuerMetadataUtils.d.ts.map +1 -1
- package/build/shared/issuerMetadataUtils.mjs.map +1 -1
- package/build/shared/models/index.d.ts +1 -1
- package/build/shared/router/context.mjs.map +1 -1
- package/build/shared/router/index.js +1 -1
- package/build/shared/router/index.mjs +1 -1
- package/build/shared/router/tenants.mjs.map +1 -1
- package/build/shared/utils.js +0 -8
- package/build/shared/utils.mjs +1 -7
- package/build/shared/utils.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -83,8 +83,8 @@ let OpenId4VpHolderService = class OpenId4VpHolderService$1 {
|
|
|
83
83
|
}
|
|
84
84
|
extendCredentialsWithTransactionDataHashes(selectedCredentials, transactionData, selectedTransactionDataCredentials) {
|
|
85
85
|
if (!transactionData && !selectedTransactionDataCredentials) return selectedCredentials;
|
|
86
|
-
if (!selectedTransactionDataCredentials) throw new CredoError("
|
|
87
|
-
if (!transactionData) throw new CredoError("
|
|
86
|
+
if (!selectedTransactionDataCredentials) throw new CredoError("Authorization request contains transaction data entries, but no credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method.");
|
|
87
|
+
if (!transactionData) throw new CredoError("Authorization request doe not contains transaction data entries, but credentail ids were provided to sign transaction data hashes in acceptAuthorizationRequest method.");
|
|
88
88
|
if (transactionData.length !== selectedTransactionDataCredentials.length) throw new CredoError("Credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method, but the length does not match the number of transaction data entries from the authorization request.");
|
|
89
89
|
const credentialsToTransactionData = {};
|
|
90
90
|
transactionData.forEach((transactionDataEntry, transactionDataIndex) => {
|
|
@@ -138,7 +138,7 @@ let OpenId4VpHolderService = class OpenId4VpHolderService$1 {
|
|
|
138
138
|
const isDcApiRequest = isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload);
|
|
139
139
|
const shouldEncryptResponse = authorizationRequestPayload.response_mode && isJarmResponseMode(authorizationRequestPayload.response_mode);
|
|
140
140
|
const audience = openid4vpVersion === "v1" && isDcApiRequest ? `origin:${options.origin}` : clientId;
|
|
141
|
-
let encryptionJwk
|
|
141
|
+
let encryptionJwk;
|
|
142
142
|
if (shouldEncryptResponse) {
|
|
143
143
|
const clientMetadata = authorizationRequestPayload.client_metadata;
|
|
144
144
|
if (!clientMetadata) throw new CredoError("Authorization request payload does not contain 'client_metadata' needed to extract response encryption JWK.");
|
|
@@ -180,7 +180,7 @@ let OpenId4VpHolderService = class OpenId4VpHolderService$1 {
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
let vpToken;
|
|
183
|
-
let presentationSubmission
|
|
183
|
+
let presentationSubmission;
|
|
184
184
|
const parsedTransactionData = authorizationRequestPayload.transaction_data ? parseTransactionData({ transactionData: authorizationRequestPayload.transaction_data }) : void 0;
|
|
185
185
|
if (authorizationRequestPayload.presentation_definition || presentationExchange) {
|
|
186
186
|
if (!presentationExchange) throw new CredoError("Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4vpHolderService.mjs","names":["OpenId4VpHolderService","presentationExchangeService: DifPresentationExchangeService","dcqlService: DcqlService","credentialsToTransactionData: Record<string, ParsedTransactionDataEntry[]>","openid4vpVersion: OpenId4VpVersion","encryptionJwk: Jwk | undefined","mdocSessionTranscript: MdocSessionTranscriptOptions","vpToken: VpToken","presentationSubmission: DifPresentationExchangeSubmission | undefined"],"sources":["../../src/openid4vc-holder/OpenId4vpHolderService.ts"],"sourcesContent":["import type {\n AgentContext,\n DcqlCredentialsForRequest,\n DifPexInputDescriptorToCredentials,\n DifPresentationExchangeDefinition,\n DifPresentationExchangeSubmission,\n EncodedX509Certificate,\n HashName,\n MdocSessionTranscriptOptions,\n} from '@credo-ts/core'\nimport type {\n OpenId4VpAcceptAuthorizationRequestOptions,\n OpenId4VpResolvedAuthorizationRequest,\n ParsedTransactionDataEntry,\n ResolveOpenId4VpAuthorizationRequestOptions,\n} from './OpenId4vpHolderServiceOptions'\n\nimport {\n ClaimFormat,\n CredoError,\n DcqlService,\n DifPresentationExchangeService,\n DifPresentationExchangeSubmissionLocation,\n Hasher,\n Kms,\n TypedArrayEncoder,\n injectable,\n} from '@credo-ts/core'\nimport {\n type Openid4vpAuthorizationResponse,\n Openid4vpClient,\n type VpToken,\n extractEncryptionJwkFromJwks,\n getOpenid4vpClientId,\n isJarmResponseMode,\n isOpenid4vpAuthorizationRequestDcApi,\n parseAuthorizationRequestVersion,\n parseTransactionData,\n} from '@openid4vc/openid4vp'\n\nimport type { Jwk } from '@openid4vc/oauth2'\nimport type { OpenId4VpVersion } from '../openid4vc-verifier'\nimport { getOid4vcCallbacks } from '../shared/callbacks'\n\n@injectable()\nexport class OpenId4VpHolderService {\n public constructor(\n private presentationExchangeService: DifPresentationExchangeService,\n private dcqlService: DcqlService\n ) {}\n\n private getOpenid4vpClient(\n agentContext: AgentContext,\n options?: { trustedCertificates?: EncodedX509Certificate[]; isVerifyOpenId4VpAuthorizationRequest?: boolean }\n ) {\n const callbacks = getOid4vcCallbacks(agentContext, {\n trustedCertificates: options?.trustedCertificates,\n isVerifyOpenId4VpAuthorizationRequest: options?.isVerifyOpenId4VpAuthorizationRequest,\n })\n return new Openid4vpClient({ callbacks })\n }\n\n private async handlePresentationExchangeRequest(\n agentContext: AgentContext,\n _presentationDefinition: unknown,\n transactionData?: ParsedTransactionDataEntry[]\n ) {\n const presentationDefinition = _presentationDefinition as DifPresentationExchangeDefinition\n this.presentationExchangeService.validatePresentationDefinition(presentationDefinition)\n\n const presentationExchange = {\n definition: presentationDefinition,\n credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(\n agentContext,\n presentationDefinition\n ),\n }\n\n const availableCredentialIds = presentationExchange.credentialsForRequest.requirements.flatMap((requirement) =>\n requirement.submissionEntry.map((entry) => entry.inputDescriptorId)\n )\n\n // for each transaction data entry, get all credentials that can be used to sign the respective transaction\n const matchedTransactionData = transactionData?.map((entry) => ({\n entry,\n matchedCredentialIds: entry.transactionData.credential_ids.filter((credentialId) =>\n availableCredentialIds.includes(credentialId)\n ),\n }))\n\n return { pex: presentationExchange, matchedTransactionData }\n }\n\n private async handleDcqlRequest(\n agentContext: AgentContext,\n dcql: unknown,\n transactionData?: ParsedTransactionDataEntry[]\n ) {\n const dcqlQuery = this.dcqlService.validateDcqlQuery(dcql)\n const dcqlQueryResult = await this.dcqlService.getCredentialsForRequest(agentContext, dcqlQuery)\n\n // for each transaction data entry, get all credentials that can fore used to sign the respective transaction\n const matchedTransactionData = transactionData?.map((entry) => ({\n entry,\n matchedCredentialIds: entry.transactionData.credential_ids.filter(\n (credentialId) => dcqlQueryResult.credential_matches[credentialId].success\n ),\n }))\n\n return { dcql: { queryResult: dcqlQueryResult }, matchedTransactionData }\n }\n\n public async resolveAuthorizationRequest(\n agentContext: AgentContext,\n /**\n * Can be:\n * - JWT\n * - URI containing request or request_uri param\n * - Request payload\n */\n authorizationRequest: string | Record<string, unknown>,\n options?: ResolveOpenId4VpAuthorizationRequestOptions\n ): Promise<OpenId4VpResolvedAuthorizationRequest> {\n const openid4vpClient = this.getOpenid4vpClient(agentContext, {\n trustedCertificates: options?.trustedCertificates,\n isVerifyOpenId4VpAuthorizationRequest: true,\n })\n const { params } = openid4vpClient.parseOpenid4vpAuthorizationRequest({ authorizationRequest })\n\n const verifiedAuthorizationRequest = await openid4vpClient.resolveOpenId4vpAuthorizationRequest({\n authorizationRequestPayload: params,\n origin: options?.origin,\n })\n\n const { client, pex, transactionData, dcql } = verifiedAuthorizationRequest\n\n // Prefix on client is normalized, so also includes did/web-orgin\n if (\n client.prefix !== 'x509_san_dns' &&\n client.prefix !== 'x509_hash' &&\n client.prefix !== 'decentralized_identifier' &&\n client.prefix !== 'origin' &&\n client.prefix !== 'redirect_uri'\n ) {\n throw new CredoError(`Client id prefix '${client.prefix}' is not supported`)\n }\n\n const returnValue = {\n authorizationRequestPayload: verifiedAuthorizationRequest.authorizationRequestPayload,\n origin: options?.origin,\n signedAuthorizationRequest: verifiedAuthorizationRequest.jar\n ? {\n signer: verifiedAuthorizationRequest.jar?.signer,\n payload: verifiedAuthorizationRequest.jar.jwt.payload,\n header: verifiedAuthorizationRequest.jar.jwt.header,\n }\n : undefined,\n }\n\n const pexResult = pex?.presentation_definition\n ? await this.handlePresentationExchangeRequest(agentContext, pex.presentation_definition, transactionData)\n : undefined\n\n const dcqlResult = dcql?.query ? await this.handleDcqlRequest(agentContext, dcql.query, transactionData) : undefined\n\n agentContext.config.logger.debug('verified Authorization Request')\n agentContext.config.logger.debug(`request '${authorizationRequest}'`)\n\n return {\n ...returnValue,\n verifier: {\n clientIdPrefix: client.prefix,\n effectiveClientId: client.effective,\n },\n transactionData: pexResult?.matchedTransactionData ?? dcqlResult?.matchedTransactionData,\n presentationExchange: pexResult?.pex,\n dcql: dcqlResult?.dcql,\n }\n }\n\n private extendCredentialsWithTransactionDataHashes<\n T extends DifPexInputDescriptorToCredentials | DcqlCredentialsForRequest,\n >(\n // Either PEX or DCQL\n selectedCredentials: T,\n transactionData?: ParsedTransactionDataEntry[],\n selectedTransactionDataCredentials?: Array<{ credentialId: string }>\n ): T {\n // TODO: it would make sense for oid4vc to also handle this validation logic, but it would require\n // knowledge of PEX / DCQL...\n if (!transactionData && !selectedTransactionDataCredentials) return selectedCredentials\n\n if (!selectedTransactionDataCredentials) {\n throw new CredoError(\n 'Autohrization request contains transaction data entries, but no credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method.'\n )\n }\n\n if (!transactionData) {\n throw new CredoError(\n 'Autohrization request doe not contains transaction data entries, but credentail ids were provided to sign transaction data hashes in acceptAuthorizationRequest method.'\n )\n }\n\n if (transactionData.length !== selectedTransactionDataCredentials.length) {\n throw new CredoError(\n 'Credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method, but the length does not match the number of transaction data entries from the authorization request.'\n )\n }\n\n const credentialsToTransactionData: Record<string, ParsedTransactionDataEntry[]> = {}\n\n transactionData.forEach((transactionDataEntry, transactionDataIndex) => {\n const { credentialId } = selectedTransactionDataCredentials[transactionDataIndex]\n\n if (!transactionDataEntry.transactionData.credential_ids.includes(credentialId)) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}' is not present in allowed credential ids for transaction. Allowed credential ids are ${transactionDataEntry.transactionData.credential_ids.join(', ')}`\n )\n }\n\n if (!selectedCredentials[credentialId]) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}', but credential is not included in the credentials for the presentation.`\n )\n }\n\n const unsupportedFormats = selectedCredentials[credentialId]\n .filter((c) => c.claimFormat !== ClaimFormat.SdJwtDc)\n .map((c) => c.claimFormat)\n\n if (unsupportedFormats.length > 0) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}' unsupported format(s) ${unsupportedFormats.join(', ')}. Only '${ClaimFormat.SdJwtDc}' is supported for transaction data signing in Credo at the moment.`\n )\n }\n\n if (!credentialsToTransactionData[credentialId]) {\n credentialsToTransactionData[credentialId] = []\n }\n credentialsToTransactionData[credentialId].push(transactionDataEntry)\n })\n\n const updatedCredentials = {\n ...selectedCredentials,\n }\n for (const [credentialId, entries] of Object.entries(credentialsToTransactionData)) {\n const allowedHashAlgs = entries.reduce<string[] | undefined>(\n (allowedHashValues, entry) =>\n (entry.transactionData.transaction_data_hashes_alg ?? ['sha-256']).filter(\n (value) => !allowedHashValues || allowedHashValues.includes(value)\n ),\n undefined\n )\n\n if (!allowedHashAlgs || allowedHashAlgs.length === 0) {\n throw new CredoError(\n `Unable to determine hash alg for credential with id '${credentialId}' and transaction data indexes ${entries.map((e) => e.transactionDataIndex).join(' ')}, no common 'transaction_data_hashes_alg' value found.`\n )\n }\n\n const supportedHashAlgs = ['sha-1', 'sha-256'] satisfies HashName[]\n const supportedAllowedHashAlgs = supportedHashAlgs.filter((alg) => allowedHashAlgs.includes(alg))\n if (supportedAllowedHashAlgs.length === 0) {\n throw new CredoError(\n `Unable to create transaction data hash for credential with id '${credentialId}' and transaction data indexes ${entries.map((e) => e.transactionDataIndex).join(' ')}. None of the common allowed hash algorithms is supported by Credo: ${allowedHashAlgs.join(', ')}. Supported hash algs are ${supportedHashAlgs.join(', ')}.`\n )\n }\n\n // Not required, but we include it by default as otherwise we need to look at all entries to\n // see if any specified an alg array\n const [transactionDataHahsesAlg] = supportedAllowedHashAlgs\n const transactionDataHashes = entries.map((entry) =>\n TypedArrayEncoder.toBase64URL(Hasher.hash(entry.encoded, transactionDataHahsesAlg))\n )\n\n updatedCredentials[credentialId] = updatedCredentials[credentialId].map((credential) => {\n if (credential.claimFormat !== ClaimFormat.SdJwtDc) {\n // We already verified this above\n throw new CredoError(\n `Unexpected claim format '${credential.claimFormat}' for transaction data, expected '${ClaimFormat.SdJwtDc}'`\n )\n }\n\n return {\n ...credential,\n additionalPayload: {\n ...(credential.additionalPayload ?? {}),\n transaction_data_hashes: transactionDataHashes,\n transaction_data_hashes_alg: transactionDataHahsesAlg,\n },\n }\n })\n }\n\n return updatedCredentials\n }\n\n public async acceptAuthorizationRequest(\n agentContext: AgentContext,\n options: OpenId4VpAcceptAuthorizationRequestOptions\n ) {\n const kms = agentContext.resolve(Kms.KeyManagementApi)\n const { authorizationRequestPayload, presentationExchange, dcql, transactionData } = options\n\n const openid4vpClient = this.getOpenid4vpClient(agentContext)\n const authorizationResponseNonce = TypedArrayEncoder.toBase64URL(kms.randomBytes({ length: 32 }))\n const { nonce } = authorizationRequestPayload\n\n let openid4vpVersionNumber = parseAuthorizationRequestVersion(authorizationRequestPayload)\n\n // It's hard to detect draft 24 for x509_san_dns/unsigned dc-api. In draft 27 a new vp_formats structure was introduced\n // so if the client id prefix is 'x509_san_dns' or there's no client_id and still uses the old vp_formats structure, we parse it\n // as draft 24 (to at least ensure compatibility with credo)\n if (\n openid4vpVersionNumber >= 24 &&\n openid4vpVersionNumber < 27 &&\n (!authorizationRequestPayload.client_id || authorizationRequestPayload.client_id?.startsWith('x509_san_dns:'))\n ) {\n openid4vpVersionNumber = 24\n }\n\n // We mainly support draft 21/24 and 1.0, but we try to parse in-between versions\n // as one of the supported versions, to not throw errors even before trying.\n const openid4vpVersion: OpenId4VpVersion =\n openid4vpVersionNumber > 24 ? 'v1' : openid4vpVersionNumber <= 21 ? 'v1.draft21' : 'v1.draft24'\n\n const parsedClientId = getOpenid4vpClientId({\n responseMode: authorizationRequestPayload.response_mode,\n clientId: authorizationRequestPayload.client_id,\n legacyClientIdScheme: authorizationRequestPayload.client_id_scheme,\n origin: options.origin,\n version: openid4vpVersionNumber,\n })\n\n const clientId = parsedClientId.effectiveClientId\n const isDcApiRequest = isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)\n\n const shouldEncryptResponse =\n authorizationRequestPayload.response_mode && isJarmResponseMode(authorizationRequestPayload.response_mode)\n\n // TODO: we should return the effectiveAudience in the returned value of openid4vp lib\n // Since it differs based on the version of openid4vp used\n // NOTE: in v1 DC API request the audience is always origin: (not the client id)\n const audience = openid4vpVersion === 'v1' && isDcApiRequest ? `origin:${options.origin}` : clientId\n\n let encryptionJwk: Jwk | undefined = undefined\n if (shouldEncryptResponse) {\n // NOTE: Once we add support for federation we need to require the clientMetadata as input to the accept method.\n const clientMetadata = authorizationRequestPayload.client_metadata\n\n if (!clientMetadata) {\n throw new CredoError(\n \"Authorization request payload does not contain 'client_metadata' needed to extract response encryption JWK.\"\n )\n }\n if (!clientMetadata.jwks) {\n throw new CredoError(\n \"Authorization request payload 'client_metadata' does not contain 'jwks' needed to extract response encryption JWK.\"\n )\n }\n\n encryptionJwk = extractEncryptionJwkFromJwks(clientMetadata.jwks, {\n supportedAlgValues: ['ECDH-ES'],\n })\n\n if (!encryptionJwk) {\n throw new CredoError(\"Unable to extract encryption JWK from 'client_metadata' for supported alg 'ECDH-ES'\")\n }\n }\n\n let mdocSessionTranscript: MdocSessionTranscriptOptions\n if (isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)) {\n if (!options.origin) {\n throw new CredoError('Missing required parameter `origin` parameter for accepting openid4vp dc api requests.')\n }\n\n if (openid4vpVersion === 'v1') {\n mdocSessionTranscript = {\n type: 'openId4VpDcApi',\n origin: options.origin,\n verifierGeneratedNonce: nonce,\n encryptionJwk: encryptionJwk ? Kms.PublicJwk.fromUnknown(encryptionJwk) : undefined,\n }\n } else {\n mdocSessionTranscript = {\n type: 'openId4VpDcApiDraft24',\n clientId,\n origin: options.origin,\n verifierGeneratedNonce: nonce,\n }\n }\n } else {\n const responseUri = authorizationRequestPayload.response_uri ?? authorizationRequestPayload.redirect_uri\n if (!responseUri) {\n throw new CredoError(\n 'Missing required parameter `response_uri` or `redirect_uri` in the authorization request.'\n )\n }\n\n if (openid4vpVersion === 'v1') {\n mdocSessionTranscript = {\n type: 'openId4Vp',\n responseUri,\n clientId,\n verifierGeneratedNonce: nonce,\n encryptionJwk: encryptionJwk ? Kms.PublicJwk.fromUnknown(encryptionJwk) : undefined,\n }\n } else {\n mdocSessionTranscript = {\n type: 'openId4VpDraft18',\n mdocGeneratedNonce: authorizationResponseNonce,\n responseUri,\n clientId,\n verifierGeneratedNonce: nonce,\n }\n }\n }\n\n let vpToken: VpToken\n let presentationSubmission: DifPresentationExchangeSubmission | undefined = undefined\n\n const parsedTransactionData = authorizationRequestPayload.transaction_data\n ? parseTransactionData({\n transactionData: authorizationRequestPayload.transaction_data,\n })\n : undefined\n\n // Handle presentation exchange part\n if (authorizationRequestPayload.presentation_definition || presentationExchange) {\n if (!presentationExchange) {\n throw new CredoError(\n 'Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.'\n )\n }\n if (!authorizationRequestPayload.presentation_definition) {\n throw new CredoError(\n '`presentationExchange` was supplied, but no presentation definition was found in the presentation request.'\n )\n }\n\n const credentialsWithTransactionData = this.extendCredentialsWithTransactionDataHashes(\n presentationExchange.credentials,\n parsedTransactionData,\n transactionData\n )\n\n const { presentationSubmission: _presentationSubmission, encodedVerifiablePresentations } =\n await this.presentationExchangeService.createPresentation(agentContext, {\n credentialsForInputDescriptor: credentialsWithTransactionData,\n presentationDefinition:\n authorizationRequestPayload.presentation_definition as unknown as DifPresentationExchangeDefinition,\n challenge: nonce,\n domain: audience,\n presentationSubmissionLocation: DifPresentationExchangeSubmissionLocation.EXTERNAL,\n mdocSessionTranscript: mdocSessionTranscript,\n })\n\n vpToken =\n encodedVerifiablePresentations.length === 1 && _presentationSubmission?.descriptor_map[0]?.path === '$'\n ? encodedVerifiablePresentations[0]\n : encodedVerifiablePresentations\n presentationSubmission = _presentationSubmission\n } else if (authorizationRequestPayload.dcql_query || dcql) {\n if (!authorizationRequestPayload.dcql_query) {\n throw new CredoError(`'dcql' was supplied, but no dcql request was found in the presentation request.`)\n }\n if (!dcql) {\n throw new CredoError(\n `Authorization request included dcql request. 'dcql' MUST be supplied to accept authorization requests.`\n )\n }\n\n const credentialsWithTransactionData = this.extendCredentialsWithTransactionDataHashes(\n dcql.credentials,\n parsedTransactionData,\n transactionData\n )\n\n const { encodedDcqlPresentation } = await this.dcqlService.createPresentation(agentContext, {\n credentialQueryToCredential: credentialsWithTransactionData,\n challenge: nonce,\n domain: audience,\n mdocSessionTranscript: mdocSessionTranscript,\n })\n\n vpToken = encodedDcqlPresentation\n\n // Pre 1.0 the vp_token directly maps from query id to presentation instead of array\n if (openid4vpVersion !== 'v1') {\n vpToken = Object.fromEntries(\n Object.entries(encodedDcqlPresentation).map(([credentialQueryId, presentations]) => {\n if (presentations.length > 1) {\n throw new CredoError(\n `Multiple presentations for a single dcql query credential are not supported when using OpenID4VP version '${openid4vpVersion}'.`\n )\n }\n\n return [credentialQueryId, presentations[0]]\n })\n )\n }\n } else {\n throw new CredoError('Either pex or dcql must be provided')\n }\n\n const response = await openid4vpClient.createOpenid4vpAuthorizationResponse({\n authorizationRequestPayload,\n origin: options.origin,\n authorizationResponsePayload: {\n vp_token: vpToken,\n presentation_submission: presentationSubmission,\n },\n jarm: encryptionJwk\n ? {\n encryption: { nonce: authorizationResponseNonce, jwk: encryptionJwk },\n serverMetadata: {\n authorization_signing_alg_values_supported: [],\n authorization_encryption_alg_values_supported: ['ECDH-ES'],\n authorization_encryption_enc_values_supported: ['A128GCM', 'A256GCM', 'A128CBC-HS256'],\n },\n }\n : undefined,\n })\n\n const authorizationResponsePayload = response.authorizationResponsePayload as Openid4vpAuthorizationResponse & {\n presentation_submission?: DifPresentationExchangeSubmission\n }\n const authorizationResponse = response.jarm?.responseJwt\n ? { response: response.jarm.responseJwt }\n : authorizationResponsePayload\n\n // TODO: we should include more typing here that the user\n // still needs to submit the response. or as we discussed, split\n // this method up in create and submit\n if (isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)) {\n return {\n ok: true,\n authorizationResponse,\n authorizationResponsePayload,\n } as const\n }\n\n // TODO: parse response in openi4vp library so we can have typed error\n // as well as typed response (with redirect_uri/presentation_during_issuance_session)\n const result = await openid4vpClient.submitOpenid4vpAuthorizationResponse({\n authorizationRequestPayload,\n authorizationResponsePayload: response.authorizationResponsePayload,\n jarm: response.jarm ? { responseJwt: response.jarm.responseJwt } : undefined,\n })\n\n const responseText = await result.response\n .clone()\n .text()\n .catch(() => null)\n\n const responseJson = (await result.response\n .clone()\n .json()\n .catch(() => null)) as null | Record<string, unknown>\n\n if (!result.response.ok) {\n return {\n ok: false,\n serverResponse: {\n status: result.response.status,\n body: responseJson ?? responseText,\n },\n authorizationResponse,\n authorizationResponsePayload,\n } as const\n }\n\n return {\n ok: true,\n serverResponse: {\n status: result.response.status,\n body: responseJson ?? {},\n },\n authorizationResponse,\n authorizationResponsePayload,\n redirectUri: responseJson?.redirect_uri as string | undefined,\n presentationDuringIssuanceSession: responseJson?.presentation_during_issuance_session as string | undefined,\n } as const\n }\n}\n"],"mappings":";;;;;;;;AA6CO,mCAAMA,yBAAuB;CAClC,AAAO,YACL,AAAQC,6BACR,AAAQC,aACR;EAFQ;EACA;;CAGV,AAAQ,mBACN,cACA,SACA;AAKA,SAAO,IAAI,gBAAgB,EAAE,WAJX,mBAAmB,cAAc;GACjD,qBAAqB,SAAS;GAC9B,uCAAuC,SAAS;GACjD,CAAC,EACsC,CAAC;;CAG3C,MAAc,kCACZ,cACA,yBACA,iBACA;EACA,MAAM,yBAAyB;AAC/B,OAAK,4BAA4B,+BAA+B,uBAAuB;EAEvF,MAAM,uBAAuB;GAC3B,YAAY;GACZ,uBAAuB,MAAM,KAAK,4BAA4B,yBAC5D,cACA,uBACD;GACF;EAED,MAAM,yBAAyB,qBAAqB,sBAAsB,aAAa,SAAS,gBAC9F,YAAY,gBAAgB,KAAK,UAAU,MAAM,kBAAkB,CACpE;AAUD,SAAO;GAAE,KAAK;GAAsB,wBAPL,iBAAiB,KAAK,WAAW;IAC9D;IACA,sBAAsB,MAAM,gBAAgB,eAAe,QAAQ,iBACjE,uBAAuB,SAAS,aAAa,CAC9C;IACF,EAAE;GAEyD;;CAG9D,MAAc,kBACZ,cACA,MACA,iBACA;EACA,MAAM,YAAY,KAAK,YAAY,kBAAkB,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","names":["OpenId4VpHolderService","presentationExchangeService: DifPresentationExchangeService","dcqlService: DcqlService","credentialsToTransactionData: Record<string, ParsedTransactionDataEntry[]>","openid4vpVersion: OpenId4VpVersion","encryptionJwk: Jwk | undefined","mdocSessionTranscript: MdocSessionTranscriptOptions","vpToken: VpToken","presentationSubmission: DifPresentationExchangeSubmission | undefined"],"sources":["../../src/openid4vc-holder/OpenId4vpHolderService.ts"],"sourcesContent":["import type {\n AgentContext,\n DcqlCredentialsForRequest,\n DifPexInputDescriptorToCredentials,\n DifPresentationExchangeDefinition,\n DifPresentationExchangeSubmission,\n EncodedX509Certificate,\n HashName,\n MdocSessionTranscriptOptions,\n} from '@credo-ts/core'\nimport {\n ClaimFormat,\n CredoError,\n DcqlService,\n DifPresentationExchangeService,\n DifPresentationExchangeSubmissionLocation,\n Hasher,\n injectable,\n Kms,\n TypedArrayEncoder,\n} from '@credo-ts/core'\nimport type { Jwk } from '@openid4vc/oauth2'\nimport {\n extractEncryptionJwkFromJwks,\n getOpenid4vpClientId,\n isJarmResponseMode,\n isOpenid4vpAuthorizationRequestDcApi,\n type Openid4vpAuthorizationResponse,\n Openid4vpClient,\n parseAuthorizationRequestVersion,\n parseTransactionData,\n type VpToken,\n} from '@openid4vc/openid4vp'\nimport type { OpenId4VpVersion } from '../openid4vc-verifier'\nimport { getOid4vcCallbacks } from '../shared/callbacks'\nimport type {\n OpenId4VpAcceptAuthorizationRequestOptions,\n OpenId4VpResolvedAuthorizationRequest,\n ParsedTransactionDataEntry,\n ResolveOpenId4VpAuthorizationRequestOptions,\n} from './OpenId4vpHolderServiceOptions'\n\n@injectable()\nexport class OpenId4VpHolderService {\n public constructor(\n private presentationExchangeService: DifPresentationExchangeService,\n private dcqlService: DcqlService\n ) {}\n\n private getOpenid4vpClient(\n agentContext: AgentContext,\n options?: { trustedCertificates?: EncodedX509Certificate[]; isVerifyOpenId4VpAuthorizationRequest?: boolean }\n ) {\n const callbacks = getOid4vcCallbacks(agentContext, {\n trustedCertificates: options?.trustedCertificates,\n isVerifyOpenId4VpAuthorizationRequest: options?.isVerifyOpenId4VpAuthorizationRequest,\n })\n return new Openid4vpClient({ callbacks })\n }\n\n private async handlePresentationExchangeRequest(\n agentContext: AgentContext,\n _presentationDefinition: unknown,\n transactionData?: ParsedTransactionDataEntry[]\n ) {\n const presentationDefinition = _presentationDefinition as DifPresentationExchangeDefinition\n this.presentationExchangeService.validatePresentationDefinition(presentationDefinition)\n\n const presentationExchange = {\n definition: presentationDefinition,\n credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(\n agentContext,\n presentationDefinition\n ),\n }\n\n const availableCredentialIds = presentationExchange.credentialsForRequest.requirements.flatMap((requirement) =>\n requirement.submissionEntry.map((entry) => entry.inputDescriptorId)\n )\n\n // for each transaction data entry, get all credentials that can be used to sign the respective transaction\n const matchedTransactionData = transactionData?.map((entry) => ({\n entry,\n matchedCredentialIds: entry.transactionData.credential_ids.filter((credentialId) =>\n availableCredentialIds.includes(credentialId)\n ),\n }))\n\n return { pex: presentationExchange, matchedTransactionData }\n }\n\n private async handleDcqlRequest(\n agentContext: AgentContext,\n dcql: unknown,\n transactionData?: ParsedTransactionDataEntry[]\n ) {\n const dcqlQuery = this.dcqlService.validateDcqlQuery(dcql)\n const dcqlQueryResult = await this.dcqlService.getCredentialsForRequest(agentContext, dcqlQuery)\n\n // for each transaction data entry, get all credentials that can fore used to sign the respective transaction\n const matchedTransactionData = transactionData?.map((entry) => ({\n entry,\n matchedCredentialIds: entry.transactionData.credential_ids.filter(\n (credentialId) => dcqlQueryResult.credential_matches[credentialId].success\n ),\n }))\n\n return { dcql: { queryResult: dcqlQueryResult }, matchedTransactionData }\n }\n\n public async resolveAuthorizationRequest(\n agentContext: AgentContext,\n /**\n * Can be:\n * - JWT\n * - URI containing request or request_uri param\n * - Request payload\n */\n authorizationRequest: string | Record<string, unknown>,\n options?: ResolveOpenId4VpAuthorizationRequestOptions\n ): Promise<OpenId4VpResolvedAuthorizationRequest> {\n const openid4vpClient = this.getOpenid4vpClient(agentContext, {\n trustedCertificates: options?.trustedCertificates,\n isVerifyOpenId4VpAuthorizationRequest: true,\n })\n const { params } = openid4vpClient.parseOpenid4vpAuthorizationRequest({ authorizationRequest })\n\n const verifiedAuthorizationRequest = await openid4vpClient.resolveOpenId4vpAuthorizationRequest({\n authorizationRequestPayload: params,\n origin: options?.origin,\n })\n\n const { client, pex, transactionData, dcql } = verifiedAuthorizationRequest\n\n // Prefix on client is normalized, so also includes did/web-orgin\n if (\n client.prefix !== 'x509_san_dns' &&\n client.prefix !== 'x509_hash' &&\n client.prefix !== 'decentralized_identifier' &&\n client.prefix !== 'origin' &&\n client.prefix !== 'redirect_uri'\n ) {\n throw new CredoError(`Client id prefix '${client.prefix}' is not supported`)\n }\n\n const returnValue = {\n authorizationRequestPayload: verifiedAuthorizationRequest.authorizationRequestPayload,\n origin: options?.origin,\n signedAuthorizationRequest: verifiedAuthorizationRequest.jar\n ? {\n signer: verifiedAuthorizationRequest.jar?.signer,\n payload: verifiedAuthorizationRequest.jar.jwt.payload,\n header: verifiedAuthorizationRequest.jar.jwt.header,\n }\n : undefined,\n }\n\n const pexResult = pex?.presentation_definition\n ? await this.handlePresentationExchangeRequest(agentContext, pex.presentation_definition, transactionData)\n : undefined\n\n const dcqlResult = dcql?.query ? await this.handleDcqlRequest(agentContext, dcql.query, transactionData) : undefined\n\n agentContext.config.logger.debug('verified Authorization Request')\n agentContext.config.logger.debug(`request '${authorizationRequest}'`)\n\n return {\n ...returnValue,\n verifier: {\n clientIdPrefix: client.prefix,\n effectiveClientId: client.effective,\n },\n transactionData: pexResult?.matchedTransactionData ?? dcqlResult?.matchedTransactionData,\n presentationExchange: pexResult?.pex,\n dcql: dcqlResult?.dcql,\n }\n }\n\n private extendCredentialsWithTransactionDataHashes<\n T extends DifPexInputDescriptorToCredentials | DcqlCredentialsForRequest,\n >(\n // Either PEX or DCQL\n selectedCredentials: T,\n transactionData?: ParsedTransactionDataEntry[],\n selectedTransactionDataCredentials?: Array<{ credentialId: string }>\n ): T {\n // TODO: it would make sense for oid4vc to also handle this validation logic, but it would require\n // knowledge of PEX / DCQL...\n if (!transactionData && !selectedTransactionDataCredentials) return selectedCredentials\n\n if (!selectedTransactionDataCredentials) {\n throw new CredoError(\n 'Authorization request contains transaction data entries, but no credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method.'\n )\n }\n\n if (!transactionData) {\n throw new CredoError(\n 'Authorization request doe not contains transaction data entries, but credentail ids were provided to sign transaction data hashes in acceptAuthorizationRequest method.'\n )\n }\n\n if (transactionData.length !== selectedTransactionDataCredentials.length) {\n throw new CredoError(\n 'Credential ids to sign transaction data hashes provided in acceptAuthorizationRequest method, but the length does not match the number of transaction data entries from the authorization request.'\n )\n }\n\n const credentialsToTransactionData: Record<string, ParsedTransactionDataEntry[]> = {}\n\n transactionData.forEach((transactionDataEntry, transactionDataIndex) => {\n const { credentialId } = selectedTransactionDataCredentials[transactionDataIndex]\n\n if (!transactionDataEntry.transactionData.credential_ids.includes(credentialId)) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}' is not present in allowed credential ids for transaction. Allowed credential ids are ${transactionDataEntry.transactionData.credential_ids.join(', ')}`\n )\n }\n\n if (!selectedCredentials[credentialId]) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}', but credential is not included in the credentials for the presentation.`\n )\n }\n\n const unsupportedFormats = selectedCredentials[credentialId]\n .filter((c) => c.claimFormat !== ClaimFormat.SdJwtDc)\n .map((c) => c.claimFormat)\n\n if (unsupportedFormats.length > 0) {\n throw new CredoError(\n `Credential id '${credentialId}' selected to sign transaction data with index '${transactionDataIndex}' unsupported format(s) ${unsupportedFormats.join(', ')}. Only '${ClaimFormat.SdJwtDc}' is supported for transaction data signing in Credo at the moment.`\n )\n }\n\n if (!credentialsToTransactionData[credentialId]) {\n credentialsToTransactionData[credentialId] = []\n }\n credentialsToTransactionData[credentialId].push(transactionDataEntry)\n })\n\n const updatedCredentials = {\n ...selectedCredentials,\n }\n for (const [credentialId, entries] of Object.entries(credentialsToTransactionData)) {\n const allowedHashAlgs = entries.reduce<string[] | undefined>(\n (allowedHashValues, entry) =>\n (entry.transactionData.transaction_data_hashes_alg ?? ['sha-256']).filter(\n (value) => !allowedHashValues || allowedHashValues.includes(value)\n ),\n undefined\n )\n\n if (!allowedHashAlgs || allowedHashAlgs.length === 0) {\n throw new CredoError(\n `Unable to determine hash alg for credential with id '${credentialId}' and transaction data indexes ${entries.map((e) => e.transactionDataIndex).join(' ')}, no common 'transaction_data_hashes_alg' value found.`\n )\n }\n\n const supportedHashAlgs = ['sha-1', 'sha-256'] satisfies HashName[]\n const supportedAllowedHashAlgs = supportedHashAlgs.filter((alg) => allowedHashAlgs.includes(alg))\n if (supportedAllowedHashAlgs.length === 0) {\n throw new CredoError(\n `Unable to create transaction data hash for credential with id '${credentialId}' and transaction data indexes ${entries.map((e) => e.transactionDataIndex).join(' ')}. None of the common allowed hash algorithms is supported by Credo: ${allowedHashAlgs.join(', ')}. Supported hash algs are ${supportedHashAlgs.join(', ')}.`\n )\n }\n\n // Not required, but we include it by default as otherwise we need to look at all entries to\n // see if any specified an alg array\n const [transactionDataHahsesAlg] = supportedAllowedHashAlgs\n const transactionDataHashes = entries.map((entry) =>\n TypedArrayEncoder.toBase64URL(Hasher.hash(entry.encoded, transactionDataHahsesAlg))\n )\n\n updatedCredentials[credentialId] = updatedCredentials[credentialId].map((credential) => {\n if (credential.claimFormat !== ClaimFormat.SdJwtDc) {\n // We already verified this above\n throw new CredoError(\n `Unexpected claim format '${credential.claimFormat}' for transaction data, expected '${ClaimFormat.SdJwtDc}'`\n )\n }\n\n return {\n ...credential,\n additionalPayload: {\n ...(credential.additionalPayload ?? {}),\n transaction_data_hashes: transactionDataHashes,\n transaction_data_hashes_alg: transactionDataHahsesAlg,\n },\n }\n })\n }\n\n return updatedCredentials\n }\n\n public async acceptAuthorizationRequest(\n agentContext: AgentContext,\n options: OpenId4VpAcceptAuthorizationRequestOptions\n ) {\n const kms = agentContext.resolve(Kms.KeyManagementApi)\n const { authorizationRequestPayload, presentationExchange, dcql, transactionData } = options\n\n const openid4vpClient = this.getOpenid4vpClient(agentContext)\n const authorizationResponseNonce = TypedArrayEncoder.toBase64URL(kms.randomBytes({ length: 32 }))\n const { nonce } = authorizationRequestPayload\n\n let openid4vpVersionNumber = parseAuthorizationRequestVersion(authorizationRequestPayload)\n\n // It's hard to detect draft 24 for x509_san_dns/unsigned dc-api. In draft 27 a new vp_formats structure was introduced\n // so if the client id prefix is 'x509_san_dns' or there's no client_id and still uses the old vp_formats structure, we parse it\n // as draft 24 (to at least ensure compatibility with credo)\n if (\n openid4vpVersionNumber >= 24 &&\n openid4vpVersionNumber < 27 &&\n (!authorizationRequestPayload.client_id || authorizationRequestPayload.client_id?.startsWith('x509_san_dns:'))\n ) {\n openid4vpVersionNumber = 24\n }\n\n // We mainly support draft 21/24 and 1.0, but we try to parse in-between versions\n // as one of the supported versions, to not throw errors even before trying.\n const openid4vpVersion: OpenId4VpVersion =\n openid4vpVersionNumber > 24 ? 'v1' : openid4vpVersionNumber <= 21 ? 'v1.draft21' : 'v1.draft24'\n\n const parsedClientId = getOpenid4vpClientId({\n responseMode: authorizationRequestPayload.response_mode,\n clientId: authorizationRequestPayload.client_id,\n legacyClientIdScheme: authorizationRequestPayload.client_id_scheme,\n origin: options.origin,\n version: openid4vpVersionNumber,\n })\n\n const clientId = parsedClientId.effectiveClientId\n const isDcApiRequest = isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)\n\n const shouldEncryptResponse =\n authorizationRequestPayload.response_mode && isJarmResponseMode(authorizationRequestPayload.response_mode)\n\n // TODO: we should return the effectiveAudience in the returned value of openid4vp lib\n // Since it differs based on the version of openid4vp used\n // NOTE: in v1 DC API request the audience is always origin: (not the client id)\n const audience = openid4vpVersion === 'v1' && isDcApiRequest ? `origin:${options.origin}` : clientId\n\n let encryptionJwk: Jwk | undefined\n if (shouldEncryptResponse) {\n // NOTE: Once we add support for federation we need to require the clientMetadata as input to the accept method.\n const clientMetadata = authorizationRequestPayload.client_metadata\n\n if (!clientMetadata) {\n throw new CredoError(\n \"Authorization request payload does not contain 'client_metadata' needed to extract response encryption JWK.\"\n )\n }\n if (!clientMetadata.jwks) {\n throw new CredoError(\n \"Authorization request payload 'client_metadata' does not contain 'jwks' needed to extract response encryption JWK.\"\n )\n }\n\n encryptionJwk = extractEncryptionJwkFromJwks(clientMetadata.jwks, {\n supportedAlgValues: ['ECDH-ES'],\n })\n\n if (!encryptionJwk) {\n throw new CredoError(\"Unable to extract encryption JWK from 'client_metadata' for supported alg 'ECDH-ES'\")\n }\n }\n\n let mdocSessionTranscript: MdocSessionTranscriptOptions\n if (isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)) {\n if (!options.origin) {\n throw new CredoError('Missing required parameter `origin` parameter for accepting openid4vp dc api requests.')\n }\n\n if (openid4vpVersion === 'v1') {\n mdocSessionTranscript = {\n type: 'openId4VpDcApi',\n origin: options.origin,\n verifierGeneratedNonce: nonce,\n encryptionJwk: encryptionJwk ? Kms.PublicJwk.fromUnknown(encryptionJwk) : undefined,\n }\n } else {\n mdocSessionTranscript = {\n type: 'openId4VpDcApiDraft24',\n clientId,\n origin: options.origin,\n verifierGeneratedNonce: nonce,\n }\n }\n } else {\n const responseUri = authorizationRequestPayload.response_uri ?? authorizationRequestPayload.redirect_uri\n if (!responseUri) {\n throw new CredoError(\n 'Missing required parameter `response_uri` or `redirect_uri` in the authorization request.'\n )\n }\n\n if (openid4vpVersion === 'v1') {\n mdocSessionTranscript = {\n type: 'openId4Vp',\n responseUri,\n clientId,\n verifierGeneratedNonce: nonce,\n encryptionJwk: encryptionJwk ? Kms.PublicJwk.fromUnknown(encryptionJwk) : undefined,\n }\n } else {\n mdocSessionTranscript = {\n type: 'openId4VpDraft18',\n mdocGeneratedNonce: authorizationResponseNonce,\n responseUri,\n clientId,\n verifierGeneratedNonce: nonce,\n }\n }\n }\n\n let vpToken: VpToken\n let presentationSubmission: DifPresentationExchangeSubmission | undefined\n\n const parsedTransactionData = authorizationRequestPayload.transaction_data\n ? parseTransactionData({\n transactionData: authorizationRequestPayload.transaction_data,\n })\n : undefined\n\n // Handle presentation exchange part\n if (authorizationRequestPayload.presentation_definition || presentationExchange) {\n if (!presentationExchange) {\n throw new CredoError(\n 'Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.'\n )\n }\n if (!authorizationRequestPayload.presentation_definition) {\n throw new CredoError(\n '`presentationExchange` was supplied, but no presentation definition was found in the presentation request.'\n )\n }\n\n const credentialsWithTransactionData = this.extendCredentialsWithTransactionDataHashes(\n presentationExchange.credentials,\n parsedTransactionData,\n transactionData\n )\n\n const { presentationSubmission: _presentationSubmission, encodedVerifiablePresentations } =\n await this.presentationExchangeService.createPresentation(agentContext, {\n credentialsForInputDescriptor: credentialsWithTransactionData,\n presentationDefinition:\n authorizationRequestPayload.presentation_definition as unknown as DifPresentationExchangeDefinition,\n challenge: nonce,\n domain: audience,\n presentationSubmissionLocation: DifPresentationExchangeSubmissionLocation.EXTERNAL,\n mdocSessionTranscript: mdocSessionTranscript,\n })\n\n vpToken =\n encodedVerifiablePresentations.length === 1 && _presentationSubmission?.descriptor_map[0]?.path === '$'\n ? encodedVerifiablePresentations[0]\n : encodedVerifiablePresentations\n presentationSubmission = _presentationSubmission\n } else if (authorizationRequestPayload.dcql_query || dcql) {\n if (!authorizationRequestPayload.dcql_query) {\n throw new CredoError(`'dcql' was supplied, but no dcql request was found in the presentation request.`)\n }\n if (!dcql) {\n throw new CredoError(\n `Authorization request included dcql request. 'dcql' MUST be supplied to accept authorization requests.`\n )\n }\n\n const credentialsWithTransactionData = this.extendCredentialsWithTransactionDataHashes(\n dcql.credentials,\n parsedTransactionData,\n transactionData\n )\n\n const { encodedDcqlPresentation } = await this.dcqlService.createPresentation(agentContext, {\n credentialQueryToCredential: credentialsWithTransactionData,\n challenge: nonce,\n domain: audience,\n mdocSessionTranscript: mdocSessionTranscript,\n })\n\n vpToken = encodedDcqlPresentation\n\n // Pre 1.0 the vp_token directly maps from query id to presentation instead of array\n if (openid4vpVersion !== 'v1') {\n vpToken = Object.fromEntries(\n Object.entries(encodedDcqlPresentation).map(([credentialQueryId, presentations]) => {\n if (presentations.length > 1) {\n throw new CredoError(\n `Multiple presentations for a single dcql query credential are not supported when using OpenID4VP version '${openid4vpVersion}'.`\n )\n }\n\n return [credentialQueryId, presentations[0]]\n })\n )\n }\n } else {\n throw new CredoError('Either pex or dcql must be provided')\n }\n\n const response = await openid4vpClient.createOpenid4vpAuthorizationResponse({\n authorizationRequestPayload,\n origin: options.origin,\n authorizationResponsePayload: {\n vp_token: vpToken,\n presentation_submission: presentationSubmission,\n },\n jarm: encryptionJwk\n ? {\n encryption: { nonce: authorizationResponseNonce, jwk: encryptionJwk },\n serverMetadata: {\n authorization_signing_alg_values_supported: [],\n authorization_encryption_alg_values_supported: ['ECDH-ES'],\n authorization_encryption_enc_values_supported: ['A128GCM', 'A256GCM', 'A128CBC-HS256'],\n },\n }\n : undefined,\n })\n\n const authorizationResponsePayload = response.authorizationResponsePayload as Openid4vpAuthorizationResponse & {\n presentation_submission?: DifPresentationExchangeSubmission\n }\n const authorizationResponse = response.jarm?.responseJwt\n ? { response: response.jarm.responseJwt }\n : authorizationResponsePayload\n\n // TODO: we should include more typing here that the user\n // still needs to submit the response. or as we discussed, split\n // this method up in create and submit\n if (isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload)) {\n return {\n ok: true,\n authorizationResponse,\n authorizationResponsePayload,\n } as const\n }\n\n // TODO: parse response in openi4vp library so we can have typed error\n // as well as typed response (with redirect_uri/presentation_during_issuance_session)\n const result = await openid4vpClient.submitOpenid4vpAuthorizationResponse({\n authorizationRequestPayload,\n authorizationResponsePayload: response.authorizationResponsePayload,\n jarm: response.jarm ? { responseJwt: response.jarm.responseJwt } : undefined,\n })\n\n const responseText = await result.response\n .clone()\n .text()\n .catch(() => null)\n\n const responseJson = (await result.response\n .clone()\n .json()\n .catch(() => null)) as null | Record<string, unknown>\n\n if (!result.response.ok) {\n return {\n ok: false,\n serverResponse: {\n status: result.response.status,\n body: responseJson ?? responseText,\n },\n authorizationResponse,\n authorizationResponsePayload,\n } as const\n }\n\n return {\n ok: true,\n serverResponse: {\n status: result.response.status,\n body: responseJson ?? {},\n },\n authorizationResponse,\n authorizationResponsePayload,\n redirectUri: responseJson?.redirect_uri as string | undefined,\n presentationDuringIssuanceSession: responseJson?.presentation_during_issuance_session as string | undefined,\n } as const\n }\n}\n"],"mappings":";;;;;;;;AA2CO,mCAAMA,yBAAuB;CAClC,AAAO,YACL,AAAQC,6BACR,AAAQC,aACR;EAFQ;EACA;;CAGV,AAAQ,mBACN,cACA,SACA;AAKA,SAAO,IAAI,gBAAgB,EAAE,WAJX,mBAAmB,cAAc;GACjD,qBAAqB,SAAS;GAC9B,uCAAuC,SAAS;GACjD,CAAC,EACsC,CAAC;;CAG3C,MAAc,kCACZ,cACA,yBACA,iBACA;EACA,MAAM,yBAAyB;AAC/B,OAAK,4BAA4B,+BAA+B,uBAAuB;EAEvF,MAAM,uBAAuB;GAC3B,YAAY;GACZ,uBAAuB,MAAM,KAAK,4BAA4B,yBAC5D,cACA,uBACD;GACF;EAED,MAAM,yBAAyB,qBAAqB,sBAAsB,aAAa,SAAS,gBAC9F,YAAY,gBAAgB,KAAK,UAAU,MAAM,kBAAkB,CACpE;AAUD,SAAO;GAAE,KAAK;GAAsB,wBAPL,iBAAiB,KAAK,WAAW;IAC9D;IACA,sBAAsB,MAAM,gBAAgB,eAAe,QAAQ,iBACjE,uBAAuB,SAAS,aAAa,CAC9C;IACF,EAAE;GAEyD;;CAG9D,MAAc,kBACZ,cACA,MACA,iBACA;EACA,MAAM,YAAY,KAAK,YAAY,kBAAkB,KAAK;EAC1D,MAAM,kBAAkB,MAAM,KAAK,YAAY,yBAAyB,cAAc,UAAU;EAGhG,MAAM,yBAAyB,iB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M,IAAI,WAAW,sCAAsC;EAG7D,MAAM,WAAW,MAAM,gBAAgB,qCAAqC;GAC1E;GACA,QAAQ,QAAQ;GAChB,8BAA8B;IAC5B,UAAU;IACV,yBAAyB;IAC1B;GACD,MAAM,gBACF;IACE,YAAY;KAAE,OAAO;KAA4B,KAAK;KAAe;IACrE,gBAAgB;KACd,4CAA4C,EAAE;KAC9C,+CAA+C,CAAC,UAAU;KAC1D,+CAA+C;MAAC;MAAW;MAAW;MAAgB;KACvF;IACF,GACD;GACL,CAAC;EAEF,MAAM,+BAA+B,SAAS;EAG9C,MAAM,wBAAwB,SAAS,MAAM,cACzC,EAAE,UAAU,SAAS,KAAK,aAAa,GACvC;AAKJ,MAAI,qCAAqC,4BAA4B,CACnE,QAAO;GACL,IAAI;GACJ;GACA;GACD;EAKH,MAAM,SAAS,MAAM,gBAAgB,qCAAqC;GACxE;GACA,8BAA8B,SAAS;GACvC,MAAM,SAAS,OAAO,EAAE,aAAa,SAAS,KAAK,aAAa,GAAG;GACpE,CAAC;EAEF,MAAM,eAAe,MAAM,OAAO,SAC/B,OAAO,CACP,MAAM,CACN,YAAY,KAAK;EAEpB,MAAM,eAAgB,MAAM,OAAO,SAChC,OAAO,CACP,MAAM,CACN,YAAY,KAAK;AAEpB,MAAI,CAAC,OAAO,SAAS,GACnB,QAAO;GACL,IAAI;GACJ,gBAAgB;IACd,QAAQ,OAAO,SAAS;IACxB,MAAM,gBAAgB;IACvB;GACD;GACA;GACD;AAGH,SAAO;GACL,IAAI;GACJ,gBAAgB;IACd,QAAQ,OAAO,SAAS;IACxB,MAAM,gBAAgB,EAAE;IACzB;GACD;GACA;GACA,aAAa,cAAc;GAC3B,mCAAmC,cAAc;GAClD;;;qCA3hBJ,YAAY"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { OpenId4VciCredentialOfferPayload } from "../shared/models/index.mjs";
|
|
1
2
|
import { OpenId4VcUpdateIssuerRecordOptions, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions } from "./OpenId4VcIssuerServiceOptions.mjs";
|
|
2
|
-
import { OpenId4VcIssuerRecord } from "./repository/OpenId4VcIssuerRecord.mjs";
|
|
3
3
|
import { OpenId4VcIssuanceSessionRecord } from "./repository/OpenId4VcIssuanceSessionRecord.mjs";
|
|
4
|
+
import { OpenId4VcIssuerRecord } from "./repository/OpenId4VcIssuerRecord.mjs";
|
|
4
5
|
import { OpenId4VcIssuerModuleConfig } from "./OpenId4VcIssuerModuleConfig.mjs";
|
|
5
6
|
import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs";
|
|
6
7
|
import { AgentContext } from "@credo-ts/core";
|
|
7
8
|
import * as _openid4vc_openid4vci0 from "@openid4vc/openid4vci";
|
|
8
|
-
import * as zod0 from "zod";
|
|
9
9
|
|
|
10
10
|
//#region src/openid4vc-issuer/OpenId4VcIssuerApi.d.ts
|
|
11
11
|
/**
|
|
@@ -39,191 +39,7 @@ declare class OpenId4VcIssuerApi {
|
|
|
39
39
|
issuerId: string;
|
|
40
40
|
}): Promise<{
|
|
41
41
|
credentialOffer: string;
|
|
42
|
-
credentialOfferObject:
|
|
43
|
-
credential_issuer: zod0.ZodEffects<zod0.ZodString, string, string>;
|
|
44
|
-
credential_configuration_ids: zod0.ZodArray<zod0.ZodString, "many">;
|
|
45
|
-
grants: zod0.ZodOptional<zod0.ZodObject<{
|
|
46
|
-
authorization_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
47
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
48
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
49
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
50
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
51
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
52
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
53
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
54
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
55
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
56
|
-
"urn:ietf:params:oauth:grant-type:pre-authorized_code": zod0.ZodOptional<zod0.ZodObject<{
|
|
57
|
-
"pre-authorized_code": zod0.ZodString;
|
|
58
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
59
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
60
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
61
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
62
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
63
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
64
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
65
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
66
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
67
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
68
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
69
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
70
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
71
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
72
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
73
|
-
"pre-authorized_code": zod0.ZodString;
|
|
74
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
75
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
76
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
77
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
78
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
79
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
80
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
81
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
82
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
83
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
84
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
85
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
86
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
87
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
88
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
89
|
-
"pre-authorized_code": zod0.ZodString;
|
|
90
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
91
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
92
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
93
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
94
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
95
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
96
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
97
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
98
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
99
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
100
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
101
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
102
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
103
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
104
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
105
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
106
|
-
authorization_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
107
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
108
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
109
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
110
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
111
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
112
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
113
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
114
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
115
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
116
|
-
"urn:ietf:params:oauth:grant-type:pre-authorized_code": zod0.ZodOptional<zod0.ZodObject<{
|
|
117
|
-
"pre-authorized_code": zod0.ZodString;
|
|
118
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
119
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
120
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
121
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
122
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
123
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
124
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
125
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
126
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
127
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
128
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
129
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
130
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
131
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
132
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
133
|
-
"pre-authorized_code": zod0.ZodString;
|
|
134
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
135
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
136
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
137
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
138
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
139
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
140
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
141
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
142
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
143
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
144
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
145
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
146
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
147
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
148
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
149
|
-
"pre-authorized_code": zod0.ZodString;
|
|
150
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
151
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
152
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
153
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
154
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
155
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
156
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
157
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
158
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
159
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
160
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
161
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
162
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
163
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
164
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
165
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
166
|
-
authorization_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
167
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
168
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
169
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
170
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
171
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
172
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
173
|
-
issuer_state: zod0.ZodOptional<zod0.ZodString>;
|
|
174
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
175
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
176
|
-
"urn:ietf:params:oauth:grant-type:pre-authorized_code": zod0.ZodOptional<zod0.ZodObject<{
|
|
177
|
-
"pre-authorized_code": zod0.ZodString;
|
|
178
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
179
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
180
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
181
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
182
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
183
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
184
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
185
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
186
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
187
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
188
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
189
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
190
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
191
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
192
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
193
|
-
"pre-authorized_code": zod0.ZodString;
|
|
194
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
195
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
196
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
197
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
198
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
199
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
200
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
201
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
202
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
203
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
204
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
205
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
206
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
207
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
208
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
209
|
-
"pre-authorized_code": zod0.ZodString;
|
|
210
|
-
tx_code: zod0.ZodOptional<zod0.ZodObject<{
|
|
211
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
212
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
213
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
214
|
-
}, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
|
|
215
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
216
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
217
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
218
|
-
}, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
|
|
219
|
-
input_mode: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodLiteral<"numeric">, zod0.ZodLiteral<"text">]>>;
|
|
220
|
-
length: zod0.ZodOptional<zod0.ZodNumber>;
|
|
221
|
-
description: zod0.ZodOptional<zod0.ZodString>;
|
|
222
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
223
|
-
authorization_server: zod0.ZodOptional<zod0.ZodEffects<zod0.ZodString, string, string>>;
|
|
224
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
225
|
-
}, zod0.ZodTypeAny, "passthrough">>>;
|
|
226
|
-
}, zod0.ZodTypeAny, "passthrough">;
|
|
42
|
+
credentialOfferObject: OpenId4VciCredentialOfferPayload;
|
|
227
43
|
}>;
|
|
228
44
|
/**
|
|
229
45
|
* Creates a credential offer. Either the preAuthorizedCodeFlowConfig or the authorizationCodeFlowConfig must be provided.
|
|
@@ -242,23 +58,8 @@ declare class OpenId4VcIssuerApi {
|
|
|
242
58
|
createCredentialResponse(options: OpenId4VciCreateCredentialResponseOptions & {
|
|
243
59
|
issuanceSessionId: string;
|
|
244
60
|
}): Promise<{
|
|
245
|
-
credentialResponse: zod0.objectOutputType<{
|
|
246
|
-
credentials: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodArray<zod0.ZodObject<{
|
|
247
|
-
credential: zod0.ZodUnion<[zod0.ZodString, zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>]>;
|
|
248
|
-
}, "strip", zod0.ZodTypeAny, {
|
|
249
|
-
credential: string | Record<string, any>;
|
|
250
|
-
}, {
|
|
251
|
-
credential: string | Record<string, any>;
|
|
252
|
-
}>, "many">, zod0.ZodArray<zod0.ZodUnion<[zod0.ZodString, zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>]>, "many">]>>;
|
|
253
|
-
interval: zod0.ZodOptional<zod0.ZodNumber>;
|
|
254
|
-
notification_id: zod0.ZodOptional<zod0.ZodString>;
|
|
255
|
-
} & {
|
|
256
|
-
credential: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>]>>;
|
|
257
|
-
transaction_id: zod0.ZodOptional<zod0.ZodString>;
|
|
258
|
-
c_nonce: zod0.ZodOptional<zod0.ZodString>;
|
|
259
|
-
c_nonce_expires_in: zod0.ZodOptional<zod0.ZodNumber>;
|
|
260
|
-
}, zod0.ZodTypeAny, "passthrough">;
|
|
261
61
|
issuanceSession: OpenId4VcIssuanceSessionRecord;
|
|
62
|
+
credentialResponse: _openid4vc_openid4vci0.CredentialResponse;
|
|
262
63
|
}>;
|
|
263
64
|
/**
|
|
264
65
|
* This function creates a response which can be sent to the holder after receiving a deferred credential issuance request.
|
|
@@ -266,18 +67,8 @@ declare class OpenId4VcIssuerApi {
|
|
|
266
67
|
createDeferredCredentialResponse(options: OpenId4VciCreateDeferredCredentialResponseOptions & {
|
|
267
68
|
issuanceSessionId: string;
|
|
268
69
|
}): Promise<{
|
|
269
|
-
deferredCredentialResponse: zod0.objectOutputType<{
|
|
270
|
-
credentials: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodArray<zod0.ZodObject<{
|
|
271
|
-
credential: zod0.ZodUnion<[zod0.ZodString, zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>]>;
|
|
272
|
-
}, "strip", zod0.ZodTypeAny, {
|
|
273
|
-
credential: string | Record<string, any>;
|
|
274
|
-
}, {
|
|
275
|
-
credential: string | Record<string, any>;
|
|
276
|
-
}>, "many">, zod0.ZodArray<zod0.ZodUnion<[zod0.ZodString, zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>]>, "many">]>>;
|
|
277
|
-
interval: zod0.ZodOptional<zod0.ZodNumber>;
|
|
278
|
-
notification_id: zod0.ZodOptional<zod0.ZodString>;
|
|
279
|
-
}, zod0.ZodTypeAny, "passthrough">;
|
|
280
70
|
issuanceSession: OpenId4VcIssuanceSessionRecord;
|
|
71
|
+
deferredCredentialResponse: _openid4vc_openid4vci0.DeferredCredentialResponse;
|
|
281
72
|
}>;
|
|
282
73
|
getIssuerMetadata(issuerId: string): Promise<_openid4vc_openid4vci0.IssuerMetadataResult>;
|
|
283
74
|
getIssuanceSessionById(issuanceSessionId: string): Promise<OpenId4VcIssuanceSessionRecord>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcIssuerApi.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuerApi.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAmBa,cAAA,kBAAA,CAAkB;EAAA,SAAA,MAAA,EAEH,2BAFG;UAEH,YAAA;UAAA,sBAAA;aACF,CAAA,MAAA,EADE,2BACF,EAAA,YAAA,EAAA,YAAA,EAAA,sBAAA,EACU,sBADV;eACU,CAAA,CAAA,EAGR,OAHQ,CAAsB,qBAAA,EAAtB,CAAA;qBAAsB,CAAA,QAAA,EAAA,MAAA,CAAA,EAOP,OAPO,CAG9B,qBAAA,CAH8B;;;;;cAeQ,CAAA,OAAA,EAA7B,6BAA6B,CAAA,EAAA,OAAA,CAAA,qBAAA,CAAA;;;;6BAYa,CAAA,QAAA,EAAA,MAAA,CAAA,EALpB,OAKoB,CAAA,IAAA,CAAA;sBAwBlE,CAAA,OAAA,EAxBgC,kCAwBhC,CAAA,EAxBkE,OAwBlE,CAAA,IAAA,CAAA;;;;;gCAY8F,CAAA,OAAA,EAZ9F,+CAY8F,GAAA;IAU9F,QAAA,EAAA,MAAA;MAtBsE,OAsB7B,CAAA;;IAAgC,qBAAA,EAtB1B,gCAsB0B;;;;;;;uBA6BrC,CAAA,OAAA,EAvCH,sCAuCG,GAAA;IAKc,QAAA,EAAA,MAAA;EAAA,CAAA,CAAA,EA5C4C,OA4C5C,CAAA;qBA5CqB;;;;;;oCAUvE;;MAAyE;qBAAhC;;;;;;4CAezC;;MAAiF;qBAAhC;;;uCAcb,QAd6C,sBAAA,CAc7C,oBAAA;qDAKc,QALd,8BAAA"}
|