@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
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fetchMrtdPopInit } from "@pagopa/io-wallet-oauth2";
|
|
1
|
+
import { createClientAttestationPopJwt, fetchMrtdPopInit } from "@pagopa/io-wallet-oauth2";
|
|
3
2
|
import { UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError } from "@pagopa/io-wallet-utils";
|
|
4
|
-
import { createPopToken } from "../../../utils/pop";
|
|
5
3
|
import { Logger, LogLevel } from "../../../utils/logging";
|
|
6
|
-
import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from version 1.0.0
|
|
7
4
|
import { IssuerResponseError, IssuerResponseErrorCodes, ResponseErrorBuilder } from "../../../utils/errors";
|
|
8
|
-
import { createVerifyJwtFromJwks } from "../../../utils/callbacks";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
import { createSignJwtFromCryptoContext, createVerifyJwtFromJwks, partialCallbacks } from "../../../utils/callbacks";
|
|
6
|
+
/**
|
|
7
|
+
* Factory function to create `initChallenge` for MRTD PoP flow.
|
|
8
|
+
* The factory is needed to inject version specific SDK configuration.
|
|
9
|
+
* @param config Configuration object containing the IO Wallet SDK configuration
|
|
10
|
+
* @returns `initChallenge` function compliant with the public API
|
|
11
|
+
*/
|
|
12
|
+
export function createInitChallenge(config) {
|
|
13
|
+
return async function initChallenge(issuerConf, initUrl, mrtd_auth_session, mrtd_pop_jwt_nonce, context) {
|
|
14
|
+
const {
|
|
15
|
+
appFetch = fetch,
|
|
16
|
+
walletInstanceAttestation,
|
|
17
|
+
wiaCryptoContext
|
|
18
|
+
} = context;
|
|
19
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
20
|
+
config: config.sdkConfig,
|
|
21
|
+
callbacks: {
|
|
22
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
23
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext)
|
|
24
|
+
},
|
|
25
|
+
clientAttestation: walletInstanceAttestation,
|
|
26
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
27
|
+
signer: {
|
|
28
|
+
method: "jwk",
|
|
29
|
+
alg: "ES256",
|
|
30
|
+
publicJwk: await wiaCryptoContext.getPublicKey()
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const initResult = await fetchMrtdPopInit({
|
|
34
|
+
popInitEndpoint: initUrl,
|
|
35
|
+
mrtdAuthSession: mrtd_auth_session,
|
|
36
|
+
mrtdPopJwtNonce: mrtd_pop_jwt_nonce,
|
|
37
|
+
walletAttestation: walletInstanceAttestation,
|
|
38
|
+
clientAttestationDPoP,
|
|
39
|
+
callbacks: {
|
|
40
|
+
verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
|
|
41
|
+
fetch: appFetch
|
|
42
|
+
}
|
|
43
|
+
}).catch(handleInitChallengeError);
|
|
44
|
+
return {
|
|
45
|
+
challenge: initResult.challenge,
|
|
46
|
+
mrtd_pop_nonce: initResult.mrtdPopNonce,
|
|
47
|
+
pop_verify_endpoint: initResult.popVerifyEndpoint,
|
|
48
|
+
mrz: initResult.mrz
|
|
49
|
+
};
|
|
37
50
|
};
|
|
38
|
-
}
|
|
51
|
+
}
|
|
39
52
|
const handleInitChallengeError = e => {
|
|
40
53
|
Logger.log(LogLevel.ERROR, `Failed to get MRTD challenge: ${e}`);
|
|
41
54
|
if (!(e instanceof SdkUnexpectedStatusCodeError)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createClientAttestationPopJwt","fetchMrtdPopInit","UnexpectedStatusCodeError","SdkUnexpectedStatusCodeError","Logger","LogLevel","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","createSignJwtFromCryptoContext","createVerifyJwtFromJwks","partialCallbacks","createInitChallenge","config","initChallenge","issuerConf","initUrl","mrtd_auth_session","mrtd_pop_jwt_nonce","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","clientAttestationDPoP","sdkConfig","callbacks","generateRandom","signJwt","clientAttestation","authorizationServer","credential_issuer","signer","method","alg","publicJwk","getPublicKey","initResult","popInitEndpoint","mrtdAuthSession","mrtdPopJwtNonce","walletAttestation","verifyJwt","keys","catch","handleInitChallengeError","challenge","mrtd_pop_nonce","mrtdPopNonce","pop_verify_endpoint","popVerifyEndpoint","mrz","e","log","ERROR","handle","code","MrtdChallengeInitRequestFailed","message","buildFrom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/02-init-challenge.ts"],"mappings":"AAAA,SACEA,6BAA6B,EAC7BC,gBAAgB,QACX,0BAA0B;AACjC,SAEEC,yBAAyB,IAAIC,4BAA4B,QACpD,yBAAyB;AAChC,SAASC,MAAM,EAAEC,QAAQ,QAAQ,wBAAwB;AACzD,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,QACf,uBAAuB;AAE9B,SACEC,8BAA8B,EAC9BC,uBAAuB,EACvBC,gBAAgB,QACX,0BAA0B;AAMjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CACjCC,MAAc,EACe;EAC7B,OAAO,eAAeC,aAAaA,CACjCC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,kBAAkB,EAClBC,OAAO,EACP;IACA,MAAM;MACJC,QAAQ,GAAGC,KAAK;MAChBC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AM,IAAI5C,oBAAoB,CAACF,mBAAmB,CAAC,CAChDiD,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEjD,wBAAwB,CAACkD,8BAA8B;IAC7DC,OAAO,EAAE;EACX,CAAC,CAAC,CACDC,SAAS,CAACP,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -1,53 +1,64 @@
|
|
|
1
1
|
import { SignJWT } from "@pagopa/io-react-native-jwt";
|
|
2
|
-
import { fetchMrtdPopVerify } from "@pagopa/io-wallet-oauth2";
|
|
3
|
-
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import { createPopToken } from "../../../utils/pop";
|
|
5
|
-
import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from 1.0.0 version
|
|
2
|
+
import { createClientAttestationPopJwt, fetchMrtdPopVerify } from "@pagopa/io-wallet-oauth2";
|
|
6
3
|
import { sdkUnexpectedStatusCodeToIssuerError } from "../../../utils/errors";
|
|
7
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
4
|
+
import { createSignJwtFromCryptoContext, partialCallbacks } from "../../../utils/callbacks";
|
|
5
|
+
/**
|
|
6
|
+
* Factory function to create `validateChallenge` for MRTD PoP flow.
|
|
7
|
+
* The factory is needed to inject version specific SDK configuration.
|
|
8
|
+
* @param config Configuration object containing the IO Wallet SDK configuration
|
|
9
|
+
* @returns `validateChallenge` function compliant with the public API
|
|
10
|
+
*/
|
|
11
|
+
export function createValidateChallenge(config) {
|
|
12
|
+
return async function validateChallenge(issuerConf, verifyUrl, mrtd_auth_session, mrtd_pop_nonce, mrtd, ias, context) {
|
|
13
|
+
const {
|
|
14
|
+
appFetch = fetch,
|
|
15
|
+
walletInstanceAttestation,
|
|
16
|
+
wiaCryptoContext
|
|
17
|
+
} = context;
|
|
18
|
+
const aud = issuerConf.credential_issuer;
|
|
19
|
+
const wiaPublicJwk = await wiaCryptoContext.getPublicKey();
|
|
20
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
21
|
+
config: config.sdkConfig,
|
|
22
|
+
callbacks: {
|
|
23
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
24
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext)
|
|
25
|
+
},
|
|
26
|
+
clientAttestation: walletInstanceAttestation,
|
|
27
|
+
authorizationServer: aud,
|
|
28
|
+
signer: {
|
|
29
|
+
method: "jwk",
|
|
30
|
+
alg: "ES256",
|
|
31
|
+
publicJwk: wiaPublicJwk
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const mrtdValidationJwt = await new SignJWT(wiaCryptoContext).setProtectedHeader({
|
|
35
|
+
typ: "mrtd-ias+jwt",
|
|
36
|
+
kid: wiaPublicJwk.kid
|
|
37
|
+
}).setPayload({
|
|
38
|
+
iss: wiaPublicJwk.kid,
|
|
39
|
+
aud,
|
|
40
|
+
document_type: "cie",
|
|
41
|
+
mrtd,
|
|
42
|
+
ias
|
|
43
|
+
}).setIssuedAt().setExpirationTime("5m").sign();
|
|
44
|
+
const verifyResult = await fetchMrtdPopVerify({
|
|
45
|
+
popVerifyEndpoint: verifyUrl,
|
|
46
|
+
mrtdAuthSession: mrtd_auth_session,
|
|
47
|
+
mrtdPopNonce: mrtd_pop_nonce,
|
|
48
|
+
clientAttestationDPoP,
|
|
49
|
+
mrtdValidationJwt,
|
|
50
|
+
walletAttestation: walletInstanceAttestation,
|
|
51
|
+
callbacks: {
|
|
52
|
+
fetch: appFetch,
|
|
53
|
+
...partialCallbacks
|
|
54
|
+
}
|
|
55
|
+
}).catch(sdkUnexpectedStatusCodeToIssuerError);
|
|
56
|
+
return {
|
|
57
|
+
redirect_uri: verifyResult.redirectUri,
|
|
58
|
+
mrtd_val_pop_nonce: verifyResult.mrtdValPopNonce
|
|
59
|
+
};
|
|
49
60
|
};
|
|
50
|
-
}
|
|
61
|
+
}
|
|
51
62
|
export const buildChallengeCallbackUrl = async (redirectUri, valPopNonce, authSession) => {
|
|
52
63
|
const params = new URLSearchParams({
|
|
53
64
|
mrtd_val_pop_nonce: valPopNonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SignJWT","
|
|
1
|
+
{"version":3,"names":["SignJWT","createClientAttestationPopJwt","fetchMrtdPopVerify","sdkUnexpectedStatusCodeToIssuerError","createSignJwtFromCryptoContext","partialCallbacks","createValidateChallenge","config","validateChallenge","issuerConf","verifyUrl","mrtd_auth_session","mrtd_pop_nonce","mrtd","ias","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","aud","credential_issuer","wiaPublicJwk","getPublicKey","clientAttestationDPoP","sdkConfig","callbacks","generateRandom","signJwt","clientAttestation","authorizationServer","signer","method","alg","publicJwk","mrtdValidationJwt","setProtectedHeader","typ","kid","setPayload","iss","document_type","setIssuedAt","setExpirationTime","sign","verifyResult","popVerifyEndpoint","mrtdAuthSession","mrtdPopNonce","walletAttestation","catch","redirect_uri","redirectUri","mrtd_val_pop_nonce","mrtdValPopNonce","buildChallengeCallbackUrl","valPopNonce","authSession","params","URLSearchParams","callbackUrl"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/03-validate-challenge.ts"],"mappings":"AAAA,SA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F,CAAC,CAAC,CACD4B,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;IAET,MAAMC,YAAY,GAAG,MAAM3C,kBAAkB,CAAC;MAC5C4C,iBAAiB,EAAEpC,SAAS;MAC5BqC,eAAe,EAAEpC,iBAAiB;MAClCqC,YAAY,EAAEpC,cAAc;MAC5BY,qBAAqB;MACrBW,iBAAiB;MACjBc,iBAAiB,EAAE/B,yBAAyB;MAC5CQ,SAAS,EAAE;QACTT,KAAK,EAAED,QAAQ;QACf,GAAGX;MACL;IACF,CAAC,CAAC,CAAC6C,KAAK,CAAC/C,oCAAoC,CAAC;IAE9C,OAAO;MACLgD,YAAY,EAAEN,YAAY,CAACO,WAAW;MACtCC,kBAAkB,EAAER,YAAY,CAACS;IACnC,CAAC;EACH,CAAC;AACH;AAEA,OAAO,MAAMC,yBAAkE,GAC7E,MAAAA,CAAOH,WAAW,EAAEI,WAAW,EAAEC,WAAW,KAAK;EAC/C,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCN,kBAAkB,EAAEG,WAAW;IAC/B7C,iBAAiB,EAAE8C;EACrB,CAAC,CAAC;EAEF,MAAMG,WAAW,GAAI,GAAER,WAAY,IAAGM,MAAO,EAAC;EAC9C,OAAO;IAAEE;EAAY,CAAC;AACxB,CAAC"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { sdkConfigV1_0, sdkConfigV1_3 } from "../../../utils/config";
|
|
1
2
|
import { verifyAndParseChallengeInfo } from "./01-verify-and-parse-challenge-info";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export const
|
|
3
|
+
import { createInitChallenge } from "./02-init-challenge";
|
|
4
|
+
import { createValidateChallenge, buildChallengeCallbackUrl } from "./03-validate-challenge";
|
|
5
|
+
export const MRTDPoPv1_0 = {
|
|
5
6
|
verifyAndParseChallengeInfo,
|
|
6
|
-
initChallenge
|
|
7
|
-
|
|
7
|
+
initChallenge: createInitChallenge({
|
|
8
|
+
sdkConfig: sdkConfigV1_0
|
|
9
|
+
}),
|
|
10
|
+
validateChallenge: createValidateChallenge({
|
|
11
|
+
sdkConfig: sdkConfigV1_0
|
|
12
|
+
}),
|
|
13
|
+
buildChallengeCallbackUrl
|
|
14
|
+
};
|
|
15
|
+
export const MRTDPoPv1_3 = {
|
|
16
|
+
verifyAndParseChallengeInfo,
|
|
17
|
+
initChallenge: createInitChallenge({
|
|
18
|
+
sdkConfig: sdkConfigV1_3
|
|
19
|
+
}),
|
|
20
|
+
validateChallenge: createValidateChallenge({
|
|
21
|
+
sdkConfig: sdkConfigV1_3
|
|
22
|
+
}),
|
|
8
23
|
buildChallengeCallbackUrl
|
|
9
24
|
};
|
|
10
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["verifyAndParseChallengeInfo","
|
|
1
|
+
{"version":3,"names":["sdkConfigV1_0","sdkConfigV1_3","verifyAndParseChallengeInfo","createInitChallenge","createValidateChallenge","buildChallengeCallbackUrl","MRTDPoPv1_0","initChallenge","sdkConfig","validateChallenge","MRTDPoPv1_3"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/index.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,aAAa,QAAQ,uBAAuB;AAEpE,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SACEC,uBAAuB,EACvBC,yBAAyB,QACpB,yBAAyB;AAEhC,OAAO,MAAMC,WAAuB,GAAG;EACrCJ,2BAA2B;EAC3BK,aAAa,EAAEJ,mBAAmB,CAAC;IAAEK,SAAS,EAAER;EAAc,CAAC,CAAC;EAChES,iBAAiB,EAAEL,uBAAuB,CAAC;IAAEI,SAAS,EAAER;EAAc,CAAC,CAAC;EACxEK;AACF,CAAC;AAED,OAAO,MAAMK,WAAuB,GAAG;EACrCR,2BAA2B;EAC3BK,aAAa,EAAEJ,mBAAmB,CAAC;IAAEK,SAAS,EAAEP;EAAc,CAAC,CAAC;EAChEQ,iBAAiB,EAAEL,uBAAuB,CAAC;IAAEI,SAAS,EAAEP;EAAc,CAAC,CAAC;EACxEI;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { generateRandomAlphaNumericString } from "../../../utils/misc";
|
|
|
2
2
|
import { makeParRequest } from "../../../utils/par";
|
|
3
3
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
4
4
|
import { IoWalletError } from "../../../utils/errors";
|
|
5
|
-
import { selectCredentialDefinition, selectResponseMode } from "../common/authorization";
|
|
5
|
+
import { selectCredentialDefinition, selectResponseMode } from "../common/02-start-user-authorization";
|
|
6
6
|
export const startUserAuthorization = async (issuerConf, credentialIds, proof, ctx) => {
|
|
7
7
|
const {
|
|
8
8
|
wiaCryptoContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateRandomAlphaNumericString","makeParRequest","LogLevel","Logger","IoWalletError","selectCredentialDefinition","selectResponseMode","startUserAuthorization","issuerConf","credentialIds","proof","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","log","ERROR","codeVerifier","parEndpoint","pushed_authorization_request_endpoint","aud","credential_issuer","responseMode","getPar","credentialDefinition","map","c","proofType","push","type","idphinting","idpHinting","challenge_method","challenge_redirect_uri","issuerRequestUri","authorizationDetails"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/02-start-user-authorization.ts"],"mappings":"AAAA,SAASA,gCAAgC,QAAQ,qBAAqB;AACtE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,uBAAuB;AAErD,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,
|
|
1
|
+
{"version":3,"names":["generateRandomAlphaNumericString","makeParRequest","LogLevel","Logger","IoWalletError","selectCredentialDefinition","selectResponseMode","startUserAuthorization","issuerConf","credentialIds","proof","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","log","ERROR","codeVerifier","parEndpoint","pushed_authorization_request_endpoint","aud","credential_issuer","responseMode","getPar","credentialDefinition","map","c","proofType","push","type","idphinting","idpHinting","challenge_method","challenge_redirect_uri","issuerRequestUri","authorizationDetails"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/02-start-user-authorization.ts"],"mappings":"AAAA,SAASA,gCAAgC,QAAQ,qBAAqB;AACtE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,uBAAuB;AAErD,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,uCAAuC;AAE9C,OAAO,MAAMC,sBAA6D,GACxE,MAAAA,CAAOC,UAAU,EAAEC,aAAa,EAAEC,KAAK,EAAEC,GAAG,KAAK;EAC/C,MAAM;IACJC,gBAAgB;IAChBC,yBAAyB;IACzBC,WAAW;IACXC,QAAQ,GAAGC;EACb,CAAC,GAAGL,GAAG;EAEP,MAAMM,QAAQ,GAAG,MAAML,gBAAgB,CAACM,YAAY,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,GAAG,CAAC;EAEzE,IAAI,CAACJ,QAAQ,EAAE;IACbd,MAAM,CAACmB,GAAG,CACRpB,QAAQ,CAACqB,KAAK,EACb,kCAAiCN,QAAS,0BAC7C,CAAC;IACD,MAAM,IAAIb,aAAa,CAAC,qBAAqB,CAAC;EAChD;EACA,MAAMoB,YAAY,GAAGxB,gCAAgC,CAAC,EAAE,CAAC;EACzD,MAAMyB,WAAW,GAAGjB,UAAU,CAACkB,qCAAqC;EACpE,MAAMC,GAAG,GAAGnB,UAAU,CAACoB,iBAAiB;EACxC,MAAMC,YAAY,GAAGvB,kBAAkB,CAACE,UAAU,EAAEC,aAAa,CAAC;EAClE,MAAMqB,MAAM,GAAG7B,cAAc,CAAC;IAAEW,gBAAgB;IAAEG;EAAS,CAAC,CAAC;EAE7D,MAAMgB,oBAAoB,GAAGtB,aAAa,CAACuB,GAAG,CAAEC,CAAC,IAC/C5B,0BAA0B,CAACG,UAAU,EAAEyB,CAAC,CAC1C,CAAC;EAED,IAAIvB,KAAK,CAACwB,SAAS,KAAK,UAAU,EAAE;IAClC;AACN;AACA;AACA;AACA;AACA;IACMH,oBAAoB,CAACI,IAAI,CAAC;MACxBC,IAAI,EAAE,sBAAsB;MAC5BC,UAAU,EAAE3B,KAAK,CAAC4B,UAAU;MAC5BC,gBAAgB,EAAE,UAAU;MAC5BC,sBAAsB,EAAE1B;IAC1B,CAAC,CAAC;EACJ;EAEA,MAAM2B,gBAAgB,GAAG,MAAMX,MAAM,CACnCL,WAAW,EACXZ,yBAAyB,EACzB;IACEc,GAAG;IACHV,QAAQ;IACRO,YAAY;IACZV,WAAW;IACXe,YAAY;IACZa,oBAAoB,EAAEX;EACxB,CACF,CAAC;EAED,OAAO;IAAEU,gBAAgB;IAAExB,QAAQ;IAAEO,YAAY;IAAEO;EAAqB,CAAC;AAC3E,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { ResponseUriResultShape } from "./types";
|
|
|
7
7
|
import { getJwtFromFormPost } from "../../../utils/decoder";
|
|
8
8
|
import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
|
|
9
9
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
10
|
-
import {
|
|
10
|
+
import { RawRequestObject } from "../../presentation/v1.0.0/types";
|
|
11
11
|
import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.0.0";
|
|
12
12
|
export const continueUserAuthorizationWithMRTDPoPChallenge = async authRedirectUrl => {
|
|
13
13
|
Logger.log(LogLevel.DEBUG, `The requested credential is a PersonIdentificationData and requires MRTD PoP, starting MRTD PoP validation from auth redirect`);
|
|
@@ -55,7 +55,10 @@ export const getRequestedCredentialToBePresented = async function (issuerRequest
|
|
|
55
55
|
Logger.log(LogLevel.DEBUG, `Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`);
|
|
56
56
|
const requestObject = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
|
|
57
57
|
method: "GET"
|
|
58
|
-
}).then(hasStatusOrThrow(200, IssuerResponseError)).then(res => res.text()).then(jws => decode(jws)).then(reqObj =>
|
|
58
|
+
}).then(hasStatusOrThrow(200, IssuerResponseError)).then(res => res.text()).then(jws => decode(jws)).then(reqObj => RawRequestObject.safeParse({
|
|
59
|
+
header: reqObj.protectedHeader,
|
|
60
|
+
payload: reqObj.payload
|
|
61
|
+
}));
|
|
59
62
|
if (!requestObject.success) {
|
|
60
63
|
Logger.log(LogLevel.ERROR, `Error while validating the response object: ${requestObject.error.message}`);
|
|
61
64
|
throw new ValidationFailed({
|
|
@@ -63,7 +66,7 @@ export const getRequestedCredentialToBePresented = async function (issuerRequest
|
|
|
63
66
|
reason: requestObject.error.message
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
|
-
return requestObject.data;
|
|
69
|
+
return requestObject.data.payload;
|
|
67
70
|
};
|
|
68
71
|
export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, _issuerConfig, pid, _ref) => {
|
|
69
72
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AuthorizationChallengeResultShape","AuthorizationErrorShape","AuthorizationResultShape","hasStatusOrThrow","parseUrl","IssuerResponseError","ValidationFailed","decode","SignJWT","ResponseUriResultShape","getJwtFromFormPost","AuthorizationError","AuthorizationIdpError","LogLevel","Logger","
|
|
1
|
+
{"version":3,"names":["AuthorizationChallengeResultShape","AuthorizationErrorShape","AuthorizationResultShape","hasStatusOrThrow","parseUrl","IssuerResponseError","ValidationFailed","decode","SignJWT","ResponseUriResultShape","getJwtFromFormPost","AuthorizationError","AuthorizationIdpError","LogLevel","Logger","RawRequestObject","RemotePresentation","RemotePresentationFlow","continueUserAuthorizationWithMRTDPoPChallenge","authRedirectUrl","log","DEBUG","query","authResParsed","safeParse","success","authErr","ERROR","error","message","JSON","stringify","data","error_description","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","completeUserAuthorizationWithQueryMode","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObject","method","then","res","text","jws","reqObj","header","protectedHeader","payload","reason","completeUserAuthorizationWithFormPostJwtMode","_issuerConfig","pid","_ref","wiaCryptoContext","pidKeyTag","dcqlQueryResult","evaluateDcqlQuery","dcql_query","authRequestObject","nonce","responseUri","response_uri","remotePresentation","prepareRemotePresentations","authzResponsePayload","createAuthzResponsePayload","state","body","response","resUriRes","headers","reqUri","json","redirect_uri","cbRes","decodedJwt","authRes","_ref2","kid","getPublicKey","setProtectedHeader","typ","setPayload","vp_token","presentations","reduce","_ref3","credentialId","vpToken","setIssuedAt","setExpirationTime","sign"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/03-complete-user-authorization.ts"],"mappings":"AAAA,SACEA,iCAAiC,EACjCC,uBAAuB,EACvBC,wBAAwB,QAEnB,qBAAqB;AAC5B,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,OAAOC,QAAQ,MAAM,WAAW;AAEhC,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAC7E,SACEC,MAAM,EACNC,OAAO,QAEF,6BAA6B;AACpC,SAASC,sBAAsB,QAAQ,SAAS;AAChD,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,kBAAkB;AAC5E,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,kBAAkB,IAAIC,sBAAsB,QAAQ,2BAA2B;AAIxF,OAAO,MAAMC,6CAA2G,GACtH,MAAOC,eAAe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AU,CAAC;IACV;AACN;AACA;AACA;AACA;IACM,IAAIhB,KAAK,GAAG;MAAEA;IAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3BiB,QAAQ,EAAErB,kBAAkB,CAACsB,aAAa,CAACC,MAAM,CAC/C,CAACF,QAAQ,EAAAG,KAAA;MAAA,IAAE;QAAEC,YAAY;QAAEC;MAAQ,CAAC,GAAAF,KAAA;MAAA,OAAM;QACxC,GAAGH,QAAQ;QACX,CAACI,YAAY,GAAGC;MAClB,CAAC;IAAA,CAAC,EACF,CAAC,CACH;EACF,CAAC,CAAC,CACDC,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
import { v4 as uuidv4 } from "uuid";
|
|
3
3
|
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
4
|
-
import { IssuerResponseError, IssuerResponseErrorCodes, ResponseErrorBuilder, UnexpectedStatusCodeError, ValidationFailed } from "../../../utils/errors";
|
|
4
|
+
import { IssuerResponseError, IssuerResponseErrorCodes, ResponseErrorBuilder, UnexpectedStatusCodeError, UnimplementedFeatureError, ValidationFailed } from "../../../utils/errors";
|
|
5
5
|
import { createDPopToken } from "../../../utils/dpop";
|
|
6
6
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
7
7
|
import { CredentialResponse, NonceResponse } from "./types";
|
|
@@ -137,4 +137,7 @@ const handleObtainCredentialError = e => {
|
|
|
137
137
|
message: "Unable to obtain the requested credential"
|
|
138
138
|
}).buildFrom(e);
|
|
139
139
|
};
|
|
140
|
+
export const obtainCredentialsBatch = () => {
|
|
141
|
+
throw new UnimplementedFeatureError("obtainCredentialsBatch", "1.0.0");
|
|
142
|
+
};
|
|
140
143
|
//# sourceMappingURL=05-obtain-credential.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","v4","uuidv4","hasStatusOrThrow","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","UnexpectedStatusCodeError","ValidationFailed","createDPopToken","LogLevel","Logger","CredentialResponse","NonceResponse","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credential_configuration_id","credential_identifier","credentialUrl","credential_endpoint","issuerUrl","credential_issuer","nonceUrl","nonce_endpoint","c_nonce","method","headers","then","res","json","body","parse","signedNonceProof","log","DEBUG","containsCredentialDefinition","authorization_details","some","c","credential_identifiers","includes","ERROR","message","credentialRequestFormBody","proof","jwt","proof_type","JSON","stringify","tokenRequestSignedDPop","htm","htu","jti","ath","access_token","credentialRes","DPoP","Authorization","token_type","safeParse","catch","handleObtainCredentialError","success","error","reason","data","issuerCredentialConfig","credential_configurations_supported","credential","credentials","at","format","e","handle","code","CredentialIssuingNotSynchronous","CredentialInvalidStatus","CredentialRequestFailed","buildFrom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/05-obtain-credential.ts"],"mappings":"AAAA,SAEEA,cAAc,EACdC,OAAO,QACF,6BAA6B;AACpC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,yBAAyB,EACzBC,gBAAgB,QACX,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AAEzD,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,SAAS;AAE3D,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,
|
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","v4","uuidv4","hasStatusOrThrow","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","UnexpectedStatusCodeError","UnimplementedFeatureError","ValidationFailed","createDPopToken","LogLevel","Logger","CredentialResponse","NonceResponse","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credential_configuration_id","credential_identifier","credentialUrl","credential_endpoint","issuerUrl","credential_issuer","nonceUrl","nonce_endpoint","c_nonce","method","headers","then","res","json","body","parse","signedNonceProof","log","DEBUG","containsCredentialDefinition","authorization_details","some","c","credential_identifiers","includes","ERROR","message","credentialRequestFormBody","proof","jwt","proof_type","JSON","stringify","tokenRequestSignedDPop","htm","htu","jti","ath","access_token","credentialRes","DPoP","Authorization","token_type","safeParse","catch","handleObtainCredentialError","success","error","reason","data","issuerCredentialConfig","credential_configurations_supported","credential","credentials","at","format","e","handle","code","CredentialIssuingNotSynchronous","CredentialInvalidStatus","CredentialRequestFailed","buildFrom","obtainCredentialsBatch"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/05-obtain-credential.ts"],"mappings":"AAAA,SAEEA,cAAc,EACdC,OAAO,QACF,6BAA6B;AACpC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,yBAAyB,EACzBC,yBAAyB,EACzBC,gBAAgB,QACX,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAE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O,CAAC;AACxE,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
|
|
|
2
2
|
import { startUserAuthorization } from "./02-start-user-authorization";
|
|
3
3
|
import { continueUserAuthorizationWithMRTDPoPChallenge, completeUserAuthorizationWithQueryMode, completeUserAuthorizationWithFormPostJwtMode, buildAuthorizationUrl, getRequestedCredentialToBePresented } from "./03-complete-user-authorization";
|
|
4
4
|
import { authorizeAccess } from "./04-authorize-access";
|
|
5
|
-
import { obtainCredential } from "./05-obtain-credential";
|
|
5
|
+
import { obtainCredential, obtainCredentialsBatch } from "./05-obtain-credential";
|
|
6
6
|
import { verifyAndParseCredential } from "./06-verify-and-parse-credential";
|
|
7
|
-
import {
|
|
7
|
+
import { MRTDPoPv1_0 } from "../mrtd-pop";
|
|
8
8
|
export const Issuance = {
|
|
9
9
|
evaluateIssuerTrust,
|
|
10
10
|
startUserAuthorization,
|
|
@@ -15,7 +15,8 @@ export const Issuance = {
|
|
|
15
15
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
16
16
|
authorizeAccess,
|
|
17
17
|
obtainCredential,
|
|
18
|
+
obtainCredentialsBatch,
|
|
18
19
|
verifyAndParseCredential,
|
|
19
|
-
MRTDPoP
|
|
20
|
+
MRTDPoP: MRTDPoPv1_0
|
|
20
21
|
};
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","continueUserAuthorizationWithMRTDPoPChallenge","completeUserAuthorizationWithQueryMode","completeUserAuthorizationWithFormPostJwtMode","buildAuthorizationUrl","getRequestedCredentialToBePresented","authorizeAccess","obtainCredential","verifyAndParseCredential","
|
|
1
|
+
{"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","continueUserAuthorizationWithMRTDPoPChallenge","completeUserAuthorizationWithQueryMode","completeUserAuthorizationWithFormPostJwtMode","buildAuthorizationUrl","getRequestedCredentialToBePresented","authorizeAccess","obtainCredential","obtainCredentialsBatch","verifyAndParseCredential","MRTDPoPv1_0","Issuance","MRTDPoP"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/index.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,sBAAsB,QAAQ,+BAA+B;AACtE,SACEC,6CAA6C,EAC7CC,sCAAsC,EACtCC,4CAA4C,EAC5CC,qBAAqB,EACrBC,mCAAmC,QAC9B,kCAAkC;AACzC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SACEC,gBAAgB,EAChBC,sBAAsB,QACjB,wBAAwB;AAC/B,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,SAASC,WAAW,QAAQ,aAAa;AAEzC,OAAO,MAAMC,QAAqB,GAAG;EACnCZ,mBAAmB;EACnBC,sBAAsB;EACtBI,qBAAqB;EACrBF,sCAAsC;EACtCD,6CAA6C;EAC7CI,mCAAmC;EACnCF,4CAA4C;EAC5CG,eAAe;EACfC,gBAAgB;EAChBC,sBAAsB;EACtBC,wBAAwB;EACxBG,OAAO,EAAEF;AACX,CAAC"}
|
|
@@ -10,7 +10,7 @@ export const mapToIssuerConfig = createMapper(x => {
|
|
|
10
10
|
credential_endpoint: openid_credential_issuer.credential_endpoint,
|
|
11
11
|
credential_issuer: openid_credential_issuer.credential_issuer,
|
|
12
12
|
credential_configurations_supported: openid_credential_issuer.credential_configurations_supported,
|
|
13
|
-
keys: openid_credential_issuer.jwks.keys,
|
|
13
|
+
keys: [...openid_credential_issuer.jwks.keys, ...oauth_authorization_server.jwks.keys],
|
|
14
14
|
pushed_authorization_request_endpoint: oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
15
15
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
16
16
|
status_assertion_endpoint: openid_credential_issuer.status_attestation_endpoint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMapper","mapToIssuerConfig","x","oauth_authorization_server","openid_credential_issuer","federation_entity","payload","metadata","authorization_endpoint","credential_endpoint","credential_issuer","credential_configurations_supported","keys","jwks","pushed_authorization_request_endpoint","token_endpoint","status_assertion_endpoint","status_attestation_endpoint","nonce_endpoint"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/mappers.ts"],"mappings":"AACA,SAASA,YAAY,QAAQ,wBAAwB;AAGrD,OAAO,MAAMC,iBAAiB,GAAGD,YAAY,CAG1CE,CAAC,IAAK;EACP,MAAM;IACJC,0BAA0B;IAC1BC,wBAAwB;IACxBC;EACF,CAAC,GAAGH,CAAC,CAACI,OAAO,CAACC,QAAQ;EACtB,OAAO;IACLC,sBAAsB,EAAEL,0BAA0B,CAACK,sBAAsB;IACzEC,mBAAmB,EAAEL,wBAAwB,CAACK,mBAAmB;IACjEC,iBAAiB,EAAEN,wBAAwB,CAACM,iBAAiB;IAC7DC,mCAAmC,EACjCP,wBAAwB,CAACO,mCAAmC;IAC9DC,IAAI,
|
|
1
|
+
{"version":3,"names":["createMapper","mapToIssuerConfig","x","oauth_authorization_server","openid_credential_issuer","federation_entity","payload","metadata","authorization_endpoint","credential_endpoint","credential_issuer","credential_configurations_supported","keys","jwks","pushed_authorization_request_endpoint","token_endpoint","status_assertion_endpoint","status_attestation_endpoint","nonce_endpoint"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/mappers.ts"],"mappings":"AACA,SAASA,YAAY,QAAQ,wBAAwB;AAGrD,OAAO,MAAMC,iBAAiB,GAAGD,YAAY,CAG1CE,CAAC,IAAK;EACP,MAAM;IACJC,0BAA0B;IAC1BC,wBAAwB;IACxBC;EACF,CAAC,GAAGH,CAAC,CAACI,OAAO,CAACC,QAAQ;EACtB,OAAO;IACLC,sBAAsB,EAAEL,0BAA0B,CAACK,sBAAsB;IACzEC,mBAAmB,EAAEL,wBAAwB,CAACK,mBAAmB;IACjEC,iBAAiB,EAAEN,wBAAwB,CAACM,iBAAiB;IAC7DC,mCAAmC,EACjCP,wBAAwB,CAACO,mCAAmC;IAC9DC,IAAI,EAAE,CACJ,GAAGR,wBAAwB,CAACS,IAAI,CAACD,IAAI,EACrC,GAAGT,0BAA0B,CAACU,IAAI,CAACD,IAAI,CACxC;IACDE,qCAAqC,EACnCX,0BAA0B,CAACW,qCAAqC;IAClEC,cAAc,EAAEZ,0BAA0B,CAACY,cAAc;IACzDC,yBAAyB,EACvBZ,wBAAwB,CAACa,2BAA2B;IACtDC,cAAc,EAAEd,wBAAwB,CAACc,cAAc;IACvDb;EACF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { fetchMetadata } from "@pagopa/io-wallet-oid4vci";
|
|
2
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
3
2
|
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
4
3
|
import { mapToIssuerConfig } from "./mappers";
|
|
5
4
|
export const evaluateIssuerTrust = async function (issuerUrl) {
|
|
@@ -8,7 +7,6 @@ export const evaluateIssuerTrust = async function (issuerUrl) {
|
|
|
8
7
|
config: sdkConfigV1_3,
|
|
9
8
|
credentialIssuerUrl: issuerUrl,
|
|
10
9
|
callbacks: {
|
|
11
|
-
...partialCallbacks,
|
|
12
10
|
fetch: context.appFetch
|
|
13
11
|
}
|
|
14
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fetchMetadata","
|
|
1
|
+
{"version":3,"names":["fetchMetadata","sdkConfigV1_3","mapToIssuerConfig","evaluateIssuerTrust","issuerUrl","context","arguments","length","undefined","issuerMetadata","config","credentialIssuerUrl","callbacks","fetch","appFetch","issuerConf"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/01-evaluate-issuer-trust.ts"],"mappings":"AAAA,SACEA,aAAa,QAER,2BAA2B;AAClC,SAASC,aAAa,QAAQ,uBAAuB;AAErD,SAASC,iBAAiB,QAAQ,WAAW;AAE7C,OAAO,MAAMC,mBAAuD,GAAG,eAAAA,CACrEC,SAAS,EAEN;EAAA,IADHC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEZ,MAAMG,cAAc,GAAI,MAAMT,aAAa,CAAC;IAC1CU,MAAM,EAAET,aAAa;IACrBU,mBAAmB,EAAEP,SAAS;IAC9BQ,SAAS,EAAE;MACTC,KAAK,EAAER,OAAO,CAACS;IACjB;EACF,CAAC,CAA0B;EAE3B,OAAO;IAAEC,UAAU,EAAEb,iBAAiB,CAACO,cAAc;EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createPushedAuthorizationRequest, fetchPushedAuthorizationResponse, createClientAttestationPopJwt } from "@pagopa/io-wallet-oauth2";
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
3
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
3
|
-
import {
|
|
4
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
4
|
+
import { createSignJwtFromCryptoContext, partialCallbacks } from "../../../utils/callbacks";
|
|
5
5
|
import { IoWalletError } from "../../../utils/errors";
|
|
6
|
-
import {
|
|
6
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
7
|
+
import { selectCredentialDefinition } from "../common/02-start-user-authorization";
|
|
7
8
|
export const startUserAuthorization = async (issuerConf, credentialIds, proof, ctx) => {
|
|
8
9
|
const {
|
|
9
10
|
wiaCryptoContext,
|
|
@@ -16,7 +17,6 @@ export const startUserAuthorization = async (issuerConf, credentialIds, proof, c
|
|
|
16
17
|
Logger.log(LogLevel.ERROR, `Public key associated with kid ${clientId} not found in the device`);
|
|
17
18
|
throw new IoWalletError("No public key found");
|
|
18
19
|
}
|
|
19
|
-
const responseMode = selectResponseMode(issuerConf, credentialIds);
|
|
20
20
|
const credentialDefinition = credentialIds.map(c => selectCredentialDefinition(issuerConf, c));
|
|
21
21
|
if (proof.proofType === "mrtd-pop") {
|
|
22
22
|
/**
|
|
@@ -32,12 +32,14 @@ export const startUserAuthorization = async (issuerConf, credentialIds, proof, c
|
|
|
32
32
|
challenge_redirect_uri: redirectUri
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
35
|
+
const wiaSigner = {
|
|
36
|
+
method: "jwk",
|
|
37
|
+
alg: "ES256",
|
|
38
|
+
publicJwk: await wiaCryptoContext.getPublicKey()
|
|
39
|
+
};
|
|
40
|
+
const signJwt = createSignJwtFromCryptoContext(wiaCryptoContext);
|
|
40
41
|
const parRequest = await createPushedAuthorizationRequest({
|
|
42
|
+
config: sdkConfigV1_3,
|
|
41
43
|
callbacks: {
|
|
42
44
|
...partialCallbacks,
|
|
43
45
|
signJwt
|
|
@@ -45,24 +47,26 @@ export const startUserAuthorization = async (issuerConf, credentialIds, proof, c
|
|
|
45
47
|
authorizationServerMetadata: {
|
|
46
48
|
require_signed_request_object: true
|
|
47
49
|
},
|
|
50
|
+
jti: uuidv4(),
|
|
48
51
|
clientId,
|
|
49
52
|
audience: issuerConf.credential_issuer,
|
|
50
53
|
authorization_details: credentialDefinition,
|
|
51
54
|
codeChallengeMethodsSupported: ["S256"],
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
redirectUri,
|
|
56
|
+
dpop: {
|
|
57
|
+
signer: wiaSigner
|
|
58
|
+
}
|
|
54
59
|
});
|
|
55
60
|
const clientAttestationPoP = await createClientAttestationPopJwt({
|
|
61
|
+
config: sdkConfigV1_3,
|
|
56
62
|
callbacks: {
|
|
63
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
57
64
|
signJwt
|
|
58
65
|
},
|
|
59
66
|
clientAttestation: walletInstanceAttestation,
|
|
60
67
|
authorizationServer: issuerConf.authorization_endpoint,
|
|
61
|
-
signer:
|
|
62
|
-
|
|
63
|
-
alg: "ES256",
|
|
64
|
-
publicJwk: signerJwk
|
|
65
|
-
}
|
|
68
|
+
signer: wiaSigner,
|
|
69
|
+
jti: uuidv4()
|
|
66
70
|
});
|
|
67
71
|
const {
|
|
68
72
|
request_uri
|