@credo-ts/openid4vc 0.6.2-alpha-20251222120740 → 0.6.2-pr-2610-20260107224024
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/index.d.mts +2 -2
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts +4 -1
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderApi.mjs +3 -0
- package/build/openid4vc-holder/OpenId4VcHolderApi.mjs.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.mts +4 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs +16 -4
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts +5 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs.map +1 -1
- package/build/openid4vc-holder/index.d.mts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts +2 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts +4 -3
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs +5 -4
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs.map +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs +2 -2
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs.map +1 -1
- package/build/openid4vc-issuer/router/redirectEndpoint.mjs +12 -4
- package/build/openid4vc-issuer/router/redirectEndpoint.mjs.map +1 -1
- package/package.json +7 -7
package/build/index.d.mts
CHANGED
|
@@ -26,7 +26,7 @@ import { OpenId4VcUpdateIssuerRecordOptions, OpenId4VciAuthorizationCodeFlowConf
|
|
|
26
26
|
import { OpenId4VcIssuerModuleConfig } from "./openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs";
|
|
27
27
|
import { OpenId4VcIssuerModuleConfigOptions, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcVerifierModuleConfigOptions } from "./OpenId4VcModuleConfig.mjs";
|
|
28
28
|
import { OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpResolvedAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions } from "./openid4vc-holder/OpenId4vpHolderServiceOptions.mjs";
|
|
29
|
-
import { OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationFlow, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciNotificationEvent, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, openId4VciSupportedCredentialFormats } from "./openid4vc-holder/OpenId4VciHolderServiceOptions.mjs";
|
|
29
|
+
import { OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationFlow, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciNotificationEvent, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, openId4VciSupportedCredentialFormats } from "./openid4vc-holder/OpenId4VciHolderServiceOptions.mjs";
|
|
30
30
|
import { OpenId4VciHolderService } from "./openid4vc-holder/OpenId4VciHolderService.mjs";
|
|
31
31
|
import { OpenId4VpHolderService } from "./openid4vc-holder/OpenId4vpHolderService.mjs";
|
|
32
32
|
import { OpenId4VcHolderApi } from "./openid4vc-holder/OpenId4VcHolderApi.mjs";
|
|
@@ -39,4 +39,4 @@ import { OpenId4VcIssuerModule } from "./openid4vc-issuer/OpenId4VcIssuerModule.
|
|
|
39
39
|
import "./openid4vc-issuer/index.mjs";
|
|
40
40
|
import { OpenId4VcApi } from "./OpenId4VcApi.mjs";
|
|
41
41
|
import { OpenId4VcModule } from "./OpenId4VcModule.mjs";
|
|
42
|
-
export { DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier };
|
|
42
|
+
export { DefaultOpenId4VcVerificationSessionRecordTags, DefaultOpenId4VcVerifierRecordTags, OpenId4VcApi, OpenId4VcAuthorizationCodeTokenRequestOptions, OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, OpenId4VcHolderApi, OpenId4VcHolderModule, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionRepository, OpenId4VcIssuanceSessionState, OpenId4VcIssuanceSessionStateChangedEvent, OpenId4VcIssuanceSessionWalletAttestation, OpenId4VcIssuerApi, OpenId4VcIssuerEvents, OpenId4VcIssuerModule, OpenId4VcIssuerModuleConfig, OpenId4VcIssuerModuleConfigOptions, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags, OpenId4VcIssuerService, OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded, OpenId4VcModule, OpenId4VcModuleConfig, OpenId4VcModuleConfigOptions, OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VcUpdateIssuerRecordOptions, OpenId4VcUpdateVerifierRecordOptions, OpenId4VcVerificationSessionRecord, OpenId4VcVerificationSessionRecordProps, OpenId4VcVerificationSessionRecordTags, OpenId4VcVerificationSessionRepository, OpenId4VcVerificationSessionState, OpenId4VcVerificationSessionStateChangedEvent, OpenId4VcVerifierApi, OpenId4VcVerifierEvents, OpenId4VcVerifierModule, OpenId4VcVerifierModuleConfig, OpenId4VcVerifierModuleConfigOptions, OpenId4VcVerifierRecord, OpenId4VcVerifierRecordProps, OpenId4VcVerifierRecordTags, OpenId4VcVerifierRepository, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAccessTokenResponse, OpenId4VciAuthCodeFlowOptions, OpenId4VciAuthorizationCodeFlowConfig, OpenId4VciAuthorizationFlow, OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciBatchCredentialIssuanceOptions, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions, OpenId4VciCredentialBindingOptions, OpenId4VciCredentialBindingResolver, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialFormatProfile, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestAuthorization, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialRequestToCredentialMapper, OpenId4VciCredentialRequestToCredentialMapperOptions, OpenId4VciCredentialRequestWithFormats, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequest, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialRequestToCredentialMapper, OpenId4VciDeferredCredentialRequestToCredentialMapperOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDeferredCredentials, OpenId4VciDirectAuthorizationServerConfig, OpenId4VciDpopRequestOptions, OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization, OpenId4VciHolderService, OpenId4VciMetadata, OpenId4VciNotificationEvent, OpenId4VciParsedCredentialRequest, OpenId4VciPreAuthorizedCodeFlowConfig, OpenId4VciPreAuthorizedTokenRequestOptions, OpenId4VciProofOfPossessionRequirements, OpenId4VciProofOfPressionProofTypes, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciSignCredentials, OpenId4VciSignMdocCredentials, OpenId4VciSignSdJwtCredentials, OpenId4VciSignW3cCredentials, OpenId4VciSignW3cV2Credentials, OpenId4VciSupportedCredentialFormats, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions, OpenId4VciTxCode, OpenId4VciVersion, OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpCreateAuthorizationRequestOptions, OpenId4VpCreateAuthorizationRequestReturn, OpenId4VpCreateVerifierOptions, OpenId4VpHolderService, OpenId4VpResolvedAuthorizationRequest, OpenId4VpVerifiedAuthorizationRequest, OpenId4VpVerifiedAuthorizationResponse, OpenId4VpVerifiedAuthorizationResponseDcql, OpenId4VpVerifiedAuthorizationResponsePresentationExchange, OpenId4VpVerifiedAuthorizationResponseTransactionData, OpenId4VpVerifierClientMetadata, OpenId4VpVerifierService, OpenId4VpVerifyAuthorizationResponseOptions, OpenId4VpVersion, Openid4vpAuthorizationRequest, ParsedTransactionDataEntry, ResolveOpenId4VpAuthorizationRequestOptions, ResponseMode, VerifiedOpenId4VcCredentialHolderBinding, authorizationCodeGrantIdentifier, dynamicOid4vciClientAuthentication, getAllowedAndRequestedScopeValues, getCredentialConfigurationsSupportedForScopes, getOfferedCredentials, getOid4vcCallbacks, getOid4vcDecryptJweCallback, getOid4vcEncryptJweCallback, getOid4vcJwtSignCallback, getOid4vcJwtVerifyCallback, getScopesFromCredentialConfigurationsSupported, openId4VciSupportedCredentialFormats, preAuthorizedCodeGrantIdentifier };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenId4VciMetadata } from "../shared/models/index.mjs";
|
|
2
2
|
import "../shared/index.mjs";
|
|
3
3
|
import { OpenId4VpAcceptAuthorizationRequestOptions, OpenId4VpResolvedAuthorizationRequest, ResolveOpenId4VpAuthorizationRequestOptions } from "./OpenId4vpHolderServiceOptions.mjs";
|
|
4
|
-
import { OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions } from "./OpenId4VciHolderServiceOptions.mjs";
|
|
4
|
+
import { OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialRequestOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions } from "./OpenId4VciHolderServiceOptions.mjs";
|
|
5
5
|
import { OpenId4VciHolderService } from "./OpenId4VciHolderService.mjs";
|
|
6
6
|
import { OpenId4VpHolderService } from "./OpenId4vpHolderService.mjs";
|
|
7
7
|
import * as _credo_ts_core0 from "@credo-ts/core";
|
|
@@ -202,6 +202,9 @@ declare class OpenId4VcHolderApi {
|
|
|
202
202
|
authorizationCode: string;
|
|
203
203
|
dpop?: OpenId4VciDpopRequestOptions;
|
|
204
204
|
}>;
|
|
205
|
+
parseAuthorizationCodeFromAuthorizationResponse(options: OpenId4VcParseAndVerifyAuthorizationResponseOptions): {
|
|
206
|
+
authorizationCode: string;
|
|
207
|
+
};
|
|
205
208
|
/**
|
|
206
209
|
* Requests the token to be used for credential requests.
|
|
207
210
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcHolderApi.d.mts","names":[],"sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OpenId4VcHolderApi.d.mts","names":[],"sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAiCa,kBAAA;EAAA,QAAA,YAAA;EAEa,QAAA,u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QAAA,sCAAA;;;;;;sDAezC,8DAA2D;;WAAA;;2DAKN;;;;;;wBAO7B,gCAAgC,QAAQ;;;;wBAoBhE,gCACR,QAAQ,KAAK;;;;;8BAmByB,qCAAkC;iBAAA,4BAAA;;;;;;;;sCAgB1B,6CAA0C;iBAAA,4BAAA;;;;;;;4BAOpD,oCAAiC"}
|
|
@@ -106,6 +106,9 @@ let OpenId4VcHolderApi = class OpenId4VcHolderApi$1 {
|
|
|
106
106
|
async retrieveAuthorizationCodeUsingPresentation(options) {
|
|
107
107
|
return await this.openId4VciHolderService.retrieveAuthorizationCodeUsingPresentation(this.agentContext, options);
|
|
108
108
|
}
|
|
109
|
+
parseAuthorizationCodeFromAuthorizationResponse(options) {
|
|
110
|
+
return this.openId4VciHolderService.parseAuthorizationCodeFromAuthorizationResponse(this.agentContext, options);
|
|
111
|
+
}
|
|
109
112
|
/**
|
|
110
113
|
* Requests the token to be used for credential requests.
|
|
111
114
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcHolderApi.mjs","names":["OpenId4VcHolderApi","agentContext: AgentContext","openId4VciHolderService: OpenId4VciHolderService","openId4VpHolderService: OpenId4VpHolderService","difPresentationExchangeService: DifPresentationExchangeService","dcqlService: DcqlService"],"sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"sourcesContent":["import {\n AgentContext,\n type DcqlQueryResult,\n type DcqlSelectCredentialsForRequestOptions,\n DcqlService,\n type DifPexCredentialsForRequest,\n DifPresentationExchangeService,\n injectable,\n} from '@credo-ts/core'\nimport type { OpenId4VciMetadata } from '../shared'\nimport { OpenId4VciHolderService } from './OpenId4VciHolderService'\nimport type {\n OpenId4VciAuthCodeFlowOptions,\n OpenId4VciDeferredCredentialRequestOptions,\n OpenId4VciCredentialRequestOptions as OpenId4VciRequestCredentialOptions,\n OpenId4VciTokenRequestOptions as OpenId4VciRequestTokenOptions,\n OpenId4VciRequestTokenResponse,\n OpenId4VciResolvedCredentialOffer,\n OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions,\n OpenId4VciSendNotificationOptions,\n OpenId4VciTokenRefreshOptions,\n} from './OpenId4VciHolderServiceOptions'\nimport { OpenId4VpHolderService } from './OpenId4vpHolderService'\nimport type {\n OpenId4VpAcceptAuthorizationRequestOptions,\n ResolveOpenId4VpAuthorizationRequestOptions,\n} from './OpenId4vpHolderServiceOptions'\n\n/**\n * @public\n */\n@injectable()\nexport class OpenId4VcHolderApi {\n public constructor(\n private agentContext: AgentContext,\n private openId4VciHolderService: OpenId4VciHolderService,\n private openId4VpHolderService: OpenId4VpHolderService,\n private difPresentationExchangeService: DifPresentationExchangeService,\n private dcqlService: DcqlService\n ) {}\n\n /**\n * Resolves the authentication request given as URI or JWT to a unified format, and\n * verifies the validity of the request.\n *\n * The resolved request can be accepted with the @see acceptOpenId4VpAuthorizationRequest.\n *\n * If the authorization request uses OpenID4VP and included presentation definitions,\n * a `presentationExchange` property will be defined with credentials that satisfy the\n * incoming request. When `presentationExchange` is present, you MUST supply `presentationExchange`\n * when calling `acceptOpenId4VpAuthorizationRequest` as well.\n *\n * @param request\n * Can be:\n * - JWT\n * - URI containing request or request_uri param\n * - Request payload\n * @returns the resolved and verified authentication request.\n */\n public async resolveOpenId4VpAuthorizationRequest(\n request: string | Record<string, unknown>,\n options?: ResolveOpenId4VpAuthorizationRequestOptions\n ) {\n return this.openId4VpHolderService.resolveAuthorizationRequest(this.agentContext, request, options)\n }\n\n /**\n * Accepts the authentication request after it has been resolved and verified with {@link resolveOpenId4VpAuthorizationRequest}.\n *\n * If the resolved authorization request included a `presentationExchange` property, you MUST supply `presentationExchange`\n * in the `options` parameter. The same is true for `dcql`.\n *\n * For response mode of `direct_post` or `direct_post.jwt` the response will be submitted directly\n * to the response url. For `dc_api` and `dc_api.jwt` the response will be returned but without a\n * `serverResponse`, and you have to submit the response yourself.\n */\n public async acceptOpenId4VpAuthorizationRequest(options: OpenId4VpAcceptAuthorizationRequestOptions) {\n return await this.openId4VpHolderService.acceptAuthorizationRequest(this.agentContext, options)\n }\n\n /**\n * Automatically select credentials from available credentials for a presentation exchange request. Can be called after calling\n * @see resolveOpenId4VpAuthorizationRequest.\n */\n public selectCredentialsForPresentationExchangeRequest(credentialsForRequest: DifPexCredentialsForRequest) {\n return this.difPresentationExchangeService.selectCredentialsForRequest(credentialsForRequest)\n }\n\n /**\n * Automatically select credentials from available credentials for a dcql request. Can be called after calling\n * @see resolveOpenId4VpAuthorizationRequest.\n */\n public selectCredentialsForDcqlRequest(\n dcqlQueryResult: DcqlQueryResult,\n options?: DcqlSelectCredentialsForRequestOptions\n ) {\n return this.dcqlService.selectCredentialsForRequest(dcqlQueryResult, options)\n }\n\n public async resolveIssuerMetadata(credentialIssuer: string): Promise<OpenId4VciMetadata> {\n return await this.openId4VciHolderService.resolveIssuerMetadata(this.agentContext, credentialIssuer)\n }\n\n /**\n * Resolves a credential offer given as credential offer URL, or issuance initiation URL,\n * into a unified format with metadata.\n *\n * @param credentialOffer the credential offer to resolve\n * @returns The uniform credential offer payload, the issuer metadata, protocol version, and the offered credentials with metadata.\n */\n public async resolveCredentialOffer(credentialOffer: string) {\n return await this.openId4VciHolderService.resolveCredentialOffer(this.agentContext, credentialOffer)\n }\n\n /**\n * This function is to be used to receive an credential in OpenID4VCI using the Authorization Code Flow.\n *\n * Not to be confused with the {@link resolveOpenId4VpAuthorizationRequest}, which is only used for OpenID4VP requests.\n *\n * It will generate an authorization session based on the provided options.\n *\n * There are two possible flows:\n * - Oauth2Redirect: an authorization request URI is returend which can be used to obtain the authorization code.\n * This needs to be done manually (e.g. by opening a browser window)\n * - PresentationDuringIssuance: an openid4vp presentation request needs to be handled. A oid4vpRequestUri is returned\n * which can be parsed using `resolveOpenId4VpAuthorizationRequest`. After the presentation session has been completed,\n * the resulting `presentationDuringIssuanceSession` can be used to obtain an authorization code\n *\n * Authorization to request credentials can only be requested through scopes.\n *\n * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer\n * @param authCodeFlowOptions\n * @returns The authorization request URI alongside the code verifier and original @param authCodeFlowOptions\n */\n public async resolveOpenId4VciAuthorizationRequest(\n resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer,\n authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions\n ) {\n return await this.openId4VciHolderService.resolveAuthorizationRequest(\n this.agentContext,\n resolvedCredentialOffer,\n authCodeFlowOptions\n )\n }\n\n /**\n * Retrieve an authorization code using an `presentationDuringIssuanceSession`.\n *\n * The authorization code can be exchanged for an `accessToken` @see requestToken\n */\n public async retrieveAuthorizationCodeUsingPresentation(\n options: OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions\n ) {\n return await this.openId4VciHolderService.retrieveAuthorizationCodeUsingPresentation(this.agentContext, options)\n }\n\n /**\n * Requests the token to be used for credential requests.\n */\n public async requestToken(options: OpenId4VciRequestTokenOptions): Promise<OpenId4VciRequestTokenResponse> {\n const { accessTokenResponse, authorizationServer, dpop } = await this.openId4VciHolderService.requestAccessToken(\n this.agentContext,\n options\n )\n\n return {\n accessToken: accessTokenResponse.access_token,\n refreshToken: accessTokenResponse.refresh_token,\n cNonce: accessTokenResponse.c_nonce,\n authorizationServer,\n dpop,\n accessTokenResponse,\n }\n }\n\n /**\n * Requests the token to be used for credential requests.\n */\n public async refreshToken(\n options: OpenId4VciTokenRefreshOptions\n ): Promise<Omit<OpenId4VciRequestTokenResponse, 'authorizationServer'>> {\n const { accessTokenResponse, dpop } = await this.openId4VciHolderService.refreshAccessToken(\n this.agentContext,\n options\n )\n\n return {\n accessToken: accessTokenResponse.access_token,\n refreshToken: accessTokenResponse.refresh_token,\n cNonce: accessTokenResponse.c_nonce,\n dpop,\n accessTokenResponse,\n }\n }\n\n /**\n * Request a set of credentials from the credential issuer.\n * Can be used with both the pre-authorized code flow and the authorization code flow.\n */\n public async requestCredentials(options: OpenId4VciRequestCredentialOptions) {\n const { resolvedCredentialOffer, cNonce, accessToken, dpop, clientId, ...credentialRequestOptions } = options\n\n return this.openId4VciHolderService.acceptCredentialOffer(this.agentContext, {\n resolvedCredentialOffer,\n acceptCredentialOfferOptions: credentialRequestOptions,\n accessToken,\n cNonce,\n dpop,\n clientId,\n })\n }\n\n /**\n * Request a set of deferred credentials from the credential issuer.\n */\n public async requestDeferredCredentials(options: OpenId4VciDeferredCredentialRequestOptions) {\n return this.openId4VciHolderService.retrieveDeferredCredentials(this.agentContext, options)\n }\n\n /**\n * Send a notification event to the credential issuer\n */\n public async sendNotification(options: OpenId4VciSendNotificationOptions) {\n return this.openId4VciHolderService.sendNotification(this.agentContext, options)\n }\n}\n"],"mappings":";;;;;;;;AAgCO,+BAAMA,qBAAmB;CAC9B,AAAO,YACL,AAAQC,cACR,AAAQC,yBACR,AAAQC,wBACR,AAAQC,gCACR,AAAQC,aACR;EALQ;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;;;;;;CAqBV,MAAa,qCACX,SACA,SACA;AACA,SAAO,KAAK,uBAAuB,4BAA4B,KAAK,cAAc,SAAS,QAAQ;;;;;;;;;;;;CAarG,MAAa,oCAAoC,SAAqD;AACpG,SAAO,MAAM,KAAK,uBAAuB,2BAA2B,KAAK,cAAc,QAAQ;;;;;;CAOjG,AAAO,gDAAgD,uBAAoD;AACzG,SAAO,KAAK,+BAA+B,4BAA4B,sBAAsB;;;;;;CAO/F,AAAO,gCACL,iBACA,SACA;AACA,SAAO,KAAK,YAAY,4BAA4B,iBAAiB,QAAQ;;CAG/E,MAAa,sBAAsB,kBAAuD;AACxF,SAAO,MAAM,KAAK,wBAAwB,sBAAsB,KAAK,cAAc,iBAAiB;;;;;;;;;CAUtG,MAAa,uBAAuB,iBAAyB;AAC3D,SAAO,MAAM,KAAK,wBAAwB,uBAAuB,KAAK,cAAc,gBAAgB;;;;;;;;;;;;;;;;;;;;;;CAuBtG,MAAa,sCACX,yBACA,qBACA;AACA,SAAO,MAAM,KAAK,wBAAwB,4BACxC,KAAK,cACL,yBACA,oBACD;;;;;;;CAQH,MAAa,2CACX,SACA;AACA,SAAO,MAAM,KAAK,wBAAwB,2CAA2C,KAAK,cAAc,QAAQ;;;;;CAMlH,MAAa,aAAa,SAAiF;EACzG,MAAM,EAAE,qBAAqB,qBAAqB,SAAS,MAAM,KAAK,wBAAwB,mBAC5F,KAAK,cACL,QACD;AAED,SAAO;GACL,aAAa,oBAAoB;GACjC,cAAc,oBAAoB;GAClC,QAAQ,oBAAoB;GAC5B;GACA;GACA;GACD;;;;;CAMH,MAAa,aACX,SACsE;EACtE,MAAM,EAAE,qBAAqB,SAAS,MAAM,KAAK,wBAAwB,mBACvE,KAAK,cACL,QACD;AAED,SAAO;GACL,aAAa,oBAAoB;GACjC,cAAc,oBAAoB;GAClC,QAAQ,oBAAoB;GAC5B;GACA;GACD;;;;;;CAOH,MAAa,mBAAmB,SAA6C;EAC3E,MAAM,EAAE,yBAAyB,QAAQ,aAAa,MAAM,UAAU,GAAG,6BAA6B;AAEtG,SAAO,KAAK,wBAAwB,sBAAsB,KAAK,cAAc;GAC3E;GACA,8BAA8B;GAC9B;GACA;GACA;GACA;GACD,CAAC;;;;;CAMJ,MAAa,2BAA2B,SAAqD;AAC3F,SAAO,KAAK,wBAAwB,4BAA4B,KAAK,cAAc,QAAQ;;;;;CAM7F,MAAa,iBAAiB,SAA4C;AACxE,SAAO,KAAK,wBAAwB,iBAAiB,KAAK,cAAc,QAAQ;;;iCAhMnF,YAAY"}
|
|
1
|
+
{"version":3,"file":"OpenId4VcHolderApi.mjs","names":["OpenId4VcHolderApi","agentContext: AgentContext","openId4VciHolderService: OpenId4VciHolderService","openId4VpHolderService: OpenId4VpHolderService","difPresentationExchangeService: DifPresentationExchangeService","dcqlService: DcqlService"],"sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"sourcesContent":["import {\n AgentContext,\n type DcqlQueryResult,\n type DcqlSelectCredentialsForRequestOptions,\n DcqlService,\n type DifPexCredentialsForRequest,\n DifPresentationExchangeService,\n injectable,\n} from '@credo-ts/core'\nimport type { OpenId4VciMetadata } from '../shared'\nimport { OpenId4VciHolderService } from './OpenId4VciHolderService'\nimport type {\n OpenId4VciAuthCodeFlowOptions,\n OpenId4VciDeferredCredentialRequestOptions,\n OpenId4VciCredentialRequestOptions as OpenId4VciRequestCredentialOptions,\n OpenId4VciTokenRequestOptions as OpenId4VciRequestTokenOptions,\n OpenId4VciRequestTokenResponse,\n OpenId4VciResolvedCredentialOffer,\n OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions,\n OpenId4VciSendNotificationOptions,\n OpenId4VciTokenRefreshOptions,\n OpenId4VcParseAndVerifyAuthorizationResponseOptions,\n} from './OpenId4VciHolderServiceOptions'\nimport { OpenId4VpHolderService } from './OpenId4vpHolderService'\nimport type {\n OpenId4VpAcceptAuthorizationRequestOptions,\n ResolveOpenId4VpAuthorizationRequestOptions,\n} from './OpenId4vpHolderServiceOptions'\n\n/**\n * @public\n */\n@injectable()\nexport class OpenId4VcHolderApi {\n public constructor(\n private agentContext: AgentContext,\n private openId4VciHolderService: OpenId4VciHolderService,\n private openId4VpHolderService: OpenId4VpHolderService,\n private difPresentationExchangeService: DifPresentationExchangeService,\n private dcqlService: DcqlService\n ) {}\n\n /**\n * Resolves the authentication request given as URI or JWT to a unified format, and\n * verifies the validity of the request.\n *\n * The resolved request can be accepted with the @see acceptOpenId4VpAuthorizationRequest.\n *\n * If the authorization request uses OpenID4VP and included presentation definitions,\n * a `presentationExchange` property will be defined with credentials that satisfy the\n * incoming request. When `presentationExchange` is present, you MUST supply `presentationExchange`\n * when calling `acceptOpenId4VpAuthorizationRequest` as well.\n *\n * @param request\n * Can be:\n * - JWT\n * - URI containing request or request_uri param\n * - Request payload\n * @returns the resolved and verified authentication request.\n */\n public async resolveOpenId4VpAuthorizationRequest(\n request: string | Record<string, unknown>,\n options?: ResolveOpenId4VpAuthorizationRequestOptions\n ) {\n return this.openId4VpHolderService.resolveAuthorizationRequest(this.agentContext, request, options)\n }\n\n /**\n * Accepts the authentication request after it has been resolved and verified with {@link resolveOpenId4VpAuthorizationRequest}.\n *\n * If the resolved authorization request included a `presentationExchange` property, you MUST supply `presentationExchange`\n * in the `options` parameter. The same is true for `dcql`.\n *\n * For response mode of `direct_post` or `direct_post.jwt` the response will be submitted directly\n * to the response url. For `dc_api` and `dc_api.jwt` the response will be returned but without a\n * `serverResponse`, and you have to submit the response yourself.\n */\n public async acceptOpenId4VpAuthorizationRequest(options: OpenId4VpAcceptAuthorizationRequestOptions) {\n return await this.openId4VpHolderService.acceptAuthorizationRequest(this.agentContext, options)\n }\n\n /**\n * Automatically select credentials from available credentials for a presentation exchange request. Can be called after calling\n * @see resolveOpenId4VpAuthorizationRequest.\n */\n public selectCredentialsForPresentationExchangeRequest(credentialsForRequest: DifPexCredentialsForRequest) {\n return this.difPresentationExchangeService.selectCredentialsForRequest(credentialsForRequest)\n }\n\n /**\n * Automatically select credentials from available credentials for a dcql request. Can be called after calling\n * @see resolveOpenId4VpAuthorizationRequest.\n */\n public selectCredentialsForDcqlRequest(\n dcqlQueryResult: DcqlQueryResult,\n options?: DcqlSelectCredentialsForRequestOptions\n ) {\n return this.dcqlService.selectCredentialsForRequest(dcqlQueryResult, options)\n }\n\n public async resolveIssuerMetadata(credentialIssuer: string): Promise<OpenId4VciMetadata> {\n return await this.openId4VciHolderService.resolveIssuerMetadata(this.agentContext, credentialIssuer)\n }\n\n /**\n * Resolves a credential offer given as credential offer URL, or issuance initiation URL,\n * into a unified format with metadata.\n *\n * @param credentialOffer the credential offer to resolve\n * @returns The uniform credential offer payload, the issuer metadata, protocol version, and the offered credentials with metadata.\n */\n public async resolveCredentialOffer(credentialOffer: string) {\n return await this.openId4VciHolderService.resolveCredentialOffer(this.agentContext, credentialOffer)\n }\n\n /**\n * This function is to be used to receive an credential in OpenID4VCI using the Authorization Code Flow.\n *\n * Not to be confused with the {@link resolveOpenId4VpAuthorizationRequest}, which is only used for OpenID4VP requests.\n *\n * It will generate an authorization session based on the provided options.\n *\n * There are two possible flows:\n * - Oauth2Redirect: an authorization request URI is returend which can be used to obtain the authorization code.\n * This needs to be done manually (e.g. by opening a browser window)\n * - PresentationDuringIssuance: an openid4vp presentation request needs to be handled. A oid4vpRequestUri is returned\n * which can be parsed using `resolveOpenId4VpAuthorizationRequest`. After the presentation session has been completed,\n * the resulting `presentationDuringIssuanceSession` can be used to obtain an authorization code\n *\n * Authorization to request credentials can only be requested through scopes.\n *\n * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer\n * @param authCodeFlowOptions\n * @returns The authorization request URI alongside the code verifier and original @param authCodeFlowOptions\n */\n public async resolveOpenId4VciAuthorizationRequest(\n resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer,\n authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions\n ) {\n return await this.openId4VciHolderService.resolveAuthorizationRequest(\n this.agentContext,\n resolvedCredentialOffer,\n authCodeFlowOptions\n )\n }\n\n /**\n * Retrieve an authorization code using an `presentationDuringIssuanceSession`.\n *\n * The authorization code can be exchanged for an `accessToken` @see requestToken\n */\n public async retrieveAuthorizationCodeUsingPresentation(\n options: OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions\n ) {\n return await this.openId4VciHolderService.retrieveAuthorizationCodeUsingPresentation(this.agentContext, options)\n }\n\n public parseAuthorizationCodeFromAuthorizationResponse(options: OpenId4VcParseAndVerifyAuthorizationResponseOptions) {\n return this.openId4VciHolderService.parseAuthorizationCodeFromAuthorizationResponse(this.agentContext, options)\n }\n\n /**\n * Requests the token to be used for credential requests.\n */\n public async requestToken(options: OpenId4VciRequestTokenOptions): Promise<OpenId4VciRequestTokenResponse> {\n const { accessTokenResponse, authorizationServer, dpop } = await this.openId4VciHolderService.requestAccessToken(\n this.agentContext,\n options\n )\n\n return {\n accessToken: accessTokenResponse.access_token,\n refreshToken: accessTokenResponse.refresh_token,\n cNonce: accessTokenResponse.c_nonce,\n authorizationServer,\n dpop,\n accessTokenResponse,\n }\n }\n\n /**\n * Requests the token to be used for credential requests.\n */\n public async refreshToken(\n options: OpenId4VciTokenRefreshOptions\n ): Promise<Omit<OpenId4VciRequestTokenResponse, 'authorizationServer'>> {\n const { accessTokenResponse, dpop } = await this.openId4VciHolderService.refreshAccessToken(\n this.agentContext,\n options\n )\n\n return {\n accessToken: accessTokenResponse.access_token,\n refreshToken: accessTokenResponse.refresh_token,\n cNonce: accessTokenResponse.c_nonce,\n dpop,\n accessTokenResponse,\n }\n }\n\n /**\n * Request a set of credentials from the credential issuer.\n * Can be used with both the pre-authorized code flow and the authorization code flow.\n */\n public async requestCredentials(options: OpenId4VciRequestCredentialOptions) {\n const { resolvedCredentialOffer, cNonce, accessToken, dpop, clientId, ...credentialRequestOptions } = options\n\n return this.openId4VciHolderService.acceptCredentialOffer(this.agentContext, {\n resolvedCredentialOffer,\n acceptCredentialOfferOptions: credentialRequestOptions,\n accessToken,\n cNonce,\n dpop,\n clientId,\n })\n }\n\n /**\n * Request a set of deferred credentials from the credential issuer.\n */\n public async requestDeferredCredentials(options: OpenId4VciDeferredCredentialRequestOptions) {\n return this.openId4VciHolderService.retrieveDeferredCredentials(this.agentContext, options)\n }\n\n /**\n * Send a notification event to the credential issuer\n */\n public async sendNotification(options: OpenId4VciSendNotificationOptions) {\n return this.openId4VciHolderService.sendNotification(this.agentContext, options)\n }\n}\n"],"mappings":";;;;;;;;AAiCO,+BAAMA,qBAAmB;CAC9B,AAAO,YACL,AAAQC,cACR,AAAQC,yBACR,AAAQC,wBACR,AAAQC,gCACR,AAAQC,aACR;EALQ;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;;;;;;CAqBV,MAAa,qCACX,SACA,SACA;AACA,SAAO,KAAK,uBAAuB,4BAA4B,KAAK,cAAc,SAAS,QAAQ;;;;;;;;;;;;CAarG,MAAa,oCAAoC,SAAqD;AACpG,SAAO,MAAM,KAAK,uBAAuB,2BAA2B,KAAK,cAAc,QAAQ;;;;;;CAOjG,AAAO,gDAAgD,uBAAoD;AACzG,SAAO,KAAK,+BAA+B,4BAA4B,sBAAsB;;;;;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4BAA4B,KAAK,cAAc,QAAQ;;;;;CAM7F,MAAa,iBAAiB,SAA4C;AACxE,SAAO,KAAK,wBAAwB,iBAAiB,KAAK,cAAc,QAAQ;;;iCApMnF,YAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenId4VciMetadata } from "../shared/models/index.mjs";
|
|
2
2
|
import "../shared/index.mjs";
|
|
3
|
-
import { OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions } from "./OpenId4VciHolderServiceOptions.mjs";
|
|
3
|
+
import { OpenId4VcParseAndVerifyAuthorizationResponseOptions, OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialResponse, OpenId4VciDeferredCredentialRequestOptions, OpenId4VciDeferredCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciTokenRefreshOptions, OpenId4VciTokenRequestOptions } from "./OpenId4VciHolderServiceOptions.mjs";
|
|
4
4
|
import { AgentContext, Logger, W3cCredentialService, W3cV2CredentialService } from "@credo-ts/core";
|
|
5
5
|
import { AccessTokenResponse, Oauth2Client } from "@openid4vc/oauth2";
|
|
6
6
|
|
|
@@ -19,6 +19,9 @@ declare class OpenId4VciHolderService {
|
|
|
19
19
|
authorizationCode: string;
|
|
20
20
|
dpop?: OpenId4VciDpopRequestOptions;
|
|
21
21
|
}>;
|
|
22
|
+
parseAuthorizationCodeFromAuthorizationResponse(agentContext: AgentContext, options: OpenId4VcParseAndVerifyAuthorizationResponseOptions): {
|
|
23
|
+
authorizationCode: string;
|
|
24
|
+
};
|
|
22
25
|
requestAccessToken(agentContext: AgentContext, options: OpenId4VciTokenRequestOptions): Promise<{
|
|
23
26
|
authorizationServer: string;
|
|
24
27
|
accessTokenResponse: AccessTokenResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VciHolderService.d.mts","names":[],"sources":["../../src/openid4vc-holder/OpenId4VciHolderService.ts"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"OpenId4VciHolderService.d.mts","names":[],"sources":["../../src/openid4vc-holder/OpenId4VciHolderService.ts"],"sourcesContent":[],"mappings":";;;;;;;cAqFa,uBAAA;;;EAAA,QAAA,sBAAuB;EAMS,WAAA,CAAA,MAAA,EAAA,MAAA,EAAA,oBAAA,EACnB,oBADmB,EAAA,sBAAA,EAEjB,sBAFiB;EACnB,qBAAA,CAAA,YAAA,EASR,YATQ,EAAA,gBAAA,EAAA,MAAA,CAAA,EAWrB,OAXqB,CAWb,kBAXa,CAAA;EACE,sBAAA,CAAA,YAAA,EAoBV,YApBU,EAAA,eAAA,EAAA,MAAA,CAAA,EAsBvB,OAtBuB,CAsBf,iCAtBe,CAAA;EAQV,2BAAA,CAAA,YAAA,EAoCA,YApCA,EAAA,uBAAA,EAqCW,iCArCX,EAAA,mBAAA,EAsCO,6BAtCP,CAAA,EAuCb,OAvCa,CAuCL,sCAvCK,CAAA;EAEL,gBAAA,CAAA,YAAA,EAiHiC,YAjHjC,EAAA,OAAA,EAiHwD,iCAjHxD,CAAA,EAiHyF,OAjHzF,CAAA,IAAA,CAAA;EAAR,QAAA,cAAA;EAUa,0CAAA,CAAA,YAAA,EA8LA,YA9LA,EAAA,OAAA,EA+LL,2DA/LK,CAAA,EAgMb,OAhMa,CAAA;IAEL,iBAAA,EAAA,MAAA;IAAR,IAAA,CAAA,EAgMM,4BAhMN;EAsB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AAA;EAGvB;;;;;;EA8KA,QAAA,2BAAA;EAEI"}
|
|
@@ -8,8 +8,8 @@ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.99.0/hel
|
|
|
8
8
|
import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
|
|
9
9
|
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
10
10
|
import { AgentContext, CredoError, DidsApi, InjectionSymbols, Kms, Mdoc, MdocApi, MdocRecord, SdJwtVcApi, SdJwtVcRecord, SignatureSuiteRegistry, TypedArrayEncoder, W3cCredentialRecord, W3cCredentialService, W3cJsonLdCredentialService, W3cJsonLdVerifiableCredential, W3cJwtVerifiableCredential, W3cV2CredentialRecord, W3cV2CredentialService, W3cV2SdJwtVerifiableCredential, inject, injectable, parseDid, replaceError } from "@credo-ts/core";
|
|
11
|
-
import { Oauth2Client, authorizationCodeGrantIdentifier, clientAuthenticationAnonymous, clientAuthenticationClientAttestationJwt, clientAuthenticationNone, getAuthorizationServerMetadataFromList, preAuthorizedCodeGrantIdentifier, refreshTokenGrantIdentifier } from "@openid4vc/oauth2";
|
|
12
|
-
import { AuthorizationFlow, Openid4vciClient,
|
|
11
|
+
import { Oauth2Client, Oauth2ServerErrorResponseError, authorizationCodeGrantIdentifier, clientAuthenticationAnonymous, clientAuthenticationClientAttestationJwt, clientAuthenticationNone, getAuthorizationServerMetadataFromList, preAuthorizedCodeGrantIdentifier, refreshTokenGrantIdentifier } from "@openid4vc/oauth2";
|
|
12
|
+
import { AuthorizationFlow, Openid4vciClient, Openid4vciRetrieveCredentialsError, Openid4vciVersion, determineAuthorizationServerForCredentialOffer, parseKeyAttestationJwt } from "@openid4vc/openid4vci";
|
|
13
13
|
|
|
14
14
|
//#region src/openid4vc-holder/OpenId4VciHolderService.ts
|
|
15
15
|
var _ref, _ref2;
|
|
@@ -154,6 +154,18 @@ let OpenId4VciHolderService = class OpenId4VciHolderService$1 {
|
|
|
154
154
|
} : void 0
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
+
parseAuthorizationCodeFromAuthorizationResponse(agentContext, options) {
|
|
158
|
+
const { metadata, credentialOfferPayload } = options.resolvedCredentialOffer;
|
|
159
|
+
const client = this.getClient(agentContext);
|
|
160
|
+
const authorizationServer = credentialOfferPayload.grants?.authorization_code?.authorization_server;
|
|
161
|
+
const authorizationServerMetadata = getAuthorizationServerMetadataFromList(metadata.authorizationServers, authorizationServer ?? metadata.authorizationServers[0].issuer);
|
|
162
|
+
const authorizationResponse = client.parseAndVerifyAuthorizationResponseRedirectUrl({
|
|
163
|
+
authorizationServerMetadata,
|
|
164
|
+
url: options.authorizationResponseRedirectUrl
|
|
165
|
+
});
|
|
166
|
+
if (!authorizationResponse.code) throw new Oauth2ServerErrorResponseError(authorizationResponse, { internalMessage: "Error response received from the authorization server" });
|
|
167
|
+
return { authorizationCode: authorizationResponse.code };
|
|
168
|
+
}
|
|
157
169
|
async requestAccessToken(agentContext, options) {
|
|
158
170
|
const { metadata, credentialOfferPayload } = options.resolvedCredentialOffer;
|
|
159
171
|
const client = this.getClient(agentContext, {
|
|
@@ -256,7 +268,7 @@ let OpenId4VciHolderService = class OpenId4VciHolderService$1 {
|
|
|
256
268
|
credentialBindingResolver
|
|
257
269
|
});
|
|
258
270
|
this.logger.debug("Generated credential request proof of possession", { proofs });
|
|
259
|
-
const proof = (metadata.originalDraftVersion ===
|
|
271
|
+
const proof = (metadata.originalDraftVersion === Openid4vciVersion.Draft11 || metadata.originalDraftVersion === Openid4vciVersion.Draft14 && metadata.credentialIssuer.batch_credential_issuance === void 0) && proofs.jwt?.length === 1 ? {
|
|
260
272
|
proof_type: "jwt",
|
|
261
273
|
jwt: proofs.jwt[0]
|
|
262
274
|
} : void 0;
|
|
@@ -520,7 +532,7 @@ let OpenId4VciHolderService = class OpenId4VciHolderService$1 {
|
|
|
520
532
|
const signatureSuiteRegistry = agentContext.dependencyManager.resolve(SignatureSuiteRegistry);
|
|
521
533
|
let proofTypesSupported = configuration.proof_types_supported;
|
|
522
534
|
if (!proofTypesSupported) {
|
|
523
|
-
if (metadata.originalDraftVersion !==
|
|
535
|
+
if (metadata.originalDraftVersion !== Openid4vciVersion.Draft11) throw new CredoError(`Credential configuration '${configurationId}' does not specify proof_types_supported. Credentials not bound to keys are not supported at the moment`);
|
|
524
536
|
proofTypesSupported = { jwt: { proof_signing_alg_values_supported: possibleProofOfPossessionSignatureAlgorithms } };
|
|
525
537
|
}
|
|
526
538
|
const proofTypes = {
|