@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
|
@@ -2,8 +2,8 @@ import * as z from "zod";
|
|
|
2
2
|
import { UnixTime } from "../../utils/zod";
|
|
3
3
|
|
|
4
4
|
const ASDataCapability = z.object({
|
|
5
|
+
// required per spec
|
|
5
6
|
dataset_id: z.string(),
|
|
6
|
-
domains: z.array(z.string()),
|
|
7
7
|
intended_purposes: z.array(z.string()),
|
|
8
8
|
available_claims: z.array(
|
|
9
9
|
z.object({
|
|
@@ -12,20 +12,48 @@ const ASDataCapability = z.object({
|
|
|
12
12
|
mandatory: z.boolean(),
|
|
13
13
|
})
|
|
14
14
|
),
|
|
15
|
-
|
|
15
|
+
domains: z.array(z.string()).optional(),
|
|
16
|
+
data_origin_l10n_id: z.string(),
|
|
17
|
+
integration_endpoint: z.string(),
|
|
18
|
+
integration_method: z.string(),
|
|
19
|
+
user_information_l10n_id: z.string(),
|
|
20
|
+
// optional per spec (api_specification required in spec but absent in actual responses)
|
|
21
|
+
api_specification: z.string().optional(),
|
|
22
|
+
background_color: z.string().optional(),
|
|
23
|
+
contacts: z.array(z.string()).optional(),
|
|
24
|
+
data_provision: z
|
|
25
|
+
.object({
|
|
26
|
+
deferred_flow: z.boolean(),
|
|
27
|
+
immediate_flow: z.boolean(),
|
|
28
|
+
})
|
|
29
|
+
.optional(),
|
|
30
|
+
logo_uri: z.string().optional(),
|
|
31
|
+
"logo_uri#integrity": z.string().optional(),
|
|
32
|
+
service_documentation: z.string().optional(),
|
|
33
|
+
update_frequency: z.string().optional(),
|
|
16
34
|
});
|
|
17
35
|
|
|
18
36
|
export const AuthenticSource = z.object({
|
|
19
37
|
entity_id: z.string(),
|
|
20
38
|
organization_info: z.object({
|
|
21
|
-
|
|
39
|
+
// required per spec
|
|
40
|
+
organization_name_l10n_id: z.string(),
|
|
22
41
|
organization_type: z.string(),
|
|
23
42
|
organization_country: z.string(),
|
|
43
|
+
legal_identifier: z.string(),
|
|
44
|
+
homepage_uri: z.string(),
|
|
45
|
+
contacts: z.array(z.string()),
|
|
46
|
+
policy_uri: z.string(),
|
|
47
|
+
// conditional: required for public AS
|
|
24
48
|
ipa_code: z.string().optional(),
|
|
25
|
-
|
|
26
|
-
|
|
49
|
+
// conditional: required for private AS
|
|
50
|
+
tos_uri: z.string().optional(),
|
|
51
|
+
// optional per spec
|
|
27
52
|
logo_uri: z.string().optional(),
|
|
28
|
-
|
|
53
|
+
"logo_uri#integrity": z.string().optional(),
|
|
54
|
+
logo_extended_uri: z.string().optional(),
|
|
55
|
+
"logo_extended_uri#integrity": z.string().optional(),
|
|
56
|
+
dpa_contact: z.string().optional(),
|
|
29
57
|
}),
|
|
30
58
|
data_capabilities: z.array(ASDataCapability),
|
|
31
59
|
});
|
|
@@ -44,42 +72,65 @@ export const Schema = z.object({
|
|
|
44
72
|
});
|
|
45
73
|
export type Schema = z.infer<typeof Schema>;
|
|
46
74
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
claims_required: z.array(z.string()),
|
|
51
|
-
claim_recommended: z.array(z.string()),
|
|
75
|
+
const AdministrativeExpirationUserInfo = z.object({
|
|
76
|
+
title_l10n_id: z.string(),
|
|
77
|
+
description_l10n_id: z.string(),
|
|
52
78
|
});
|
|
53
79
|
|
|
80
|
+
const AllowedState = z
|
|
81
|
+
.object({
|
|
82
|
+
title_l10n_id: z.string(),
|
|
83
|
+
description_l10n_id: z.string(),
|
|
84
|
+
})
|
|
85
|
+
.catchall(z.string());
|
|
86
|
+
|
|
54
87
|
const CredentialIssuer = z.object({
|
|
55
88
|
id: z.string(),
|
|
56
|
-
|
|
89
|
+
organization_name_l10n_id: z.string(),
|
|
57
90
|
organization_code: z.string(),
|
|
58
91
|
organization_country: z.string(),
|
|
92
|
+
legal_type: z.string().optional(),
|
|
59
93
|
contacts: z.array(z.string()).optional(),
|
|
60
94
|
homepage_uri: z.string().optional(),
|
|
61
95
|
logo_uri: z.string().optional(),
|
|
62
96
|
policy_uri: z.string().optional(),
|
|
63
97
|
tos_uri: z.string().optional(),
|
|
98
|
+
service_documentation: z.string().optional(),
|
|
99
|
+
issuance_flows: z.object({ deferred_flow: z.boolean() }).optional(),
|
|
64
100
|
});
|
|
65
101
|
|
|
66
102
|
export const DigitalCredential = z.object({
|
|
67
103
|
version: z.string(),
|
|
68
104
|
credential_type: z.string(),
|
|
69
|
-
|
|
105
|
+
credential_name_l10n_id: z.string(),
|
|
70
106
|
legal_type: z.string(),
|
|
71
|
-
|
|
107
|
+
restriction_policy: z
|
|
108
|
+
.object({
|
|
109
|
+
allowed_wallet_ids: z.array(z.string()).optional(),
|
|
110
|
+
allowed_issuer_ids: z.array(z.string()).optional(),
|
|
111
|
+
presentation_flows: z.object({
|
|
112
|
+
remote: z.boolean(),
|
|
113
|
+
proximity: z.boolean(),
|
|
114
|
+
}),
|
|
115
|
+
})
|
|
116
|
+
.optional(),
|
|
72
117
|
validity_info: z.object({
|
|
73
118
|
max_validity_days: z.number(),
|
|
74
119
|
status_methods: z.array(z.string()),
|
|
75
|
-
|
|
120
|
+
administrative_expiration_user_info:
|
|
121
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
122
|
+
allowed_states: z.array(AllowedState),
|
|
76
123
|
}),
|
|
124
|
+
administrative_expiration_user_info:
|
|
125
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
77
126
|
authentication: z.object({
|
|
78
127
|
user_auth_required: z.boolean(),
|
|
79
128
|
min_loa: z.string(),
|
|
80
|
-
|
|
129
|
+
supported_schemes: z.array(z.string()),
|
|
81
130
|
}),
|
|
82
|
-
|
|
131
|
+
domains: z.array(z.string()).optional(),
|
|
132
|
+
classes: z.array(z.string()).optional(),
|
|
133
|
+
purposes: z.array(z.string()),
|
|
83
134
|
issuers: z.array(CredentialIssuer),
|
|
84
135
|
authentic_sources: z.array(
|
|
85
136
|
z.object({
|
|
@@ -102,7 +153,8 @@ const JwtHeader = z.object({
|
|
|
102
153
|
*/
|
|
103
154
|
export const SchemaRegistry = z.object({
|
|
104
155
|
version: z.string(),
|
|
105
|
-
last_modified: z.string(),
|
|
156
|
+
last_modified: z.string().optional(),
|
|
157
|
+
last_updated: z.string().optional(),
|
|
106
158
|
schemas: z.array(Schema),
|
|
107
159
|
});
|
|
108
160
|
export type SchemaRegistry = z.infer<typeof SchemaRegistry>;
|
|
@@ -112,8 +164,17 @@ export type SchemaRegistry = z.infer<typeof SchemaRegistry>;
|
|
|
112
164
|
* @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/registry.html#authentic-source-registry
|
|
113
165
|
*/
|
|
114
166
|
export const AuthenticSourceRegistry = z.object({
|
|
167
|
+
id: z.string().optional(),
|
|
115
168
|
version: z.string(),
|
|
116
169
|
last_modified: z.string(),
|
|
170
|
+
localization: z
|
|
171
|
+
.object({
|
|
172
|
+
available_locales: z.array(z.string()),
|
|
173
|
+
base_uri: z.string(),
|
|
174
|
+
default_locale: z.string(),
|
|
175
|
+
version: z.string(),
|
|
176
|
+
})
|
|
177
|
+
.optional(),
|
|
117
178
|
authentic_sources: z.array(AuthenticSource),
|
|
118
179
|
});
|
|
119
180
|
export type AuthenticSourceRegistry = z.infer<typeof AuthenticSourceRegistry>;
|
|
@@ -125,8 +186,18 @@ export type AuthenticSourceRegistry = z.infer<typeof AuthenticSourceRegistry>;
|
|
|
125
186
|
export const DigitalCredentialsCatalogueJwt = z.object({
|
|
126
187
|
header: JwtHeader,
|
|
127
188
|
payload: z.object({
|
|
189
|
+
iss: z.string(),
|
|
190
|
+
id: z.string(),
|
|
128
191
|
version: z.string(),
|
|
129
192
|
last_modified: z.string(),
|
|
193
|
+
localization: z
|
|
194
|
+
.object({
|
|
195
|
+
available_locales: z.array(z.string()),
|
|
196
|
+
base_uri: z.string(),
|
|
197
|
+
default_locale: z.string(),
|
|
198
|
+
version: z.string(),
|
|
199
|
+
})
|
|
200
|
+
.optional(),
|
|
130
201
|
credentials: z.array(DigitalCredential),
|
|
131
202
|
iat: UnixTime,
|
|
132
203
|
exp: UnixTime,
|
|
@@ -141,22 +212,24 @@ export type DigitalCredentialsCatalogueJwt = z.infer<
|
|
|
141
212
|
* This is the entrypoint to build the full catalogue.
|
|
142
213
|
* @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/registry.html#registry-discovery-endpoint
|
|
143
214
|
*/
|
|
215
|
+
const RegistryDiscoveryEndpoints = z.object({
|
|
216
|
+
claims_registry: z.string(),
|
|
217
|
+
authentic_sources: z.string(),
|
|
218
|
+
credential_catalog: z.string(),
|
|
219
|
+
taxonomy: z.string(),
|
|
220
|
+
schema_registry: z.string(),
|
|
221
|
+
federation_list_endpoint: z.string(),
|
|
222
|
+
federation_fetch_endpoint: z.string(),
|
|
223
|
+
federation_resolve_endpoint: z.string(),
|
|
224
|
+
federation_trust_mark_status_endpoint: z.string(),
|
|
225
|
+
});
|
|
226
|
+
|
|
144
227
|
export const RegistryDiscoveryJwt = z.object({
|
|
145
228
|
header: JwtHeader,
|
|
146
229
|
payload: z.object({
|
|
147
230
|
registry_version: z.string(),
|
|
148
231
|
last_updated: z.string(),
|
|
149
|
-
endpoints:
|
|
150
|
-
claims_registry: z.string(),
|
|
151
|
-
authentic_sources: z.string(),
|
|
152
|
-
credential_catalog: z.string(),
|
|
153
|
-
taxonomy: z.string(),
|
|
154
|
-
schema_registry: z.string(),
|
|
155
|
-
federation_list: z.string(),
|
|
156
|
-
federation_fetch: z.string(),
|
|
157
|
-
federation_resolve: z.string(),
|
|
158
|
-
federation_trust_mark_status: z.string(),
|
|
159
|
-
}),
|
|
232
|
+
endpoints: RegistryDiscoveryEndpoints,
|
|
160
233
|
}),
|
|
161
234
|
});
|
|
162
235
|
export type RegistryDiscoveryJwt = z.infer<typeof RegistryDiscoveryJwt>;
|
|
@@ -11,7 +11,7 @@ type FetchRegistryParams<T> = {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Utility to fetch an entity from the Registry Infrastructure.
|
|
14
|
-
* The function supports
|
|
14
|
+
* The function supports `application/json` and signed JOSE/JWT responses.
|
|
15
15
|
* @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/registry.html
|
|
16
16
|
*
|
|
17
17
|
* @param url The url to fetch from
|
|
@@ -30,7 +30,7 @@ export const fetchRegistry = async <T>(
|
|
|
30
30
|
const response = await appFetch(url, {
|
|
31
31
|
method: "GET",
|
|
32
32
|
headers: {
|
|
33
|
-
Accept: asJson ? "application/json" : "application/jwt",
|
|
33
|
+
Accept: asJson ? "application/json" : "application/jose, application/jwt",
|
|
34
34
|
},
|
|
35
35
|
}).then(hasStatusOrThrow(200));
|
|
36
36
|
|
|
@@ -41,7 +41,10 @@ export const fetchRegistry = async <T>(
|
|
|
41
41
|
return schema.parse(responseJson);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
if (
|
|
44
|
+
if (
|
|
45
|
+
contentType?.includes("application/jwt") ||
|
|
46
|
+
contentType?.includes("application/jose")
|
|
47
|
+
) {
|
|
45
48
|
assert("jwks" in params, "params.jwks required when response is JWT");
|
|
46
49
|
|
|
47
50
|
const responseText = await response.text();
|
|
@@ -60,5 +63,40 @@ export const fetchRegistry = async <T>(
|
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
throw new IoWalletError(
|
|
66
|
+
throw new IoWalletError(
|
|
67
|
+
`Unsupported content-type for ${url}: ${contentType}`
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Fetch a locale bundle file from the Registry Infrastructure.
|
|
73
|
+
* Bundle files are flat JSON objects mapping l10n_id keys to translated strings.
|
|
74
|
+
* @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/registry.html
|
|
75
|
+
*
|
|
76
|
+
* @param baseUri The base URI from a registry's localization object
|
|
77
|
+
* @param locale The locale code (e.g. "it", "en")
|
|
78
|
+
* @param appFetch Custom fetch implementation
|
|
79
|
+
* @returns Flat key→value translation map
|
|
80
|
+
*/
|
|
81
|
+
export const fetchLocaleBundle = async (
|
|
82
|
+
baseUri: string,
|
|
83
|
+
locale: string,
|
|
84
|
+
appFetch: GlobalFetch["fetch"] = fetch
|
|
85
|
+
): Promise<Record<string, string>> => {
|
|
86
|
+
const url = `${baseUri.replace(/\/$/, "")}/${locale}.json`;
|
|
87
|
+
|
|
88
|
+
const response = await appFetch(url, {
|
|
89
|
+
method: "GET",
|
|
90
|
+
headers: { Accept: "application/json" },
|
|
91
|
+
}).then(hasStatusOrThrow(200));
|
|
92
|
+
|
|
93
|
+
const contentType = response.headers.get("Content-Type");
|
|
94
|
+
if (!contentType?.includes("application/json")) {
|
|
95
|
+
throw new IoWalletError(
|
|
96
|
+
`Locale bundle at ${url} returned unexpected Content-Type: ${contentType}`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const responseJson = await response.json();
|
|
101
|
+
return z.record(z.string(), z.string()).parse(responseJson);
|
|
64
102
|
};
|
package/src/index.ts
CHANGED
|
@@ -15,10 +15,14 @@ import * as SdJwt from "./sd-jwt";
|
|
|
15
15
|
import * as Mdoc from "./mdoc";
|
|
16
16
|
import * as Errors from "./utils/errors";
|
|
17
17
|
import * as WalletInstanceAttestation from "./wallet-instance-attestation";
|
|
18
|
+
import * as WalletUnitAttestation from "./wallet-unit-attestation";
|
|
18
19
|
import * as WalletInstance from "./wallet-instance";
|
|
19
20
|
import * as Logging from "./utils/logging";
|
|
20
21
|
import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
|
|
21
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
createCryptoContextFor,
|
|
24
|
+
type KeyAttestationCryptoContext,
|
|
25
|
+
} from "./utils/crypto";
|
|
22
26
|
import type { IntegrityContext } from "./utils/integrity";
|
|
23
27
|
|
|
24
28
|
export {
|
|
@@ -31,6 +35,7 @@ export {
|
|
|
31
35
|
SdJwt,
|
|
32
36
|
Mdoc,
|
|
33
37
|
WalletInstanceAttestation,
|
|
38
|
+
WalletUnitAttestation,
|
|
34
39
|
WalletInstance,
|
|
35
40
|
Trustmark,
|
|
36
41
|
Errors,
|
|
@@ -41,7 +46,11 @@ export {
|
|
|
41
46
|
Logging,
|
|
42
47
|
};
|
|
43
48
|
|
|
44
|
-
export type {
|
|
49
|
+
export type {
|
|
50
|
+
IntegrityContext,
|
|
51
|
+
AuthorizationContext,
|
|
52
|
+
KeyAttestationCryptoContext,
|
|
53
|
+
};
|
|
45
54
|
|
|
46
55
|
export type * from "./api";
|
|
47
56
|
|
|
@@ -50,7 +50,7 @@ export const FederationEntityMetadata = z
|
|
|
50
50
|
logo_uri: z.string().optional(),
|
|
51
51
|
contacts: z.array(z.string()).optional(),
|
|
52
52
|
})
|
|
53
|
-
.
|
|
53
|
+
.loose();
|
|
54
54
|
|
|
55
55
|
// Structure common to every Entity Configuration document
|
|
56
56
|
export type BaseEntityConfiguration = z.infer<typeof BaseEntityConfiguration>;
|
|
@@ -67,12 +67,12 @@ export const BaseEntityConfiguration = z.object({
|
|
|
67
67
|
.object({
|
|
68
68
|
federation_entity: FederationEntityMetadata,
|
|
69
69
|
})
|
|
70
|
-
.
|
|
70
|
+
.loose(),
|
|
71
71
|
jwks: z.object({
|
|
72
72
|
keys: z.array(JWK),
|
|
73
73
|
}),
|
|
74
74
|
})
|
|
75
|
-
.
|
|
75
|
+
.loose(),
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
export const FederationListResponse = z.array(z.string());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { jsonWebKeySchema } from "@pagopa/io-wallet-oid-federation";
|
|
2
3
|
import { JWK } from "../../utils/jwk";
|
|
3
4
|
import { BaseEntityConfiguration } from "../common/types";
|
|
4
|
-
import { jsonWebKeySchema } from "@openid-federation/core";
|
|
5
5
|
|
|
6
6
|
const RelyingPartyMetadata = z.object({
|
|
7
7
|
application_type: z.string().optional(),
|
|
@@ -65,7 +65,9 @@ const SupportedCredentialMetadata = z.intersection(
|
|
|
65
65
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
|
66
66
|
credential_signing_alg_values_supported: z.array(z.string()),
|
|
67
67
|
authentic_source: z.string().optional(),
|
|
68
|
-
issuance_errors_supported: z
|
|
68
|
+
issuance_errors_supported: z
|
|
69
|
+
.record(z.string(), IssuanceErrorSupported)
|
|
70
|
+
.optional(),
|
|
69
71
|
})
|
|
70
72
|
);
|
|
71
73
|
|
|
@@ -92,6 +94,7 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(
|
|
|
92
94
|
status_attestation_endpoint: z.string(),
|
|
93
95
|
display: z.array(CredentialIssuerDisplayMetadata),
|
|
94
96
|
credential_configurations_supported: z.record(
|
|
97
|
+
z.string(),
|
|
95
98
|
SupportedCredentialMetadata
|
|
96
99
|
),
|
|
97
100
|
jwks: z.object({ keys: z.array(JWK) }),
|
|
@@ -157,7 +160,7 @@ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(
|
|
|
157
160
|
),
|
|
158
161
|
jwks: z.object({ keys: z.array(JWK) }),
|
|
159
162
|
})
|
|
160
|
-
.
|
|
163
|
+
.loose(),
|
|
161
164
|
}),
|
|
162
165
|
}),
|
|
163
166
|
})
|
|
@@ -165,14 +168,11 @@ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(
|
|
|
165
168
|
|
|
166
169
|
// Maps any entity configuration by the union of every possible shapes
|
|
167
170
|
export type EntityConfiguration = z.infer<typeof EntityConfiguration>;
|
|
168
|
-
export const EntityConfiguration = z
|
|
169
|
-
[
|
|
171
|
+
export const EntityConfiguration = z
|
|
172
|
+
.union([
|
|
170
173
|
WalletProviderEntityConfiguration,
|
|
171
174
|
CredentialIssuerEntityConfiguration,
|
|
172
175
|
TrustAnchorEntityConfiguration,
|
|
173
176
|
RelyingPartyEntityConfiguration,
|
|
174
|
-
]
|
|
175
|
-
|
|
176
|
-
description: "Any kind of Entity Configuration allowed in the ecosystem",
|
|
177
|
-
}
|
|
178
|
-
);
|
|
177
|
+
])
|
|
178
|
+
.describe("Any kind of Entity Configuration allowed in the ecosystem");
|
|
@@ -56,13 +56,10 @@ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(
|
|
|
56
56
|
|
|
57
57
|
// Maps any entity configuration by the union of every possible shapes
|
|
58
58
|
export type EntityConfiguration = z.infer<typeof EntityConfiguration>;
|
|
59
|
-
export const EntityConfiguration = z
|
|
60
|
-
[
|
|
59
|
+
export const EntityConfiguration = z
|
|
60
|
+
.union([
|
|
61
61
|
WalletProviderEntityConfiguration,
|
|
62
62
|
CredentialIssuerEntityConfiguration,
|
|
63
63
|
RelyingPartyEntityConfiguration,
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
description: "Any kind of Entity Configuration allowed in the ecosystem",
|
|
67
|
-
}
|
|
68
|
-
);
|
|
64
|
+
])
|
|
65
|
+
.describe("Any kind of Entity Configuration allowed in the ecosystem");
|
package/src/utils/callbacks.ts
CHANGED
|
@@ -12,6 +12,12 @@ type PartialCallbackContext = Omit<
|
|
|
12
12
|
"signJwt" | "clientAuthentication"
|
|
13
13
|
>;
|
|
14
14
|
|
|
15
|
+
// Fix incompatibility between ArrayBuffer types
|
|
16
|
+
type DigestFixed = (
|
|
17
|
+
data: string | ArrayBuffer | ArrayBufferView,
|
|
18
|
+
algorithm?: string
|
|
19
|
+
) => Uint8Array;
|
|
20
|
+
|
|
15
21
|
/**
|
|
16
22
|
* Shared callbacks with React Native implementations for use
|
|
17
23
|
* in IO Wallet SDK. Callbacks not found here must be provided by the caller,
|
|
@@ -19,7 +25,7 @@ type PartialCallbackContext = Omit<
|
|
|
19
25
|
*/
|
|
20
26
|
export const partialCallbacks: PartialCallbackContext = {
|
|
21
27
|
generateRandom: generateRandomBytes,
|
|
22
|
-
hash: digest,
|
|
28
|
+
hash: digest as DigestFixed,
|
|
23
29
|
encryptJwe: async ({ publicJwk, alg, enc, kid }, data) => ({
|
|
24
30
|
// @ts-expect-error `alg` and `enc` are strings, but EncryptJwe expects specific string literals
|
|
25
31
|
jwe: await new EncryptJwe(data, { alg, enc, kid }).encrypt(publicJwk),
|
package/src/utils/crypto.ts
CHANGED
|
@@ -90,3 +90,21 @@ export const getSigninJwkFromCert = (pemCert: string): JWK => {
|
|
|
90
90
|
"Unable to find the signing key inside the PEM certificate"
|
|
91
91
|
);
|
|
92
92
|
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Extension of the {@link CryptoContext} that adds key generation with optional key attestation.
|
|
96
|
+
*
|
|
97
|
+
* This context requires the consumer to provide an additional method for **key generation**;
|
|
98
|
+
* on Android this method should also generate a key attestation as a certificate chain
|
|
99
|
+
* to ensure the key pair is hardware-backed.
|
|
100
|
+
*/
|
|
101
|
+
export type KeyAttestationCryptoContext = CryptoContext & {
|
|
102
|
+
/**
|
|
103
|
+
* Generate a key pair with an **optional key attestation** (Android).
|
|
104
|
+
* @param challenge The challenge for the key attestation.
|
|
105
|
+
* @returns An object with a success flag and a key attestation, if it was generated.
|
|
106
|
+
*/
|
|
107
|
+
generateKeyWithAttestation(
|
|
108
|
+
challenge: string
|
|
109
|
+
): Promise<{ success: boolean; attestation?: string }>;
|
|
110
|
+
};
|
package/src/utils/dpop.ts
CHANGED
|
@@ -29,7 +29,7 @@ export const createDPopToken = async (
|
|
|
29
29
|
export type DPoPPayload = z.infer<typeof DPoPPayload>;
|
|
30
30
|
export const DPoPPayload = z.object({
|
|
31
31
|
jti: z.string(),
|
|
32
|
-
htm: z.
|
|
32
|
+
htm: z.enum(["POST", "GET"]),
|
|
33
33
|
htu: z.string(),
|
|
34
34
|
ath: z.string().optional(),
|
|
35
35
|
});
|
package/src/utils/jwk.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const JWK = z.object({
|
|
|
20
20
|
/** JWK "kty" (Key Type) Parameter.
|
|
21
21
|
* This attribute is required to discriminate the
|
|
22
22
|
* type of EC/RSA algorithm */
|
|
23
|
-
kty: z.
|
|
23
|
+
kty: z.enum(["RSA", "EC"]),
|
|
24
24
|
n: z.string().optional(),
|
|
25
25
|
p: z.string().optional(),
|
|
26
26
|
q: z.string().optional(),
|
package/src/utils/mappers.ts
CHANGED
|
@@ -33,8 +33,8 @@ export function createMapper<I, O>(
|
|
|
33
33
|
export function createMapper<I, O>(
|
|
34
34
|
mapper: (input: I) => O,
|
|
35
35
|
config?: {
|
|
36
|
-
inputSchema?: z.ZodType<I>;
|
|
37
|
-
outputSchema: z.ZodType<O>;
|
|
36
|
+
inputSchema?: z.ZodType<I, any>;
|
|
37
|
+
outputSchema: z.ZodType<O, any>;
|
|
38
38
|
}
|
|
39
39
|
) {
|
|
40
40
|
if (!config) {
|
package/src/utils/zod.ts
CHANGED
|
@@ -11,7 +11,11 @@ type Literal = z.infer<typeof literalSchema>;
|
|
|
11
11
|
type Json = Literal | { [key: string]: Json } | Json[];
|
|
12
12
|
|
|
13
13
|
const jsonSchema: z.ZodType<Json> = z.lazy(() =>
|
|
14
|
-
z.union([
|
|
14
|
+
z.union([
|
|
15
|
+
literalSchema,
|
|
16
|
+
z.array(jsonSchema),
|
|
17
|
+
z.record(z.string(), jsonSchema),
|
|
18
|
+
])
|
|
15
19
|
);
|
|
16
20
|
|
|
17
21
|
export const json = () => jsonSchema;
|
|
@@ -30,16 +30,19 @@ const { WALLET_PROVIDER_BASE_URL } = env; // Let's assume env is an object conta
|
|
|
30
30
|
* WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
|
|
31
31
|
*/
|
|
32
32
|
const wallet = new IoWallet({ version: "1.0.0" });
|
|
33
|
-
const issuedAttestation = await wallet.WalletInstanceAttestation.getAttestation(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
const issuedAttestation = await wallet.WalletInstanceAttestation.getAttestation(
|
|
34
|
+
{
|
|
35
|
+
walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
|
|
36
|
+
walletSolutionId: "exampleId",
|
|
37
|
+
walletSolutionVersion: "1.2.3",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
wiaCryptoContext,
|
|
41
|
+
integrityContext,
|
|
42
|
+
appFetch,
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
// [{ "format": "jwt", "attestation": "ey..." }, { "format": "dc+sd-jwt", "attestation": "ey..." }]
|
|
43
46
|
return issuedAttestation;
|
|
44
47
|
```
|
|
45
48
|
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
import type { IntegrityContext } from "../../utils/integrity";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
DecodedWalletInstanceAttestation,
|
|
5
|
+
WalletAttestation,
|
|
6
|
+
WalletAttestationRequestParams,
|
|
7
|
+
} from "./types";
|
|
4
8
|
|
|
5
9
|
export interface WalletInstanceAttestationApi {
|
|
6
10
|
/**
|
|
7
11
|
* Request a Wallet Instance Attestation (WIA) to the Wallet provider.
|
|
8
|
-
* The Wallet Attestation may be issued in different formats
|
|
12
|
+
* The Wallet Instance Attestation may be issued in different formats.
|
|
9
13
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
14
|
+
* @param requestParams Wallet Provider data for the Wallet Attestation request
|
|
15
|
+
* @param ctx.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
|
|
16
|
+
* @param ctx.integrityContext The hardware key pair associated with the Wallet Instance
|
|
17
|
+
* @param ctx.appFetch (optional) Http client
|
|
13
18
|
* @returns The retrieved Wallet Instance Attestation tokens
|
|
14
19
|
* @throws {WalletProviderResponseError} with a specific code for more context
|
|
15
20
|
*/
|
|
16
|
-
getAttestation(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
getAttestation(
|
|
22
|
+
requestParams: WalletAttestationRequestParams,
|
|
23
|
+
ctx: {
|
|
24
|
+
wiaCryptoContext: CryptoContext;
|
|
25
|
+
integrityContext: IntegrityContext;
|
|
26
|
+
appFetch?: GlobalFetch["fetch"];
|
|
27
|
+
}
|
|
28
|
+
): Promise<WalletAttestation[]>;
|
|
22
29
|
|
|
23
30
|
/**
|
|
24
31
|
* Decode a given JWT to get the parsed Wallet Instance Attestation object they define.
|
|
@@ -32,7 +39,7 @@ export interface WalletInstanceAttestationApi {
|
|
|
32
39
|
* @throws A decoding error if the token doesn't resolve in a valid JWT
|
|
33
40
|
* @throws A validation error if the provided data doesn't result in a valid Wallet Instance Attestation
|
|
34
41
|
*/
|
|
35
|
-
decode(token: string):
|
|
42
|
+
decode(token: string): DecodedWalletInstanceAttestation;
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
* Verify a given JWT to get the parsed Wallet Instance Attestation object they define.
|
|
@@ -44,5 +51,5 @@ export interface WalletInstanceAttestationApi {
|
|
|
44
51
|
* @throws A validation error if the provided data doesn't result in a valid Wallet Instance Attestation
|
|
45
52
|
* @throws Invalid signature error if the token signature is not valid
|
|
46
53
|
*/
|
|
47
|
-
verify(token: string): Promise<
|
|
54
|
+
verify(token: string): Promise<DecodedWalletInstanceAttestation>;
|
|
48
55
|
}
|
|
@@ -3,23 +3,35 @@ import { UnixTime } from "../../utils/zod";
|
|
|
3
3
|
import { JWK } from "../../utils/jwk";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Common Wallet Attestation shape. This object is
|
|
6
|
+
* Common Wallet Instance Attestation shape. This object is
|
|
7
7
|
* an abstraction over the version-specific JWTs.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
10
|
-
|
|
9
|
+
export type DecodedWalletInstanceAttestation = z.infer<
|
|
10
|
+
typeof DecodedWalletInstanceAttestation
|
|
11
|
+
>;
|
|
12
|
+
export const DecodedWalletInstanceAttestation = z.object({
|
|
11
13
|
iss: z.string(),
|
|
12
14
|
iat: UnixTime,
|
|
13
15
|
exp: UnixTime,
|
|
14
16
|
cnf: z.object({ jwk: JWK }),
|
|
15
17
|
sub: z.string(),
|
|
18
|
+
wallet_provider_name: z.string().optional(),
|
|
19
|
+
wallet_solution_id: z.string().optional(),
|
|
20
|
+
/** @deprecated */
|
|
16
21
|
wallet_link: z.string().optional(),
|
|
22
|
+
/** @deprecated */
|
|
17
23
|
wallet_name: z.string().optional(),
|
|
24
|
+
/** @deprecated */
|
|
18
25
|
aal: z.string().optional(),
|
|
19
26
|
});
|
|
20
27
|
|
|
21
28
|
export type WalletAttestation = {
|
|
22
|
-
type: "wallet_instance_attestation" | "wallet_unit_attestation";
|
|
23
29
|
format: string;
|
|
24
30
|
attestation: string;
|
|
25
31
|
};
|
|
32
|
+
|
|
33
|
+
export type WalletAttestationRequestParams = {
|
|
34
|
+
walletProviderBaseUrl: string;
|
|
35
|
+
walletSolutionId: string;
|
|
36
|
+
walletSolutionVersion: string;
|
|
37
|
+
};
|
|
@@ -2,10 +2,10 @@ import type { WalletInstanceAttestationApi } from "../api";
|
|
|
2
2
|
import { withMapper, withMapperAsync } from "../../utils/mappers";
|
|
3
3
|
import { getAttestation } from "./issuing";
|
|
4
4
|
import { decode, verify } from "./utils";
|
|
5
|
-
import {
|
|
5
|
+
import { mapToDecodedWalletInstanceAttestation } from "./mappers";
|
|
6
6
|
|
|
7
7
|
export const WalletInstanceAttestation: WalletInstanceAttestationApi = {
|
|
8
8
|
getAttestation,
|
|
9
|
-
decode: withMapper(
|
|
10
|
-
verify: withMapperAsync(
|
|
9
|
+
decode: withMapper(mapToDecodedWalletInstanceAttestation, decode),
|
|
10
|
+
verify: withMapperAsync(mapToDecodedWalletInstanceAttestation, verify),
|
|
11
11
|
};
|