@credo-ts/openid4vc 0.6.1-pr-2091-20241119140918 → 0.6.1
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 +24 -0
- package/build/OpenId4VcApi.d.mts.map +1 -0
- package/build/OpenId4VcApi.mjs +35 -0
- package/build/OpenId4VcApi.mjs.map +1 -0
- package/build/OpenId4VcModule.d.mts +30 -0
- package/build/OpenId4VcModule.d.mts.map +1 -0
- package/build/OpenId4VcModule.mjs +42 -0
- package/build/OpenId4VcModule.mjs.map +1 -0
- package/build/OpenId4VcModuleConfig.d.mts +44 -0
- package/build/OpenId4VcModuleConfig.d.mts.map +1 -0
- package/build/OpenId4VcModuleConfig.mjs +24 -0
- package/build/OpenId4VcModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/index.d.mts +42 -0
- package/build/index.mjs +37 -0
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts +238 -0
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts.map +1 -0
- package/build/openid4vc-holder/OpenId4VcHolderApi.mjs +174 -0
- package/build/openid4vc-holder/OpenId4VcHolderApi.mjs.map +1 -0
- package/build/openid4vc-holder/OpenId4VcHolderModule.d.mts +17 -0
- package/build/openid4vc-holder/OpenId4VcHolderModule.d.mts.map +1 -0
- package/build/openid4vc-holder/OpenId4VcHolderModule.mjs +23 -0
- package/build/openid4vc-holder/OpenId4VcHolderModule.mjs.map +1 -0
- package/build/openid4vc-holder/OpenId4VciHolderService.d.mts +69 -0
- package/build/openid4vc-holder/OpenId4VciHolderService.d.mts.map +1 -0
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs +751 -0
- package/build/openid4vc-holder/OpenId4VciHolderService.mjs.map +1 -0
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts +398 -0
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts.map +1 -0
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs +16 -0
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs.map +1 -0
- package/build/openid4vc-holder/OpenId4vpHolderService.d.mts +130 -0
- package/build/openid4vc-holder/OpenId4vpHolderService.d.mts.map +1 -0
- package/build/openid4vc-holder/OpenId4vpHolderService.mjs +278 -0
- package/build/openid4vc-holder/OpenId4vpHolderService.mjs.map +1 -0
- package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.mts +112 -0
- package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.mts.map +1 -0
- package/build/openid4vc-holder/index.d.mts +6 -0
- package/build/openid4vc-holder/index.mjs +5 -0
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.mts +16 -0
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.mjs +18 -0
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts +137 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs +108 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.mts +19 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.mjs +9 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts +27 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs +150 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts +279 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs +179 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts +182 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs +881 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts +340 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts.map +1 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.mjs +1 -0
- package/build/openid4vc-issuer/index.d.mts +11 -0
- package/build/openid4vc-issuer/index.mjs +11 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts +300 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs +102 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.mts +10 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.mts.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs +22 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts +84 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs +89 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.mts +12 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.mts.map +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs +28 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs.map +1 -0
- package/build/openid4vc-issuer/repository/index.d.mts +4 -0
- package/build/openid4vc-issuer/repository/index.mjs +4 -0
- package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs +199 -0
- package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs +241 -0
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/authorizationEndpoint.mjs +51 -0
- package/build/openid4vc-issuer/router/authorizationEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs +25 -0
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs +142 -0
- package/build/openid4vc-issuer/router/credentialEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs +38 -0
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs +84 -0
- package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/index.mjs +12 -0
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs +43 -0
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/jwksEndpoint.mjs +18 -0
- package/build/openid4vc-issuer/router/jwksEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/nonceEndpoint.mjs +29 -0
- package/build/openid4vc-issuer/router/nonceEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/pushedAuthorizationRequestEndpoint.mjs +164 -0
- package/build/openid4vc-issuer/router/pushedAuthorizationRequestEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/router/redirectEndpoint.mjs +124 -0
- package/build/openid4vc-issuer/router/redirectEndpoint.mjs.map +1 -0
- package/build/openid4vc-issuer/util/txCode.mjs +18 -0
- package/build/openid4vc-issuer/util/txCode.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.mts +10 -0
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.mjs +12 -0
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts +60 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs +83 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.mts +19 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.mjs +9 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts +25 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs +91 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.mts +55 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.mjs +36 -0
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts +60 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts.map +1 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs +714 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs.map +1 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts +194 -0
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts.map +1 -0
- package/build/openid4vc-verifier/index.d.mts +12 -0
- package/build/openid4vc-verifier/index.mjs +11 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts +129 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs +64 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.mts +10 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.mts.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs +22 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts +33 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs +32 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.mts +12 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.mts.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs +28 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs.map +1 -0
- package/build/openid4vc-verifier/repository/index.d.mts +4 -0
- package/build/openid4vc-verifier/repository/index.mjs +4 -0
- package/build/openid4vc-verifier/router/authorizationEndpoint.mjs +117 -0
- package/build/openid4vc-verifier/router/authorizationEndpoint.mjs.map +1 -0
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs +39 -0
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs.map +1 -0
- package/build/openid4vc-verifier/router/index.mjs +1 -0
- package/build/shared/callbacks.d.mts +47 -0
- package/build/shared/callbacks.d.mts.map +1 -0
- package/build/shared/callbacks.mjs +279 -0
- package/build/shared/callbacks.mjs.map +1 -0
- package/build/shared/index.d.mts +7 -0
- package/build/shared/index.mjs +4 -0
- package/build/shared/issuerMetadataUtils.d.mts +22 -0
- package/build/shared/issuerMetadataUtils.d.mts.map +1 -0
- package/build/shared/issuerMetadataUtils.mjs +30 -0
- package/build/shared/issuerMetadataUtils.mjs.map +1 -0
- package/build/shared/models/CredentialHolderBinding.d.mts +71 -0
- package/build/shared/models/CredentialHolderBinding.d.mts.map +1 -0
- package/build/shared/models/CredentialHolderBinding.mjs +1 -0
- package/build/shared/models/OpenId4VcJwtIssuer.d.mts +46 -0
- package/build/shared/models/OpenId4VcJwtIssuer.d.mts.map +1 -0
- package/build/shared/models/OpenId4VcJwtIssuer.mjs +1 -0
- package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.mts +71 -0
- package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.mts.map +1 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.d.mts +12 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.d.mts.map +1 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.mjs +14 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.mjs.map +1 -0
- package/build/shared/models/index.d.mts +30 -0
- package/build/shared/models/index.d.mts.map +1 -0
- package/build/shared/models/index.mjs +6 -0
- package/build/shared/router/context.mjs +52 -0
- package/build/shared/router/context.mjs.map +1 -0
- package/build/shared/router/express.browser.d.mts +5 -0
- package/build/shared/router/express.browser.d.mts.map +1 -0
- package/build/shared/router/express.browser.mjs +8 -0
- package/build/shared/router/express.browser.mjs.map +1 -0
- package/build/shared/router/express.mjs +10 -0
- package/build/shared/router/express.mjs.map +1 -0
- package/build/shared/router/express.native.d.mts +5 -0
- package/build/shared/router/express.native.d.mts.map +1 -0
- package/build/shared/router/express.native.mjs +8 -0
- package/build/shared/router/express.native.mjs.map +1 -0
- package/build/shared/router/index.mjs +3 -0
- package/build/shared/router/tenants.mjs +36 -0
- package/build/shared/router/tenants.mjs.map +1 -0
- package/build/shared/transactionData.mjs +19 -0
- package/build/shared/transactionData.mjs.map +1 -0
- package/build/shared/utils.mjs +90 -0
- package/build/shared/utils.mjs.map +1 -0
- package/package.json +30 -23
- package/build/index.d.ts +0 -4
- package/build/index.js +0 -21
- package/build/index.js.map +0 -1
- package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +0 -124
- package/build/openid4vc-holder/OpenId4VcHolderApi.js +0 -155
- package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +0 -1
- package/build/openid4vc-holder/OpenId4VcHolderModule.d.ts +0 -13
- package/build/openid4vc-holder/OpenId4VcHolderModule.js +0 -35
- package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +0 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +0 -72
- package/build/openid4vc-holder/OpenId4VciHolderService.js +0 -569
- package/build/openid4vc-holder/OpenId4VciHolderService.js.map +0 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +0 -238
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +0 -14
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +0 -1
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +0 -32
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +0 -302
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +0 -1
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +0 -38
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js +0 -3
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js.map +0 -1
- package/build/openid4vc-holder/index.d.ts +0 -6
- package/build/openid4vc-holder/index.js +0 -23
- package/build/openid4vc-holder/index.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.ts +0 -12
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js +0 -19
- package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +0 -101
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +0 -110
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +0 -13
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js +0 -8
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +0 -21
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +0 -121
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +0 -190
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +0 -141
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +0 -116
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js +0 -698
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +0 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +0 -229
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js +0 -3
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js.map +0 -1
- package/build/openid4vc-issuer/index.d.ts +0 -8
- package/build/openid4vc-issuer/index.js +0 -27
- package/build/openid4vc-issuer/index.js.map +0 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +0 -160
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +0 -88
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +0 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +0 -5
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +0 -29
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js.map +0 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +0 -56
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +0 -83
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +0 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +0 -8
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js +0 -35
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js.map +0 -1
- package/build/openid4vc-issuer/repository/index.d.ts +0 -4
- package/build/openid4vc-issuer/repository/index.js +0 -21
- package/build/openid4vc-issuer/repository/index.js.map +0 -1
- package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +0 -5
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js +0 -164
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.d.ts +0 -3
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +0 -213
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.d.ts +0 -6
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js +0 -25
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +0 -3
- package/build/openid4vc-issuer/router/credentialEndpoint.js +0 -176
- package/build/openid4vc-issuer/router/credentialEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +0 -3
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +0 -45
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/index.d.ts +0 -9
- package/build/openid4vc-issuer/router/index.js +0 -20
- package/build/openid4vc-issuer/router/index.js.map +0 -1
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.d.ts +0 -2
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js +0 -26
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +0 -3
- package/build/openid4vc-issuer/router/jwksEndpoint.js +0 -20
- package/build/openid4vc-issuer/router/jwksEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +0 -3
- package/build/openid4vc-issuer/router/nonceEndpoint.js +0 -26
- package/build/openid4vc-issuer/router/nonceEndpoint.js.map +0 -1
- package/build/openid4vc-issuer/router/requestContext.d.ts +0 -5
- package/build/openid4vc-issuer/router/requestContext.js +0 -3
- package/build/openid4vc-issuer/router/requestContext.js.map +0 -1
- package/build/openid4vc-issuer/util/txCode.d.ts +0 -3
- package/build/openid4vc-issuer/util/txCode.js +0 -18
- package/build/openid4vc-issuer/util/txCode.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +0 -55
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +0 -498
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +0 -77
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js +0 -3
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.ts +0 -6
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js +0 -11
- package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +0 -61
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +0 -108
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +0 -13
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js +0 -8
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +0 -21
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +0 -109
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +0 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +0 -31
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +0 -28
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +0 -1
- package/build/openid4vc-verifier/index.d.ts +0 -8
- package/build/openid4vc-verifier/index.js +0 -25
- package/build/openid4vc-verifier/index.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +0 -49
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +0 -234
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +0 -19
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +0 -146
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +0 -71
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +0 -46
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +0 -5
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +0 -29
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +0 -29
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js +0 -29
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js.map +0 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +0 -8
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js +0 -35
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js.map +0 -1
- package/build/openid4vc-verifier/repository/index.d.ts +0 -4
- package/build/openid4vc-verifier/repository/index.js +0 -21
- package/build/openid4vc-verifier/repository/index.js.map +0 -1
- package/build/openid4vc-verifier/router/authorizationEndpoint.d.ts +0 -11
- package/build/openid4vc-verifier/router/authorizationEndpoint.js +0 -102
- package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +0 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +0 -11
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +0 -63
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +0 -1
- package/build/openid4vc-verifier/router/index.d.ts +0 -2
- package/build/openid4vc-verifier/router/index.js +0 -6
- package/build/openid4vc-verifier/router/index.js.map +0 -1
- package/build/openid4vc-verifier/router/requestContext.d.ts +0 -5
- package/build/openid4vc-verifier/router/requestContext.js +0 -3
- package/build/openid4vc-verifier/router/requestContext.js.map +0 -1
- package/build/shared/callbacks.d.ts +0 -18
- package/build/shared/callbacks.js +0 -81
- package/build/shared/callbacks.js.map +0 -1
- package/build/shared/index.d.ts +0 -2
- package/build/shared/index.js +0 -19
- package/build/shared/index.js.map +0 -1
- package/build/shared/issuerMetadataUtils.d.ts +0 -158
- package/build/shared/issuerMetadataUtils.js +0 -38
- package/build/shared/issuerMetadataUtils.js.map +0 -1
- package/build/shared/models/CredentialHolderBinding.d.ts +0 -13
- package/build/shared/models/CredentialHolderBinding.js +0 -3
- package/build/shared/models/CredentialHolderBinding.js.map +0 -1
- package/build/shared/models/OpenId4VcJwtIssuer.d.ts +0 -28
- package/build/shared/models/OpenId4VcJwtIssuer.js +0 -3
- package/build/shared/models/OpenId4VcJwtIssuer.js.map +0 -1
- package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.ts +0 -10
- package/build/shared/models/OpenId4VciAuthorizationServerConfig.js +0 -3
- package/build/shared/models/OpenId4VciAuthorizationServerConfig.js.map +0 -1
- package/build/shared/models/OpenId4VciCredentialFormatProfile.d.ts +0 -7
- package/build/shared/models/OpenId4VciCredentialFormatProfile.js +0 -12
- package/build/shared/models/OpenId4VciCredentialFormatProfile.js.map +0 -1
- package/build/shared/models/index.d.ts +0 -24
- package/build/shared/models/index.js +0 -25
- package/build/shared/models/index.js.map +0 -1
- package/build/shared/router/context.d.ts +0 -17
- package/build/shared/router/context.js +0 -76
- package/build/shared/router/context.js.map +0 -1
- package/build/shared/router/express.d.ts +0 -2
- package/build/shared/router/express.js +0 -15
- package/build/shared/router/express.js.map +0 -1
- package/build/shared/router/express.native.d.ts +0 -1
- package/build/shared/router/express.native.js +0 -7
- package/build/shared/router/express.native.js.map +0 -1
- package/build/shared/router/index.d.ts +0 -3
- package/build/shared/router/index.js +0 -20
- package/build/shared/router/index.js.map +0 -1
- package/build/shared/router/tenants.d.ts +0 -13
- package/build/shared/router/tenants.js +0 -49
- package/build/shared/router/tenants.js.map +0 -1
- package/build/shared/transform.d.ts +0 -5
- package/build/shared/transform.js +0 -73
- package/build/shared/transform.js.map +0 -1
- package/build/shared/utils.d.ts +0 -22
- package/build/shared/utils.js +0 -154
- package/build/shared/utils.js.map +0 -1
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { OpenId4VciCredentialOfferPayload } from "../../shared/models/index.mjs";
|
|
2
|
+
import { OpenId4VcIssuanceSessionState } from "../OpenId4VcIssuanceSessionState.mjs";
|
|
3
|
+
import "../../shared/index.mjs";
|
|
4
|
+
import { OpenId4VciVersion } from "../OpenId4VcIssuerServiceOptions.mjs";
|
|
5
|
+
import { BaseRecord, RecordTags, TagsBase } from "@credo-ts/core";
|
|
6
|
+
import { AccessTokenResponse, AuthorizationServerMetadata, PkceCodeChallengeMethod } from "@openid4vc/oauth2";
|
|
7
|
+
|
|
8
|
+
//#region src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts
|
|
9
|
+
interface OpenId4VcIssuanceSessionDpop {
|
|
10
|
+
/**
|
|
11
|
+
* Whether dpop is required. Can be set to false to override the
|
|
12
|
+
* global config
|
|
13
|
+
*/
|
|
14
|
+
required: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* JWK thumbprint of the dpop key. This is mostly used when a dpop key is bound
|
|
17
|
+
* to the issuance session before the access token is created (which contains the dpop key)
|
|
18
|
+
*/
|
|
19
|
+
dpopJkt?: string;
|
|
20
|
+
}
|
|
21
|
+
interface OpenId4VcIssuanceSessionWalletAttestation {
|
|
22
|
+
/**
|
|
23
|
+
* Whether presentation of a wallet attestation is required.
|
|
24
|
+
* Can be set to false to override the global config
|
|
25
|
+
*/
|
|
26
|
+
required: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface OpenId4VcIssuanceSessionAuthorization {
|
|
29
|
+
code?: string;
|
|
30
|
+
/**
|
|
31
|
+
* @todo: I saw in google's library that for codes they encrypt an id with expiration time.
|
|
32
|
+
* You know the code was created by you because you can decrypt it, and you don't have to store
|
|
33
|
+
* additional metadata on your server. It's similar to the signed / encrypted nonce
|
|
34
|
+
*/
|
|
35
|
+
codeExpiresAt?: Date;
|
|
36
|
+
/**
|
|
37
|
+
* String value created by the Credential Issuer and opaque to the Wallet that
|
|
38
|
+
* is used to bind the subsequent Authorization Request with the Credential Issuer to a context set up during previous steps.
|
|
39
|
+
*/
|
|
40
|
+
issuerState?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Scopes that are granted when the authorization is complete.
|
|
43
|
+
*/
|
|
44
|
+
scopes?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Subject the issuance session is bound to. For internal authorization this will be defined
|
|
47
|
+
* from the moment the token is issued. For external authorization this will be defined after
|
|
48
|
+
* the first time the credential endpoint has been called.
|
|
49
|
+
*/
|
|
50
|
+
subject?: string;
|
|
51
|
+
}
|
|
52
|
+
interface OpenId4VcIssuanceSessionPresentation {
|
|
53
|
+
/**
|
|
54
|
+
* Whether presentation during issuance is required. Mutually exclusive with `chainedIdentity`.
|
|
55
|
+
*/
|
|
56
|
+
required: true;
|
|
57
|
+
/**
|
|
58
|
+
* Auth session for the presentation during issuance flow
|
|
59
|
+
*/
|
|
60
|
+
authSession?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The id of the `OpenId4VcVerificationSessionRecord` record this issuance session is linked to
|
|
63
|
+
*/
|
|
64
|
+
openId4VcVerificationSessionId?: string;
|
|
65
|
+
}
|
|
66
|
+
interface OpenId4VcIssuanceSessionPkce {
|
|
67
|
+
codeChallengeMethod: PkceCodeChallengeMethod;
|
|
68
|
+
codeChallenge: string;
|
|
69
|
+
}
|
|
70
|
+
interface OpenId4VcIssuanceSessionChainedIdentity {
|
|
71
|
+
/**
|
|
72
|
+
* The identifier of the external identity provider's authorization server.
|
|
73
|
+
* Mutually exclusive with `presentation`.
|
|
74
|
+
*/
|
|
75
|
+
externalAuthorizationServerUrl: string;
|
|
76
|
+
/**
|
|
77
|
+
* The <reference-value> from the `request_uri` parameter returned to the client
|
|
78
|
+
* in the form of `urn:ietf:params:oauth:request_uri:<reference-value>`.
|
|
79
|
+
*/
|
|
80
|
+
requestUriReferenceValue?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The expiry time of the request URI.
|
|
83
|
+
*
|
|
84
|
+
* @todo: I saw in google's library that for codes they encrypt an id with expiration time.
|
|
85
|
+
* You know the code was created by you because you can decrypt it, and you don't have to store
|
|
86
|
+
* additional metadata on your server. It's similar to the signed / encrypted nonce
|
|
87
|
+
*/
|
|
88
|
+
requestUriExpiresAt?: Date;
|
|
89
|
+
/**
|
|
90
|
+
* The state value that was received in the pushed authorization request.
|
|
91
|
+
*/
|
|
92
|
+
state?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The redirect uri to redirect to after the authorization code has been granted.
|
|
95
|
+
*/
|
|
96
|
+
redirectUri?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The PKCE code verifier used in the authorization request to the external identity provider.
|
|
99
|
+
*/
|
|
100
|
+
pkceCodeVerifier?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The chained identity authorization request url, used to authorize to the external identity provider.
|
|
103
|
+
*/
|
|
104
|
+
externalAuthorizationRequestUrl?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The state value used in the authorization request to the external identity provider.
|
|
107
|
+
*/
|
|
108
|
+
externalState?: string;
|
|
109
|
+
/**
|
|
110
|
+
* The metadata of the external identity provider's authorization server.
|
|
111
|
+
*/
|
|
112
|
+
externalAuthorizationServerMetadata?: AuthorizationServerMetadata;
|
|
113
|
+
/**
|
|
114
|
+
* The access token response received from the external identity provider.
|
|
115
|
+
*
|
|
116
|
+
* If the scope 'openid' is requested, we automatically verify if the
|
|
117
|
+
* ID Token JWT is valid.
|
|
118
|
+
*/
|
|
119
|
+
externalAccessTokenResponse?: AccessTokenResponse;
|
|
120
|
+
}
|
|
121
|
+
type DefaultOpenId4VcIssuanceSessionRecordTags = {
|
|
122
|
+
issuerId: string;
|
|
123
|
+
cNonce?: string;
|
|
124
|
+
state: OpenId4VcIssuanceSessionState;
|
|
125
|
+
credentialOfferUri?: string;
|
|
126
|
+
credentialOfferId?: string;
|
|
127
|
+
preAuthorizedCode?: string;
|
|
128
|
+
authorizationCode?: string;
|
|
129
|
+
issuerState?: string;
|
|
130
|
+
authorizationSubject?: string;
|
|
131
|
+
presentationAuthSession?: string;
|
|
132
|
+
chainedIdentityRequestUriReferenceValue?: string;
|
|
133
|
+
chainedIdentityState?: string;
|
|
134
|
+
};
|
|
135
|
+
interface OpenId4VcIssuanceSessionRecordTransaction {
|
|
136
|
+
transactionId: string;
|
|
137
|
+
numberOfCredentials: number;
|
|
138
|
+
credentialConfigurationId: string;
|
|
139
|
+
}
|
|
140
|
+
interface OpenId4VcIssuanceSessionRecordProps {
|
|
141
|
+
createdAt: Date;
|
|
142
|
+
expiresAt: Date;
|
|
143
|
+
id?: string;
|
|
144
|
+
tags?: TagsBase;
|
|
145
|
+
state: OpenId4VcIssuanceSessionState;
|
|
146
|
+
issuerId: string;
|
|
147
|
+
/**
|
|
148
|
+
* Client id will mostly be used when doing auth flow
|
|
149
|
+
*/
|
|
150
|
+
clientId?: string;
|
|
151
|
+
walletAttestation?: OpenId4VcIssuanceSessionWalletAttestation;
|
|
152
|
+
dpop?: OpenId4VcIssuanceSessionDpop;
|
|
153
|
+
preAuthorizedCode?: string;
|
|
154
|
+
userPin?: string;
|
|
155
|
+
pkce?: {
|
|
156
|
+
codeChallengeMethod: PkceCodeChallengeMethod;
|
|
157
|
+
codeChallenge: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* When authorization code flow is used, this links the authorization
|
|
161
|
+
*/
|
|
162
|
+
authorization?: OpenId4VcIssuanceSessionAuthorization;
|
|
163
|
+
/**
|
|
164
|
+
* When presentation during issuance is required this should link the
|
|
165
|
+
* `OpenId4VcVerificationSessionRecord` and state
|
|
166
|
+
*/
|
|
167
|
+
presentation?: OpenId4VcIssuanceSessionPresentation;
|
|
168
|
+
transactions?: OpenId4VcIssuanceSessionRecordTransaction[];
|
|
169
|
+
/**
|
|
170
|
+
* Identity chaining enables doing another OAuth2 authentication flow as part
|
|
171
|
+
* of the OpenID4VCI authorization flow. This allows leveraging the advanced OAuth2
|
|
172
|
+
* functionality from Credo (e.g. Wallet Attestations, DPoP, PAR) while still allowing
|
|
173
|
+
* integration with existing IDPs.
|
|
174
|
+
*/
|
|
175
|
+
chainedIdentity?: OpenId4VcIssuanceSessionChainedIdentity;
|
|
176
|
+
credentialOfferUri?: string;
|
|
177
|
+
credentialOfferId: string;
|
|
178
|
+
credentialOfferPayload: OpenId4VciCredentialOfferPayload;
|
|
179
|
+
issuanceMetadata?: Record<string, unknown>;
|
|
180
|
+
errorMessage?: string;
|
|
181
|
+
generateRefreshTokens?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* The version of openid4ci used for the request
|
|
184
|
+
*/
|
|
185
|
+
openId4VciVersion: OpenId4VciVersion;
|
|
186
|
+
}
|
|
187
|
+
declare class OpenId4VcIssuanceSessionRecord extends BaseRecord<DefaultOpenId4VcIssuanceSessionRecordTags> {
|
|
188
|
+
static readonly type = "OpenId4VcIssuanceSessionRecord";
|
|
189
|
+
readonly type = "OpenId4VcIssuanceSessionRecord";
|
|
190
|
+
/**
|
|
191
|
+
* Expiry time for the issuance session. This can change dynamically during
|
|
192
|
+
* the session lifetime, based on the possible deferrals.
|
|
193
|
+
*
|
|
194
|
+
* @since 0.6
|
|
195
|
+
*/
|
|
196
|
+
expiresAt?: Date;
|
|
197
|
+
/**
|
|
198
|
+
* The id of the issuer that this session is for.
|
|
199
|
+
*/
|
|
200
|
+
issuerId: string;
|
|
201
|
+
/**
|
|
202
|
+
* The state of the issuance session.
|
|
203
|
+
*/
|
|
204
|
+
state: OpenId4VcIssuanceSessionState;
|
|
205
|
+
/**
|
|
206
|
+
* The credentials that were issued during this session.
|
|
207
|
+
*/
|
|
208
|
+
issuedCredentials: string[];
|
|
209
|
+
/**
|
|
210
|
+
* The credential transactions for deferred credentials.
|
|
211
|
+
*/
|
|
212
|
+
transactions: OpenId4VcIssuanceSessionRecordTransaction[];
|
|
213
|
+
/**
|
|
214
|
+
* Pre authorized code used for the issuance session. Only used when a pre-authorized credential
|
|
215
|
+
* offer is created.
|
|
216
|
+
*/
|
|
217
|
+
preAuthorizedCode?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Optional user pin that needs to be provided by the user in the access token request.
|
|
220
|
+
*/
|
|
221
|
+
userPin?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Client id of the exchange
|
|
224
|
+
*/
|
|
225
|
+
clientId?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Proof Key Code Exchange
|
|
228
|
+
*/
|
|
229
|
+
pkce?: OpenId4VcIssuanceSessionPkce;
|
|
230
|
+
walletAttestation?: OpenId4VcIssuanceSessionWalletAttestation;
|
|
231
|
+
dpop?: OpenId4VcIssuanceSessionDpop;
|
|
232
|
+
/**
|
|
233
|
+
* Authorization code flow specific metadata values
|
|
234
|
+
*/
|
|
235
|
+
authorization?: OpenId4VcIssuanceSessionAuthorization;
|
|
236
|
+
/**
|
|
237
|
+
* Presentation during issuance specific metadata values
|
|
238
|
+
*/
|
|
239
|
+
presentation?: OpenId4VcIssuanceSessionPresentation;
|
|
240
|
+
/**
|
|
241
|
+
* Chained identity specific metadata values
|
|
242
|
+
*/
|
|
243
|
+
chainedIdentity?: OpenId4VcIssuanceSessionChainedIdentity;
|
|
244
|
+
/**
|
|
245
|
+
* User-defined metadata that will be provided to the credential request to credential mapper
|
|
246
|
+
* to allow to retrieve the needed credential input data. Can be the credential data itself,
|
|
247
|
+
* or some other data that is needed to retrieve the credential data.
|
|
248
|
+
*/
|
|
249
|
+
issuanceMetadata?: Record<string, unknown>;
|
|
250
|
+
/**
|
|
251
|
+
* The credential offer that was used to create the issuance session.
|
|
252
|
+
*/
|
|
253
|
+
credentialOfferPayload: OpenId4VciCredentialOfferPayload;
|
|
254
|
+
/**
|
|
255
|
+
* URI of the credential offer. This is the url that cn can be used to retrieve
|
|
256
|
+
* the credential offer
|
|
257
|
+
*/
|
|
258
|
+
credentialOfferUri?: string;
|
|
259
|
+
/**
|
|
260
|
+
* The public id for the credential offer. This is used in the credential
|
|
261
|
+
* offer uri.
|
|
262
|
+
*
|
|
263
|
+
* @since 0.6
|
|
264
|
+
*/
|
|
265
|
+
credentialOfferId?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Whether to generate refresh tokens for the issuance session.
|
|
268
|
+
*
|
|
269
|
+
* @since 0.6
|
|
270
|
+
*/
|
|
271
|
+
generateRefreshTokens?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* The version of openid4ci used for the request
|
|
274
|
+
*
|
|
275
|
+
* @since 0.6
|
|
276
|
+
*/
|
|
277
|
+
openId4VciVersion?: OpenId4VciVersion;
|
|
278
|
+
/**
|
|
279
|
+
* Optional error message of the error that occurred during the issuance session. Will be set when state is {@link OpenId4VcIssuanceSessionState.Error}
|
|
280
|
+
*/
|
|
281
|
+
errorMessage?: string;
|
|
282
|
+
constructor(props: OpenId4VcIssuanceSessionRecordProps);
|
|
283
|
+
assertState(expectedStates: OpenId4VcIssuanceSessionState | OpenId4VcIssuanceSessionState[]): void;
|
|
284
|
+
getTags(): {
|
|
285
|
+
issuerId: string;
|
|
286
|
+
credentialOfferUri: string | undefined;
|
|
287
|
+
credentialOfferId: string | undefined;
|
|
288
|
+
state: OpenId4VcIssuanceSessionState;
|
|
289
|
+
preAuthorizedCode: string | undefined;
|
|
290
|
+
issuerState: string | undefined;
|
|
291
|
+
authorizationCode: string | undefined;
|
|
292
|
+
authorizationSubject: string | undefined;
|
|
293
|
+
presentationAuthSession: string | undefined;
|
|
294
|
+
chainedIdentityRequestUriReferenceValue: string | undefined;
|
|
295
|
+
chainedIdentityState: string | undefined;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
//#endregion
|
|
299
|
+
export { DefaultOpenId4VcIssuanceSessionRecordTags, OpenId4VcIssuanceSessionAuthorization, OpenId4VcIssuanceSessionChainedIdentity, OpenId4VcIssuanceSessionDpop, OpenId4VcIssuanceSessionPkce, OpenId4VcIssuanceSessionPresentation, OpenId4VcIssuanceSessionRecord, OpenId4VcIssuanceSessionRecordProps, OpenId4VcIssuanceSessionRecordTransaction, OpenId4VcIssuanceSessionWalletAttestation };
|
|
300
|
+
//# sourceMappingURL=OpenId4VcIssuanceSessionRecord.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuanceSessionRecord.d.mts","names":[],"sources":["../../../src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAUiB,4BAAA;EAAA;AAcjB;AAQA;AA6BA;EAiBiB,QAAA,EAAA,OAAA;EAKA;;;;EA0DkC,OAAA,CAAA,EAAA,MAAA;AAGnD;AAwBiB,UAhJA,yCAAA,CAgJyC;EAUzC;;;;EAOR,QAAA,EAAA,OAAA;;AASA,UAlKQ,qCAAA,CAkKR;EAQgB,IAAA,CAAA,EAAA,MAAA;EAOP;;;;;EAwBG,aAAA,CAAA,EAjMH,IAiMG;EAQA;;AAGrB;;EAWqB,WAAA,CAAA,EAAA,MAAA;EAkBJ;;;EAiCK,MAAA,CAAA,EAAA,MAAA,EAAA;EACb;;;;;EAmFyB,OAAA,CAAA,EAAA,MAAA;;AAmCN,UA5WX,oCAAA,CA4WW;EA+BS;;;EApNe,QAAA,EAAA,IAAA;EAAU;;;;;;;;;UAtK7C,4BAAA;uBACM;;;UAIN,uCAAA;;;;;;;;;;;;;;;;;;wBAoBO;;;;;;;;;;;;;;;;;;;;;;;;wCA8BgB;;;;;;;gCAQR;;KAGpB,yCAAA;;;SAGH;;;;;;;;;;;UAqBQ,yCAAA;;;;;UAUA,mCAAA;aACJ;aACA;;SAGJ;SAEA;;;;;;sBAQa;SACb;;;;yBAQgB;;;;;;kBAOP;;;;;iBAMD;iBAGA;;;;;;;oBAQG;;;0BAKM;qBAEL;;;;;;qBAQA;;cAGR,8BAAA,SAAuC,WAAW;;;;;;;;;cAW1C;;;;;;;;SAkBJ;;;;;;;;gBAUM;;;;;;;;;;;;;;;;;SAqBP;sBAEM;SACb;;;;kBA2BgB;;;;iBAKD;;;;oBAuCG;;;;;;qBAOC;;;;0BAKM;;;;;;;;;;;;;;;;;;;;;;;;sBA4BL;;;;;qBAOD;8BA+BS,gCAAgC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
3
|
+
import { OpenId4VcIssuanceSessionState } from "../OpenId4VcIssuanceSessionState.mjs";
|
|
4
|
+
import { BaseRecord, CredoError, DateTransformer, isJsonObject, utils } from "@credo-ts/core";
|
|
5
|
+
import { PkceCodeChallengeMethod } from "@openid4vc/oauth2";
|
|
6
|
+
import { Transform, TransformationType } from "class-transformer";
|
|
7
|
+
|
|
8
|
+
//#region src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.ts
|
|
9
|
+
var _ref, _ref2;
|
|
10
|
+
var OpenId4VcIssuanceSessionRecord = class OpenId4VcIssuanceSessionRecord extends BaseRecord {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super();
|
|
13
|
+
this.type = OpenId4VcIssuanceSessionRecord.type;
|
|
14
|
+
this.issuedCredentials = [];
|
|
15
|
+
this.transactions = [];
|
|
16
|
+
if (props) {
|
|
17
|
+
this.id = props.id ?? utils.uuid();
|
|
18
|
+
this.createdAt = props.createdAt;
|
|
19
|
+
this.expiresAt = props.expiresAt;
|
|
20
|
+
this._tags = props.tags ?? {};
|
|
21
|
+
this.issuerId = props.issuerId;
|
|
22
|
+
this.clientId = props.clientId;
|
|
23
|
+
this.userPin = props.userPin;
|
|
24
|
+
this.preAuthorizedCode = props.preAuthorizedCode;
|
|
25
|
+
this.pkce = props.pkce;
|
|
26
|
+
this.authorization = props.authorization;
|
|
27
|
+
this.presentation = props.presentation;
|
|
28
|
+
this.chainedIdentity = props.chainedIdentity;
|
|
29
|
+
this.credentialOfferUri = props.credentialOfferUri;
|
|
30
|
+
this.credentialOfferId = props.credentialOfferId;
|
|
31
|
+
this.credentialOfferPayload = props.credentialOfferPayload;
|
|
32
|
+
this.issuanceMetadata = props.issuanceMetadata;
|
|
33
|
+
this.dpop = props.dpop;
|
|
34
|
+
this.walletAttestation = props.walletAttestation;
|
|
35
|
+
this.state = props.state;
|
|
36
|
+
this.generateRefreshTokens = props.generateRefreshTokens;
|
|
37
|
+
this.errorMessage = props.errorMessage;
|
|
38
|
+
this.transactions = props.transactions ?? [];
|
|
39
|
+
this.openId4VciVersion = props.openId4VciVersion;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
assertState(expectedStates) {
|
|
43
|
+
if (!Array.isArray(expectedStates)) expectedStates = [expectedStates];
|
|
44
|
+
if (!expectedStates.includes(this.state)) throw new CredoError(`OpenId4VcIssuanceSessionRecord is in invalid state ${this.state}. Valid states are: ${expectedStates.join(", ")}.`);
|
|
45
|
+
}
|
|
46
|
+
getTags() {
|
|
47
|
+
return {
|
|
48
|
+
...this._tags,
|
|
49
|
+
issuerId: this.issuerId,
|
|
50
|
+
credentialOfferUri: this.credentialOfferUri,
|
|
51
|
+
credentialOfferId: this.credentialOfferId,
|
|
52
|
+
state: this.state,
|
|
53
|
+
preAuthorizedCode: this.preAuthorizedCode,
|
|
54
|
+
issuerState: this.authorization?.issuerState,
|
|
55
|
+
authorizationCode: this.authorization?.code,
|
|
56
|
+
authorizationSubject: this.authorization?.subject,
|
|
57
|
+
presentationAuthSession: this.presentation?.authSession,
|
|
58
|
+
chainedIdentityRequestUriReferenceValue: this.chainedIdentity?.requestUriReferenceValue,
|
|
59
|
+
chainedIdentityState: this.chainedIdentity?.externalState
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
OpenId4VcIssuanceSessionRecord.type = "OpenId4VcIssuanceSessionRecord";
|
|
64
|
+
__decorate([DateTransformer(), __decorateMetadata("design:type", typeof (_ref = typeof Date !== "undefined" && Date) === "function" ? _ref : Object)], OpenId4VcIssuanceSessionRecord.prototype, "expiresAt", void 0);
|
|
65
|
+
__decorate([Transform(({ value }) => {
|
|
66
|
+
if (value === "CredentialIssued") return OpenId4VcIssuanceSessionState.Error;
|
|
67
|
+
return value;
|
|
68
|
+
}), __decorateMetadata("design:type", typeof (_ref2 = typeof OpenId4VcIssuanceSessionState !== "undefined" && OpenId4VcIssuanceSessionState) === "function" ? _ref2 : Object)], OpenId4VcIssuanceSessionRecord.prototype, "state", void 0);
|
|
69
|
+
__decorate([Transform(({ type, value }) => {
|
|
70
|
+
if (type === TransformationType.PLAIN_TO_CLASS && isJsonObject(value) && typeof value.codeExpiresAt === "string") return {
|
|
71
|
+
...value,
|
|
72
|
+
codeExpiresAt: new Date(value.codeExpiresAt)
|
|
73
|
+
};
|
|
74
|
+
if (type === TransformationType.CLASS_TO_CLASS && isJsonObject(value) && value.codeExpiresAt instanceof Date) return {
|
|
75
|
+
...value,
|
|
76
|
+
codeExpiresAt: new Date(value.codeExpiresAt.getTime())
|
|
77
|
+
};
|
|
78
|
+
if (type === TransformationType.CLASS_TO_PLAIN && isJsonObject(value) && value.codeExpiresAt instanceof Date) return {
|
|
79
|
+
...value,
|
|
80
|
+
codeExpiresAt: value.codeExpiresAt.toISOString()
|
|
81
|
+
};
|
|
82
|
+
return value;
|
|
83
|
+
}), __decorateMetadata("design:type", Object)], OpenId4VcIssuanceSessionRecord.prototype, "authorization", void 0);
|
|
84
|
+
__decorate([Transform(({ type, value }) => {
|
|
85
|
+
if (type === TransformationType.PLAIN_TO_CLASS && isJsonObject(value) && typeof value.requestUriExpiresAt === "string") return {
|
|
86
|
+
...value,
|
|
87
|
+
requestUriExpiresAt: new Date(value.requestUriExpiresAt)
|
|
88
|
+
};
|
|
89
|
+
if (type === TransformationType.CLASS_TO_CLASS && isJsonObject(value) && value.requestUriExpiresAt instanceof Date) return {
|
|
90
|
+
...value,
|
|
91
|
+
requestUriExpiresAt: new Date(value.requestUriExpiresAt.getTime())
|
|
92
|
+
};
|
|
93
|
+
if (type === TransformationType.CLASS_TO_PLAIN && isJsonObject(value) && value.requestUriExpiresAt instanceof Date) return {
|
|
94
|
+
...value,
|
|
95
|
+
requestUriExpiresAt: value.requestUriExpiresAt.toISOString()
|
|
96
|
+
};
|
|
97
|
+
return value;
|
|
98
|
+
}), __decorateMetadata("design:type", Object)], OpenId4VcIssuanceSessionRecord.prototype, "chainedIdentity", void 0);
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { OpenId4VcIssuanceSessionRecord };
|
|
102
|
+
//# sourceMappingURL=OpenId4VcIssuanceSessionRecord.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuanceSessionRecord.mjs","names":[],"sources":["../../../src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.ts"],"sourcesContent":["import type { RecordTags, TagsBase } from '@credo-ts/core'\nimport { BaseRecord, CredoError, DateTransformer, isJsonObject, utils } from '@credo-ts/core'\nimport { type AccessTokenResponse, type AuthorizationServerMetadata, PkceCodeChallengeMethod } from '@openid4vc/oauth2'\nimport { Transform, TransformationType } from 'class-transformer'\nimport type { OpenId4VciCredentialOfferPayload } from '../../shared'\nimport { OpenId4VcIssuanceSessionState } from '../OpenId4VcIssuanceSessionState'\nimport type { OpenId4VciVersion } from '../OpenId4VcIssuerServiceOptions'\n\nexport type OpenId4VcIssuanceSessionRecordTags = RecordTags<OpenId4VcIssuanceSessionRecord>\n\nexport interface OpenId4VcIssuanceSessionDpop {\n /**\n * Whether dpop is required. Can be set to false to override the\n * global config\n */\n required: boolean\n\n /**\n * JWK thumbprint of the dpop key. This is mostly used when a dpop key is bound\n * to the issuance session before the access token is created (which contains the dpop key)\n */\n dpopJkt?: string\n}\n\nexport interface OpenId4VcIssuanceSessionWalletAttestation {\n /**\n * Whether presentation of a wallet attestation is required.\n * Can be set to false to override the global config\n */\n required: boolean\n}\n\nexport interface OpenId4VcIssuanceSessionAuthorization {\n code?: string\n\n /**\n * @todo: I saw in google's library that for codes they encrypt an id with expiration time.\n * You know the code was created by you because you can decrypt it, and you don't have to store\n * additional metadata on your server. It's similar to the signed / encrypted nonce\n */\n codeExpiresAt?: Date\n\n /**\n * String value created by the Credential Issuer and opaque to the Wallet that\n * is used to bind the subsequent Authorization Request with the Credential Issuer to a context set up during previous steps.\n */\n issuerState?: string\n\n /**\n * Scopes that are granted when the authorization is complete.\n */\n scopes?: string[]\n\n /**\n * Subject the issuance session is bound to. For internal authorization this will be defined\n * from the moment the token is issued. For external authorization this will be defined after\n * the first time the credential endpoint has been called.\n */\n subject?: string\n}\n\nexport interface OpenId4VcIssuanceSessionPresentation {\n /**\n * Whether presentation during issuance is required. Mutually exclusive with `chainedIdentity`.\n */\n required: true\n\n /**\n * Auth session for the presentation during issuance flow\n */\n authSession?: string\n\n /**\n * The id of the `OpenId4VcVerificationSessionRecord` record this issuance session is linked to\n */\n openId4VcVerificationSessionId?: string\n}\n\nexport interface OpenId4VcIssuanceSessionPkce {\n codeChallengeMethod: PkceCodeChallengeMethod\n codeChallenge: string\n}\n\nexport interface OpenId4VcIssuanceSessionChainedIdentity {\n /**\n * The identifier of the external identity provider's authorization server.\n * Mutually exclusive with `presentation`.\n */\n externalAuthorizationServerUrl: string\n\n /**\n * The <reference-value> from the `request_uri` parameter returned to the client\n * in the form of `urn:ietf:params:oauth:request_uri:<reference-value>`.\n */\n requestUriReferenceValue?: string\n\n /**\n * The expiry time of the request URI.\n *\n * @todo: I saw in google's library that for codes they encrypt an id with expiration time.\n * You know the code was created by you because you can decrypt it, and you don't have to store\n * additional metadata on your server. It's similar to the signed / encrypted nonce\n */\n requestUriExpiresAt?: Date\n\n /**\n * The state value that was received in the pushed authorization request.\n */\n state?: string\n\n /**\n * The redirect uri to redirect to after the authorization code has been granted.\n */\n redirectUri?: string\n\n /**\n * The PKCE code verifier used in the authorization request to the external identity provider.\n */\n pkceCodeVerifier?: string\n\n /**\n * The chained identity authorization request url, used to authorize to the external identity provider.\n */\n externalAuthorizationRequestUrl?: string\n\n /**\n * The state value used in the authorization request to the external identity provider.\n */\n externalState?: string\n\n /**\n * The metadata of the external identity provider's authorization server.\n */\n externalAuthorizationServerMetadata?: AuthorizationServerMetadata\n\n /**\n * The access token response received from the external identity provider.\n *\n * If the scope 'openid' is requested, we automatically verify if the\n * ID Token JWT is valid.\n */\n externalAccessTokenResponse?: AccessTokenResponse\n}\n\nexport type DefaultOpenId4VcIssuanceSessionRecordTags = {\n issuerId: string\n cNonce?: string\n state: OpenId4VcIssuanceSessionState\n credentialOfferUri?: string\n credentialOfferId?: string\n\n // pre-auth flow\n preAuthorizedCode?: string\n\n // auth flow\n authorizationCode?: string\n issuerState?: string\n\n authorizationSubject?: string\n\n // presentation during issuance\n presentationAuthSession?: string\n\n // identity chaining\n chainedIdentityRequestUriReferenceValue?: string\n chainedIdentityState?: string\n}\n\nexport interface OpenId4VcIssuanceSessionRecordTransaction {\n transactionId: string\n\n // The expected number of credentials that will be issued in this transaction\n numberOfCredentials: number\n\n // The credential configuration that is used for this transaction.\n credentialConfigurationId: string\n}\n\nexport interface OpenId4VcIssuanceSessionRecordProps {\n createdAt: Date\n expiresAt: Date\n\n id?: string\n tags?: TagsBase\n\n state: OpenId4VcIssuanceSessionState\n issuerId: string\n\n /**\n * Client id will mostly be used when doing auth flow\n */\n clientId?: string\n\n walletAttestation?: OpenId4VcIssuanceSessionWalletAttestation\n dpop?: OpenId4VcIssuanceSessionDpop\n\n // Pre auth flow\n preAuthorizedCode?: string\n userPin?: string\n\n // Auth flow (move to authorization?)\n pkce?: {\n codeChallengeMethod: PkceCodeChallengeMethod\n codeChallenge: string\n }\n\n /**\n * When authorization code flow is used, this links the authorization\n */\n authorization?: OpenId4VcIssuanceSessionAuthorization\n\n /**\n * When presentation during issuance is required this should link the\n * `OpenId4VcVerificationSessionRecord` and state\n */\n presentation?: OpenId4VcIssuanceSessionPresentation\n\n // Transaction data for deferred credential issuances\n transactions?: OpenId4VcIssuanceSessionRecordTransaction[]\n\n /**\n * Identity chaining enables doing another OAuth2 authentication flow as part\n * of the OpenID4VCI authorization flow. This allows leveraging the advanced OAuth2\n * functionality from Credo (e.g. Wallet Attestations, DPoP, PAR) while still allowing\n * integration with existing IDPs.\n */\n chainedIdentity?: OpenId4VcIssuanceSessionChainedIdentity\n\n credentialOfferUri?: string\n credentialOfferId: string\n\n credentialOfferPayload: OpenId4VciCredentialOfferPayload\n\n issuanceMetadata?: Record<string, unknown>\n errorMessage?: string\n\n generateRefreshTokens?: boolean\n\n /**\n * The version of openid4ci used for the request\n */\n openId4VciVersion: OpenId4VciVersion\n}\n\nexport class OpenId4VcIssuanceSessionRecord extends BaseRecord<DefaultOpenId4VcIssuanceSessionRecordTags> {\n public static readonly type = 'OpenId4VcIssuanceSessionRecord'\n public readonly type = OpenId4VcIssuanceSessionRecord.type\n\n /**\n * Expiry time for the issuance session. This can change dynamically during\n * the session lifetime, based on the possible deferrals.\n *\n * @since 0.6\n */\n @DateTransformer()\n public expiresAt?: Date\n\n /**\n * The id of the issuer that this session is for.\n */\n public issuerId!: string\n\n /**\n * The state of the issuance session.\n */\n @Transform(({ value }) => {\n // CredentialIssued is an old state that is no longer used. It should be mapped to Error.\n if (value === 'CredentialIssued') {\n return OpenId4VcIssuanceSessionState.Error\n }\n\n return value\n })\n public state!: OpenId4VcIssuanceSessionState\n\n /**\n * The credentials that were issued during this session.\n */\n public issuedCredentials: string[] = []\n\n /**\n * The credential transactions for deferred credentials.\n */\n public transactions: OpenId4VcIssuanceSessionRecordTransaction[] = []\n\n /**\n * Pre authorized code used for the issuance session. Only used when a pre-authorized credential\n * offer is created.\n */\n public preAuthorizedCode?: string\n\n /**\n * Optional user pin that needs to be provided by the user in the access token request.\n */\n public userPin?: string\n\n /**\n * Client id of the exchange\n */\n public clientId?: string\n\n /**\n * Proof Key Code Exchange\n */\n public pkce?: OpenId4VcIssuanceSessionPkce\n\n walletAttestation?: OpenId4VcIssuanceSessionWalletAttestation\n dpop?: OpenId4VcIssuanceSessionDpop\n\n /**\n * Authorization code flow specific metadata values\n */\n @Transform(({ type, value }) => {\n if (type === TransformationType.PLAIN_TO_CLASS && isJsonObject(value) && typeof value.codeExpiresAt === 'string') {\n return {\n ...value,\n codeExpiresAt: new Date(value.codeExpiresAt),\n }\n }\n if (type === TransformationType.CLASS_TO_CLASS && isJsonObject(value) && value.codeExpiresAt instanceof Date) {\n return {\n ...value,\n codeExpiresAt: new Date(value.codeExpiresAt.getTime()),\n }\n }\n if (type === TransformationType.CLASS_TO_PLAIN && isJsonObject(value) && value.codeExpiresAt instanceof Date) {\n return {\n ...value,\n codeExpiresAt: value.codeExpiresAt.toISOString(),\n }\n }\n\n return value\n })\n public authorization?: OpenId4VcIssuanceSessionAuthorization\n\n /**\n * Presentation during issuance specific metadata values\n */\n public presentation?: OpenId4VcIssuanceSessionPresentation\n\n /**\n * Chained identity specific metadata values\n */\n @Transform(({ type, value }) => {\n if (\n type === TransformationType.PLAIN_TO_CLASS &&\n isJsonObject(value) &&\n typeof value.requestUriExpiresAt === 'string'\n ) {\n return {\n ...value,\n requestUriExpiresAt: new Date(value.requestUriExpiresAt),\n }\n }\n if (\n type === TransformationType.CLASS_TO_CLASS &&\n isJsonObject(value) &&\n value.requestUriExpiresAt instanceof Date\n ) {\n return {\n ...value,\n requestUriExpiresAt: new Date(value.requestUriExpiresAt.getTime()),\n }\n }\n if (\n type === TransformationType.CLASS_TO_PLAIN &&\n isJsonObject(value) &&\n value.requestUriExpiresAt instanceof Date\n ) {\n return {\n ...value,\n requestUriExpiresAt: value.requestUriExpiresAt.toISOString(),\n }\n }\n\n return value\n })\n public chainedIdentity?: OpenId4VcIssuanceSessionChainedIdentity\n\n /**\n * User-defined metadata that will be provided to the credential request to credential mapper\n * to allow to retrieve the needed credential input data. Can be the credential data itself,\n * or some other data that is needed to retrieve the credential data.\n */\n public issuanceMetadata?: Record<string, unknown>\n\n /**\n * The credential offer that was used to create the issuance session.\n */\n public credentialOfferPayload!: OpenId4VciCredentialOfferPayload\n\n /**\n * URI of the credential offer. This is the url that cn can be used to retrieve\n * the credential offer\n */\n public credentialOfferUri?: string\n\n /**\n * The public id for the credential offer. This is used in the credential\n * offer uri.\n *\n * @since 0.6\n */\n public credentialOfferId?: string\n\n /**\n * Whether to generate refresh tokens for the issuance session.\n *\n * @since 0.6\n */\n public generateRefreshTokens?: boolean\n\n /**\n * The version of openid4ci used for the request\n *\n * @since 0.6\n */\n public openId4VciVersion?: OpenId4VciVersion\n\n /**\n * Optional error message of the error that occurred during the issuance session. Will be set when state is {@link OpenId4VcIssuanceSessionState.Error}\n */\n public errorMessage?: string\n\n public constructor(props: OpenId4VcIssuanceSessionRecordProps) {\n super()\n\n if (props) {\n this.id = props.id ?? utils.uuid()\n this.createdAt = props.createdAt\n this.expiresAt = props.expiresAt\n this._tags = props.tags ?? {}\n\n this.issuerId = props.issuerId\n this.clientId = props.clientId\n this.userPin = props.userPin\n this.preAuthorizedCode = props.preAuthorizedCode\n this.pkce = props.pkce\n this.authorization = props.authorization\n this.presentation = props.presentation\n this.chainedIdentity = props.chainedIdentity\n this.credentialOfferUri = props.credentialOfferUri\n this.credentialOfferId = props.credentialOfferId\n this.credentialOfferPayload = props.credentialOfferPayload\n this.issuanceMetadata = props.issuanceMetadata\n this.dpop = props.dpop\n this.walletAttestation = props.walletAttestation\n this.state = props.state\n this.generateRefreshTokens = props.generateRefreshTokens\n this.errorMessage = props.errorMessage\n this.transactions = props.transactions ?? []\n this.openId4VciVersion = props.openId4VciVersion\n }\n }\n\n public assertState(expectedStates: OpenId4VcIssuanceSessionState | OpenId4VcIssuanceSessionState[]) {\n if (!Array.isArray(expectedStates)) {\n expectedStates = [expectedStates]\n }\n\n if (!expectedStates.includes(this.state)) {\n throw new CredoError(\n `OpenId4VcIssuanceSessionRecord is in invalid state ${this.state}. Valid states are: ${expectedStates.join(\n ', '\n )}.`\n )\n }\n }\n\n public getTags() {\n return {\n ...this._tags,\n issuerId: this.issuerId,\n credentialOfferUri: this.credentialOfferUri,\n credentialOfferId: this.credentialOfferId,\n state: this.state,\n\n // Pre-auth flow\n preAuthorizedCode: this.preAuthorizedCode,\n\n // Auth flow\n issuerState: this.authorization?.issuerState,\n authorizationCode: this.authorization?.code,\n\n authorizationSubject: this.authorization?.subject,\n\n // Presentation during issuance\n presentationAuthSession: this.presentation?.authSession,\n\n // Chained identity\n chainedIdentityRequestUriReferenceValue: this.chainedIdentity?.requestUriReferenceValue,\n chainedIdentityState: this.chainedIdentity?.externalState,\n }\n }\n}\n"],"mappings":";;;;;;;;;AAoPA,IAAa,iCAAb,MAAa,uCAAuC,WAAsD;CAqLxG,AAAO,YAAY,OAA4C;AAC7D,SAAO;OApLO,OAAO,+BAA+B;OAgC/C,oBAA8B,EAAE;OAKhC,eAA4D,EAAE;AAiJnE,MAAI,OAAO;AACT,QAAK,KAAK,MAAM,MAAM,MAAM,MAAM;AAClC,QAAK,YAAY,MAAM;AACvB,QAAK,YAAY,MAAM;AACvB,QAAK,QAAQ,MAAM,QAAQ,EAAE;AAE7B,QAAK,WAAW,MAAM;AACtB,QAAK,WAAW,MAAM;AACtB,QAAK,UAAU,MAAM;AACrB,QAAK,oBAAoB,MAAM;AAC/B,QAAK,OAAO,MAAM;AAClB,QAAK,gBAAgB,MAAM;AAC3B,QAAK,eAAe,MAAM;AAC1B,QAAK,kBAAkB,MAAM;AAC7B,QAAK,qBAAqB,MAAM;AAChC,QAAK,oBAAoB,MAAM;AAC/B,QAAK,yBAAyB,MAAM;AACpC,QAAK,mBAAmB,MAAM;AAC9B,QAAK,OAAO,MAAM;AAClB,QAAK,oBAAoB,MAAM;AAC/B,QAAK,QAAQ,MAAM;AACnB,QAAK,wBAAwB,MAAM;AACnC,QAAK,eAAe,MAAM;AAC1B,QAAK,eAAe,MAAM,gBAAgB,EAAE;AAC5C,QAAK,oBAAoB,MAAM;;;CAInC,AAAO,YAAY,gBAAiF;AAClG,MAAI,CAAC,MAAM,QAAQ,eAAe,CAChC,kBAAiB,CAAC,eAAe;AAGnC,MAAI,CAAC,eAAe,SAAS,KAAK,MAAM,CACtC,OAAM,IAAI,WACR,sDAAsD,KAAK,MAAM,sBAAsB,eAAe,KACpG,KACD,CAAC,GACH;;CAIL,AAAO,UAAU;AACf,SAAO;GACL,GAAG,KAAK;GACR,UAAU,KAAK;GACf,oBAAoB,KAAK;GACzB,mBAAmB,KAAK;GACxB,OAAO,KAAK;GAGZ,mBAAmB,KAAK;GAGxB,aAAa,KAAK,eAAe;GACjC,mBAAmB,KAAK,eAAe;GAEvC,sBAAsB,KAAK,eAAe;GAG1C,yBAAyB,KAAK,cAAc;GAG5C,yCAAyC,KAAK,iBAAiB;GAC/D,sBAAsB,KAAK,iBAAiB;GAC7C;;;+BAxPoB,OAAO;YAS7B,iBAAiB;YAWjB,WAAW,EAAE,YAAY;AAExB,KAAI,UAAU,mBACZ,QAAO,8BAA8B;AAGvC,QAAO;EACP;YAwCD,WAAW,EAAE,MAAM,YAAY;AAC9B,KAAI,SAAS,mBAAmB,kBAAkB,aAAa,MAAM,IAAI,OAAO,MAAM,kBAAkB,SACtG,QAAO;EACL,GAAG;EACH,eAAe,IAAI,KAAK,MAAM,cAAc;EAC7C;AAEH,KAAI,SAAS,mBAAmB,kBAAkB,aAAa,MAAM,IAAI,MAAM,yBAAyB,KACtG,QAAO;EACL,GAAG;EACH,eAAe,IAAI,KAAK,MAAM,cAAc,SAAS,CAAC;EACvD;AAEH,KAAI,SAAS,mBAAmB,kBAAkB,aAAa,MAAM,IAAI,MAAM,yBAAyB,KACtG,QAAO;EACL,GAAG;EACH,eAAe,MAAM,cAAc,aAAa;EACjD;AAGH,QAAO;EACP;YAWD,WAAW,EAAE,MAAM,YAAY;AAC9B,KACE,SAAS,mBAAmB,kBAC5B,aAAa,MAAM,IACnB,OAAO,MAAM,wBAAwB,SAErC,QAAO;EACL,GAAG;EACH,qBAAqB,IAAI,KAAK,MAAM,oBAAoB;EACzD;AAEH,KACE,SAAS,mBAAmB,kBAC5B,aAAa,MAAM,IACnB,MAAM,+BAA+B,KAErC,QAAO;EACL,GAAG;EACH,qBAAqB,IAAI,KAAK,MAAM,oBAAoB,SAAS,CAAC;EACnE;AAEH,KACE,SAAS,mBAAmB,kBAC5B,aAAa,MAAM,IACnB,MAAM,+BAA+B,KAErC,QAAO;EACL,GAAG;EACH,qBAAqB,MAAM,oBAAoB,aAAa;EAC7D;AAGH,QAAO;EACP"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenId4VcIssuanceSessionRecord } from "./OpenId4VcIssuanceSessionRecord.mjs";
|
|
2
|
+
import { EventEmitter, Repository, StorageService } from "@credo-ts/core";
|
|
3
|
+
|
|
4
|
+
//#region src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts
|
|
5
|
+
declare class OpenId4VcIssuanceSessionRepository extends Repository<OpenId4VcIssuanceSessionRecord> {
|
|
6
|
+
constructor(storageService: StorageService<OpenId4VcIssuanceSessionRecord>, eventEmitter: EventEmitter);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { OpenId4VcIssuanceSessionRepository };
|
|
10
|
+
//# sourceMappingURL=OpenId4VcIssuanceSessionRepository.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuanceSessionRepository.d.mts","names":[],"sources":["../../../src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.ts"],"sourcesContent":[],"mappings":";;;;cAKa,kCAAA,SAA2C,WAAW;8BAEN,eAAe,+CAC1D;AAJlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
4
|
+
import { OpenId4VcIssuanceSessionRecord } from "./OpenId4VcIssuanceSessionRecord.mjs";
|
|
5
|
+
import { EventEmitter, InjectionSymbols, Repository, inject, injectable } from "@credo-ts/core";
|
|
6
|
+
|
|
7
|
+
//#region src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.ts
|
|
8
|
+
var _ref;
|
|
9
|
+
let OpenId4VcIssuanceSessionRepository = class OpenId4VcIssuanceSessionRepository$1 extends Repository {
|
|
10
|
+
constructor(storageService, eventEmitter) {
|
|
11
|
+
super(OpenId4VcIssuanceSessionRecord, storageService, eventEmitter);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
OpenId4VcIssuanceSessionRepository = __decorate([
|
|
15
|
+
injectable(),
|
|
16
|
+
__decorateParam(0, inject(InjectionSymbols.StorageService)),
|
|
17
|
+
__decorateMetadata("design:paramtypes", [Object, typeof (_ref = typeof EventEmitter !== "undefined" && EventEmitter) === "function" ? _ref : Object])
|
|
18
|
+
], OpenId4VcIssuanceSessionRepository);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { OpenId4VcIssuanceSessionRepository };
|
|
22
|
+
//# sourceMappingURL=OpenId4VcIssuanceSessionRepository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuanceSessionRepository.mjs","names":["OpenId4VcIssuanceSessionRepository","storageService: StorageService<OpenId4VcIssuanceSessionRecord>"],"sources":["../../../src/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.ts"],"sourcesContent":["import { EventEmitter, InjectionSymbols, inject, injectable, Repository, type StorageService } from '@credo-ts/core'\n\nimport { OpenId4VcIssuanceSessionRecord } from './OpenId4VcIssuanceSessionRecord'\n\n@injectable()\nexport class OpenId4VcIssuanceSessionRepository extends Repository<OpenId4VcIssuanceSessionRecord> {\n public constructor(\n @inject(InjectionSymbols.StorageService) storageService: StorageService<OpenId4VcIssuanceSessionRecord>,\n eventEmitter: EventEmitter\n ) {\n super(OpenId4VcIssuanceSessionRecord, storageService, eventEmitter)\n }\n}\n"],"mappings":";;;;;;;;AAKO,+CAAMA,6CAA2C,WAA2C;CACjG,AAAO,YACL,AAAyCC,gBACzC,cACA;AACA,QAAM,gCAAgC,gBAAgB,aAAa;;;;CANtE,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { OpenId4VciAuthorizationServerConfig, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciDirectAuthorizationServerConfig } from "../../shared/models/OpenId4VciAuthorizationServerConfig.mjs";
|
|
2
|
+
import { OpenId4VcJwtIssuerEncoded } from "../../shared/models/OpenId4VcJwtIssuer.mjs";
|
|
3
|
+
import { OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialIssuerMetadataDisplay } from "../../shared/models/index.mjs";
|
|
4
|
+
import "../../shared/index.mjs";
|
|
5
|
+
import { OpenId4VciBatchCredentialIssuanceOptions } from "../OpenId4VcIssuerServiceOptions.mjs";
|
|
6
|
+
import "../../index.mjs";
|
|
7
|
+
import { BaseRecord, Kms, RecordTags, TagsBase } from "@credo-ts/core";
|
|
8
|
+
|
|
9
|
+
//#region src/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts
|
|
10
|
+
type OpenId4VcIssuerRecordTags = RecordTags<OpenId4VcIssuerRecord>;
|
|
11
|
+
type DefaultOpenId4VcIssuerRecordTags = {
|
|
12
|
+
issuerId: string;
|
|
13
|
+
};
|
|
14
|
+
type OpenId4VcIssuerRecordSignedMetadata = {
|
|
15
|
+
signer: OpenId4VcJwtIssuerEncoded;
|
|
16
|
+
/**
|
|
17
|
+
* The credential issuer metadata as a signed JWT
|
|
18
|
+
*/
|
|
19
|
+
jwt: string;
|
|
20
|
+
};
|
|
21
|
+
type OpenId4VcIssuerRecordProps = {
|
|
22
|
+
id?: string;
|
|
23
|
+
createdAt?: Date;
|
|
24
|
+
tags?: TagsBase;
|
|
25
|
+
issuerId: string;
|
|
26
|
+
/**
|
|
27
|
+
* The public jwk of the key used to sign access tokens for this issuer. Must include a `kid` parameter.
|
|
28
|
+
*/
|
|
29
|
+
accessTokenPublicJwk: Kms.KmsJwkPublicAsymmetric;
|
|
30
|
+
/**
|
|
31
|
+
* The DPoP signing algorithms supported by this issuer.
|
|
32
|
+
* If not provided, dPoP is considered unsupported.
|
|
33
|
+
*/
|
|
34
|
+
dpopSigningAlgValuesSupported?: [Kms.KnownJwaSignatureAlgorithm, ...Kms.KnownJwaSignatureAlgorithm[]];
|
|
35
|
+
display?: OpenId4VciCredentialIssuerMetadataDisplay[];
|
|
36
|
+
authorizationServerConfigs?: OpenId4VciAuthorizationServerConfig[];
|
|
37
|
+
credentialConfigurationsSupported: OpenId4VciCredentialConfigurationsSupportedWithFormats;
|
|
38
|
+
/**
|
|
39
|
+
* Indicate support for batch issuance of credentials
|
|
40
|
+
*/
|
|
41
|
+
batchCredentialIssuance?: OpenId4VciBatchCredentialIssuanceOptions;
|
|
42
|
+
/**
|
|
43
|
+
* When signed metadata is supported, this stores the
|
|
44
|
+
* signed jwt and signer information to update the JWT in the future.
|
|
45
|
+
*/
|
|
46
|
+
signedMetadata?: OpenId4VcIssuerRecordSignedMetadata;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* For OID4VC you need to expose metadata files. Each issuer needs to host this metadata. This is not the case for DIDComm where we can just have one /didcomm endpoint.
|
|
50
|
+
* So we create a record per openid issuer/verifier that you want, and each tenant can create multiple issuers/verifiers which have different endpoints
|
|
51
|
+
* and metadata files
|
|
52
|
+
* */
|
|
53
|
+
declare class OpenId4VcIssuerRecord extends BaseRecord<DefaultOpenId4VcIssuerRecordTags> {
|
|
54
|
+
static readonly type = "OpenId4VcIssuerRecord";
|
|
55
|
+
readonly type = "OpenId4VcIssuerRecord";
|
|
56
|
+
issuerId: string;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated accessTokenPublicJwk should be used
|
|
59
|
+
* @todo remove in migration
|
|
60
|
+
*/
|
|
61
|
+
accessTokenPublicKeyFingerprint?: string;
|
|
62
|
+
accessTokenPublicJwk?: Kms.KmsJwkPublicAsymmetric;
|
|
63
|
+
/**
|
|
64
|
+
* Only here for class transformation. If credentialsSupported is set we transform
|
|
65
|
+
* it to the new credentialConfigurationsSupported format
|
|
66
|
+
*/
|
|
67
|
+
private set credentialsSupported(value);
|
|
68
|
+
credentialConfigurationsSupported: OpenId4VciCredentialConfigurationsSupportedWithFormats;
|
|
69
|
+
display?: OpenId4VciCredentialIssuerMetadataDisplay[];
|
|
70
|
+
authorizationServerConfigs?: OpenId4VciAuthorizationServerConfig[];
|
|
71
|
+
dpopSigningAlgValuesSupported?: [Kms.KnownJwaSignatureAlgorithm, ...Kms.KnownJwaSignatureAlgorithm[]];
|
|
72
|
+
batchCredentialIssuance?: OpenId4VciBatchCredentialIssuanceOptions;
|
|
73
|
+
signedMetadata?: OpenId4VcIssuerRecordSignedMetadata;
|
|
74
|
+
get directAuthorizationServerConfigs(): OpenId4VciDirectAuthorizationServerConfig[] | undefined;
|
|
75
|
+
get chainedAuthorizationServerConfigs(): OpenId4VciChainedAuthorizationServerConfig[] | undefined;
|
|
76
|
+
get resolvedAccessTokenPublicJwk(): Kms.PublicJwk<Kms.Ed25519PublicJwk | Kms.P256PublicJwk | Kms.P384PublicJwk | Kms.P521PublicJwk | Kms.RsaPublicJwk | Kms.Secp256k1PublicJwk | Kms.X25519PublicJwk>;
|
|
77
|
+
constructor(props: OpenId4VcIssuerRecordProps);
|
|
78
|
+
getTags(): {
|
|
79
|
+
issuerId: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { DefaultOpenId4VcIssuerRecordTags, OpenId4VcIssuerRecord, OpenId4VcIssuerRecordProps, OpenId4VcIssuerRecordSignedMetadata, OpenId4VcIssuerRecordTags };
|
|
84
|
+
//# sourceMappingURL=OpenId4VcIssuerRecord.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenId4VcIssuerRecord.d.mts","names":[],"sources":["../../../src/openid4vc-issuer/repository/OpenId4VcIssuerRecord.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAWY,yBAAA,GAA4B,WAAW;KAEvC,gCAAA;;;KAIA,mCAAA;UACF;EAPE;AAEZ;AAIA;EASY,GAAA,EAAA,MAAA;CAEE;AACL,KAHG,0BAAA,GAGH;EAOe,EAAI,CAAA,EAAA,MAAA;EAMO,SAAI,CAAA,EAdzB,IAcyB;EAA+B,IAAI,CAAA,EAbjE,QAaiE;EAE9D,QAAA,EAAA,MAAA;EACmB;;;EAaZ,oBAAA,EAtBK,GAAA,CAAI,sBAsBT;EAAmC;AAQtD;;;EA0B6C,6BAAA,CAAA,EAAA,CAlDV,GAAA,CAAI,0BAkDM,EAAA,GAlDyB,GAAA,CAAI,0BAkD7B,EAAA,CAAA;EAuB1B,OAAA,CAAA,EAvEP,yCAuEO,EAAA;EAmBmB,0BAAA,CAAA,EAzFP,mCAyFO,EAAA;EAEI,iCAAI,EAzFT,sDAyFS;EAA+B;;;EAGhB,uBAAA,CAAA,EAvFjC,wCAuFiC;EAEhB;;;;EAQJ,cAAA,CAAA,EA3FtB,mCA2FsB;CAAA;;;;;;AAnFY,cAAxC,qBAAA,SAA8B,UAAU,CAAC,gCAAD,CAAA,CAAA;;;;;;;;;yBAWrB,GAAA,CAAI;;;;;;qCAeS;YAuB1B;+BAmBmB;mCAEI,GAAA,CAAI,+BAA+B,GAAA,CAAI;4BAC9C;mBAET;0CAAmC,yCAAA;2CAEhB,0CAAA;sCAQJ,GAAA,CAAA,UAAA,GAAA,CAAA,mBAAA,GAAA,CAAA,gBAAA,GAAA,CAAA,gBAAA,GAAA,CAAA,gBAAA,GAAA,CAAA,eAAA,GAAA,CAAA,qBAAA,GAAA,CAAA;qBAiBb"}
|