@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
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.OpenId4VcRelyingPartyEventHandler = void 0;
|
|
16
|
-
const core_1 = require("@credo-ts/core");
|
|
17
|
-
const did_auth_siop_1 = require("@sphereon/did-auth-siop");
|
|
18
|
-
const events_1 = require("events");
|
|
19
|
-
const OpenId4VcVerificationSessionState_1 = require("../OpenId4VcVerificationSessionState");
|
|
20
|
-
const OpenId4VcVerifierEvents_1 = require("../OpenId4VcVerifierEvents");
|
|
21
|
-
const OpenId4VcVerificationSessionRecord_1 = require("./OpenId4VcVerificationSessionRecord");
|
|
22
|
-
const OpenId4VcVerificationSessionRepository_1 = require("./OpenId4VcVerificationSessionRepository");
|
|
23
|
-
let OpenId4VcRelyingPartyEventHandler = class OpenId4VcRelyingPartyEventHandler {
|
|
24
|
-
constructor(agentContextProvider, agentDependencies) {
|
|
25
|
-
this.agentContextProvider = agentContextProvider;
|
|
26
|
-
this.onAuthorizationRequestCreatedSuccess = async (event, context) => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const authorizationRequestJwt = await ((_a = event.subject) === null || _a === void 0 ? void 0 : _a.requestObjectJwt());
|
|
29
|
-
if (!authorizationRequestJwt) {
|
|
30
|
-
throw new core_1.CredoError('Authorization request object JWT is missing');
|
|
31
|
-
}
|
|
32
|
-
const authorizationRequestUri = (_b = event.subject) === null || _b === void 0 ? void 0 : _b.payload.request_uri;
|
|
33
|
-
if (!authorizationRequestUri) {
|
|
34
|
-
throw new core_1.CredoError('Authorization request URI is missing');
|
|
35
|
-
}
|
|
36
|
-
const verificationSession = new OpenId4VcVerificationSessionRecord_1.OpenId4VcVerificationSessionRecord({
|
|
37
|
-
id: event.correlationId,
|
|
38
|
-
authorizationRequestJwt,
|
|
39
|
-
authorizationRequestUri,
|
|
40
|
-
state: OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestCreated,
|
|
41
|
-
verifierId: context.verifierId,
|
|
42
|
-
});
|
|
43
|
-
await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => {
|
|
44
|
-
await verificationSessionRepository.save(agentContext, verificationSession);
|
|
45
|
-
this.emitStateChangedEvent(agentContext, verificationSession, null);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
this.onAuthorizationRequestSentSuccess = async (event, context) => {
|
|
49
|
-
await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => {
|
|
50
|
-
const verificationSession = await verificationSessionRepository.getById(agentContext, event.correlationId);
|
|
51
|
-
// In all other cases it doesn't make sense to update the state, as the state is already advanced beyond
|
|
52
|
-
// this state.
|
|
53
|
-
if (verificationSession.state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestCreated) {
|
|
54
|
-
verificationSession.state = OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestUriRetrieved;
|
|
55
|
-
await verificationSessionRepository.update(agentContext, verificationSession);
|
|
56
|
-
this.emitStateChangedEvent(agentContext, verificationSession, OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestCreated);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
this.onAuthorizationResponseReceivedFailed = async (event, context) => {
|
|
61
|
-
await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
const verificationSession = await verificationSessionRepository.getById(agentContext, event.correlationId);
|
|
64
|
-
const previousState = verificationSession.state;
|
|
65
|
-
verificationSession.state = OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.Error;
|
|
66
|
-
verificationSession.authorizationResponsePayload = (_a = event.subject) === null || _a === void 0 ? void 0 : _a.payload;
|
|
67
|
-
verificationSession.errorMessage = (_b = event.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
68
|
-
await verificationSessionRepository.update(agentContext, verificationSession);
|
|
69
|
-
this.emitStateChangedEvent(agentContext, verificationSession, previousState);
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
this.onAuthorizationResponseVerifiedSuccess = async (event, context) => {
|
|
73
|
-
await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => {
|
|
74
|
-
var _a;
|
|
75
|
-
const verificationSession = await verificationSessionRepository.getById(agentContext, event.correlationId);
|
|
76
|
-
if (verificationSession.state !== OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.Error &&
|
|
77
|
-
verificationSession.state !== OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified) {
|
|
78
|
-
const previousState = verificationSession.state;
|
|
79
|
-
verificationSession.authorizationResponsePayload = (_a = event.subject) === null || _a === void 0 ? void 0 : _a.payload;
|
|
80
|
-
verificationSession.state = OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified;
|
|
81
|
-
await verificationSessionRepository.update(agentContext, verificationSession);
|
|
82
|
-
this.emitStateChangedEvent(agentContext, verificationSession, previousState);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
this.onAuthorizationResponseVerifiedFailed = async (event, context) => {
|
|
87
|
-
await this.withSession(context.contextCorrelationId, async (agentContext, verificationSessionRepository) => {
|
|
88
|
-
var _a;
|
|
89
|
-
const verificationSession = await verificationSessionRepository.getById(agentContext, event.correlationId);
|
|
90
|
-
const previousState = verificationSession.state;
|
|
91
|
-
verificationSession.state = OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.Error;
|
|
92
|
-
verificationSession.errorMessage = (_a = event.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
93
|
-
await verificationSessionRepository.update(agentContext, verificationSession);
|
|
94
|
-
this.emitStateChangedEvent(agentContext, verificationSession, previousState);
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
this.nativeEventEmitter = new agentDependencies.EventEmitterClass();
|
|
98
|
-
this.nativeEventEmitter.on(did_auth_siop_1.AuthorizationEvents.ON_AUTH_REQUEST_CREATED_SUCCESS, this.onAuthorizationRequestCreatedSuccess);
|
|
99
|
-
// We don't want to do anything currently when a request creation failed, as then the method that
|
|
100
|
-
// is called to create it will throw and we won't create a session
|
|
101
|
-
// AuthorizationEvents.ON_AUTH_REQUEST_CREATED_FAILED,
|
|
102
|
-
this.nativeEventEmitter.on(did_auth_siop_1.AuthorizationEvents.ON_AUTH_REQUEST_SENT_SUCCESS, this.onAuthorizationRequestSentSuccess);
|
|
103
|
-
// We manually call when the request is retrieved, and there's not really a case where it can fail, and
|
|
104
|
-
// not really sure how to represent it in the verification session. So not doing anything here.
|
|
105
|
-
// AuthorizationEvents.ON_AUTH_REQUEST_SENT_FAILED
|
|
106
|
-
// NOTE: the response received and response verified states are fired in such rapid succession
|
|
107
|
-
// that the verification session record is not updated yet to received before the verified event is
|
|
108
|
-
// emitted. For now we only track the verified / failed event. Otherwise we need to use record locking, which we don't have in-place yet
|
|
109
|
-
// AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_SUCCESS,
|
|
110
|
-
this.nativeEventEmitter.on(did_auth_siop_1.AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_FAILED, this.onAuthorizationResponseReceivedFailed);
|
|
111
|
-
this.nativeEventEmitter.on(did_auth_siop_1.AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_SUCCESS, this.onAuthorizationResponseVerifiedSuccess);
|
|
112
|
-
this.nativeEventEmitter.on(did_auth_siop_1.AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_FAILED, this.onAuthorizationResponseVerifiedFailed);
|
|
113
|
-
}
|
|
114
|
-
getEventEmitterForVerifier(contextCorrelationId, verifierId) {
|
|
115
|
-
return new OpenId4VcRelyingPartyEventEmitter(this.nativeEventEmitter, contextCorrelationId, verifierId);
|
|
116
|
-
}
|
|
117
|
-
async withSession(contextCorrelationId, callback) {
|
|
118
|
-
const agentContext = await this.agentContextProvider.getAgentContextForContextCorrelationId(contextCorrelationId);
|
|
119
|
-
try {
|
|
120
|
-
const verificationSessionRepository = agentContext.dependencyManager.resolve(OpenId4VcVerificationSessionRepository_1.OpenId4VcVerificationSessionRepository);
|
|
121
|
-
const result = await callback(agentContext, verificationSessionRepository);
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
await agentContext.endSession();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
emitStateChangedEvent(agentContext, verificationSession, previousState) {
|
|
129
|
-
const eventEmitter = agentContext.dependencyManager.resolve(core_1.EventEmitter);
|
|
130
|
-
eventEmitter.emit(agentContext, {
|
|
131
|
-
type: OpenId4VcVerifierEvents_1.OpenId4VcVerifierEvents.VerificationSessionStateChanged,
|
|
132
|
-
payload: {
|
|
133
|
-
verificationSession: verificationSession.clone(),
|
|
134
|
-
previousState,
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
exports.OpenId4VcRelyingPartyEventHandler = OpenId4VcRelyingPartyEventHandler;
|
|
140
|
-
exports.OpenId4VcRelyingPartyEventHandler = OpenId4VcRelyingPartyEventHandler = __decorate([
|
|
141
|
-
(0, core_1.injectable)(),
|
|
142
|
-
__param(0, (0, core_1.inject)(core_1.InjectionSymbols.AgentContextProvider)),
|
|
143
|
-
__param(1, (0, core_1.inject)(core_1.InjectionSymbols.AgentDependencies)),
|
|
144
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
145
|
-
], OpenId4VcRelyingPartyEventHandler);
|
|
146
|
-
/**
|
|
147
|
-
* Custom implementation of the event emitter so we can associate the contextCorrelationId
|
|
148
|
-
* and the verifierId with the events that are emitted. This allows us to only create one
|
|
149
|
-
* event emitter and thus not have endless event emitters and listeners for each active RP.
|
|
150
|
-
*
|
|
151
|
-
* We only modify the emit method, and add the verifierId and contextCorrelationId to the event
|
|
152
|
-
* this allows the listener to know which tenant and which verifier the event is associated with.
|
|
153
|
-
*/
|
|
154
|
-
class OpenId4VcRelyingPartyEventEmitter {
|
|
155
|
-
constructor(nativeEventEmitter, contextCorrelationId, verifierId) {
|
|
156
|
-
this.nativeEventEmitter = nativeEventEmitter;
|
|
157
|
-
this.contextCorrelationId = contextCorrelationId;
|
|
158
|
-
this.verifierId = verifierId;
|
|
159
|
-
}
|
|
160
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
161
|
-
emit(eventName, ...args) {
|
|
162
|
-
return this.nativeEventEmitter.emit(eventName, ...args, {
|
|
163
|
-
contextCorrelationId: this.contextCorrelationId,
|
|
164
|
-
verifierId: this.verifierId,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
168
|
-
[events_1.EventEmitter.captureRejectionSymbol](error, event, ...args) {
|
|
169
|
-
var _a, _b;
|
|
170
|
-
return (_b = (_a = this.nativeEventEmitter)[events_1.EventEmitter.captureRejectionSymbol]) === null || _b === void 0 ? void 0 : _b.call(_a, error, event, ...args);
|
|
171
|
-
}
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
173
|
-
addListener(eventName, listener) {
|
|
174
|
-
this.nativeEventEmitter.addListener(eventName, listener);
|
|
175
|
-
return this;
|
|
176
|
-
}
|
|
177
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
|
-
on(eventName, listener) {
|
|
179
|
-
this.nativeEventEmitter.on(eventName, listener);
|
|
180
|
-
return this;
|
|
181
|
-
}
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
183
|
-
once(eventName, listener) {
|
|
184
|
-
this.nativeEventEmitter.once(eventName, listener);
|
|
185
|
-
return this;
|
|
186
|
-
}
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
188
|
-
removeListener(eventName, listener) {
|
|
189
|
-
this.nativeEventEmitter.removeListener(eventName, listener);
|
|
190
|
-
return this;
|
|
191
|
-
}
|
|
192
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
193
|
-
off(eventName, listener) {
|
|
194
|
-
this.nativeEventEmitter.off(eventName, listener);
|
|
195
|
-
return this;
|
|
196
|
-
}
|
|
197
|
-
removeAllListeners(event) {
|
|
198
|
-
this.nativeEventEmitter.removeAllListeners(event);
|
|
199
|
-
return this;
|
|
200
|
-
}
|
|
201
|
-
setMaxListeners(n) {
|
|
202
|
-
this.nativeEventEmitter.setMaxListeners(n);
|
|
203
|
-
return this;
|
|
204
|
-
}
|
|
205
|
-
getMaxListeners() {
|
|
206
|
-
return this.nativeEventEmitter.getMaxListeners();
|
|
207
|
-
}
|
|
208
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
209
|
-
listeners(eventName) {
|
|
210
|
-
return this.nativeEventEmitter.listeners(eventName);
|
|
211
|
-
}
|
|
212
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
213
|
-
rawListeners(eventName) {
|
|
214
|
-
return this.nativeEventEmitter.rawListeners(eventName);
|
|
215
|
-
}
|
|
216
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
217
|
-
listenerCount(eventName, listener) {
|
|
218
|
-
return this.nativeEventEmitter.listenerCount(eventName, listener);
|
|
219
|
-
}
|
|
220
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
221
|
-
prependListener(eventName, listener) {
|
|
222
|
-
this.nativeEventEmitter.prependListener(eventName, listener);
|
|
223
|
-
return this;
|
|
224
|
-
}
|
|
225
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
226
|
-
prependOnceListener(eventName, listener) {
|
|
227
|
-
this.nativeEventEmitter.prependOnceListener(eventName, listener);
|
|
228
|
-
return this;
|
|
229
|
-
}
|
|
230
|
-
eventNames() {
|
|
231
|
-
return this.nativeEventEmitter.eventNames();
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
//# sourceMappingURL=OpenId4VcRelyingPartyEventEmitter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcRelyingPartyEventEmitter.js","sourceRoot":"","sources":["../../../src/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,yCAQuB;AACvB,2DAA6D;AAC7D,mCAA2D;AAE3D,4FAAwF;AACxF,wEAAoE;AAEpE,6FAAyF;AACzF,qGAAiG;AAQ1F,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAG5C,YACiD,oBAAkD,EACrD,iBAAoC;QADzB,yBAAoB,GAApB,oBAAoB,CAAsB;QA4C3F,yCAAoC,GAAG,KAA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;QAC9B,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,kBAAkB,CAAC,eAAe,EAAE,CAAA;IAClD,CAAC;IAED,wDAAwD;IACjD,SAAS,CAAC,SAA0B;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IACrD,CAAC;IAED,wDAAwD;IACjD,YAAY,CAAC,SAA0B;QAC5C,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IACxD,CAAC;IAED,wDAAwD;IACjD,aAAa,CAAC,SAA0B,EAAE,QAA+B;QAC9E,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACnE,CAAC;IAED,8DAA8D;IACvD,eAAe,CAAC,SAA0B,EAAE,QAAkC;QACnF,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAC5D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,8DAA8D;IACvD,mBAAmB,CAAC,SAA0B,EAAE,QAAkC;QACvF,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAChE,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,CAAA;IAC7C,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AgentContext } from '@credo-ts/core';
|
|
2
|
-
import type { AuthorizationRequestState, AuthorizationResponseState, IRPSessionManager } from '@sphereon/did-auth-siop';
|
|
3
|
-
export declare class OpenId4VcRelyingPartySessionManager implements IRPSessionManager {
|
|
4
|
-
private agentContext;
|
|
5
|
-
private verifierId;
|
|
6
|
-
private openId4VcVerificationSessionRepository;
|
|
7
|
-
constructor(agentContext: AgentContext, verifierId: string);
|
|
8
|
-
getRequestStateByCorrelationId(correlationId: string, errorOnNotFound?: boolean): Promise<AuthorizationRequestState | undefined>;
|
|
9
|
-
getRequestStateByNonce(nonce: string, errorOnNotFound?: boolean): Promise<AuthorizationRequestState | undefined>;
|
|
10
|
-
getRequestStateByState(state: string, errorOnNotFound?: boolean): Promise<AuthorizationRequestState | undefined>;
|
|
11
|
-
getResponseStateByCorrelationId(correlationId: string, errorOnNotFound?: boolean): Promise<AuthorizationResponseState | undefined>;
|
|
12
|
-
getResponseStateByNonce(nonce: string, errorOnNotFound?: boolean): Promise<AuthorizationResponseState | undefined>;
|
|
13
|
-
getResponseStateByState(state: string, errorOnNotFound?: boolean): Promise<AuthorizationResponseState | undefined>;
|
|
14
|
-
getCorrelationIdByNonce(nonce: string, errorOnNotFound?: boolean): Promise<string | undefined>;
|
|
15
|
-
getCorrelationIdByState(state: string, errorOnNotFound?: boolean): Promise<string | undefined>;
|
|
16
|
-
deleteStateForCorrelationId(): Promise<void>;
|
|
17
|
-
private getRequestStateFromSessionRecord;
|
|
18
|
-
private getResponseStateFromSessionRecord;
|
|
19
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenId4VcRelyingPartySessionManager = void 0;
|
|
4
|
-
const core_1 = require("@credo-ts/core");
|
|
5
|
-
const did_auth_siop_1 = require("@sphereon/did-auth-siop");
|
|
6
|
-
const OpenId4VcVerificationSessionState_1 = require("../OpenId4VcVerificationSessionState");
|
|
7
|
-
const OpenId4VcVerificationSessionRepository_1 = require("./OpenId4VcVerificationSessionRepository");
|
|
8
|
-
class OpenId4VcRelyingPartySessionManager {
|
|
9
|
-
constructor(agentContext, verifierId) {
|
|
10
|
-
this.agentContext = agentContext;
|
|
11
|
-
this.verifierId = verifierId;
|
|
12
|
-
this.openId4VcVerificationSessionRepository = agentContext.dependencyManager.resolve(OpenId4VcVerificationSessionRepository_1.OpenId4VcVerificationSessionRepository);
|
|
13
|
-
}
|
|
14
|
-
async getRequestStateByCorrelationId(correlationId, errorOnNotFound) {
|
|
15
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findById(this.agentContext, correlationId);
|
|
16
|
-
if (!verificationSession) {
|
|
17
|
-
if (errorOnNotFound)
|
|
18
|
-
throw new core_1.CredoError(`OpenID4VC Authorization request state for correlation id ${correlationId} not found`);
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return this.getRequestStateFromSessionRecord(verificationSession);
|
|
22
|
-
}
|
|
23
|
-
async getRequestStateByNonce(nonce, errorOnNotFound) {
|
|
24
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findSingleByQuery(this.agentContext, {
|
|
25
|
-
verifierId: this.verifierId,
|
|
26
|
-
nonce: nonce,
|
|
27
|
-
});
|
|
28
|
-
if (!verificationSession) {
|
|
29
|
-
if (errorOnNotFound)
|
|
30
|
-
throw new core_1.CredoError(`OpenID4VC Authorization request state for nonce ${nonce} not found`);
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
return this.getRequestStateFromSessionRecord(verificationSession);
|
|
34
|
-
}
|
|
35
|
-
async getRequestStateByState(state, errorOnNotFound) {
|
|
36
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findSingleByQuery(this.agentContext, {
|
|
37
|
-
verifierId: this.verifierId,
|
|
38
|
-
payloadState: state,
|
|
39
|
-
});
|
|
40
|
-
if (!verificationSession) {
|
|
41
|
-
if (errorOnNotFound)
|
|
42
|
-
throw new core_1.CredoError(`OpenID4VC Authorization request state for state ${state} not found`);
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
return this.getRequestStateFromSessionRecord(verificationSession);
|
|
46
|
-
}
|
|
47
|
-
async getResponseStateByCorrelationId(correlationId, errorOnNotFound) {
|
|
48
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findById(this.agentContext, correlationId);
|
|
49
|
-
const responseState = await this.getResponseStateFromSessionRecord(verificationSession);
|
|
50
|
-
if (!responseState) {
|
|
51
|
-
if (errorOnNotFound)
|
|
52
|
-
throw new core_1.CredoError(`OpenID4VC Authorization response state for correlation id ${correlationId} not found`);
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
return responseState;
|
|
56
|
-
}
|
|
57
|
-
async getResponseStateByNonce(nonce, errorOnNotFound) {
|
|
58
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findSingleByQuery(this.agentContext, {
|
|
59
|
-
verifierId: this.verifierId,
|
|
60
|
-
nonce,
|
|
61
|
-
});
|
|
62
|
-
const responseState = await this.getResponseStateFromSessionRecord(verificationSession);
|
|
63
|
-
if (!responseState) {
|
|
64
|
-
if (errorOnNotFound)
|
|
65
|
-
throw new core_1.CredoError(`OpenID4VC Authorization response state for nonce ${nonce} not found`);
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
return responseState;
|
|
69
|
-
}
|
|
70
|
-
async getResponseStateByState(state, errorOnNotFound) {
|
|
71
|
-
const verificationSession = await this.openId4VcVerificationSessionRepository.findSingleByQuery(this.agentContext, {
|
|
72
|
-
verifierId: this.verifierId,
|
|
73
|
-
payloadState: state,
|
|
74
|
-
});
|
|
75
|
-
const responseState = await this.getResponseStateFromSessionRecord(verificationSession);
|
|
76
|
-
if (!responseState) {
|
|
77
|
-
if (errorOnNotFound)
|
|
78
|
-
throw new core_1.CredoError(`OpenID4VC Authorization response state for state ${state} not found`);
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
return responseState;
|
|
82
|
-
}
|
|
83
|
-
async getCorrelationIdByNonce(nonce, errorOnNotFound) {
|
|
84
|
-
const requestState = await this.getRequestStateByNonce(nonce, errorOnNotFound);
|
|
85
|
-
return requestState === null || requestState === void 0 ? void 0 : requestState.correlationId;
|
|
86
|
-
}
|
|
87
|
-
async getCorrelationIdByState(state, errorOnNotFound) {
|
|
88
|
-
const requestState = await this.getRequestStateByState(state, errorOnNotFound);
|
|
89
|
-
return requestState === null || requestState === void 0 ? void 0 : requestState.correlationId;
|
|
90
|
-
}
|
|
91
|
-
async deleteStateForCorrelationId() {
|
|
92
|
-
throw new Error('Method not implemented.');
|
|
93
|
-
}
|
|
94
|
-
async getRequestStateFromSessionRecord(sessionRecord) {
|
|
95
|
-
var _a, _b;
|
|
96
|
-
const lastUpdated = (_b = (_a = sessionRecord.updatedAt) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : sessionRecord.createdAt.getTime();
|
|
97
|
-
return {
|
|
98
|
-
lastUpdated,
|
|
99
|
-
timestamp: lastUpdated,
|
|
100
|
-
correlationId: sessionRecord.id,
|
|
101
|
-
// Not so nice that the session manager expects an error instance.....
|
|
102
|
-
error: sessionRecord.errorMessage ? new Error(sessionRecord.errorMessage) : undefined,
|
|
103
|
-
request: await did_auth_siop_1.AuthorizationRequest.fromUriOrJwt(sessionRecord.authorizationRequestJwt),
|
|
104
|
-
status: sphereonAuthorizationRequestStateFromOpenId4VcVerificationState(sessionRecord.state),
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
async getResponseStateFromSessionRecord(sessionRecord) {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
if (!sessionRecord)
|
|
110
|
-
return undefined;
|
|
111
|
-
const lastUpdated = (_b = (_a = sessionRecord.updatedAt) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : sessionRecord.createdAt.getTime();
|
|
112
|
-
// If we don't have the authorization response payload yet, it means we haven't
|
|
113
|
-
// received the response yet, and thus the response state does not exist yet
|
|
114
|
-
if (!sessionRecord.authorizationResponsePayload) {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
lastUpdated,
|
|
119
|
-
timestamp: lastUpdated,
|
|
120
|
-
correlationId: sessionRecord.id,
|
|
121
|
-
// Not so nice that the session manager expects an error instance.....
|
|
122
|
-
error: sessionRecord.errorMessage ? new Error(sessionRecord.errorMessage) : undefined,
|
|
123
|
-
response: await did_auth_siop_1.AuthorizationResponse.fromPayload(sessionRecord.authorizationResponsePayload),
|
|
124
|
-
status: sphereonAuthorizationResponseStateFromOpenId4VcVerificationState(sessionRecord.state),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.OpenId4VcRelyingPartySessionManager = OpenId4VcRelyingPartySessionManager;
|
|
129
|
-
function sphereonAuthorizationResponseStateFromOpenId4VcVerificationState(state) {
|
|
130
|
-
if (state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.Error)
|
|
131
|
-
return did_auth_siop_1.AuthorizationResponseStateStatus.ERROR;
|
|
132
|
-
if (state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified)
|
|
133
|
-
return did_auth_siop_1.AuthorizationResponseStateStatus.VERIFIED;
|
|
134
|
-
throw new core_1.CredoError(`Can not map OpenId4VcVerificationSessionState ${state} to AuthorizationResponseStateStatus`);
|
|
135
|
-
}
|
|
136
|
-
function sphereonAuthorizationRequestStateFromOpenId4VcVerificationState(state) {
|
|
137
|
-
if (state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.Error)
|
|
138
|
-
return did_auth_siop_1.AuthorizationRequestStateStatus.ERROR;
|
|
139
|
-
if ([OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestCreated, OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.ResponseVerified].includes(state)) {
|
|
140
|
-
return did_auth_siop_1.AuthorizationRequestStateStatus.CREATED;
|
|
141
|
-
}
|
|
142
|
-
if (state === OpenId4VcVerificationSessionState_1.OpenId4VcVerificationSessionState.RequestUriRetrieved)
|
|
143
|
-
return did_auth_siop_1.AuthorizationRequestStateStatus.SENT;
|
|
144
|
-
throw new core_1.CredoError(`Can not map OpenId4VcVerificationSessionState ${state} to AuthorizationRequestStateStatus`);
|
|
145
|
-
}
|
|
146
|
-
//# sourceMappingURL=OpenId4VcRelyingPartySessionManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcRelyingPartySessionManager.js","sourceRoot":"","sources":["../../../src/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.ts"],"names":[],"mappings":";;;AAIA,yCAA2C;AAC3C,2DAKgC;AAEhC,4FAAwF;AAExF,qGAAiG;AAEjG,MAAa,mCAAmC;IAG9C,YAA2B,YAA0B,EAAU,UAAkB;QAAtD,iBAAY,GAAZ,YAAY,CAAc;QAAU,eAAU,GAAV,UAAU,CAAQ;QAC/E,IAAI,CAAC,sCAAsC,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAClF,+EAAsC,CACvC,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,8BAA8B,CACzC,aAAqB,EACrB,eAAyB;QAEzB,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,sCAAsC,CAAC,QAAQ,CACpF,IAAI,CAAC,YAAY,EACjB,aAAa,CACd,CAAA;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,IAAI,eAAe;gBACjB,MAAM,IAAI,iBAAU,CAAC,4DAA4D,aAAa,YAAY,CAAC,CAAA;YAC7G,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,OAAO,IAAI,CAAC,gCAAgC,CAAC,mBAAmB,CAAC,CAAA;IACnE,CAAC;IAEM,KAAK,CAAC,sBAAsB,CACjC,KAAa,EACb,eAAyB;QAEzB,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,sCAAsC,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,EAAE;YACjH,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;QAEF,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,IAAI,eAAe;gBAAE,MAAM,IAAI,i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AAC,4BAA4B,CAAC;YAC7F,MAAM,EAAE,gEAAgE,CAAC,aAAa,CAAC,KAAK,CAAC;SAC9F,CAAA;IACH,CAAC;CACF;AAvKD,kFAuKC;AAED,SAAS,gEAAgE,CACvE,KAAwC;IAExC,IAAI,KAAK,KAAK,qEAAiC,CAAC,KAAK;QAAE,OAAO,gDAAgC,CAAC,KAAK,CAAA;IACpG,IAAI,KAAK,KAAK,qEAAiC,CAAC,gBAAgB;QAAE,OAAO,gDAAgC,CAAC,QAAQ,CAAA;IAElH,MAAM,IAAI,iBAAU,CAAC,iDAAiD,KAAK,sCAAsC,CAAC,CAAA;AACpH,CAAC;AAED,SAAS,+DAA+D,CACtE,KAAwC;IAExC,IAAI,KAAK,KAAK,qEAAiC,CAAC,KAAK;QAAE,OAAO,+CAA+B,CAAC,KAAK,CAAA;IAEnG,IACE,CAAC,qEAAiC,CAAC,cAAc,EAAE,qEAAiC,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAC7G,KAAK,CACN,EACD,CAAC;QACD,OAAO,+CAA+B,CAAC,OAAO,CAAA;IAChD,CAAC;IAED,IAAI,KAAK,KAAK,qEAAiC,CAAC,mBAAmB;QAAE,OAAO,+CAA+B,CAAC,IAAI,CAAA;IAEhH,MAAM,IAAI,iBAAU,CAAC,iDAAiD,KAAK,qCAAqC,CAAC,CAAA;AACnH,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { OpenId4VcSiopAuthorizationResponsePayload } from '../../shared/models';
|
|
2
|
-
import type { OpenId4VcVerificationSessionState } from '../OpenId4VcVerificationSessionState';
|
|
3
|
-
import type { RecordTags, TagsBase } from '@credo-ts/core';
|
|
4
|
-
import { BaseRecord } from '@credo-ts/core';
|
|
5
|
-
export type OpenId4VcVerificationSessionRecordTags = RecordTags<OpenId4VcVerificationSessionRecord>;
|
|
6
|
-
export type DefaultOpenId4VcVerificationSessionRecordTags = {
|
|
7
|
-
verifierId: string;
|
|
8
|
-
state: OpenId4VcVerificationSessionState;
|
|
9
|
-
nonce: string;
|
|
10
|
-
payloadState: string;
|
|
11
|
-
authorizationRequestUri: string;
|
|
12
|
-
};
|
|
13
|
-
export interface OpenId4VcVerificationSessionRecordProps {
|
|
14
|
-
id?: string;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
tags?: TagsBase;
|
|
17
|
-
verifierId: string;
|
|
18
|
-
state: OpenId4VcVerificationSessionState;
|
|
19
|
-
errorMessage?: string;
|
|
20
|
-
authorizationRequestUri: string;
|
|
21
|
-
authorizationRequestJwt: string;
|
|
22
|
-
authorizationResponsePayload?: OpenId4VcSiopAuthorizationResponsePayload;
|
|
23
|
-
/**
|
|
24
|
-
* Presentation during issuance session. This is used when issuance of a credential requires a presentation, and helps
|
|
25
|
-
* prevent session fixation attacks
|
|
26
|
-
*/
|
|
27
|
-
presentationDuringIssuanceSession?: string;
|
|
28
|
-
}
|
|
29
|
-
export declare class OpenId4VcVerificationSessionRecord extends BaseRecord<DefaultOpenId4VcVerificationSessionRecordTags> {
|
|
30
|
-
static readonly type = "OpenId4VcVerificationSessionRecord";
|
|
31
|
-
readonly type = "OpenId4VcVerificationSessionRecord";
|
|
32
|
-
/**
|
|
33
|
-
* The id of the verifier that this session is for.
|
|
34
|
-
*/
|
|
35
|
-
verifierId: string;
|
|
36
|
-
/**
|
|
37
|
-
* The state of the verification session.
|
|
38
|
-
*/
|
|
39
|
-
state: OpenId4VcVerificationSessionState;
|
|
40
|
-
/**
|
|
41
|
-
* Optional error message of the error that occurred during the verification session. Will be set when state is {@link OpenId4VcVerificationSessionState.Error}
|
|
42
|
-
*/
|
|
43
|
-
errorMessage?: string;
|
|
44
|
-
/**
|
|
45
|
-
* The signed JWT containing the authorization request
|
|
46
|
-
*/
|
|
47
|
-
authorizationRequestJwt: string;
|
|
48
|
-
/**
|
|
49
|
-
* URI of the authorization request. This is the url that can be used to
|
|
50
|
-
* retrieve the authorization request
|
|
51
|
-
*/
|
|
52
|
-
authorizationRequestUri: string;
|
|
53
|
-
/**
|
|
54
|
-
* The payload of the received authorization response
|
|
55
|
-
*/
|
|
56
|
-
authorizationResponsePayload?: OpenId4VcSiopAuthorizationResponsePayload;
|
|
57
|
-
/**
|
|
58
|
-
* Presentation during issuance session. This is used when issuance of a credential requires a presentation, and helps
|
|
59
|
-
* prevent session fixation attacks
|
|
60
|
-
*/
|
|
61
|
-
presentationDuringIssuanceSession?: string;
|
|
62
|
-
constructor(props: OpenId4VcVerificationSessionRecordProps);
|
|
63
|
-
assertState(expectedStates: OpenId4VcVerificationSessionState | OpenId4VcVerificationSessionState[]): void;
|
|
64
|
-
getTags(): {
|
|
65
|
-
verifierId: string;
|
|
66
|
-
state: OpenId4VcVerificationSessionState;
|
|
67
|
-
nonce: string;
|
|
68
|
-
payloadState: string;
|
|
69
|
-
authorizationRequestUri: string;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenId4VcVerificationSessionRecord = void 0;
|
|
4
|
-
const core_1 = require("@credo-ts/core");
|
|
5
|
-
class OpenId4VcVerificationSessionRecord extends core_1.BaseRecord {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
var _a, _b, _c;
|
|
8
|
-
super();
|
|
9
|
-
this.type = OpenId4VcVerificationSessionRecord.type;
|
|
10
|
-
if (props) {
|
|
11
|
-
this.id = (_a = props.id) !== null && _a !== void 0 ? _a : core_1.utils.uuid();
|
|
12
|
-
this.createdAt = (_b = props.createdAt) !== null && _b !== void 0 ? _b : new Date();
|
|
13
|
-
this._tags = (_c = props.tags) !== null && _c !== void 0 ? _c : {};
|
|
14
|
-
this.verifierId = props.verifierId;
|
|
15
|
-
this.state = props.state;
|
|
16
|
-
this.errorMessage = props.errorMessage;
|
|
17
|
-
this.authorizationRequestJwt = props.authorizationRequestJwt;
|
|
18
|
-
this.authorizationRequestUri = props.authorizationRequestUri;
|
|
19
|
-
this.authorizationResponsePayload = props.authorizationResponsePayload;
|
|
20
|
-
this.presentationDuringIssuanceSession = props.presentationDuringIssuanceSession;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
assertState(expectedStates) {
|
|
24
|
-
if (!Array.isArray(expectedStates)) {
|
|
25
|
-
expectedStates = [expectedStates];
|
|
26
|
-
}
|
|
27
|
-
if (!expectedStates.includes(this.state)) {
|
|
28
|
-
throw new core_1.CredoError(`OpenId4VcVerificationSessionRecord is in invalid state ${this.state}. Valid states are: ${expectedStates.join(', ')}.`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
getTags() {
|
|
32
|
-
const parsedAuthorizationRequest = core_1.Jwt.fromSerializedJwt(this.authorizationRequestJwt);
|
|
33
|
-
const nonce = parsedAuthorizationRequest.payload.additionalClaims.nonce;
|
|
34
|
-
if (!nonce || typeof nonce !== 'string')
|
|
35
|
-
throw new core_1.CredoError('Expected nonce in authorization request payload');
|
|
36
|
-
const payloadState = parsedAuthorizationRequest.payload.additionalClaims.state;
|
|
37
|
-
if (!payloadState || typeof payloadState !== 'string')
|
|
38
|
-
throw new core_1.CredoError('Expected state in authorization request payload');
|
|
39
|
-
return Object.assign(Object.assign({}, this._tags), { verifierId: this.verifierId, state: this.state, nonce,
|
|
40
|
-
// FIXME: how do we call this property so it doesn't conflict with the record state?
|
|
41
|
-
payloadState, authorizationRequestUri: this.authorizationRequestUri });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.OpenId4VcVerificationSessionRecord = OpenId4VcVerificationSessionRecord;
|
|
45
|
-
OpenId4VcVerificationSessionRecord.type = 'OpenId4VcVerificationSessionRecord';
|
|
46
|
-
//# sourceMappingURL=OpenId4VcVerificationSessionRecord.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcVerificationSessionRecord.js","sourceRoot":"","sources":["../../../src/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.ts"],"names":[],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AEM,OAAO;QACZ,MAAM,0BAA0B,GAAG,UAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;QAEtF,MAAM,KAAK,GAAG,0BAA0B,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAA;QACvE,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,MAAM,IAAI,iBAAU,CAAC,iDAAiD,CAAC,CAAA;QAEhH,MAAM,YAAY,GAAG,0BAA0B,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAA;QAC9E,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ;YACnD,MAAM,IAAI,iBAAU,CAAC,iDAAiD,CAAC,CAAA;QAEzE,uCACK,IAAI,CAAC,KAAK,KACb,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK;YACL,oFAAoF;YACpF,YAAY,EACZ,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,IACtD;IACH,CAAC;;AA7FH,gFA8FC;AA7FwB,uCAAI,GAAG,oCAAoC,AAAvC,CAAuC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Repository, StorageService, EventEmitter } from '@credo-ts/core';
|
|
2
|
-
import { OpenId4VcVerificationSessionRecord } from './OpenId4VcVerificationSessionRecord';
|
|
3
|
-
export declare class OpenId4VcVerificationSessionRepository extends Repository<OpenId4VcVerificationSessionRecord> {
|
|
4
|
-
constructor(storageService: StorageService<OpenId4VcVerificationSessionRecord>, eventEmitter: EventEmitter);
|
|
5
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.OpenId4VcVerificationSessionRepository = void 0;
|
|
16
|
-
const core_1 = require("@credo-ts/core");
|
|
17
|
-
const OpenId4VcVerificationSessionRecord_1 = require("./OpenId4VcVerificationSessionRecord");
|
|
18
|
-
let OpenId4VcVerificationSessionRepository = class OpenId4VcVerificationSessionRepository extends core_1.Repository {
|
|
19
|
-
constructor(storageService, eventEmitter) {
|
|
20
|
-
super(OpenId4VcVerificationSessionRecord_1.OpenId4VcVerificationSessionRecord, storageService, eventEmitter);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.OpenId4VcVerificationSessionRepository = OpenId4VcVerificationSessionRepository;
|
|
24
|
-
exports.OpenId4VcVerificationSessionRepository = OpenId4VcVerificationSessionRepository = __decorate([
|
|
25
|
-
(0, core_1.injectable)(),
|
|
26
|
-
__param(0, (0, core_1.inject)(core_1.InjectionSymbols.StorageService)),
|
|
27
|
-
__metadata("design:paramtypes", [Object, core_1.EventEmitter])
|
|
28
|
-
], OpenId4VcVerificationSessionRepository);
|
|
29
|
-
//# sourceMappingURL=OpenId4VcVerificationSessionRepository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcVerificationSessionRepository.js","sourceRoot":"","sources":["../../../src/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA+G;AAE/G,6FAAyF;AAGlF,IAAM,sCAAsC,GAA5C,MAAM,sCAAuC,SAAQ,iBAA8C;IACxG,YAC2C,cAAkE,EAC3G,YAA0B;QAE1B,KAAK,CAAC,uEAAkC,EAAE,cAAc,EAAE,YAAY,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAPY,wFAAsC;iDAAtC,sCAAsC;IADlD,IAAA,iBAAU,GAAE;IAGR,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,cAAc,CAAC,CAAA;6CAC1B,mBAAY;GAHjB,sCAAsC,CAOlD"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { OpenId4VcSiopVerifierClientMetadata } from '../OpenId4VcSiopVerifierServiceOptions';
|
|
2
|
-
import type { RecordTags, TagsBase } from '@credo-ts/core';
|
|
3
|
-
import { BaseRecord } from '@credo-ts/core';
|
|
4
|
-
export type OpenId4VcVerifierRecordTags = RecordTags<OpenId4VcVerifierRecord>;
|
|
5
|
-
export type DefaultOpenId4VcVerifierRecordTags = {
|
|
6
|
-
verifierId: string;
|
|
7
|
-
};
|
|
8
|
-
export interface OpenId4VcVerifierRecordProps {
|
|
9
|
-
id?: string;
|
|
10
|
-
createdAt?: Date;
|
|
11
|
-
tags?: TagsBase;
|
|
12
|
-
verifierId: string;
|
|
13
|
-
clientMetadata?: OpenId4VcSiopVerifierClientMetadata;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* For OID4VC you need to expos metadata files. Each issuer needs to host this metadata. This is not the case for DIDComm where we can just have one /didcomm endpoint.
|
|
17
|
-
* So we create a record per openid issuer/verifier that you want, and each tenant can create multiple issuers/verifiers which have different endpoints
|
|
18
|
-
* and metadata files
|
|
19
|
-
* */
|
|
20
|
-
export declare class OpenId4VcVerifierRecord extends BaseRecord<DefaultOpenId4VcVerifierRecordTags> {
|
|
21
|
-
static readonly type = "OpenId4VcVerifierRecord";
|
|
22
|
-
readonly type = "OpenId4VcVerifierRecord";
|
|
23
|
-
verifierId: string;
|
|
24
|
-
clientMetadata?: OpenId4VcSiopVerifierClientMetadata;
|
|
25
|
-
constructor(props: OpenId4VcVerifierRecordProps);
|
|
26
|
-
getTags(): {
|
|
27
|
-
verifierId: string;
|
|
28
|
-
};
|
|
29
|
-
}
|