@pagopa/io-react-native-wallet 3.0.0 → 3.1.0
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/common/06-verify-and-parse-credential.sdjwt.js +2 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.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/RelyingPartyConfig.js +2 -2
- package/lib/commonjs/credential/presentation/api/RelyingPartyConfig.js.map +1 -1
- package/lib/commonjs/credential/presentation/common/utils/sd-jwt.js +2 -1
- package/lib/commonjs/credential/presentation/common/utils/sd-jwt.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/04-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/04-verify-request-object.js +4 -2
- package/lib/commonjs/credential/presentation/v1.3.3/04-verify-request-object.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +37 -11
- 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/mappers.js +4 -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 +4 -4
- 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/sd-jwt/index.js +3 -2
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/utils.js +2 -1
- package/lib/commonjs/sd-jwt/utils.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/credentials.js +17 -2
- package/lib/commonjs/utils/credentials.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/common/06-verify-and-parse-credential.sdjwt.js +2 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.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/RelyingPartyConfig.js +1 -1
- package/lib/module/credential/presentation/api/RelyingPartyConfig.js.map +1 -1
- package/lib/module/credential/presentation/common/utils/sd-jwt.js +2 -1
- package/lib/module/credential/presentation/common/utils/sd-jwt.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/04-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/04-verify-request-object.js +4 -2
- package/lib/module/credential/presentation/v1.3.3/04-verify-request-object.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +37 -11
- 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/mappers.js +4 -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 +4 -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/sd-jwt/index.js +3 -2
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/utils.js +2 -1
- package/lib/module/sd-jwt/utils.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/credentials.js +15 -1
- package/lib/module/utils/credentials.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/06-verify-and-parse-credential.sdjwt.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/RelyingPartyConfig.d.ts +9 -154
- package/lib/typescript/credential/presentation/api/RelyingPartyConfig.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/06-send-authorization-response.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-request-object.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 +111 -525
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +48 -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/mappers.d.ts +147 -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 +1 -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 +16 -16
- 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 +5 -0
- 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/common/06-verify-and-parse-credential.sdjwt.ts +2 -1
- 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/RelyingPartyConfig.ts +1 -1
- package/src/credential/presentation/common/utils/sd-jwt.ts +4 -1
- package/src/credential/presentation/v1.0.0/04-verify-request-object.ts +2 -2
- package/src/credential/presentation/v1.3.3/04-verify-request-object.ts +4 -2
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +42 -10
- package/src/credentials-catalogue/v1.0.0/mappers.ts +27 -12
- package/src/credentials-catalogue/v1.3.3/mappers.ts +10 -4
- package/src/credentials-catalogue/v1.3.3/types.ts +102 -29
- package/src/credentials-catalogue/v1.3.3/utils.ts +9 -4
- package/src/index.ts +11 -2
- package/src/sd-jwt/index.ts +8 -3
- package/src/sd-jwt/utils.ts +5 -1
- 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/credentials.ts +17 -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
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
IoWalletError,
|
|
21
21
|
sdkUnexpectedStatusCodeToIssuerError,
|
|
22
22
|
} from "../../../utils/errors";
|
|
23
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
23
24
|
import type { IssuanceApi } from "../api";
|
|
24
25
|
import { mapToRequestObject } from "./mappers";
|
|
25
26
|
import type { RemotePresentation } from "../../presentation";
|
|
@@ -101,6 +102,7 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
|
|
|
101
102
|
}).catch(sdkUnexpectedStatusCodeToIssuerError);
|
|
102
103
|
|
|
103
104
|
const parsedAuthRequest = await parseAuthorizeRequest({
|
|
105
|
+
config: sdkConfigV1_3,
|
|
104
106
|
requestObjectJwt: authRequest.requestObjectJwt,
|
|
105
107
|
callbacks: partialCallbacks,
|
|
106
108
|
});
|
|
@@ -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,
|
|
@@ -4,6 +4,7 @@ import { digest } from "@sd-jwt/crypto-nodejs";
|
|
|
4
4
|
import type { DcqlSdJwtVcCredential } from "dcql";
|
|
5
5
|
import { IoWalletError } from "../../../../utils/errors";
|
|
6
6
|
import { LEGACY_SD_JWT } from "../../../../sd-jwt/types";
|
|
7
|
+
import { fixLegacyCredentialSdJwt } from "../../../../utils/credentials";
|
|
7
8
|
import type { Credential4Dcql } from "../../api";
|
|
8
9
|
|
|
9
10
|
type CustomDcqlSdJwtVcCredential = DcqlSdJwtVcCredential & {
|
|
@@ -51,7 +52,9 @@ export const mapCredentialsToObj = async (
|
|
|
51
52
|
|
|
52
53
|
return Promise.all(
|
|
53
54
|
credentials.map(async (credential) => {
|
|
54
|
-
const decodedRawSdJwt = await sdJwt.decode(
|
|
55
|
+
const decodedRawSdJwt = await sdJwt.decode(
|
|
56
|
+
fixLegacyCredentialSdJwt(credential[1])
|
|
57
|
+
);
|
|
55
58
|
const claims = await getClaimsFromDecodedSdJwt(decodedRawSdJwt);
|
|
56
59
|
return {
|
|
57
60
|
vct: decodedRawSdJwt.jwt?.payload?.vct as string,
|
|
@@ -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]}`)
|
|
@@ -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,
|
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { UnixTime } from "../../utils/zod";
|
|
3
3
|
|
|
4
|
+
const AdministrativeExpirationUserInfo = z.object({
|
|
5
|
+
title_l10n_id: z.string(),
|
|
6
|
+
description_l10n_id: z.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const AllowedState = z
|
|
10
|
+
.object({
|
|
11
|
+
title_l10n_id: z.string(),
|
|
12
|
+
description_l10n_id: z.string(),
|
|
13
|
+
})
|
|
14
|
+
.catchall(z.string());
|
|
15
|
+
|
|
4
16
|
const CredentialPurpose = z.object({
|
|
5
17
|
id: z.string(),
|
|
6
|
-
description: z.string(),
|
|
7
|
-
claims_required: z.array(z.string()),
|
|
8
|
-
claim_recommended: z.array(z.string()),
|
|
18
|
+
description: z.string().optional(),
|
|
19
|
+
claims_required: z.array(z.string()).optional(),
|
|
20
|
+
claim_recommended: z.array(z.string()).optional(),
|
|
9
21
|
});
|
|
10
22
|
|
|
11
23
|
const CredentialIssuer = z.object({
|
|
12
24
|
id: z.string(),
|
|
13
|
-
organization_name: z.string(),
|
|
25
|
+
organization_name: z.string().optional(),
|
|
26
|
+
organization_name_l10n_id: z.string().optional(),
|
|
14
27
|
organization_code: z.string(),
|
|
15
28
|
organization_country: z.string(),
|
|
29
|
+
legal_type: z.string().optional(),
|
|
16
30
|
contacts: z.array(z.string()).optional(),
|
|
17
31
|
homepage_uri: z.string().optional(),
|
|
18
32
|
logo_uri: z.string().optional(),
|
|
19
33
|
policy_uri: z.string().optional(),
|
|
20
34
|
tos_uri: z.string().optional(),
|
|
35
|
+
service_documentation: z.string().optional(),
|
|
36
|
+
issuance_flows: z.object({ deferred_flow: z.boolean() }).optional(),
|
|
21
37
|
});
|
|
22
38
|
|
|
23
39
|
const AuthenticSource = z.object({
|
|
24
40
|
id: z.string(),
|
|
25
|
-
organization_name: z.string(),
|
|
41
|
+
organization_name: z.string().optional(),
|
|
42
|
+
organization_name_l10n_id: z.string().optional(),
|
|
26
43
|
organization_code: z.string().optional(),
|
|
27
44
|
organization_country: z.string(),
|
|
28
45
|
organization_type: z.string(),
|
|
@@ -57,17 +74,32 @@ export const DigitalCredential = z.object({
|
|
|
57
74
|
version: z.string(),
|
|
58
75
|
credential_type: z.string(),
|
|
59
76
|
legal_type: z.string(),
|
|
60
|
-
name: z.string(),
|
|
61
|
-
|
|
77
|
+
name: z.string().optional(),
|
|
78
|
+
name_l10n_id: z.string().optional(),
|
|
79
|
+
description: z.string().optional(),
|
|
80
|
+
restriction_policy: z
|
|
81
|
+
.object({
|
|
82
|
+
presentation_flows: z.object({
|
|
83
|
+
remote: z.boolean(),
|
|
84
|
+
proximity: z.boolean(),
|
|
85
|
+
}),
|
|
86
|
+
})
|
|
87
|
+
.optional(),
|
|
62
88
|
validity_info: z.object({
|
|
63
89
|
max_validity_days: z.number(),
|
|
64
90
|
status_methods: z.array(z.string()),
|
|
65
|
-
|
|
91
|
+
administrative_expiration_user_info:
|
|
92
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
93
|
+
allowed_states: z.array(z.union([z.string(), AllowedState])),
|
|
66
94
|
}),
|
|
67
|
-
|
|
95
|
+
administrative_expiration_user_info:
|
|
96
|
+
AdministrativeExpirationUserInfo.optional(),
|
|
97
|
+
domains: z.array(z.string()).optional(),
|
|
98
|
+
classes: z.array(z.string()).optional(),
|
|
99
|
+
purposes: z.array(z.union([z.string(), CredentialPurpose])),
|
|
68
100
|
issuers: z.array(CredentialIssuer),
|
|
69
101
|
authentic_sources: z.array(AuthenticSource),
|
|
70
|
-
formats: z.array(CredentialFormat),
|
|
102
|
+
formats: z.array(CredentialFormat).optional(),
|
|
71
103
|
// claims: z.array(Claim), // TODO: [SIW-3978] Should we keep claims?
|
|
72
104
|
});
|
|
73
105
|
|
|
@@ -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,
|
|
@@ -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[] => {
|
|
@@ -60,8 +66,8 @@ export const mapToCredentialsCatalogue = createMapper<
|
|
|
60
66
|
...catalogueJwt.payload,
|
|
61
67
|
taxonomy_uri: discoveryJwt.payload.endpoints.taxonomy,
|
|
62
68
|
credentials: catalogueJwt.payload.credentials.map(
|
|
63
|
-
({ authentic_sources,
|
|
64
|
-
|
|
69
|
+
({ authentic_sources, credential_name_l10n_id, ...credential }) => ({
|
|
70
|
+
name_l10n_id: credential_name_l10n_id,
|
|
65
71
|
formats: resolveFormats(credential.credential_type),
|
|
66
72
|
authentic_sources: authentic_sources.map(resolveAuthSource),
|
|
67
73
|
...credential,
|
|
@@ -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()),
|
|
110
|
+
allowed_issuer_ids: z.array(z.string()),
|
|
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,7 @@ 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
|
+
);
|
|
64
69
|
};
|
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
|
|