@pagopa/io-react-native-wallet 3.0.1 → 3.1.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/lib/commonjs/api/index.js +3 -0
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/client/generated/wallet-provider.js +42 -4
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
- package/lib/commonjs/client/index.js +5 -3
- package/lib/commonjs/client/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +2 -0
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js +2 -2
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +2 -0
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +2 -0
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +15 -8
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +0 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/api/{06-send-authorization-response.js → 04-verify-certificate-chain.js} +1 -1
- package/lib/commonjs/credential/presentation/api/04-verify-certificate-chain.js.map +1 -0
- package/lib/commonjs/credential/presentation/api/{04-verify-request-object.js → 05-verify-request-object.js} +1 -1
- package/lib/commonjs/credential/presentation/api/05-verify-request-object.js.map +1 -0
- package/lib/commonjs/credential/presentation/api/{05-evaluate-dcql-query.js → 06-evaluate-dcql-query.js} +1 -1
- package/lib/commonjs/credential/presentation/api/06-evaluate-dcql-query.js.map +1 -0
- package/lib/commonjs/credential/presentation/api/07-send-authorization-response.js +6 -0
- package/lib/commonjs/credential/presentation/api/07-send-authorization-response.js.map +1 -0
- package/lib/commonjs/credential/presentation/api/RelyingPartyConfig.js +2 -2
- package/lib/commonjs/credential/presentation/api/RelyingPartyConfig.js.map +1 -1
- package/lib/commonjs/credential/presentation/api/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js +12 -0
- package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +1 -0
- package/lib/commonjs/credential/presentation/v1.0.0/{04-verify-request-object.js → 05-verify-request-object.js} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/{04-verify-request-object.js.map → 05-verify-request-object.js.map} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/{05-evaluate-dcql-query.js → 06-evaluate-dcql-query.js} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/{05-evaluate-dcql-query.js.map → 06-evaluate-dcql-query.js.map} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/{06-send-authorization-response.js → 07-send-authorization-response.js} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/{06-send-authorization-response.js.map → 07-send-authorization-response.js.map} +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/index.js +5 -3
- package/lib/commonjs/credential/presentation/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/04-verify-certificate-chain.js +33 -0
- package/lib/commonjs/credential/presentation/v1.3.3/04-verify-certificate-chain.js.map +1 -0
- package/lib/commonjs/credential/presentation/v1.3.3/{04-verify-request-object.js → 05-verify-request-object.js} +5 -3
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -0
- package/lib/commonjs/credential/presentation/v1.3.3/{05-evaluate-dcql-query.js → 06-evaluate-dcql-query.js} +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/{05-evaluate-dcql-query.js.map → 06-evaluate-dcql-query.js.map} +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/{06-send-authorization-response.js → 07-send-authorization-response.js} +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/{06-send-authorization-response.js.map → 07-send-authorization-response.js.map} +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/index.js +5 -3
- package/lib/commonjs/credential/presentation/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +53 -13
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.0.0/mappers.js +16 -5
- package/lib/commonjs/credentials-catalogue/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js +32 -0
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js +6 -2
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js +91 -30
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/utils.js +36 -5
- package/lib/commonjs/credentials-catalogue/v1.3.3/utils.js.map +1 -1
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/trust/common/types.js +3 -3
- package/lib/commonjs/trust/common/types.js.map +1 -1
- package/lib/commonjs/trust/v1.0.0/types.js +6 -8
- package/lib/commonjs/trust/v1.0.0/types.js.map +1 -1
- package/lib/commonjs/trust/v1.3.3/types.js +1 -3
- package/lib/commonjs/trust/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/utils/callbacks.js +2 -0
- package/lib/commonjs/utils/callbacks.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +8 -0
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/dpop.js +1 -1
- package/lib/commonjs/utils/dpop.js.map +1 -1
- package/lib/commonjs/utils/jwk.js +1 -1
- package/lib/commonjs/utils/jwk.js.map +1 -1
- package/lib/commonjs/utils/zod.js +1 -1
- package/lib/commonjs/utils/zod.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/README.md +13 -10
- package/lib/commonjs/wallet-instance-attestation/api/types.js +9 -4
- package/lib/commonjs/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/index.js +2 -2
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/issuing.js +4 -5
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/mappers.js +4 -5
- package/lib/commonjs/wallet-instance-attestation/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/index.js +5 -7
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/issuing.js +73 -3
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js +26 -0
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js +13 -24
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/utils.js +35 -0
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/utils.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/README.md +73 -0
- package/lib/commonjs/wallet-unit-attestation/api/index.js +6 -0
- package/lib/commonjs/wallet-unit-attestation/api/index.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/api/types.js +45 -0
- package/lib/commonjs/wallet-unit-attestation/api/types.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/index.js +20 -0
- package/lib/commonjs/wallet-unit-attestation/index.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.0.0/index.js +11 -0
- package/lib/commonjs/wallet-unit-attestation/v1.0.0/index.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/index.js +17 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/index.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/issuing.js +118 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/issuing.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/mappers.js +13 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/mappers.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/types.js +23 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/types.js.map +1 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/utils.js +20 -0
- package/lib/commonjs/wallet-unit-attestation/v1.3.3/utils.js.map +1 -0
- package/lib/module/api/index.js +3 -0
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +33 -1
- package/lib/module/client/generated/wallet-provider.js.map +1 -1
- package/lib/module/client/index.js +4 -2
- package/lib/module/client/index.js.map +1 -1
- package/lib/module/credential/issuance/README.md +2 -0
- package/lib/module/credential/issuance/api/IssuerConfig.js +2 -2
- package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +2 -0
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +2 -0
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +16 -9
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +0 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/presentation/api/04-verify-certificate-chain.js +2 -0
- package/lib/module/credential/presentation/api/04-verify-certificate-chain.js.map +1 -0
- package/lib/module/credential/presentation/api/05-verify-request-object.js +2 -0
- package/lib/module/credential/presentation/api/05-verify-request-object.js.map +1 -0
- package/lib/module/credential/presentation/api/06-evaluate-dcql-query.js +2 -0
- package/lib/module/credential/presentation/api/06-evaluate-dcql-query.js.map +1 -0
- package/lib/module/credential/presentation/api/07-send-authorization-response.js +2 -0
- package/lib/module/credential/presentation/api/07-send-authorization-response.js.map +1 -0
- package/lib/module/credential/presentation/api/RelyingPartyConfig.js +1 -1
- package/lib/module/credential/presentation/api/RelyingPartyConfig.js.map +1 -1
- package/lib/module/credential/presentation/api/index.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js +5 -0
- package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +1 -0
- package/lib/module/credential/presentation/v1.0.0/{04-verify-request-object.js → 05-verify-request-object.js} +1 -1
- package/lib/module/credential/presentation/v1.0.0/{04-verify-request-object.js.map → 05-verify-request-object.js.map} +1 -1
- package/lib/module/credential/presentation/v1.0.0/{05-evaluate-dcql-query.js → 06-evaluate-dcql-query.js} +1 -1
- package/lib/module/credential/presentation/v1.0.0/{05-evaluate-dcql-query.js.map → 06-evaluate-dcql-query.js.map} +1 -1
- package/lib/module/credential/presentation/v1.0.0/{06-send-authorization-response.js → 07-send-authorization-response.js} +1 -1
- package/lib/module/credential/presentation/v1.0.0/{06-send-authorization-response.js.map → 07-send-authorization-response.js.map} +1 -1
- package/lib/module/credential/presentation/v1.0.0/index.js +5 -3
- package/lib/module/credential/presentation/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/04-verify-certificate-chain.js +26 -0
- package/lib/module/credential/presentation/v1.3.3/04-verify-certificate-chain.js.map +1 -0
- package/lib/module/credential/presentation/v1.3.3/{04-verify-request-object.js → 05-verify-request-object.js} +5 -3
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -0
- package/lib/module/credential/presentation/v1.3.3/{05-evaluate-dcql-query.js → 06-evaluate-dcql-query.js} +1 -1
- package/lib/module/credential/presentation/v1.3.3/{05-evaluate-dcql-query.js.map → 06-evaluate-dcql-query.js.map} +1 -1
- package/lib/module/credential/presentation/v1.3.3/{06-send-authorization-response.js → 07-send-authorization-response.js} +1 -1
- package/lib/module/credential/presentation/v1.3.3/{06-send-authorization-response.js.map → 07-send-authorization-response.js.map} +1 -1
- package/lib/module/credential/presentation/v1.3.3/index.js +5 -3
- package/lib/module/credential/presentation/v1.3.3/index.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +52 -12
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.0.0/mappers.js +16 -5
- package/lib/module/credentials-catalogue/v1.0.0/mappers.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js +25 -0
- package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -0
- package/lib/module/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js +6 -2
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/types.js +91 -30
- package/lib/module/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/utils.js +32 -4
- package/lib/module/credentials-catalogue/v1.3.3/utils.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/trust/common/types.js +3 -3
- package/lib/module/trust/common/types.js.map +1 -1
- package/lib/module/trust/v1.0.0/types.js +5 -7
- package/lib/module/trust/v1.0.0/types.js.map +1 -1
- package/lib/module/trust/v1.3.3/types.js +1 -3
- package/lib/module/trust/v1.3.3/types.js.map +1 -1
- package/lib/module/utils/callbacks.js +3 -0
- package/lib/module/utils/callbacks.js.map +1 -1
- package/lib/module/utils/crypto.js +8 -0
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/dpop.js +1 -1
- package/lib/module/utils/dpop.js.map +1 -1
- package/lib/module/utils/jwk.js +1 -1
- package/lib/module/utils/jwk.js.map +1 -1
- package/lib/module/utils/zod.js +1 -1
- package/lib/module/utils/zod.js.map +1 -1
- package/lib/module/wallet-instance-attestation/README.md +13 -10
- package/lib/module/wallet-instance-attestation/api/types.js +7 -2
- package/lib/module/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.0.0/index.js +3 -3
- package/lib/module/wallet-instance-attestation/v1.0.0/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.0.0/issuing.js +4 -5
- package/lib/module/wallet-instance-attestation/v1.0.0/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.0.0/mappers.js +3 -4
- package/lib/module/wallet-instance-attestation/v1.0.0/mappers.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/index.js +5 -7
- package/lib/module/wallet-instance-attestation/v1.3.3/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/issuing.js +73 -3
- package/lib/module/wallet-instance-attestation/v1.3.3/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js +19 -0
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -0
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js +10 -21
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/utils.js +29 -0
- package/lib/module/wallet-instance-attestation/v1.3.3/utils.js.map +1 -0
- package/lib/module/wallet-unit-attestation/README.md +73 -0
- package/lib/module/wallet-unit-attestation/api/index.js +2 -0
- package/lib/module/wallet-unit-attestation/api/index.js.map +1 -0
- package/lib/module/wallet-unit-attestation/api/types.js +36 -0
- package/lib/module/wallet-unit-attestation/api/types.js.map +1 -0
- package/lib/module/wallet-unit-attestation/index.js +3 -0
- package/lib/module/wallet-unit-attestation/index.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.0.0/index.js +4 -0
- package/lib/module/wallet-unit-attestation/v1.0.0/index.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/index.js +10 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/index.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/issuing.js +112 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/issuing.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/mappers.js +6 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/mappers.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/types.js +14 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/types.js.map +1 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/utils.js +15 -0
- package/lib/module/wallet-unit-attestation/v1.3.3/utils.js.map +1 -0
- package/lib/typescript/api/index.d.ts +2 -0
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +122 -358
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
- package/lib/typescript/client/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts +2 -0
- package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +21 -357
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/types.d.ts +5 -41
- package/lib/typescript/credential/issuance/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +103 -106
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/types.d.ts +4 -26
- package/lib/typescript/credential/issuance/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/01-evaluate-issuer-trust.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +594 -2095
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/types.d.ts +1 -5
- package/lib/typescript/credential/issuance/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts +17 -0
- package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/api/{04-verify-request-object.d.ts → 05-verify-request-object.d.ts} +1 -1
- package/lib/typescript/credential/presentation/api/{04-verify-request-object.d.ts.map → 05-verify-request-object.d.ts.map} +1 -1
- package/lib/typescript/credential/presentation/api/{05-evaluate-dcql-query.d.ts → 06-evaluate-dcql-query.d.ts} +1 -1
- package/lib/typescript/credential/presentation/api/{05-evaluate-dcql-query.d.ts.map → 06-evaluate-dcql-query.d.ts.map} +1 -1
- package/lib/typescript/credential/presentation/api/{06-send-authorization-response.d.ts → 07-send-authorization-response.d.ts} +2 -2
- package/lib/typescript/credential/presentation/api/{06-send-authorization-response.d.ts.map → 07-send-authorization-response.d.ts.map} +1 -1
- package/lib/typescript/credential/presentation/api/RelyingPartyConfig.d.ts +9 -154
- package/lib/typescript/credential/presentation/api/RelyingPartyConfig.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/index.d.ts +5 -4
- package/lib/typescript/credential/presentation/api/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/types.d.ts +30 -106
- package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/dcql.d.ts +29 -244
- package/lib/typescript/credential/presentation/common/utils/dcql.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/sd-jwt.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts +3 -0
- package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.0.0/{04-verify-request-object.d.ts → 05-verify-request-object.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/05-verify-request-object.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.0.0/{05-evaluate-dcql-query.d.ts → 06-evaluate-dcql-query.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/06-evaluate-dcql-query.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.0.0/{06-send-authorization-response.d.ts → 07-send-authorization-response.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/07-send-authorization-response.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/mappers.d.ts +56 -58
- package/lib/typescript/credential/presentation/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/types.d.ts +13 -52
- package/lib/typescript/credential/presentation/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/utils.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/utils.jwks.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/04-verify-certificate-chain.d.ts +3 -0
- package/lib/typescript/credential/presentation/v1.3.3/04-verify-certificate-chain.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.3.3/{04-verify-request-object.d.ts → 05-verify-request-object.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.3.3/{05-evaluate-dcql-query.d.ts → 06-evaluate-dcql-query.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/06-evaluate-dcql-query.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.3.3/{06-send-authorization-response.d.ts → 07-send-authorization-response.d.ts} +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/{06-send-authorization-response.d.ts.map → 07-send-authorization-response.d.ts.map} +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +133 -525
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/sdkErrorMapper.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +39 -3672
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/utils.mdoc.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.0.0/mappers.d.ts +6 -6
- package/lib/typescript/credential/status/v1.0.0/types.d.ts +33 -659
- package/lib/typescript/credential/status/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +135 -525
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +22 -2
- package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +60 -20
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.0.0/types.d.ts +41 -737
- package/lib/typescript/credentials-catalogue/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/fetch-translations.d.ts +3 -0
- package/lib/typescript/credentials-catalogue/v1.3.3/fetch-translations.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts +159 -62
- package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts +180 -941
- package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/utils.d.ts +12 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/utils.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/mdoc/index.d.ts.map +1 -1
- package/lib/typescript/mdoc/utils.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +15 -15
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +33 -492
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/utils.d.ts.map +1 -1
- package/lib/typescript/trust/api/TrustAnchorConfig.d.ts +12 -201
- package/lib/typescript/trust/api/TrustAnchorConfig.d.ts.map +1 -1
- package/lib/typescript/trust/common/build-chain.d.ts.map +1 -1
- package/lib/typescript/trust/common/types.d.ts +32 -1198
- package/lib/typescript/trust/common/types.d.ts.map +1 -1
- package/lib/typescript/trust/common/utils.d.ts.map +1 -1
- package/lib/typescript/trust/v1.0.0/build-chain.d.ts +1 -53
- package/lib/typescript/trust/v1.0.0/build-chain.d.ts.map +1 -1
- package/lib/typescript/trust/v1.0.0/entities.d.ts +324 -347
- package/lib/typescript/trust/v1.0.0/entities.d.ts.map +1 -1
- package/lib/typescript/trust/v1.0.0/mappers.d.ts +31 -35
- package/lib/typescript/trust/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/trust/v1.0.0/types.d.ts +678 -12454
- package/lib/typescript/trust/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/trust/v1.0.0/verify-chain.d.ts +4 -56
- package/lib/typescript/trust/v1.0.0/verify-chain.d.ts.map +1 -1
- package/lib/typescript/trust/v1.3.3/entities.d.ts +43 -47
- package/lib/typescript/trust/v1.3.3/entities.d.ts.map +1 -1
- package/lib/typescript/trust/v1.3.3/types.d.ts +655 -14339
- package/lib/typescript/trust/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/utils/auth.d.ts +3 -25
- package/lib/typescript/utils/auth.d.ts.map +1 -1
- package/lib/typescript/utils/callbacks.d.ts.map +1 -1
- package/lib/typescript/utils/config.d.ts +3 -3
- package/lib/typescript/utils/config.d.ts.map +1 -1
- package/lib/typescript/utils/credentials.d.ts.map +1 -1
- package/lib/typescript/utils/crypto.d.ts +18 -0
- package/lib/typescript/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/utils/decoder.d.ts.map +1 -1
- package/lib/typescript/utils/dpop.d.ts +5 -12
- package/lib/typescript/utils/dpop.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/jwk.d.ts +15 -175
- package/lib/typescript/utils/jwk.d.ts.map +1 -1
- package/lib/typescript/utils/mappers.d.ts.map +1 -1
- package/lib/typescript/utils/misc.d.ts +2 -2
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/utils/object.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +7 -45
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/utils/parser.d.ts.map +1 -1
- package/lib/typescript/utils/pop.d.ts +1 -9
- package/lib/typescript/utils/pop.d.ts.map +1 -1
- package/lib/typescript/utils/string.d.ts.map +1 -1
- package/lib/typescript/utils/zod.d.ts +4 -4
- package/lib/typescript/utils/zod.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/api/index.d.ts +9 -9
- package/lib/typescript/wallet-instance-attestation/api/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts +19 -174
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/common/types.d.ts +14 -273
- package/lib/typescript/wallet-instance-attestation/common/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.0.0/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts +5 -3
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.0.0/types.d.ts +39 -629
- package/lib/typescript/wallet-instance-attestation/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts +90 -0
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts +29 -891
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/utils.d.ts +15 -0
- package/lib/typescript/wallet-instance-attestation/v1.3.3/utils.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/api/index.d.ts +39 -0
- package/lib/typescript/wallet-unit-attestation/api/index.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts +67 -0
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/index.d.ts +4 -0
- package/lib/typescript/wallet-unit-attestation/index.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.0.0/index.d.ts +3 -0
- package/lib/typescript/wallet-unit-attestation/v1.0.0/index.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/index.d.ts +3 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/index.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/issuing.d.ts +3 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/issuing.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts +107 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts +69 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts.map +1 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/utils.d.ts +7 -0
- package/lib/typescript/wallet-unit-attestation/v1.3.3/utils.d.ts.map +1 -0
- package/package.json +8 -8
- package/src/api/index.ts +4 -0
- package/src/client/generated/wallet-provider.ts +44 -0
- package/src/client/index.ts +5 -1
- package/src/credential/issuance/README.md +2 -0
- package/src/credential/issuance/api/05-obtain-credential.ts +2 -0
- package/src/credential/issuance/api/IssuerConfig.ts +4 -2
- package/src/credential/issuance/v1.3.3/01-evaluate-issuer-trust.ts +8 -3
- package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +2 -0
- package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +25 -11
- package/src/credential/issuance/v1.3.3/mappers.ts +10 -9
- package/src/credential/presentation/api/04-verify-certificate-chain.ts +20 -0
- package/src/credential/presentation/api/{06-send-authorization-response.ts → 07-send-authorization-response.ts} +1 -1
- package/src/credential/presentation/api/RelyingPartyConfig.ts +1 -1
- package/src/credential/presentation/api/index.ts +5 -3
- package/src/credential/presentation/v1.0.0/04-verify-certificate-chain.ts +10 -0
- package/src/credential/presentation/v1.0.0/{04-verify-request-object.ts → 05-verify-request-object.ts} +2 -2
- package/src/credential/presentation/v1.0.0/{05-evaluate-dcql-query.ts → 06-evaluate-dcql-query.ts} +1 -1
- package/src/credential/presentation/v1.0.0/index.ts +5 -3
- package/src/credential/presentation/v1.3.3/04-verify-certificate-chain.ts +49 -0
- package/src/credential/presentation/v1.3.3/{04-verify-request-object.ts → 05-verify-request-object.ts} +4 -2
- package/src/credential/presentation/v1.3.3/{05-evaluate-dcql-query.ts → 06-evaluate-dcql-query.ts} +1 -1
- package/src/credential/presentation/v1.3.3/index.ts +5 -3
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +58 -10
- package/src/credentials-catalogue/api/index.ts +36 -2
- package/src/credentials-catalogue/v1.0.0/mappers.ts +27 -12
- package/src/credentials-catalogue/v1.3.3/fetch-translations.ts +32 -0
- package/src/credentials-catalogue/v1.3.3/index.ts +2 -0
- package/src/credentials-catalogue/v1.3.3/mappers.ts +12 -4
- package/src/credentials-catalogue/v1.3.3/types.ts +102 -29
- package/src/credentials-catalogue/v1.3.3/utils.ts +42 -4
- package/src/index.ts +11 -2
- package/src/trust/common/types.ts +3 -3
- package/src/trust/v1.0.0/types.ts +10 -10
- package/src/trust/v1.3.3/types.ts +4 -7
- package/src/utils/callbacks.ts +7 -1
- package/src/utils/crypto.ts +18 -0
- package/src/utils/dpop.ts +1 -1
- package/src/utils/jwk.ts +1 -1
- package/src/utils/mappers.ts +2 -2
- package/src/utils/zod.ts +5 -1
- package/src/wallet-instance-attestation/README.md +13 -10
- package/src/wallet-instance-attestation/api/index.ts +20 -13
- package/src/wallet-instance-attestation/api/types.ts +16 -4
- package/src/wallet-instance-attestation/v1.0.0/index.ts +3 -3
- package/src/wallet-instance-attestation/v1.0.0/issuing.ts +7 -9
- package/src/wallet-instance-attestation/v1.0.0/mappers.ts +7 -5
- package/src/wallet-instance-attestation/v1.3.3/index.ts +5 -7
- package/src/wallet-instance-attestation/v1.3.3/issuing.ts +107 -3
- package/src/wallet-instance-attestation/v1.3.3/mappers.ts +18 -0
- package/src/wallet-instance-attestation/v1.3.3/types.ts +16 -30
- package/src/wallet-instance-attestation/v1.3.3/utils.ts +35 -0
- package/src/wallet-unit-attestation/README.md +73 -0
- package/src/wallet-unit-attestation/api/index.ts +51 -0
- package/src/wallet-unit-attestation/api/types.ts +49 -0
- package/src/wallet-unit-attestation/index.ts +3 -0
- package/src/wallet-unit-attestation/v1.0.0/index.ts +5 -0
- package/src/wallet-unit-attestation/v1.3.3/index.ts +11 -0
- package/src/wallet-unit-attestation/v1.3.3/issuing.ts +147 -0
- package/src/wallet-unit-attestation/v1.3.3/mappers.ts +10 -0
- package/src/wallet-unit-attestation/v1.3.3/types.ts +21 -0
- package/src/wallet-unit-attestation/v1.3.3/utils.ts +14 -0
- package/lib/commonjs/credential/presentation/api/04-verify-request-object.js.map +0 -1
- package/lib/commonjs/credential/presentation/api/05-evaluate-dcql-query.js.map +0 -1
- package/lib/commonjs/credential/presentation/api/06-send-authorization-response.js.map +0 -1
- package/lib/commonjs/credential/presentation/v1.3.3/04-verify-request-object.js.map +0 -1
- package/lib/module/credential/presentation/api/04-verify-request-object.js +0 -2
- package/lib/module/credential/presentation/api/04-verify-request-object.js.map +0 -1
- package/lib/module/credential/presentation/api/05-evaluate-dcql-query.js +0 -2
- package/lib/module/credential/presentation/api/05-evaluate-dcql-query.js.map +0 -1
- package/lib/module/credential/presentation/api/06-send-authorization-response.js +0 -2
- package/lib/module/credential/presentation/api/06-send-authorization-response.js.map +0 -1
- package/lib/module/credential/presentation/v1.3.3/04-verify-request-object.js.map +0 -1
- package/lib/typescript/credential/presentation/v1.0.0/04-verify-request-object.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.0.0/05-evaluate-dcql-query.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.0.0/06-send-authorization-response.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.3.3/04-verify-request-object.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.3.3/05-evaluate-dcql-query.d.ts.map +0 -1
- /package/src/credential/presentation/api/{04-verify-request-object.ts → 05-verify-request-object.ts} +0 -0
- /package/src/credential/presentation/api/{05-evaluate-dcql-query.ts → 06-evaluate-dcql-query.ts} +0 -0
- /package/src/credential/presentation/v1.0.0/{06-send-authorization-response.ts → 07-send-authorization-response.ts} +0 -0
- /package/src/credential/presentation/v1.3.3/{06-send-authorization-response.ts → 07-send-authorization-response.ts} +0 -0
|
@@ -3,11 +3,11 @@ import { createTokenDPoP } from "@pagopa/io-wallet-oauth2";
|
|
|
3
3
|
import {
|
|
4
4
|
fetchCredentialResponse,
|
|
5
5
|
createCredentialRequest,
|
|
6
|
-
type CredentialRequestOptionsV1_3,
|
|
7
6
|
} from "@pagopa/io-wallet-oid4vci";
|
|
8
7
|
import { UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError } from "@pagopa/io-wallet-utils";
|
|
9
8
|
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
10
9
|
import {
|
|
10
|
+
IoWalletError,
|
|
11
11
|
IssuerResponseError,
|
|
12
12
|
IssuerResponseErrorCodes,
|
|
13
13
|
ResponseErrorBuilder,
|
|
@@ -50,9 +50,17 @@ export const obtainCredential: IssuanceApi["obtainCredential"] = async (
|
|
|
50
50
|
) => {
|
|
51
51
|
const {
|
|
52
52
|
credentialCryptoContext,
|
|
53
|
-
appFetch = fetch,
|
|
54
53
|
dPopCryptoContext,
|
|
54
|
+
walletUnitAttestation,
|
|
55
|
+
appFetch = fetch,
|
|
55
56
|
} = context;
|
|
57
|
+
if (!walletUnitAttestation) {
|
|
58
|
+
throw new ValidationFailed({
|
|
59
|
+
message:
|
|
60
|
+
"The Wallet Unit Attestation is required to obtain the credential",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
const { credential_configuration_id, credential_identifier } =
|
|
57
65
|
credentialDefinition;
|
|
58
66
|
|
|
@@ -88,8 +96,9 @@ export const obtainCredential: IssuanceApi["obtainCredential"] = async (
|
|
|
88
96
|
const signerJwk = await credentialCryptoContext.getPublicKey();
|
|
89
97
|
|
|
90
98
|
const credentialRequest = await createCredentialRequest({
|
|
91
|
-
config: sdkConfigV1_3
|
|
99
|
+
config: sdkConfigV1_3,
|
|
92
100
|
callbacks: {
|
|
101
|
+
hash: partialCallbacks.hash,
|
|
93
102
|
signJwt: async (_, payload) => ({
|
|
94
103
|
jwt: await new SignJWT(credentialCryptoContext)
|
|
95
104
|
.setPayload(payload)
|
|
@@ -101,12 +110,14 @@ export const obtainCredential: IssuanceApi["obtainCredential"] = async (
|
|
|
101
110
|
credential_identifier: credentialDefinition.credential_identifier!,
|
|
102
111
|
issuerIdentifier: issuerConf.credential_issuer,
|
|
103
112
|
nonce: c_nonce,
|
|
104
|
-
keyAttestation:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
keyAttestation: walletUnitAttestation,
|
|
114
|
+
signers: [
|
|
115
|
+
{
|
|
116
|
+
alg: "ES256",
|
|
117
|
+
method: "jwk",
|
|
118
|
+
publicJwk: signerJwk,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
110
121
|
});
|
|
111
122
|
|
|
112
123
|
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
@@ -131,7 +142,6 @@ export const obtainCredential: IssuanceApi["obtainCredential"] = async (
|
|
|
131
142
|
accessToken: accessToken.access_token,
|
|
132
143
|
});
|
|
133
144
|
|
|
134
|
-
// TODO: handle issuance errors
|
|
135
145
|
const credentialRes = await fetchCredentialResponse({
|
|
136
146
|
callbacks: {
|
|
137
147
|
fetch: appFetch,
|
|
@@ -151,9 +161,13 @@ export const obtainCredential: IssuanceApi["obtainCredential"] = async (
|
|
|
151
161
|
const issuerCredentialConfig =
|
|
152
162
|
issuerConf.credential_configurations_supported[credential_configuration_id];
|
|
153
163
|
|
|
164
|
+
if ("transaction_id" in credentialRes) {
|
|
165
|
+
throw new IoWalletError("Deferred issuance is not supported");
|
|
166
|
+
}
|
|
167
|
+
|
|
154
168
|
// TODO: [SIW-2264] Handle multiple credentials
|
|
155
169
|
return {
|
|
156
|
-
credential: credentialRes.credentials
|
|
170
|
+
credential: credentialRes.credentials.at(0)!.credential,
|
|
157
171
|
format: issuerCredentialConfig!.format,
|
|
158
172
|
};
|
|
159
173
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MetadataResponseV1_3 } from "@pagopa/io-wallet-oid4vci";
|
|
2
2
|
import type { ParsedAuthorizeRequestResult } from "@pagopa/io-wallet-oid4vp";
|
|
3
3
|
import { assert } from "../../../utils/misc";
|
|
4
4
|
import { createMapper } from "../../../utils/mappers";
|
|
@@ -9,12 +9,12 @@ import { IssuerConfig } from "../api/IssuerConfig";
|
|
|
9
9
|
type CredentialConfigurations =
|
|
10
10
|
IssuerConfig["credential_configurations_supported"];
|
|
11
11
|
type OpenIdCredentialIssuer =
|
|
12
|
-
|
|
12
|
+
MetadataResponseV1_3["metadata"]["openid_credential_issuer"];
|
|
13
13
|
|
|
14
14
|
const mapCredentialConfigurationsSupported = (
|
|
15
|
-
oidIssuer: OpenIdCredentialIssuer
|
|
15
|
+
oidIssuer: NonNullable<OpenIdCredentialIssuer>
|
|
16
16
|
): CredentialConfigurations =>
|
|
17
|
-
Object.entries(oidIssuer
|
|
17
|
+
Object.entries(oidIssuer.credential_configurations_supported).reduce(
|
|
18
18
|
(acc, [key, config]) => {
|
|
19
19
|
acc[key] = {
|
|
20
20
|
...(config.format === "dc+sd-jwt"
|
|
@@ -33,7 +33,10 @@ const mapCredentialConfigurationsSupported = (
|
|
|
33
33
|
{} as CredentialConfigurations
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
export const mapToIssuerConfig = createMapper<
|
|
36
|
+
export const mapToIssuerConfig = createMapper<
|
|
37
|
+
MetadataResponseV1_3,
|
|
38
|
+
IssuerConfig
|
|
39
|
+
>(
|
|
37
40
|
(x) => {
|
|
38
41
|
const {
|
|
39
42
|
oauth_authorization_server,
|
|
@@ -61,8 +64,6 @@ export const mapToIssuerConfig = createMapper<MetadataResponse, IssuerConfig>(
|
|
|
61
64
|
pushed_authorization_request_endpoint:
|
|
62
65
|
oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
63
66
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
64
|
-
status_assertion_endpoint:
|
|
65
|
-
openid_credential_issuer.status_attestation_endpoint,
|
|
66
67
|
nonce_endpoint: openid_credential_issuer.nonce_endpoint!,
|
|
67
68
|
federation_entity: federation_entity ?? {},
|
|
68
69
|
credential_issuance_batch_size:
|
|
@@ -78,9 +79,9 @@ export const mapToRequestObject = createMapper<
|
|
|
78
79
|
>(({ payload }) => ({
|
|
79
80
|
iss: payload.iss ?? "UNKNOWN_ISSUER",
|
|
80
81
|
client_id: payload.client_id,
|
|
81
|
-
dcql_query: payload.dcql_query
|
|
82
|
+
dcql_query: payload.dcql_query,
|
|
82
83
|
nonce: payload.nonce,
|
|
83
|
-
response_uri: payload.response_uri
|
|
84
|
+
response_uri: payload.response_uri,
|
|
84
85
|
state: payload.state,
|
|
85
86
|
response_mode: payload.response_mode,
|
|
86
87
|
response_type: payload.response_type,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CertificateValidationResult } from "@pagopa/io-react-native-crypto";
|
|
2
|
+
|
|
3
|
+
export interface VerifyAuthRequestCertificateChainApi {
|
|
4
|
+
/**
|
|
5
|
+
* Verify the X.509 certificate chain in the Request Object `x5c` header claim.
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* @param requestObjectJwt The Request Object in JWT format
|
|
9
|
+
* @param params.caRootCert The CA root certificate used to validate the chain
|
|
10
|
+
* @returns The certificate validation result
|
|
11
|
+
* @throws {MissingX509CertsError} if the Request Object does not contain x5c
|
|
12
|
+
* @throws {X509ValidationError} if the certificate chain validation fails
|
|
13
|
+
*/
|
|
14
|
+
verifyAuthRequestCertificateChain(
|
|
15
|
+
requestObjectJwt: string,
|
|
16
|
+
params: {
|
|
17
|
+
caRootCert: string;
|
|
18
|
+
}
|
|
19
|
+
): Promise<CertificateValidationResult>;
|
|
20
|
+
}
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
RequestObject,
|
|
6
6
|
} from "./types";
|
|
7
7
|
import type { RelyingPartyConfig } from "./RelyingPartyConfig";
|
|
8
|
-
import type { EvaluateDcqlQueryApi } from "./
|
|
8
|
+
import type { EvaluateDcqlQueryApi } from "./06-evaluate-dcql-query";
|
|
9
9
|
import type { Out } from "../../../../src/utils/misc";
|
|
10
10
|
type FetchContext = { appFetch?: GlobalFetch["fetch"] };
|
|
11
11
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { StartFlowApi } from "./01-start-flow";
|
|
2
2
|
import type { EvaluateRelyingPartyTrustApi } from "./02-evaluate-rp-trust";
|
|
3
3
|
import type { GetRequestObjectApi } from "./03-get-request-object";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { VerifyAuthRequestCertificateChainApi } from "./04-verify-certificate-chain";
|
|
5
|
+
import type { VerifyRequestObjectApi } from "./05-verify-request-object";
|
|
6
|
+
import type { EvaluateDcqlQueryApi } from "./06-evaluate-dcql-query";
|
|
7
|
+
import type { SendAuthorizationResponseApi } from "./07-send-authorization-response";
|
|
7
8
|
import type { RelyingPartyConfig } from "./RelyingPartyConfig";
|
|
8
9
|
|
|
9
10
|
export interface RemotePresentationApi
|
|
10
11
|
extends StartFlowApi,
|
|
11
12
|
EvaluateRelyingPartyTrustApi,
|
|
12
13
|
GetRequestObjectApi,
|
|
14
|
+
VerifyAuthRequestCertificateChainApi,
|
|
13
15
|
VerifyRequestObjectApi,
|
|
14
16
|
EvaluateDcqlQueryApi,
|
|
15
17
|
SendAuthorizationResponseApi {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UnimplementedFeatureError } from "../../../utils/errors";
|
|
2
|
+
import { type RemotePresentationApi } from "../api";
|
|
3
|
+
|
|
4
|
+
export const verifyAuthRequestCertificateChain: RemotePresentationApi["verifyAuthRequestCertificateChain"] =
|
|
5
|
+
async () => {
|
|
6
|
+
throw new UnimplementedFeatureError(
|
|
7
|
+
"verifyAuthRequestCertificateChain",
|
|
8
|
+
"1.0.0"
|
|
9
|
+
);
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { decode as decodeJwt, verify } from "@pagopa/io-react-native-jwt";
|
|
2
|
-
import { type
|
|
2
|
+
import { type z } from "zod";
|
|
3
3
|
import type { RelyingPartyConfig, RemotePresentationApi } from "../api";
|
|
4
4
|
import { InvalidRequestObjectError } from "../common/errors";
|
|
5
5
|
import { RequestObjectPayload } from "./types";
|
|
@@ -97,7 +97,7 @@ const getSigPublicKey = (
|
|
|
97
97
|
* Utility to format flattened Zod errors into a simplified string `key1: key1_error, key2: key2_error`
|
|
98
98
|
*/
|
|
99
99
|
const formatFlattenedZodErrors = (
|
|
100
|
-
errors:
|
|
100
|
+
errors: z.core.$ZodFlattenedError<RequestObjectPayload>
|
|
101
101
|
): string =>
|
|
102
102
|
Object.entries(errors.fieldErrors)
|
|
103
103
|
.map(([key, error]) => `${key}: ${error[0]}`)
|
package/src/credential/presentation/v1.0.0/{05-evaluate-dcql-query.ts → 06-evaluate-dcql-query.ts}
RENAMED
|
@@ -2,7 +2,7 @@ import { DcqlQuery, DcqlError } from "dcql";
|
|
|
2
2
|
import { isValiError } from "valibot";
|
|
3
3
|
import { CredentialsNotFoundError } from "../common/errors";
|
|
4
4
|
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
5
|
-
import type { CredentialPurpose } from "../api/
|
|
5
|
+
import type { CredentialPurpose } from "../api/06-evaluate-dcql-query";
|
|
6
6
|
import * as sdJwtUtils from "../common/utils/sd-jwt";
|
|
7
7
|
import {
|
|
8
8
|
extractFailedCredentialsDetails,
|
|
@@ -2,18 +2,20 @@ import type { RemotePresentationApi } from "../api";
|
|
|
2
2
|
import { startFlowFromQR } from "./01-start-flow";
|
|
3
3
|
import { evaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
|
|
4
4
|
import { getRequestObject } from "./03-get-request-object";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { verifyAuthRequestCertificateChain } from "./04-verify-certificate-chain";
|
|
6
|
+
import { verifyRequestObject } from "./05-verify-request-object";
|
|
7
|
+
import { evaluateDcqlQuery } from "./06-evaluate-dcql-query";
|
|
7
8
|
import {
|
|
8
9
|
prepareRemotePresentations,
|
|
9
10
|
sendAuthorizationResponse,
|
|
10
11
|
sendAuthorizationErrorResponse,
|
|
11
|
-
} from "./
|
|
12
|
+
} from "./07-send-authorization-response";
|
|
12
13
|
|
|
13
14
|
export const RemotePresentation: RemotePresentationApi = {
|
|
14
15
|
startFlowFromQR,
|
|
15
16
|
evaluateRelyingPartyTrust,
|
|
16
17
|
getRequestObject,
|
|
18
|
+
verifyAuthRequestCertificateChain,
|
|
17
19
|
verifyRequestObject,
|
|
18
20
|
evaluateDcqlQuery,
|
|
19
21
|
prepareRemotePresentations,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { RemotePresentationApi } from "../api";
|
|
2
|
+
import { decode } from "@pagopa/io-react-native-jwt";
|
|
3
|
+
import {
|
|
4
|
+
verifyCertificateChain,
|
|
5
|
+
type X509CertificateOptions,
|
|
6
|
+
} from "@pagopa/io-react-native-crypto";
|
|
7
|
+
import {
|
|
8
|
+
MissingX509CertsError,
|
|
9
|
+
X509ValidationError,
|
|
10
|
+
} from "../../../trust/common/errors";
|
|
11
|
+
import { Logger, LogLevel } from "../../../utils/logging";
|
|
12
|
+
|
|
13
|
+
export const verifyAuthRequestCertificateChain: RemotePresentationApi["verifyAuthRequestCertificateChain"] =
|
|
14
|
+
async (requestObjectJwt, { caRootCert }) => {
|
|
15
|
+
const x509Options: X509CertificateOptions = {
|
|
16
|
+
requireCrl: false,
|
|
17
|
+
connectTimeout: 10_000,
|
|
18
|
+
readTimeout: 10_000,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const requestObject = decode(requestObjectJwt);
|
|
22
|
+
|
|
23
|
+
const certChain = requestObject.protectedHeader.x5c;
|
|
24
|
+
|
|
25
|
+
if (!certChain) {
|
|
26
|
+
throw new MissingX509CertsError(
|
|
27
|
+
"No certificate chain (x5c) found in the Request Object"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const validationResult = await verifyCertificateChain(
|
|
32
|
+
certChain,
|
|
33
|
+
caRootCert,
|
|
34
|
+
x509Options
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (!validationResult.isValid) {
|
|
38
|
+
Logger.log(
|
|
39
|
+
LogLevel.ERROR,
|
|
40
|
+
`Certificate chain failure: ${validationResult.validationStatus} - ${validationResult.errorMessage}`
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
throw new X509ValidationError(
|
|
44
|
+
"X.509 certificate chain validation failed"
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return validationResult;
|
|
49
|
+
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { RemotePresentationApi } from "../api";
|
|
2
2
|
import { parseAuthorizeRequest as sdkParseAuthorizeRequest } from "@pagopa/io-wallet-oid4vp";
|
|
3
3
|
import { partialCallbacks } from "../../../utils/callbacks";
|
|
4
|
-
import {
|
|
5
|
-
import { mapSdkRequestObjectError } from "./sdkErrorMapper";
|
|
4
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
6
5
|
import { InvalidRequestObjectError } from "../common/errors";
|
|
6
|
+
import { mapSdkRequestObjectError } from "./sdkErrorMapper";
|
|
7
|
+
import { mapToRequestObject } from "./mappers";
|
|
7
8
|
|
|
8
9
|
export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
9
10
|
async (requestObjectEncodedJwt, { clientId, rpConf }) => {
|
|
10
11
|
const parsedRequestObject = await sdkParseAuthorizeRequest({
|
|
12
|
+
config: sdkConfigV1_3,
|
|
11
13
|
requestObjectJwt: requestObjectEncodedJwt,
|
|
12
14
|
callbacks: {
|
|
13
15
|
verifyJwt: partialCallbacks.verifyJwt,
|
package/src/credential/presentation/v1.3.3/{05-evaluate-dcql-query.ts → 06-evaluate-dcql-query.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DcqlQuery, DcqlError } from "dcql";
|
|
2
2
|
import { isValiError } from "valibot";
|
|
3
3
|
import { CredentialsNotFoundError } from "../common/errors";
|
|
4
|
-
import type { CredentialPurpose } from "../api/
|
|
4
|
+
import type { CredentialPurpose } from "../api/06-evaluate-dcql-query";
|
|
5
5
|
import * as mdocUtils from "./utils.mdoc";
|
|
6
6
|
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
7
7
|
import * as sdJwtUtils from "../common/utils/sd-jwt";
|
|
@@ -2,18 +2,20 @@ import type { RemotePresentationApi } from "../api";
|
|
|
2
2
|
import { startFlowFromQR } from "./01-start-flow";
|
|
3
3
|
import { evaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
|
|
4
4
|
import { getRequestObject } from "./03-get-request-object";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { verifyAuthRequestCertificateChain } from "./04-verify-certificate-chain";
|
|
6
|
+
import { verifyRequestObject } from "./05-verify-request-object";
|
|
7
|
+
import { evaluateDcqlQuery } from "./06-evaluate-dcql-query";
|
|
7
8
|
import {
|
|
8
9
|
prepareRemotePresentations,
|
|
9
10
|
sendAuthorizationResponse,
|
|
10
11
|
sendAuthorizationErrorResponse,
|
|
11
|
-
} from "./
|
|
12
|
+
} from "./07-send-authorization-response";
|
|
12
13
|
|
|
13
14
|
export const RemotePresentation: RemotePresentationApi = {
|
|
14
15
|
startFlowFromQR,
|
|
15
16
|
evaluateRelyingPartyTrust,
|
|
16
17
|
getRequestObject,
|
|
18
|
+
verifyAuthRequestCertificateChain,
|
|
17
19
|
verifyRequestObject,
|
|
18
20
|
evaluateDcqlQuery,
|
|
19
21
|
prepareRemotePresentations,
|
|
@@ -1,28 +1,59 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { UnixTime } from "../../utils/zod";
|
|
3
3
|
|
|
4
|
+
export const LocalizationInfo = z.object({
|
|
5
|
+
available_locales: z.array(z.string()),
|
|
6
|
+
base_uri: z.string(),
|
|
7
|
+
default_locale: z.string(),
|
|
8
|
+
version: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export type LocalizationInfo = z.infer<typeof LocalizationInfo>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Merged translations for one or more locales, keyed by locale code.
|
|
14
|
+
* Each locale maps l10n_id keys to their translated string values.
|
|
15
|
+
*/
|
|
16
|
+
export type CatalogueTranslations = Record<string, Record<string, string>>;
|
|
17
|
+
|
|
18
|
+
const AdministrativeExpirationUserInfo = z.object({
|
|
19
|
+
title_l10n_id: z.string(),
|
|
20
|
+
description_l10n_id: z.string(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const AllowedState = z
|
|
24
|
+
.object({
|
|
25
|
+
title_l10n_id: z.string(),
|
|
26
|
+
description_l10n_id: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.catchall(z.string());
|
|
29
|
+
|
|
4
30
|
const CredentialPurpose = z.object({
|
|
5
31
|
id: z.string(),
|
|
6
|
-
description: z.string(),
|
|
7
|
-
claims_required: z.array(z.string()),
|
|
8
|
-
claim_recommended: z.array(z.string()),
|
|
32
|
+
description: z.string().optional(),
|
|
33
|
+
claims_required: z.array(z.string()).optional(),
|
|
34
|
+
claim_recommended: z.array(z.string()).optional(),
|
|
9
35
|
});
|
|
10
36
|
|
|
11
37
|
const CredentialIssuer = z.object({
|
|
12
38
|
id: z.string(),
|
|
13
|
-
organization_name: z.string(),
|
|
39
|
+
organization_name: z.string().optional(),
|
|
40
|
+
organization_name_l10n_id: z.string().optional(),
|
|
14
41
|
organization_code: z.string(),
|
|
15
42
|
organization_country: z.string(),
|
|
43
|
+
legal_type: z.string().optional(),
|
|
16
44
|
contacts: z.array(z.string()).optional(),
|
|
17
45
|
homepage_uri: z.string().optional(),
|
|
18
46
|
logo_uri: z.string().optional(),
|
|
19
47
|
policy_uri: z.string().optional(),
|
|
20
48
|
tos_uri: z.string().optional(),
|
|
49
|
+
service_documentation: z.string().optional(),
|
|
50
|
+
issuance_flows: z.object({ deferred_flow: z.boolean() }).optional(),
|
|
21
51
|
});
|
|
22
52
|
|
|
23
53
|
const AuthenticSource = z.object({
|
|
24
54
|
id: z.string(),
|
|
25
|
-
organization_name: z.string(),
|
|
55
|
+
organization_name: z.string().optional(),
|
|
56
|
+
organization_name_l10n_id: z.string().optional(),
|
|
26
57
|
organization_code: z.string().optional(),
|
|
27
58
|
organization_country: z.string(),
|
|
28
59
|
organization_type: z.string(),
|
|
@@ -57,17 +88,32 @@ export const DigitalCredential = z.object({
|
|
|
57
88
|
version: z.string(),
|
|
58
89
|
credential_type: z.string(),
|
|
59
90
|
legal_type: z.string(),
|
|
60
|
-
name: z.string(),
|
|
61
|
-
|
|
91
|
+
name: z.string().optional(),
|
|
92
|
+
name_l10n_id: z.string().optional(),
|
|
93
|
+
description: z.string().optional(),
|
|
94
|
+
restriction_policy: z
|
|
95
|
+
.object({
|
|
96
|
+
presentation_flows: z.object({
|
|
97
|
+
remote: z.boolean(),
|
|
98
|
+
proximity: z.boolean(),
|
|
99
|
+
}),
|
|
100
|
+
})
|
|
101
|
+
.optional(),
|
|
62
102
|
validity_info: z.object({
|
|
63
103
|
max_validity_days: z.number(),
|
|
64
104
|
status_methods: z.array(z.string()),
|
|
65
|
-
|
|
105
|
+
administrative_expiration_user_info:
|
|
106
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
107
|
+
allowed_states: z.array(z.union([z.string(), AllowedState])),
|
|
66
108
|
}),
|
|
67
|
-
|
|
109
|
+
administrative_expiration_user_info:
|
|
110
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
111
|
+
domains: z.array(z.string()).optional(),
|
|
112
|
+
classes: z.array(z.string()).optional(),
|
|
113
|
+
purposes: z.array(z.union([z.string(), CredentialPurpose])),
|
|
68
114
|
issuers: z.array(CredentialIssuer),
|
|
69
115
|
authentic_sources: z.array(AuthenticSource),
|
|
70
|
-
formats: z.array(CredentialFormat),
|
|
116
|
+
formats: z.array(CredentialFormat).optional(),
|
|
71
117
|
// claims: z.array(Claim), // TODO: [SIW-3978] Should we keep claims?
|
|
72
118
|
});
|
|
73
119
|
|
|
@@ -76,6 +122,8 @@ export const DigitalCredentialsCatalogue = z.object({
|
|
|
76
122
|
credentials: z.array(DigitalCredential),
|
|
77
123
|
iat: UnixTime,
|
|
78
124
|
exp: UnixTime,
|
|
125
|
+
localization: LocalizationInfo.optional(),
|
|
126
|
+
as_localization: LocalizationInfo.optional(),
|
|
79
127
|
});
|
|
80
128
|
export type DigitalCredentialsCatalogue = z.infer<
|
|
81
129
|
typeof DigitalCredentialsCatalogue
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type CatalogueTranslations,
|
|
3
|
+
type DigitalCredentialsCatalogue,
|
|
4
|
+
type LocalizationInfo,
|
|
5
|
+
} from "./DigitalCredentialsCatalogue";
|
|
2
6
|
|
|
3
7
|
type FetchContext = { appFetch?: GlobalFetch["fetch"] };
|
|
4
8
|
|
|
9
|
+
type FetchTranslationsLocalizations = {
|
|
10
|
+
catalogue?: LocalizationInfo;
|
|
11
|
+
authenticSources?: LocalizationInfo;
|
|
12
|
+
};
|
|
13
|
+
|
|
5
14
|
export interface CredentialsCatalogueApi {
|
|
6
15
|
/**
|
|
7
16
|
* Fetch and parse the Digital Credential Catalogue from the Trust Anchor.
|
|
@@ -16,6 +25,31 @@ export interface CredentialsCatalogueApi {
|
|
|
16
25
|
trustAnchorBaseUrl: string,
|
|
17
26
|
ctx?: FetchContext
|
|
18
27
|
): Promise<DigitalCredentialsCatalogue>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetch locale bundle files for the credential catalogue and authentic sources.
|
|
31
|
+
* For each requested locale, fetches translations from both registries (if the locale
|
|
32
|
+
* is listed in their respective `available_locales`) and merges the keys.
|
|
33
|
+
* Locales not present in a registry's `available_locales` are silently skipped for that source.
|
|
34
|
+
* On key conflicts, authentic-sources translations take precedence.
|
|
35
|
+
*
|
|
36
|
+
* Optional: not supported by all versions. Check for existence before calling.
|
|
37
|
+
*
|
|
38
|
+
* @since 1.3.3
|
|
39
|
+
* @param localizations Localization metadata from a previously fetched catalogue
|
|
40
|
+
* @param locales Array of locale codes to fetch (e.g. ["it", "en"])
|
|
41
|
+
* @param ctx.appFetch (optional) fetch API implementation. Default: built-in fetch
|
|
42
|
+
* @returns Record keyed by locale, each containing merged translation key→value pairs
|
|
43
|
+
*/
|
|
44
|
+
fetchTranslations?(
|
|
45
|
+
localizations: FetchTranslationsLocalizations,
|
|
46
|
+
locales: string[],
|
|
47
|
+
ctx?: FetchContext
|
|
48
|
+
): Promise<CatalogueTranslations>;
|
|
19
49
|
}
|
|
20
50
|
|
|
21
|
-
export {
|
|
51
|
+
export {
|
|
52
|
+
type CatalogueTranslations,
|
|
53
|
+
type DigitalCredentialsCatalogue,
|
|
54
|
+
type LocalizationInfo,
|
|
55
|
+
};
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { createMapper } from "../../utils/mappers";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
DigitalCredentialsCatalogue,
|
|
4
|
+
type DigitalCredentialsCatalogue as DigitalCredentialsCatalogueType,
|
|
5
|
+
} from "../api/DigitalCredentialsCatalogue";
|
|
6
|
+
import {
|
|
7
|
+
DigitalCredentialsCatalogueJwt,
|
|
8
|
+
type DigitalCredentialsCatalogueJwt as DigitalCredentialsCatalogueJwtType,
|
|
9
|
+
} from "./types";
|
|
4
10
|
|
|
5
|
-
export const mapToCredentialsCatalogue = createMapper
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export const mapToCredentialsCatalogue = createMapper<
|
|
12
|
+
DigitalCredentialsCatalogueJwtType,
|
|
13
|
+
DigitalCredentialsCatalogueType
|
|
14
|
+
>(
|
|
15
|
+
({ payload }) => {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
+
const { catalog_version, ...rest } = payload;
|
|
18
|
+
return {
|
|
19
|
+
...rest,
|
|
20
|
+
credentials: payload.credentials.map((credential) => ({
|
|
21
|
+
...credential,
|
|
22
|
+
authentic_sources: credential.authentic_sources.map(
|
|
23
|
+
({ source_type, ...as }) => ({
|
|
24
|
+
...as,
|
|
25
|
+
organization_type: source_type,
|
|
26
|
+
})
|
|
27
|
+
),
|
|
13
28
|
})),
|
|
14
|
-
}
|
|
15
|
-
}
|
|
29
|
+
};
|
|
30
|
+
},
|
|
16
31
|
{
|
|
17
32
|
inputSchema: DigitalCredentialsCatalogueJwt,
|
|
18
33
|
outputSchema: DigitalCredentialsCatalogue,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CredentialsCatalogueApi as Api } from "../api";
|
|
2
|
+
import { fetchLocaleBundle } from "./utils";
|
|
3
|
+
|
|
4
|
+
export const fetchTranslations: NonNullable<Api["fetchTranslations"]> = async (
|
|
5
|
+
{ catalogue, authenticSources },
|
|
6
|
+
locales,
|
|
7
|
+
{ appFetch = fetch } = {}
|
|
8
|
+
) => {
|
|
9
|
+
const result: Record<string, Record<string, string>> = {};
|
|
10
|
+
|
|
11
|
+
await Promise.all(
|
|
12
|
+
locales.map(async (locale) => {
|
|
13
|
+
const [catalogueBundle, asBundle] = await Promise.all([
|
|
14
|
+
catalogue?.available_locales.includes(locale)
|
|
15
|
+
? fetchLocaleBundle(catalogue.base_uri, locale, appFetch)
|
|
16
|
+
: Promise.resolve({}),
|
|
17
|
+
authenticSources?.available_locales.includes(locale)
|
|
18
|
+
? fetchLocaleBundle(authenticSources.base_uri, locale, appFetch)
|
|
19
|
+
: Promise.resolve({}),
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const merged = { ...catalogueBundle, ...asBundle };
|
|
23
|
+
|
|
24
|
+
// Only include the locale in the result if at least one source provided translations
|
|
25
|
+
if (Object.keys(merged).length > 0) {
|
|
26
|
+
result[locale] = merged;
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CredentialsCatalogueApi } from "../api";
|
|
2
2
|
import { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
|
|
3
|
+
import { fetchTranslations } from "./fetch-translations";
|
|
3
4
|
|
|
4
5
|
export const CredentialsCatalogue: CredentialsCatalogueApi = {
|
|
5
6
|
fetchAndParseCatalogue,
|
|
7
|
+
fetchTranslations,
|
|
6
8
|
};
|
|
@@ -40,8 +40,14 @@ export const mapToCredentialsCatalogue = createMapper<
|
|
|
40
40
|
}): ApiAuthenticSource => {
|
|
41
41
|
const as = authSourcesById.get(id);
|
|
42
42
|
assert(as, `AS ${id} must be present in the Authentic Source Registry`);
|
|
43
|
-
const { ipa_code, ...rest } =
|
|
44
|
-
|
|
43
|
+
const { ipa_code, organization_name_l10n_id, ...rest } =
|
|
44
|
+
as.organization_info;
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
organization_name_l10n_id,
|
|
48
|
+
organization_code: ipa_code,
|
|
49
|
+
...rest,
|
|
50
|
+
};
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
const resolveFormats = (credentialType: string): ApiCredentialFormat[] => {
|
|
@@ -59,9 +65,11 @@ export const mapToCredentialsCatalogue = createMapper<
|
|
|
59
65
|
return {
|
|
60
66
|
...catalogueJwt.payload,
|
|
61
67
|
taxonomy_uri: discoveryJwt.payload.endpoints.taxonomy,
|
|
68
|
+
localization: catalogueJwt.payload.localization,
|
|
69
|
+
as_localization: authSourceRegistry.localization,
|
|
62
70
|
credentials: catalogueJwt.payload.credentials.map(
|
|
63
|
-
({ authentic_sources,
|
|
64
|
-
|
|
71
|
+
({ authentic_sources, credential_name_l10n_id, ...credential }) => ({
|
|
72
|
+
name_l10n_id: credential_name_l10n_id,
|
|
65
73
|
formats: resolveFormats(credential.credential_type),
|
|
66
74
|
authentic_sources: authentic_sources.map(resolveAuthSource),
|
|
67
75
|
...credential,
|