@pagopa/io-react-native-wallet 3.1.2 → 3.3.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/credential/issuance/README.md +44 -17
- package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js +4 -3
- package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +37 -8
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js +46 -38
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -51
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js +21 -5
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js +3 -3
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js +5 -2
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/05-obtain-credential.js +5 -1
- package/lib/commonjs/credential/issuance/v1.0.0/05-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js +2 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js +20 -16
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js +20 -19
- package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +150 -57
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
- package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/index.js +2 -1
- package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/api/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
- package/lib/commonjs/credential/presentation/common/utils/mdoc.js.map +1 -0
- package/lib/commonjs/credential/presentation/v1.0.0/05-verify-request-object.js +18 -12
- package/lib/commonjs/credential/presentation/v1.0.0/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -0
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/index.js +0 -2
- package/lib/commonjs/credential/presentation/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/mappers.js +23 -13
- package/lib/commonjs/credential/presentation/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/types.js +25 -17
- package/lib/commonjs/credential/presentation/v1.0.0/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +29 -6
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -2
- package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js +9 -6
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js +25 -13
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/types.js +6 -3
- package/lib/commonjs/credential/presentation/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/credential/status/README.md +3 -2
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js +27 -5
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +26 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js +4 -0
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js +5 -3
- package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js +9 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js +49 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/mdoc/index.js +3 -24
- package/lib/commonjs/mdoc/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +2 -14
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/utils.test.js +0 -12
- package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +1 -14
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/utils/callbacks.js +45 -7
- package/lib/commonjs/utils/callbacks.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +58 -5
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/x509.js +34 -0
- package/lib/commonjs/utils/x509.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/api/types.js +0 -2
- package/lib/commonjs/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js +2 -7
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/wallet-unit-attestation/api/types.js +0 -11
- package/lib/commonjs/wallet-unit-attestation/api/types.js.map +1 -1
- package/lib/module/credential/issuance/README.md +44 -17
- package/lib/module/credential/issuance/common/02-start-user-authorization.js +4 -3
- package/lib/module/credential/issuance/common/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +39 -10
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js +47 -34
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -47
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/index.js +20 -5
- package/lib/module/credential/issuance/mrtd-pop/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js +1 -1
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js +6 -3
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/05-obtain-credential.js +4 -1
- package/lib/module/credential/issuance/v1.0.0/05-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/index.js +4 -3
- package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js +1 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js +20 -16
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +1 -1
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js +22 -19
- package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +147 -55
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
- package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/index.js +4 -3
- package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/presentation/api/types.js.map +1 -1
- package/lib/module/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
- package/lib/module/credential/presentation/common/utils/mdoc.js.map +1 -0
- package/lib/module/credential/presentation/v1.0.0/05-verify-request-object.js +13 -7
- package/lib/module/credential/presentation/v1.0.0/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js +4 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/index.js +0 -2
- package/lib/module/credential/presentation/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/mappers.js +23 -13
- package/lib/module/credential/presentation/v1.0.0/mappers.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/types.js +23 -15
- package/lib/module/credential/presentation/v1.0.0/types.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +28 -6
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -3
- package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js +9 -6
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.js +25 -13
- package/lib/module/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/types.js +5 -2
- package/lib/module/credential/presentation/v1.3.3/types.js.map +1 -1
- package/lib/module/credential/status/README.md +3 -2
- package/lib/module/credential/status/v1.3.3/01-status-list.js +27 -5
- package/lib/module/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +24 -0
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js +5 -1
- package/lib/module/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js +5 -3
- package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js +9 -1
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/types.js +47 -0
- package/lib/module/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/module/mdoc/index.js +3 -24
- package/lib/module/mdoc/index.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +2 -14
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/utils.test.js +0 -12
- package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -1
- package/lib/module/sd-jwt/types.js +1 -14
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/utils/callbacks.js +45 -8
- package/lib/module/utils/callbacks.js.map +1 -1
- package/lib/module/utils/crypto.js +57 -6
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/x509.js +28 -0
- package/lib/module/utils/x509.js.map +1 -0
- package/lib/module/wallet-instance-attestation/api/types.js +0 -2
- package/lib/module/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js +2 -7
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/module/wallet-unit-attestation/api/types.js +0 -11
- package/lib/module/wallet-unit-attestation/api/types.js.map +1 -1
- package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts +20 -0
- package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.d.ts +4 -0
- package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.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/mrtd-pop/02-init-challenge.d.ts +12 -1
- package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts +12 -1
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts +2 -1
- package/lib/typescript/credential/issuance/mrtd-pop/index.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 +1 -0
- package/lib/typescript/credential/issuance/v1.0.0/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.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/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/04-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts +23 -2
- package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/06-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts +9 -2
- package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +2 -2
- package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/07-send-authorization-response.d.ts +2 -2
- package/lib/typescript/credential/presentation/api/07-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/types.d.ts +18 -0
- package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/{v1.3.3/utils.mdoc.d.ts → common/utils/mdoc.d.ts} +2 -2
- package/lib/typescript/credential/presentation/common/utils/mdoc.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.0.0/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.0.0/07-send-authorization-response.d.ts.map +1 -1
- 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 +21 -13
- 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 +23 -15
- package/lib/typescript/credential/presentation/v1.0.0/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/06-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/07-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +89 -79
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +87 -79
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/credential/status/api/status-list.d.ts +8 -4
- package/lib/typescript/credential/status/api/status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/02-verify-and-parse-status-list.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +73 -0
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +6 -5
- package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +25 -0
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/fetch-translations.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts +51 -0
- 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 +33 -0
- package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/mdoc/index.d.ts +1 -1
- package/lib/typescript/mdoc/index.d.ts.map +1 -1
- package/lib/typescript/mdoc/utils.d.ts +0 -24
- package/lib/typescript/mdoc/utils.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +0 -12
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/utils/callbacks.d.ts +7 -0
- package/lib/typescript/utils/callbacks.d.ts.map +1 -1
- package/lib/typescript/utils/crypto.d.ts +32 -15
- package/lib/typescript/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/utils/x509.d.ts +10 -0
- package/lib/typescript/utils/x509.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts +0 -2
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts +0 -2
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts +2 -9
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts +2 -7
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts +0 -11
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts +0 -22
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts +0 -11
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/credential/issuance/README.md +44 -17
- package/src/credential/issuance/api/05-obtain-credential.ts +24 -0
- package/src/credential/issuance/api/06-verify-and-parse-credential.ts +4 -0
- package/src/credential/issuance/common/02-start-user-authorization.ts +6 -3
- package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +42 -9
- package/src/credential/issuance/mrtd-pop/02-init-challenge.ts +69 -45
- package/src/credential/issuance/mrtd-pop/03-validate-challenge.ts +84 -62
- package/src/credential/issuance/mrtd-pop/index.ts +13 -5
- package/src/credential/issuance/v1.0.0/02-start-user-authorization.ts +1 -1
- package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +8 -3
- package/src/credential/issuance/v1.0.0/05-obtain-credential.ts +6 -0
- package/src/credential/issuance/v1.0.0/index.ts +7 -3
- package/src/credential/issuance/v1.0.0/mappers.ts +4 -1
- package/src/credential/issuance/v1.3.3/01-evaluate-issuer-trust.ts +0 -2
- package/src/credential/issuance/v1.3.3/02-start-user-authorization.ts +24 -20
- package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +1 -1
- package/src/credential/issuance/v1.3.3/04-authorize-access.ts +28 -23
- package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +182 -87
- package/src/credential/issuance/v1.3.3/06-verify-and-parse-credential.ts +2 -1
- package/src/credential/issuance/v1.3.3/index.ts +7 -3
- package/src/credential/issuance/v1.3.3/mappers.ts +4 -1
- package/src/credential/presentation/api/04-verify-certificate-chain.ts +9 -2
- package/src/credential/presentation/api/05-verify-request-object.ts +2 -2
- package/src/credential/presentation/api/07-send-authorization-response.ts +2 -2
- package/src/credential/presentation/api/types.ts +16 -0
- package/src/credential/presentation/{v1.3.3/utils.mdoc.ts → common/utils/mdoc.ts} +2 -2
- package/src/credential/presentation/v1.0.0/05-verify-request-object.ts +21 -10
- package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +7 -0
- package/src/credential/presentation/v1.0.0/index.ts +0 -2
- package/src/credential/presentation/v1.0.0/mappers.ts +17 -17
- package/src/credential/presentation/v1.0.0/types.ts +23 -15
- package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +63 -10
- package/src/credential/presentation/v1.3.3/06-evaluate-dcql-query.ts +3 -3
- package/src/credential/presentation/v1.3.3/07-send-authorization-response.ts +13 -4
- package/src/credential/presentation/v1.3.3/mappers.ts +19 -17
- package/src/credential/presentation/v1.3.3/types.ts +9 -3
- package/src/credential/status/README.md +3 -2
- package/src/credential/status/api/status-list.ts +10 -7
- package/src/credential/status/v1.3.3/01-status-list.ts +21 -7
- package/src/credential/status/v1.3.3/02-verify-and-parse-status-list.ts +19 -5
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +32 -0
- package/src/credentials-catalogue/api/index.ts +6 -3
- package/src/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.ts +6 -0
- package/src/credentials-catalogue/v1.3.3/fetch-translations.ts +6 -3
- package/src/credentials-catalogue/v1.3.3/mappers.ts +17 -1
- package/src/credentials-catalogue/v1.3.3/types.ts +51 -0
- package/src/mdoc/index.ts +5 -41
- package/src/sd-jwt/__test__/types.test.ts +1 -13
- package/src/sd-jwt/__test__/utils.test.ts +0 -12
- package/src/sd-jwt/types.ts +0 -13
- package/src/utils/callbacks.ts +57 -9
- package/src/utils/crypto.ts +86 -15
- package/src/utils/x509.ts +43 -0
- package/src/wallet-instance-attestation/api/types.ts +0 -2
- package/src/wallet-instance-attestation/v1.3.3/mappers.ts +3 -11
- package/src/wallet-instance-attestation/v1.3.3/types.ts +2 -7
- package/src/wallet-unit-attestation/api/types.ts +0 -11
- package/lib/commonjs/credential/issuance/common/authorization.js +0 -56
- package/lib/commonjs/credential/issuance/common/authorization.js.map +0 -1
- package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js +0 -12
- package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +0 -1
- package/lib/commonjs/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
- package/lib/module/credential/issuance/common/authorization.js +0 -48
- package/lib/module/credential/issuance/common/authorization.js.map +0 -1
- package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js +0 -5
- package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +0 -1
- package/lib/module/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
- package/lib/typescript/credential/issuance/common/authorization.d.ts +0 -21
- package/lib/typescript/credential/issuance/common/authorization.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts +0 -3
- package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.3.3/utils.mdoc.d.ts.map +0 -1
- package/src/credential/issuance/common/authorization.ts +0 -89
- package/src/credential/presentation/v1.0.0/04-verify-certificate-chain.ts +0 -10
|
@@ -9,9 +9,12 @@ import {
|
|
|
9
9
|
getRequestedCredentialToBePresented,
|
|
10
10
|
} from "./03-complete-user-authorization";
|
|
11
11
|
import { authorizeAccess } from "./04-authorize-access";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
obtainCredential,
|
|
14
|
+
obtainCredentialsBatch,
|
|
15
|
+
} from "./05-obtain-credential";
|
|
13
16
|
import { verifyAndParseCredential } from "./06-verify-and-parse-credential";
|
|
14
|
-
import {
|
|
17
|
+
import { MRTDPoPv1_3 } from "../mrtd-pop";
|
|
15
18
|
|
|
16
19
|
export const Issuance: IssuanceApi = {
|
|
17
20
|
evaluateIssuerTrust,
|
|
@@ -23,6 +26,7 @@ export const Issuance: IssuanceApi = {
|
|
|
23
26
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
24
27
|
authorizeAccess,
|
|
25
28
|
obtainCredential,
|
|
29
|
+
obtainCredentialsBatch,
|
|
26
30
|
verifyAndParseCredential,
|
|
27
|
-
MRTDPoP,
|
|
31
|
+
MRTDPoP: MRTDPoPv1_3,
|
|
28
32
|
};
|
|
@@ -60,7 +60,10 @@ export const mapToIssuerConfig = createMapper<
|
|
|
60
60
|
credential_configurations_supported: mapCredentialConfigurationsSupported(
|
|
61
61
|
openid_credential_issuer
|
|
62
62
|
),
|
|
63
|
-
keys:
|
|
63
|
+
keys: [
|
|
64
|
+
...openid_credential_issuer.jwks.keys,
|
|
65
|
+
...oauth_authorization_server.jwks.keys,
|
|
66
|
+
] as JWK[],
|
|
64
67
|
pushed_authorization_request_endpoint:
|
|
65
68
|
oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
66
69
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
@@ -3,7 +3,14 @@ import type { CertificateValidationResult } from "@pagopa/io-react-native-crypto
|
|
|
3
3
|
export interface VerifyAuthRequestCertificateChainApi {
|
|
4
4
|
/**
|
|
5
5
|
* Verify the X.509 certificate chain in the Request Object `x5c` header claim.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* **Note:** the method is optional and might not be present in the interface. Always check for its presence before calling it.
|
|
8
|
+
* @example
|
|
9
|
+
* if (RemotePresentation.verifyAuthRequestCertificateChain) {
|
|
10
|
+
* RemotePresentation.verifyAuthRequestCertificateChain(requestObjectJwt, { caRootCert })
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* @since 1.3.3
|
|
7
14
|
*
|
|
8
15
|
* @param requestObjectJwt The Request Object in JWT format
|
|
9
16
|
* @param params.caRootCert The CA root certificate used to validate the chain
|
|
@@ -11,7 +18,7 @@ export interface VerifyAuthRequestCertificateChainApi {
|
|
|
11
18
|
* @throws {MissingX509CertsError} if the Request Object does not contain x5c
|
|
12
19
|
* @throws {X509ValidationError} if the certificate chain validation fails
|
|
13
20
|
*/
|
|
14
|
-
verifyAuthRequestCertificateChain(
|
|
21
|
+
verifyAuthRequestCertificateChain?(
|
|
15
22
|
requestObjectJwt: string,
|
|
16
23
|
params: {
|
|
17
24
|
caRootCert: string;
|
|
@@ -8,7 +8,7 @@ export interface VerifyRequestObjectApi {
|
|
|
8
8
|
*
|
|
9
9
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
|
10
10
|
* @param params.clientId The client ID to verify
|
|
11
|
-
* @param params.rpConf
|
|
11
|
+
* @param params.rpConf Optional Relying Party configuration (OpenID Federation clients only)
|
|
12
12
|
* @param params.state Optional state
|
|
13
13
|
* @returns The verified Request Object
|
|
14
14
|
* @throws {InvalidRequestObjectError} if the Request Object cannot be validated
|
|
@@ -17,7 +17,7 @@ export interface VerifyRequestObjectApi {
|
|
|
17
17
|
requestObjectEncodedJwt: string,
|
|
18
18
|
params: {
|
|
19
19
|
clientId: string;
|
|
20
|
-
rpConf
|
|
20
|
+
rpConf?: RelyingPartyConfig;
|
|
21
21
|
state?: string;
|
|
22
22
|
}
|
|
23
23
|
): Promise<{ requestObject: RequestObject }>;
|
|
@@ -38,14 +38,14 @@ export interface SendAuthorizationResponseApi {
|
|
|
38
38
|
*
|
|
39
39
|
* @param requestObject The request details, including presentation requirements.
|
|
40
40
|
* @param remotePresentation The presentations to send, each with their VP token
|
|
41
|
-
* @param rpConf
|
|
41
|
+
* @param rpConf Optional Relying Party configuration (OpenID Federation clients only)
|
|
42
42
|
* @param context Contains optional custom fetch implementation.
|
|
43
43
|
* @returns Parsed and validated authorization response from the Relying Party.
|
|
44
44
|
*/
|
|
45
45
|
sendAuthorizationResponse(
|
|
46
46
|
requestObject: RequestObject,
|
|
47
47
|
remotePresentation: RemotePresentation,
|
|
48
|
-
rpConf
|
|
48
|
+
rpConf?: RelyingPartyConfig,
|
|
49
49
|
context?: FetchContext
|
|
50
50
|
): Promise<AuthorizationResponse>;
|
|
51
51
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
|
3
|
+
import type { jsonWebKeySet } from "@pagopa/io-wallet-oid-federation";
|
|
3
4
|
import type { SupportedSdJwtLegacyFormat } from "../../../sd-jwt/types";
|
|
4
5
|
|
|
5
6
|
export type PresentationParams = z.infer<typeof PresentationParams>;
|
|
@@ -68,6 +69,18 @@ export type RemotePresentationDetails = {
|
|
|
68
69
|
vpToken: string;
|
|
69
70
|
};
|
|
70
71
|
|
|
72
|
+
type ClientMetadata = {
|
|
73
|
+
jwks: jsonWebKeySet;
|
|
74
|
+
encrypted_response_enc_values_supported: string[];
|
|
75
|
+
client_id: string;
|
|
76
|
+
client_name: string;
|
|
77
|
+
logo_uri: string;
|
|
78
|
+
application_type: "web";
|
|
79
|
+
request_uris: string[];
|
|
80
|
+
response_uris: string[];
|
|
81
|
+
vp_formats_supported: Record<string, { "sd-jwt_alg_values"?: string[] }>;
|
|
82
|
+
};
|
|
83
|
+
|
|
71
84
|
/**
|
|
72
85
|
* Common Request Object type, decoupled from specific IT-Wallet versions
|
|
73
86
|
*/
|
|
@@ -80,6 +93,9 @@ export type RequestObject = {
|
|
|
80
93
|
dcql_query: Record<string, unknown>;
|
|
81
94
|
response_type: "vp_token";
|
|
82
95
|
response_mode: "direct_post.jwt";
|
|
96
|
+
x5c?: string[];
|
|
97
|
+
trust_chain?: string[];
|
|
98
|
+
client_metadata?: ClientMetadata;
|
|
83
99
|
};
|
|
84
100
|
|
|
85
101
|
/**
|
|
@@ -5,8 +5,8 @@ import type {
|
|
|
5
5
|
Credential4Dcql,
|
|
6
6
|
EvaluatedDisclosure,
|
|
7
7
|
PresentationFrame,
|
|
8
|
-
} from "
|
|
9
|
-
import { getValidDcqlClaims } from "
|
|
8
|
+
} from "../../api";
|
|
9
|
+
import { getValidDcqlClaims } from "./dcql";
|
|
10
10
|
|
|
11
11
|
type CustomDcqlMdocCredential = DcqlMdocCredential & {
|
|
12
12
|
original_credential: Credential4Dcql;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { decode as decodeJwt, verify } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
import { type z } from "zod";
|
|
3
3
|
import type { RelyingPartyConfig, RemotePresentationApi } from "../api";
|
|
4
|
+
import { IoWalletError } from "../../../utils/errors";
|
|
4
5
|
import { InvalidRequestObjectError } from "../common/errors";
|
|
5
|
-
import {
|
|
6
|
+
import { RawRequestObject } from "./types";
|
|
6
7
|
import { mapToRequestObject } from "./mappers";
|
|
7
8
|
import { getJwksFromRpConfig } from "./utils.jwks";
|
|
8
9
|
|
|
9
10
|
export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
10
11
|
async (requestObjectEncodedJwt, { clientId, rpConf, state }) => {
|
|
12
|
+
if (!rpConf) {
|
|
13
|
+
throw new IoWalletError(
|
|
14
|
+
"Relying Party Configuration is required for OpenID Federation clients"
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
const requestObjectJwt = decodeJwt(requestObjectEncodedJwt);
|
|
12
19
|
|
|
13
20
|
const pubKey = getSigPublicKey(
|
|
@@ -24,10 +31,14 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
24
31
|
);
|
|
25
32
|
}
|
|
26
33
|
|
|
27
|
-
const
|
|
34
|
+
const rawRequestObject = validateRequestObjectShape({
|
|
35
|
+
header: requestObjectJwt.protectedHeader,
|
|
36
|
+
payload: requestObjectJwt.payload,
|
|
37
|
+
});
|
|
28
38
|
|
|
29
39
|
const isClientIdMatch =
|
|
30
|
-
clientId ===
|
|
40
|
+
clientId === rawRequestObject.payload.client_id &&
|
|
41
|
+
clientId === rpConf.subject;
|
|
31
42
|
|
|
32
43
|
if (!isClientIdMatch) {
|
|
33
44
|
throw new InvalidRequestObjectError(
|
|
@@ -35,15 +46,15 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
35
46
|
);
|
|
36
47
|
}
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (!isStateMatch) {
|
|
49
|
+
if (state && state !== rawRequestObject.payload.state) {
|
|
41
50
|
throw new InvalidRequestObjectError(
|
|
42
51
|
"The provided state does not match the Request Object's"
|
|
43
52
|
);
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
return {
|
|
55
|
+
return {
|
|
56
|
+
requestObject: mapToRequestObject(rawRequestObject),
|
|
57
|
+
};
|
|
47
58
|
};
|
|
48
59
|
|
|
49
60
|
/**
|
|
@@ -53,8 +64,8 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
53
64
|
* @returns A valid Request Object
|
|
54
65
|
* @throws {InvalidRequestObjectError} when the Request Object cannot be parsed
|
|
55
66
|
*/
|
|
56
|
-
const validateRequestObjectShape = (payload: unknown):
|
|
57
|
-
const requestObjectParse =
|
|
67
|
+
const validateRequestObjectShape = (payload: unknown): RawRequestObject => {
|
|
68
|
+
const requestObjectParse = RawRequestObject.safeParse(payload);
|
|
58
69
|
|
|
59
70
|
if (requestObjectParse.success) {
|
|
60
71
|
return requestObjectParse.data;
|
|
@@ -97,7 +108,7 @@ const getSigPublicKey = (
|
|
|
97
108
|
* Utility to format flattened Zod errors into a simplified string `key1: key1_error, key2: key2_error`
|
|
98
109
|
*/
|
|
99
110
|
const formatFlattenedZodErrors = (
|
|
100
|
-
errors: z.core.$ZodFlattenedError<
|
|
111
|
+
errors: z.core.$ZodFlattenedError<RawRequestObject>
|
|
101
112
|
): string =>
|
|
102
113
|
Object.entries(errors.fieldErrors)
|
|
103
114
|
.map(([key, error]) => `${key}: ${error[0]}`)
|
|
@@ -3,6 +3,7 @@ import { NoSuitableKeysFoundInEntityConfiguration } from "../common/errors";
|
|
|
3
3
|
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
4
4
|
import type { JWK } from "../../../utils/jwk";
|
|
5
5
|
import {
|
|
6
|
+
IoWalletError,
|
|
6
7
|
RelyingPartyResponseError,
|
|
7
8
|
RelyingPartyResponseErrorCodes,
|
|
8
9
|
ResponseErrorBuilder,
|
|
@@ -118,6 +119,12 @@ export const sendAuthorizationResponse: RemotePresentationApi["sendAuthorization
|
|
|
118
119
|
rpConf,
|
|
119
120
|
{ appFetch = fetch } = {}
|
|
120
121
|
) => {
|
|
122
|
+
if (!rpConf) {
|
|
123
|
+
throw new IoWalletError(
|
|
124
|
+
"Relying Party Configuration is required for OpenID Federation clients"
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
121
128
|
const { presentations } = remotePresentation;
|
|
122
129
|
// 1. Prepare the VP token as a JSON object with keys corresponding to the DCQL query credential IDs
|
|
123
130
|
const requestBody = await buildDirectPostJwtBody(requestObject, rpConf, {
|
|
@@ -2,7 +2,6 @@ import type { RemotePresentationApi } from "../api";
|
|
|
2
2
|
import { startFlowFromQR } from "./01-start-flow";
|
|
3
3
|
import { evaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
|
|
4
4
|
import { getRequestObject } from "./03-get-request-object";
|
|
5
|
-
import { verifyAuthRequestCertificateChain } from "./04-verify-certificate-chain";
|
|
6
5
|
import { verifyRequestObject } from "./05-verify-request-object";
|
|
7
6
|
import { evaluateDcqlQuery } from "./06-evaluate-dcql-query";
|
|
8
7
|
import {
|
|
@@ -15,7 +14,6 @@ export const RemotePresentation: RemotePresentationApi = {
|
|
|
15
14
|
startFlowFromQR,
|
|
16
15
|
evaluateRelyingPartyTrust,
|
|
17
16
|
getRequestObject,
|
|
18
|
-
verifyAuthRequestCertificateChain,
|
|
19
17
|
verifyRequestObject,
|
|
20
18
|
evaluateDcqlQuery,
|
|
21
19
|
prepareRemotePresentations,
|
|
@@ -2,15 +2,15 @@ import { createMapper } from "../../../utils/mappers";
|
|
|
2
2
|
import { RelyingPartyEntityConfiguration } from "../../../trust/v1.0.0/types";
|
|
3
3
|
import type { RelyingPartyConfig } from "../api";
|
|
4
4
|
import type { RequestObject } from "../api/types";
|
|
5
|
-
import {
|
|
5
|
+
import { RawRequestObject } from "./types";
|
|
6
6
|
|
|
7
7
|
export const mapToRelyingPartyConfig = createMapper<
|
|
8
8
|
RelyingPartyEntityConfiguration,
|
|
9
9
|
RelyingPartyConfig
|
|
10
|
-
>((
|
|
11
|
-
const { federation_entity, openid_credential_verifier } =
|
|
10
|
+
>(({ payload }) => {
|
|
11
|
+
const { federation_entity, openid_credential_verifier } = payload.metadata;
|
|
12
12
|
return {
|
|
13
|
-
subject:
|
|
13
|
+
subject: payload.sub,
|
|
14
14
|
jwks: openid_credential_verifier.jwks,
|
|
15
15
|
authorization_encrypted_response_alg:
|
|
16
16
|
openid_credential_verifier.authorization_encrypted_response_alg,
|
|
@@ -20,16 +20,16 @@ export const mapToRelyingPartyConfig = createMapper<
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export const mapToRequestObject = createMapper<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
export const mapToRequestObject = createMapper<RawRequestObject, RequestObject>(
|
|
24
|
+
({ header, payload }) => ({
|
|
25
|
+
iss: payload.iss,
|
|
26
|
+
client_id: payload.client_id,
|
|
27
|
+
dcql_query: payload.dcql_query,
|
|
28
|
+
nonce: payload.nonce,
|
|
29
|
+
response_uri: payload.response_uri,
|
|
30
|
+
state: payload.state,
|
|
31
|
+
response_mode: payload.response_mode,
|
|
32
|
+
response_type: payload.response_type,
|
|
33
|
+
trust_chain: header.trust_chain,
|
|
34
|
+
})
|
|
35
|
+
);
|
|
@@ -2,21 +2,29 @@ import * as z from "zod";
|
|
|
2
2
|
import { UnixTime } from "../../../utils/zod";
|
|
3
3
|
import { ErrorResponse } from "../api/types";
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
export type RawRequestObject = z.infer<typeof RawRequestObject>;
|
|
6
|
+
export const RawRequestObject = z.object({
|
|
7
|
+
header: z.object({
|
|
8
|
+
alg: z.string(),
|
|
9
|
+
kid: z.string(),
|
|
10
|
+
typ: z.literal("oauth-authz-req+jwt"),
|
|
11
|
+
trust_chain: z.array(z.string()).optional(),
|
|
12
|
+
}),
|
|
13
|
+
payload: z.object({
|
|
14
|
+
iss: z.string(),
|
|
15
|
+
iat: UnixTime,
|
|
16
|
+
exp: UnixTime,
|
|
17
|
+
state: z.string(),
|
|
18
|
+
nonce: z.string(),
|
|
19
|
+
response_uri: z.string(),
|
|
20
|
+
request_uri_method: z.string().optional(),
|
|
21
|
+
response_type: z.literal("vp_token"),
|
|
22
|
+
response_mode: z.literal("direct_post.jwt"),
|
|
23
|
+
client_id: z.string(),
|
|
24
|
+
dcql_query: z.record(z.string(), z.any()), // Validation happens within the `dcql` library, no need to duplicate it here
|
|
25
|
+
scope: z.string().optional(),
|
|
26
|
+
wallet_nonce: z.string().optional(),
|
|
27
|
+
}),
|
|
20
28
|
});
|
|
21
29
|
|
|
22
30
|
/**
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import type { RemotePresentationApi } from "../api";
|
|
2
|
-
import {
|
|
1
|
+
import type { RelyingPartyConfig, RemotePresentationApi } from "../api";
|
|
2
|
+
import {
|
|
3
|
+
parseAuthorizeRequest as sdkParseAuthorizeRequest,
|
|
4
|
+
ClientIdPrefix,
|
|
5
|
+
extractClientIdPrefix,
|
|
6
|
+
} from "@pagopa/io-wallet-oid4vp";
|
|
7
|
+
import QuickCrypto from "react-native-quick-crypto";
|
|
3
8
|
import { partialCallbacks } from "../../../utils/callbacks";
|
|
4
9
|
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
10
|
+
import { IoWalletError } from "../../../utils/errors";
|
|
5
11
|
import { InvalidRequestObjectError } from "../common/errors";
|
|
6
12
|
import { mapSdkRequestObjectError } from "./sdkErrorMapper";
|
|
7
13
|
import { mapToRequestObject } from "./mappers";
|
|
14
|
+
import type { RawRequestObject } from "./types";
|
|
8
15
|
|
|
9
16
|
export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
10
17
|
async (requestObjectEncodedJwt, { clientId, rpConf }) => {
|
|
@@ -16,18 +23,64 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
16
23
|
},
|
|
17
24
|
}).catch(mapSdkRequestObjectError);
|
|
18
25
|
|
|
19
|
-
const
|
|
26
|
+
const rawRequestObject = parsedRequestObject as RawRequestObject;
|
|
20
27
|
|
|
21
|
-
const
|
|
22
|
-
clientId === payload.client_id && clientId === rpConf.subject;
|
|
28
|
+
const clientIdPrefix = extractClientIdPrefix(clientId);
|
|
23
29
|
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
if (clientIdPrefix === ClientIdPrefix.X509_HASH) {
|
|
31
|
+
validateX509HashClient(rawRequestObject.header.x5c, clientId);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
clientIdPrefix === ClientIdPrefix.OPENID_FEDERATION ||
|
|
36
|
+
clientIdPrefix === ClientIdPrefix.NONE
|
|
37
|
+
) {
|
|
38
|
+
validateOpenIDFederationClient(rawRequestObject, clientId, rpConf);
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
return {
|
|
31
|
-
requestObject: mapToRequestObject(
|
|
42
|
+
requestObject: mapToRequestObject(rawRequestObject),
|
|
32
43
|
};
|
|
33
44
|
};
|
|
45
|
+
|
|
46
|
+
const validateOpenIDFederationClient = (
|
|
47
|
+
requestObject: RawRequestObject,
|
|
48
|
+
clientId: string,
|
|
49
|
+
rpConf: RelyingPartyConfig | undefined
|
|
50
|
+
) => {
|
|
51
|
+
if (!rpConf) {
|
|
52
|
+
throw new IoWalletError(
|
|
53
|
+
"Relying Party Configuration is required for OpenID Federation clients"
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const isClientIdMatch =
|
|
58
|
+
clientId === requestObject.payload.client_id &&
|
|
59
|
+
stripOpenIdFederationPrefix(clientId) === rpConf.subject;
|
|
60
|
+
|
|
61
|
+
if (!isClientIdMatch) {
|
|
62
|
+
throw new InvalidRequestObjectError(
|
|
63
|
+
"Client ID does not match Request Object or Entity Configuration"
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const validateX509HashClient = (
|
|
69
|
+
certificateChain: string[],
|
|
70
|
+
clientId: string
|
|
71
|
+
) => {
|
|
72
|
+
const [, x509Hash] = clientId.split(":");
|
|
73
|
+
|
|
74
|
+
const calculatedHash = QuickCrypto.createHash("sha-256")
|
|
75
|
+
.update(certificateChain[0]!, "base64")
|
|
76
|
+
.digest("base64url");
|
|
77
|
+
|
|
78
|
+
if (x509Hash !== calculatedHash) {
|
|
79
|
+
throw new InvalidRequestObjectError(
|
|
80
|
+
"x509_hash does not match the hash of the x5c leaf certificate"
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const stripOpenIdFederationPrefix = (clientId: string) =>
|
|
86
|
+
clientId.replace("openid_federation:", "");
|
|
@@ -2,13 +2,13 @@ import { DcqlQuery, DcqlError } from "dcql";
|
|
|
2
2
|
import { isValiError } from "valibot";
|
|
3
3
|
import { CredentialsNotFoundError } from "../common/errors";
|
|
4
4
|
import type { CredentialPurpose } from "../api/06-evaluate-dcql-query";
|
|
5
|
-
import * as mdocUtils from "./utils.mdoc";
|
|
6
|
-
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
7
5
|
import * as sdJwtUtils from "../common/utils/sd-jwt";
|
|
8
|
-
import
|
|
6
|
+
import * as mdocUtils from "../common/utils/mdoc";
|
|
7
|
+
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
9
8
|
import {
|
|
10
9
|
extractFailedCredentialsDetails,
|
|
11
10
|
getDcqlQueryMatches,
|
|
11
|
+
getClaimsFromDcqlMatch,
|
|
12
12
|
getPresentationFrameFromDcqlMatch,
|
|
13
13
|
} from "../common/utils/dcql";
|
|
14
14
|
|
|
@@ -101,14 +101,23 @@ export const sendAuthorizationResponse: RemotePresentationApi["sendAuthorization
|
|
|
101
101
|
{ appFetch = fetch } = {}
|
|
102
102
|
) => {
|
|
103
103
|
try {
|
|
104
|
-
|
|
104
|
+
if (!rpConf && !requestObject.client_metadata) {
|
|
105
|
+
throw new IoWalletError(
|
|
106
|
+
"At least one of rpConf or requestObject.client_metadata must be provided to send the authorization response"
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// When the RP is not an OpenID Federation client, rpConf will be undefined
|
|
111
|
+
// so the keys are taken from the Request Object's client_metadata.
|
|
105
112
|
const rpJwks = {
|
|
106
|
-
jwks: rpConf.jwks,
|
|
113
|
+
jwks: rpConf?.jwks ?? requestObject.client_metadata!.jwks,
|
|
107
114
|
encrypted_response_enc_values_supported:
|
|
108
|
-
rpConf
|
|
115
|
+
rpConf?.encrypted_response_enc_values_supported ??
|
|
116
|
+
requestObject.client_metadata!
|
|
117
|
+
.encrypted_response_enc_values_supported,
|
|
109
118
|
};
|
|
110
119
|
|
|
111
|
-
const vp_token = presentations.reduce(
|
|
120
|
+
const vp_token = remotePresentation.presentations.reduce(
|
|
112
121
|
(acc, p) => {
|
|
113
122
|
(acc[p.credentialId] ??= []).push(p.vpToken);
|
|
114
123
|
return acc;
|
|
@@ -2,16 +2,16 @@ import { RelyingPartyEntityConfiguration } from "../../../trust/v1.3.3/types";
|
|
|
2
2
|
import { createMapper } from "../../../utils/mappers";
|
|
3
3
|
import type { RelyingPartyConfig } from "../api/RelyingPartyConfig";
|
|
4
4
|
import type { RequestObject } from "../api/types";
|
|
5
|
-
import {
|
|
5
|
+
import { RawRequestObject } from "./types";
|
|
6
6
|
|
|
7
7
|
export const mapToRelyingPartyConfig = createMapper<
|
|
8
8
|
RelyingPartyEntityConfiguration,
|
|
9
9
|
RelyingPartyConfig
|
|
10
|
-
>((
|
|
11
|
-
const { federation_entity, openid_credential_verifier } =
|
|
10
|
+
>(({ payload }) => {
|
|
11
|
+
const { federation_entity, openid_credential_verifier } = payload.metadata;
|
|
12
12
|
|
|
13
13
|
return {
|
|
14
|
-
subject:
|
|
14
|
+
subject: payload.sub,
|
|
15
15
|
jwks: openid_credential_verifier.jwks,
|
|
16
16
|
federation_entity,
|
|
17
17
|
encrypted_response_enc_values_supported:
|
|
@@ -19,16 +19,18 @@ export const mapToRelyingPartyConfig = createMapper<
|
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export const mapToRequestObject = createMapper<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
export const mapToRequestObject = createMapper<RawRequestObject, RequestObject>(
|
|
23
|
+
({ payload, header }) => ({
|
|
24
|
+
iss: payload.iss,
|
|
25
|
+
client_id: payload.client_id,
|
|
26
|
+
dcql_query: payload.dcql_query,
|
|
27
|
+
nonce: payload.nonce,
|
|
28
|
+
response_uri: payload.response_uri,
|
|
29
|
+
state: payload.state,
|
|
30
|
+
response_mode: payload.response_mode,
|
|
31
|
+
response_type: payload.response_type,
|
|
32
|
+
client_metadata: payload.client_metadata,
|
|
33
|
+
x5c: header.x5c,
|
|
34
|
+
trust_chain: header.trust_chain,
|
|
35
|
+
})
|
|
36
|
+
);
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
zOpenid4vpAuthorizationRequestHeaderV1_3,
|
|
4
|
+
zOpenid4vpAuthorizationRequestPayload,
|
|
5
|
+
} from "@pagopa/io-wallet-oid4vp";
|
|
3
6
|
|
|
4
|
-
export type
|
|
5
|
-
export const
|
|
7
|
+
export type RawRequestObject = z.infer<typeof RawRequestObject>;
|
|
8
|
+
export const RawRequestObject = z.object({
|
|
9
|
+
header: zOpenid4vpAuthorizationRequestHeaderV1_3,
|
|
10
|
+
payload: zOpenid4vpAuthorizationRequestPayload,
|
|
11
|
+
});
|
|
6
12
|
|
|
7
13
|
export type AuthorizationResponse = z.infer<typeof AuthorizationResponse>;
|
|
8
14
|
export const AuthorizationResponse = z.object({
|
|
@@ -111,15 +111,16 @@ const res = await wallet.CredentialStatus.statusList.get(
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
// Verify and parse the status list response to get the credential status
|
|
114
|
-
const { status } =
|
|
114
|
+
const { status, statusBit } =
|
|
115
115
|
await wallet.CredentialStatus.statusList.verifyAndParse(
|
|
116
|
-
issuerConf,
|
|
116
|
+
issuerConf.keys,
|
|
117
117
|
res
|
|
118
118
|
);
|
|
119
119
|
|
|
120
120
|
return {
|
|
121
121
|
statusList: res.statusList,
|
|
122
122
|
status,
|
|
123
|
+
statusBit,
|
|
123
124
|
};
|
|
124
125
|
```
|
|
125
126
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Out } from "../../../utils/misc";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
IssuerConfig,
|
|
5
|
-
} from "../../../credential/issuance/api";
|
|
2
|
+
import type { CredentialFormat } from "../../../credential/issuance/api";
|
|
3
|
+
import type { JWK } from "../../../utils/jwk";
|
|
6
4
|
|
|
7
5
|
export interface StatusListApi {
|
|
8
6
|
isSupported: true;
|
|
@@ -22,6 +20,7 @@ export interface StatusListApi {
|
|
|
22
20
|
* @since 1.3.3
|
|
23
21
|
* @param credential The credential to get the status list for
|
|
24
22
|
* @param format The credential format
|
|
23
|
+
* @param context.appFetch Optional fetch function to use for the network request
|
|
25
24
|
* @returns The raw status list, the index of the credential and other metadata
|
|
26
25
|
*/
|
|
27
26
|
get(
|
|
@@ -40,11 +39,15 @@ export interface StatusListApi {
|
|
|
40
39
|
/**
|
|
41
40
|
* Verifies the signature of a status list and extract the status at the specified index.
|
|
42
41
|
* @since 1.3.3
|
|
43
|
-
* @param
|
|
42
|
+
* @param keys The JSON Web Key Set to verify the status list signature
|
|
44
43
|
* @param statusListParams The raw status list, the index to read and other metadata
|
|
44
|
+
* @return The status of the credential and the raw status bit in hexadecimal format (e.g. "0x01")
|
|
45
45
|
*/
|
|
46
46
|
verifyAndParse(
|
|
47
|
-
|
|
47
|
+
keys: JWK[],
|
|
48
48
|
statusListParams: Out<StatusListApi["get"]>
|
|
49
|
-
): Promise<{
|
|
49
|
+
): Promise<{
|
|
50
|
+
statusBit: string;
|
|
51
|
+
status: string;
|
|
52
|
+
}>;
|
|
50
53
|
}
|