@pagopa/io-react-native-wallet 3.2.0 → 3.4.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/README.md +1 -1
- package/lib/commonjs/credential/issuance/README.md +32 -14
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
- 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 +39 -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 +5 -4
- 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 +8 -5
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js +3 -2
- package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js +4 -2
- 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 +21 -17
- 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 +108 -69
- 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 +5 -7
- 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 +3 -2
- package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +10 -11
- 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/common/utils/http.js +9 -4
- package/lib/commonjs/credential/presentation/common/utils/http.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/07-send-authorization-response.js +3 -1
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- 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 +2 -0
- 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 +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.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 +2 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +23 -0
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/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 +20 -1
- package/lib/commonjs/utils/callbacks.js.map +1 -1
- package/lib/commonjs/utils/config.js +9 -1
- package/lib/commonjs/utils/config.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 +32 -14
- package/lib/module/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
- 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 +41 -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 +3 -2
- 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 -4
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/index.js +5 -4
- package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js +4 -2
- 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 +21 -17
- 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 +108 -70
- 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 +6 -8
- 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 +5 -4
- package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +10 -11
- 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/common/utils/http.js +9 -4
- package/lib/module/credential/presentation/common/utils/http.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/07-send-authorization-response.js +3 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- 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 +2 -0
- 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 +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.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 +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +16 -0
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/module/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/module/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 +19 -1
- package/lib/module/utils/callbacks.js.map +1 -1
- package/lib/module/utils/config.js +7 -0
- package/lib/module/utils/config.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/02-start-user-authorization.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts +19 -5
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.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/api/IssuerConfig.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/IssuerConfig.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/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts +2 -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/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +1 -0
- 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/03-complete-user-authorization.d.ts +2 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/04-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/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 +7 -4
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +1 -1
- package/lib/typescript/credential/presentation/api/types.d.ts +3 -7
- package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.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.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 +8 -8
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +8 -8
- 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 +6 -0
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +14 -2
- package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +9 -0
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/index.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/trust/v1.3.3/types.d.ts +6 -4
- package/lib/typescript/trust/v1.3.3/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/config.d.ts +4 -0
- package/lib/typescript/utils/config.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 +32 -14
- package/src/credential/issuance/api/02-start-user-authorization.ts +1 -0
- package/src/credential/issuance/api/03-complete-user-authorization.ts +26 -5
- package/src/credential/issuance/api/06-verify-and-parse-credential.ts +4 -0
- package/src/credential/issuance/api/IssuerConfig.ts +1 -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 +47 -10
- 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 +8 -2
- package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +16 -4
- package/src/credential/issuance/v1.0.0/index.ts +6 -4
- package/src/credential/issuance/v1.0.0/mappers.ts +9 -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 +25 -21
- package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +138 -94
- package/src/credential/issuance/v1.3.3/04-authorize-access.ts +28 -23
- package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +9 -9
- package/src/credential/issuance/v1.3.3/06-verify-and-parse-credential.ts +2 -1
- package/src/credential/issuance/v1.3.3/index.ts +6 -4
- package/src/credential/issuance/v1.3.3/mappers.ts +13 -11
- package/src/credential/presentation/api/05-verify-request-object.ts +1 -1
- package/src/credential/presentation/api/types.ts +3 -7
- package/src/credential/presentation/common/utils/http.ts +2 -2
- package/src/credential/presentation/{v1.3.3/utils.mdoc.ts → common/utils/mdoc.ts} +2 -2
- package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +1 -1
- package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +15 -14
- 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 +2 -0
- package/src/credential/presentation/v1.3.3/mappers.ts +1 -1
- 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 +4 -1
- package/src/credentials-catalogue/api/index.ts +15 -0
- package/src/credentials-catalogue/common/get-status-l10n-ids.ts +25 -0
- package/src/credentials-catalogue/v1.0.0/index.ts +2 -0
- package/src/credentials-catalogue/v1.3.3/index.ts +2 -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 +28 -1
- package/src/utils/config.ts +7 -0
- 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/common/utils.js +0 -28
- package/lib/commonjs/credential/presentation/common/utils.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/common/utils.js +0 -21
- package/lib/module/credential/presentation/common/utils.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/common/utils.d.ts +0 -11
- package/lib/typescript/credential/presentation/common/utils.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/common/utils.ts +0 -30
|
@@ -9,6 +9,7 @@ export const mapToIssuerConfig = createMapper<
|
|
|
9
9
|
const {
|
|
10
10
|
oauth_authorization_server,
|
|
11
11
|
openid_credential_issuer,
|
|
12
|
+
openid_credential_verifier,
|
|
12
13
|
federation_entity,
|
|
13
14
|
} = x.payload.metadata;
|
|
14
15
|
return {
|
|
@@ -17,7 +18,10 @@ export const mapToIssuerConfig = createMapper<
|
|
|
17
18
|
credential_issuer: openid_credential_issuer.credential_issuer,
|
|
18
19
|
credential_configurations_supported:
|
|
19
20
|
openid_credential_issuer.credential_configurations_supported,
|
|
20
|
-
keys:
|
|
21
|
+
keys: [
|
|
22
|
+
...openid_credential_issuer.jwks.keys,
|
|
23
|
+
...oauth_authorization_server.jwks.keys,
|
|
24
|
+
],
|
|
21
25
|
pushed_authorization_request_endpoint:
|
|
22
26
|
oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
23
27
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
@@ -25,5 +29,9 @@ export const mapToIssuerConfig = createMapper<
|
|
|
25
29
|
openid_credential_issuer.status_attestation_endpoint,
|
|
26
30
|
nonce_endpoint: openid_credential_issuer.nonce_endpoint,
|
|
27
31
|
federation_entity,
|
|
32
|
+
encrypted_response_enc_values_supported:
|
|
33
|
+
openid_credential_verifier?.authorization_encrypted_response_enc
|
|
34
|
+
? [openid_credential_verifier.authorization_encrypted_response_enc]
|
|
35
|
+
: undefined,
|
|
28
36
|
};
|
|
29
37
|
});
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
fetchMetadata,
|
|
3
3
|
type MetadataResponseV1_3,
|
|
4
4
|
} from "@pagopa/io-wallet-oid4vci";
|
|
5
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
6
5
|
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
7
6
|
import type { IssuanceApi } from "../api";
|
|
8
7
|
import { mapToIssuerConfig } from "./mappers";
|
|
@@ -15,7 +14,6 @@ export const evaluateIssuerTrust: IssuanceApi["evaluateIssuerTrust"] = async (
|
|
|
15
14
|
config: sdkConfigV1_3,
|
|
16
15
|
credentialIssuerUrl: issuerUrl,
|
|
17
16
|
callbacks: {
|
|
18
|
-
...partialCallbacks,
|
|
19
17
|
fetch: context.appFetch,
|
|
20
18
|
},
|
|
21
19
|
})) as MetadataResponseV1_3;
|
|
@@ -3,16 +3,17 @@ import {
|
|
|
3
3
|
fetchPushedAuthorizationResponse,
|
|
4
4
|
createClientAttestationPopJwt,
|
|
5
5
|
} from "@pagopa/io-wallet-oauth2";
|
|
6
|
-
import type {
|
|
6
|
+
import type { JwtSignerJwk } from "@pagopa/io-wallet-oauth2";
|
|
7
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7
8
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
8
9
|
import type { IssuanceApi } from "../api";
|
|
9
|
-
import { SignJWT } from "@pagopa/io-react-native-jwt";
|
|
10
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
11
|
-
import { IoWalletError } from "../../../utils/errors";
|
|
12
10
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "
|
|
11
|
+
createSignJwtFromCryptoContext,
|
|
12
|
+
partialCallbacks,
|
|
13
|
+
} from "../../../utils/callbacks";
|
|
14
|
+
import { IoWalletError } from "../../../utils/errors";
|
|
15
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
16
|
+
import { selectCredentialDefinition } from "../common/02-start-user-authorization";
|
|
16
17
|
|
|
17
18
|
export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
|
|
18
19
|
async (issuerConf, credentialIds, proof, ctx) => {
|
|
@@ -33,8 +34,6 @@ export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
|
|
|
33
34
|
throw new IoWalletError("No public key found");
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
const responseMode = selectResponseMode(issuerConf, credentialIds);
|
|
37
|
-
|
|
38
37
|
const credentialDefinition = credentialIds.map((c) =>
|
|
39
38
|
selectCredentialDefinition(issuerConf, c)
|
|
40
39
|
);
|
|
@@ -54,13 +53,16 @@ export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
|
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
56
|
+
const wiaSigner: JwtSignerJwk = {
|
|
57
|
+
method: "jwk",
|
|
58
|
+
alg: "ES256",
|
|
59
|
+
publicJwk: await wiaCryptoContext.getPublicKey(),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const signJwt = createSignJwtFromCryptoContext(wiaCryptoContext);
|
|
62
63
|
|
|
63
64
|
const parRequest = await createPushedAuthorizationRequest({
|
|
65
|
+
config: sdkConfigV1_3,
|
|
64
66
|
callbacks: {
|
|
65
67
|
...partialCallbacks,
|
|
66
68
|
signJwt,
|
|
@@ -68,25 +70,27 @@ export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
|
|
|
68
70
|
authorizationServerMetadata: {
|
|
69
71
|
require_signed_request_object: true,
|
|
70
72
|
},
|
|
73
|
+
jti: uuidv4(),
|
|
71
74
|
clientId,
|
|
72
75
|
audience: issuerConf.credential_issuer,
|
|
73
76
|
authorization_details: credentialDefinition,
|
|
74
77
|
codeChallengeMethodsSupported: ["S256"],
|
|
75
|
-
responseMode,
|
|
76
78
|
redirectUri,
|
|
79
|
+
dpop: {
|
|
80
|
+
signer: wiaSigner,
|
|
81
|
+
},
|
|
77
82
|
});
|
|
78
83
|
|
|
79
84
|
const clientAttestationPoP = await createClientAttestationPopJwt({
|
|
85
|
+
config: sdkConfigV1_3,
|
|
80
86
|
callbacks: {
|
|
87
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
81
88
|
signJwt,
|
|
82
89
|
},
|
|
83
90
|
clientAttestation: walletInstanceAttestation,
|
|
84
|
-
authorizationServer: issuerConf.
|
|
85
|
-
signer:
|
|
86
|
-
|
|
87
|
-
alg: "ES256",
|
|
88
|
-
publicJwk: signerJwk,
|
|
89
|
-
},
|
|
91
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
92
|
+
signer: wiaSigner,
|
|
93
|
+
jti: uuidv4(),
|
|
90
94
|
});
|
|
91
95
|
|
|
92
96
|
const { request_uri } = await fetchPushedAuthorizationResponse({
|
|
@@ -6,30 +6,33 @@ import {
|
|
|
6
6
|
import parseUrl from "parse-url";
|
|
7
7
|
import type { DcqlQuery } from "dcql";
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
createAuthorizationResponse,
|
|
10
10
|
parseAuthorizeRequest,
|
|
11
|
+
fetchAuthorizationResponse,
|
|
12
|
+
type CreateAuthorizationResponseResult,
|
|
11
13
|
} from "@pagopa/io-wallet-oid4vp";
|
|
12
14
|
import { sendAuthorizationResponseAndExtractCode } from "@pagopa/io-wallet-oid4vci";
|
|
15
|
+
import type { jsonWebKeySet } from "@pagopa/io-wallet-oid-federation";
|
|
13
16
|
import { parseMrtdChallenge } from "@pagopa/io-wallet-oauth2";
|
|
14
|
-
import { SignJWT, type CryptoContext } from "@pagopa/io-react-native-jwt";
|
|
15
17
|
import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
|
|
16
18
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
17
19
|
import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.3.3";
|
|
18
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
19
|
-
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "../../../utils/
|
|
24
|
-
import
|
|
21
|
+
createVerifyJwtFromJwks,
|
|
22
|
+
partialCallbacks,
|
|
23
|
+
} from "../../../utils/callbacks";
|
|
24
|
+
import { sdkConfigV1_3, sdkConfigV1_4 } from "../../../utils/config";
|
|
25
|
+
import { IoWalletError, IssuerResponseError } from "../../../utils/errors";
|
|
26
|
+
import type { IssuanceApi, IssuerConfig } from "../api";
|
|
25
27
|
import { mapToRequestObject } from "./mappers";
|
|
26
|
-
import type {
|
|
28
|
+
import type { RequestObject } from "../../presentation";
|
|
29
|
+
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
27
30
|
|
|
28
31
|
export const continueUserAuthorizationWithMRTDPoPChallenge: IssuanceApi["continueUserAuthorizationWithMRTDPoPChallenge"] =
|
|
29
32
|
async (authRedirectUrl) => {
|
|
30
33
|
Logger.log(
|
|
31
34
|
LogLevel.DEBUG,
|
|
32
|
-
|
|
35
|
+
"The requested credential is a PID and requires MRTD PoP, starting MRTD PoP validation from auth redirect"
|
|
33
36
|
);
|
|
34
37
|
try {
|
|
35
38
|
const parsedChallenge = parseMrtdChallenge({
|
|
@@ -65,11 +68,11 @@ export const buildAuthorizationUrl: IssuanceApi["buildAuthorizationUrl"] =
|
|
|
65
68
|
return { authUrl };
|
|
66
69
|
};
|
|
67
70
|
|
|
68
|
-
export const
|
|
71
|
+
export const completePidUserAuthorizationWithQueryMode: IssuanceApi["completePidUserAuthorizationWithQueryMode"] =
|
|
69
72
|
async (authRedirectUrl) => {
|
|
70
73
|
Logger.log(
|
|
71
74
|
LogLevel.DEBUG,
|
|
72
|
-
|
|
75
|
+
"The requested credential is a PID, completing the user authorization with query mode"
|
|
73
76
|
);
|
|
74
77
|
const query = parseUrl(authRedirectUrl).query;
|
|
75
78
|
|
|
@@ -80,7 +83,7 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
|
|
|
80
83
|
async (issuerRequestUri, clientId, issuerConf, appFetch = fetch) => {
|
|
81
84
|
Logger.log(
|
|
82
85
|
LogLevel.DEBUG,
|
|
83
|
-
|
|
86
|
+
"The requested credential is not a PID, requesting the credential to be presented"
|
|
84
87
|
);
|
|
85
88
|
|
|
86
89
|
const authzRequestEndpoint = issuerConf.authorization_endpoint;
|
|
@@ -94,61 +97,39 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
|
|
|
94
97
|
`Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`
|
|
95
98
|
);
|
|
96
99
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
const requestObjectJwt = await appFetch(
|
|
101
|
+
`${authzRequestEndpoint}?${params.toString()}`,
|
|
102
|
+
{ method: "GET" }
|
|
103
|
+
)
|
|
104
|
+
.then(hasStatusOrThrow(200, IssuerResponseError))
|
|
105
|
+
.then((res) => res.text());
|
|
103
106
|
|
|
104
107
|
const parsedAuthRequest = await parseAuthorizeRequest({
|
|
105
108
|
config: sdkConfigV1_3,
|
|
106
|
-
requestObjectJwt
|
|
107
|
-
callbacks:
|
|
109
|
+
requestObjectJwt,
|
|
110
|
+
callbacks: {
|
|
111
|
+
verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
|
|
112
|
+
},
|
|
108
113
|
});
|
|
109
114
|
|
|
110
115
|
return mapToRequestObject(parsedAuthRequest);
|
|
111
116
|
};
|
|
112
117
|
|
|
118
|
+
// NOTE: this function is not used in the 1.3 issuance flow. It may be removed in the future.
|
|
113
119
|
export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["completeUserAuthorizationWithFormPostJwtMode"] =
|
|
114
|
-
async (
|
|
115
|
-
requestObject,
|
|
116
|
-
issuerConfig,
|
|
117
|
-
pid,
|
|
118
|
-
{ wiaCryptoContext, pidKeyTag, appFetch = fetch }
|
|
119
|
-
) => {
|
|
120
|
+
async (requestObject, issuerConfig, pid, { appFetch = fetch }) => {
|
|
120
121
|
Logger.log(
|
|
121
122
|
LogLevel.DEBUG,
|
|
122
|
-
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
|
|
126
|
-
requestObject.dcql_query as DcqlQuery,
|
|
127
|
-
[[pidKeyTag, pid]]
|
|
123
|
+
"The requested credential is not a PID, completing the user authorization with form_post.jwt mode"
|
|
128
124
|
);
|
|
129
125
|
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const remotePresentation =
|
|
137
|
-
await RemotePresentationFlow.prepareRemotePresentations(
|
|
138
|
-
dcqlQueryResult,
|
|
139
|
-
authRequestObject
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const authzResponsePayload = await createAuthzResponsePayload({
|
|
143
|
-
state: requestObject.state,
|
|
144
|
-
remotePresentation,
|
|
145
|
-
wiaCryptoContext,
|
|
126
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
127
|
+
requestObject,
|
|
128
|
+
issuerConfig,
|
|
129
|
+
pid,
|
|
146
130
|
});
|
|
147
131
|
|
|
148
|
-
Logger.log(
|
|
149
|
-
LogLevel.DEBUG,
|
|
150
|
-
`Authz response payload: ${authzResponsePayload}`
|
|
151
|
-
);
|
|
132
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
152
133
|
|
|
153
134
|
const issuerSigKey = issuerConfig.keys.find((key) => key.use === "sig");
|
|
154
135
|
if (!issuerSigKey) {
|
|
@@ -158,13 +139,13 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
158
139
|
}
|
|
159
140
|
|
|
160
141
|
return sendAuthorizationResponseAndExtractCode({
|
|
161
|
-
authorizationResponseJarm:
|
|
142
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
162
143
|
callbacks: {
|
|
163
144
|
...partialCallbacks,
|
|
164
145
|
fetch: appFetch,
|
|
165
146
|
},
|
|
166
147
|
iss: requestObject.iss,
|
|
167
|
-
state: requestObject.state
|
|
148
|
+
state: requestObject.state ?? "",
|
|
168
149
|
presentationResponseUri: requestObject.response_uri,
|
|
169
150
|
signer: {
|
|
170
151
|
alg: "ES256",
|
|
@@ -174,6 +155,62 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
174
155
|
});
|
|
175
156
|
};
|
|
176
157
|
|
|
158
|
+
export const completeEaaUserAuthorizationWithQueryMode: IssuanceApi["completeEaaUserAuthorizationWithQueryMode"] =
|
|
159
|
+
async (
|
|
160
|
+
requestObject,
|
|
161
|
+
issuerConfig,
|
|
162
|
+
pid,
|
|
163
|
+
clientRedirectUri,
|
|
164
|
+
{ appFetch = fetch } = {}
|
|
165
|
+
) => {
|
|
166
|
+
Logger.log(
|
|
167
|
+
LogLevel.DEBUG,
|
|
168
|
+
"The requested credential is not a PID, completing the user authorization with query mode"
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
172
|
+
requestObject,
|
|
173
|
+
issuerConfig,
|
|
174
|
+
pid,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
178
|
+
|
|
179
|
+
const { redirect_uri } = await fetchAuthorizationResponse({
|
|
180
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
181
|
+
presentationResponseUri: requestObject.response_uri,
|
|
182
|
+
callbacks: {
|
|
183
|
+
...partialCallbacks,
|
|
184
|
+
fetch: appFetch,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
if (!redirect_uri) {
|
|
189
|
+
const errorMessage =
|
|
190
|
+
"The authorization server did not return a redirect_uri to continue the authorization flow";
|
|
191
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
192
|
+
throw new AuthorizationError(errorMessage);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const response = await appFetch(redirect_uri).catch(() => null);
|
|
196
|
+
|
|
197
|
+
if (!response || !response.ok) {
|
|
198
|
+
const errorMessage = `An error occurred while completing the authorization flow. Ensure ${clientRedirectUri} is a valid HTTP url for redirect`;
|
|
199
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
200
|
+
throw new AuthorizationError(errorMessage);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const finalRedirectUri = response.url;
|
|
204
|
+
|
|
205
|
+
if (!finalRedirectUri || !finalRedirectUri.startsWith(clientRedirectUri)) {
|
|
206
|
+
const errorMessage = `The authorization server did not redirect to the provided client redirect URI. Expected: ${clientRedirectUri}, got: ${finalRedirectUri}`;
|
|
207
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
208
|
+
throw new AuthorizationError(errorMessage);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return parseAuthorizationResponse(parseUrl(finalRedirectUri).query);
|
|
212
|
+
};
|
|
213
|
+
|
|
177
214
|
/**
|
|
178
215
|
* Parse the authorization response and return the result which contains code, state and iss.
|
|
179
216
|
* @throws {AuthorizationError} if an error occurs during the parsing process
|
|
@@ -207,45 +244,52 @@ export const parseAuthorizationResponse = (
|
|
|
207
244
|
};
|
|
208
245
|
|
|
209
246
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* @param
|
|
214
|
-
* @
|
|
215
|
-
* @returns The Base64 encoded authorization response payload.
|
|
247
|
+
* Utility function to process the DCQL query for PID presentation and to create the authorization response to send to the Issuer.
|
|
248
|
+
* @param params.requestObject - The request object containing the DCQL query
|
|
249
|
+
* @param params.issuerConfig - The Issuer unified configuration
|
|
250
|
+
* @param params.pid - The PID credential to be presented, as a tuple of [keyTag, credential]
|
|
251
|
+
* @returns The authorization response containing the JARM to be sent to the Issuer
|
|
216
252
|
*/
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
253
|
+
const processPidPresentationAndCreateAuthzResponse = async ({
|
|
254
|
+
requestObject,
|
|
255
|
+
issuerConfig,
|
|
256
|
+
pid,
|
|
221
257
|
}: {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}): Promise<
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
258
|
+
requestObject: RequestObject;
|
|
259
|
+
issuerConfig: IssuerConfig;
|
|
260
|
+
pid: [keyTag: string, credential: string];
|
|
261
|
+
}): Promise<CreateAuthorizationResponseResult> => {
|
|
262
|
+
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
|
|
263
|
+
requestObject.dcql_query as DcqlQuery,
|
|
264
|
+
[pid]
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const remotePresentation =
|
|
268
|
+
await RemotePresentationFlow.prepareRemotePresentations(dcqlQueryResult, {
|
|
269
|
+
clientId: requestObject.client_id,
|
|
270
|
+
nonce: requestObject.nonce,
|
|
271
|
+
responseUri: requestObject.response_uri,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const vp_token = remotePresentation.presentations.reduce(
|
|
275
|
+
(acc, { credentialId, vpToken }) => ({ ...acc, [credentialId]: [vpToken] }),
|
|
276
|
+
{} as Record<string, string[]>
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
return createAuthorizationResponse({
|
|
280
|
+
// The SDK 1.4 config is used here in order to resolve the encryption data from the Request Object
|
|
281
|
+
// client_metadata, otherwise OpenID Federation clients always ignore client_metadata as per 1.3.3 specs.
|
|
282
|
+
config: sdkConfigV1_4,
|
|
283
|
+
requestObject,
|
|
284
|
+
rpJwks: {
|
|
285
|
+
jwks: { keys: issuerConfig.keys } as jsonWebKeySet,
|
|
286
|
+
encrypted_response_enc_values_supported:
|
|
287
|
+
issuerConfig.encrypted_response_enc_values_supported,
|
|
288
|
+
},
|
|
289
|
+
vp_token,
|
|
290
|
+
callbacks: {
|
|
291
|
+
encryptJwe: partialCallbacks.encryptJwe,
|
|
292
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
293
|
+
},
|
|
294
|
+
});
|
|
251
295
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createClientAttestationPopJwt,
|
|
3
|
+
createTokenDPoP,
|
|
4
|
+
fetchTokenResponse,
|
|
5
|
+
} from "@pagopa/io-wallet-oauth2";
|
|
3
6
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
import {
|
|
8
|
+
createSignJwtFromCryptoContext,
|
|
9
|
+
partialCallbacks,
|
|
10
|
+
} from "../../../utils/callbacks";
|
|
7
11
|
import { IoWalletError } from "../../../utils/errors";
|
|
12
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
8
13
|
import type { IssuanceApi, TokenResponse } from "../api";
|
|
9
14
|
|
|
10
15
|
export const authorizeAccess: IssuanceApi["authorizeAccess"] = async (
|
|
@@ -21,37 +26,37 @@ export const authorizeAccess: IssuanceApi["authorizeAccess"] = async (
|
|
|
21
26
|
dPopCryptoContext,
|
|
22
27
|
} = context;
|
|
23
28
|
|
|
24
|
-
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
25
29
|
const tokenDPoP = await createTokenDPoP({
|
|
26
30
|
callbacks: {
|
|
27
31
|
...partialCallbacks,
|
|
28
|
-
signJwt:
|
|
29
|
-
jwt: await new SignJWT(wiaCryptoContext).setPayload(payload).sign(),
|
|
30
|
-
signerJwk: dPopSignerJwk,
|
|
31
|
-
}),
|
|
32
|
+
signJwt: createSignJwtFromCryptoContext(dPopCryptoContext),
|
|
32
33
|
},
|
|
33
34
|
signer: {
|
|
34
|
-
alg: "ES256",
|
|
35
35
|
method: "jwk",
|
|
36
|
-
|
|
36
|
+
alg: "ES256",
|
|
37
|
+
publicJwk: await dPopCryptoContext.getPublicKey(),
|
|
37
38
|
},
|
|
39
|
+
jti: uuidv4(),
|
|
38
40
|
tokenRequest: {
|
|
39
41
|
method: "POST",
|
|
40
42
|
url: issuerConf.token_endpoint,
|
|
41
43
|
},
|
|
42
44
|
});
|
|
43
45
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
jti: uuidv4(),
|
|
50
|
-
aud: issuerConf.credential_issuer,
|
|
51
|
-
iss,
|
|
46
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
47
|
+
config: sdkConfigV1_3,
|
|
48
|
+
callbacks: {
|
|
49
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
50
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext),
|
|
52
51
|
},
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
clientAttestation: walletInstanceAttestation,
|
|
53
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
54
|
+
signer: {
|
|
55
|
+
method: "jwk",
|
|
56
|
+
alg: "ES256",
|
|
57
|
+
publicJwk: await wiaCryptoContext.getPublicKey(),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
55
60
|
|
|
56
61
|
const tokenResponse = await fetchTokenResponse({
|
|
57
62
|
accessTokenEndpoint: issuerConf.token_endpoint,
|
|
@@ -61,7 +66,7 @@ export const authorizeAccess: IssuanceApi["authorizeAccess"] = async (
|
|
|
61
66
|
},
|
|
62
67
|
walletAttestation: walletInstanceAttestation,
|
|
63
68
|
dPoP: tokenDPoP.jwt,
|
|
64
|
-
clientAttestationDPoP
|
|
69
|
+
clientAttestationDPoP,
|
|
65
70
|
accessTokenRequest: {
|
|
66
71
|
code,
|
|
67
72
|
grant_type: "authorization_code",
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
createCredentialRequest,
|
|
10
10
|
} from "@pagopa/io-wallet-oid4vci";
|
|
11
11
|
import { UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError } from "@pagopa/io-wallet-utils";
|
|
12
|
+
import { v4 as uuidv4 } from "uuid";
|
|
12
13
|
import { hasStatusOrThrow, type Out } from "../../../utils/misc";
|
|
13
14
|
import {
|
|
14
15
|
IoWalletError,
|
|
@@ -19,7 +20,10 @@ import {
|
|
|
19
20
|
} from "../../../utils/errors";
|
|
20
21
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
21
22
|
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
22
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
createSignJwtFromCryptoContext,
|
|
25
|
+
partialCallbacks,
|
|
26
|
+
} from "../../../utils/callbacks";
|
|
23
27
|
import type { IssuanceApi, IssuerConfig } from "../api";
|
|
24
28
|
import { NonceResponse } from "./types";
|
|
25
29
|
import type { AuthorizeAccessApi } from "../api/04-authorize-access";
|
|
@@ -108,28 +112,24 @@ export const requestCredentials = async ({
|
|
|
108
112
|
},
|
|
109
113
|
clientId,
|
|
110
114
|
credential_identifier: credentialIdentifier,
|
|
111
|
-
issuerIdentifier: issuerConf.
|
|
115
|
+
issuerIdentifier: issuerConf.credential_endpoint,
|
|
112
116
|
maxBatchSize: issuerConf.credential_issuance_batch_size,
|
|
113
117
|
nonce: c_nonce,
|
|
114
118
|
keyAttestation: keyAttestationJwt,
|
|
115
119
|
signers,
|
|
116
120
|
});
|
|
117
121
|
|
|
118
|
-
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
119
|
-
|
|
120
122
|
const credentialDPoP = await createTokenDPoP({
|
|
121
123
|
callbacks: {
|
|
122
124
|
...partialCallbacks,
|
|
123
|
-
signJwt:
|
|
124
|
-
jwt: await new SignJWT(dPopCryptoContext).setPayload(payload).sign(),
|
|
125
|
-
signerJwk: dPopSignerJwk,
|
|
126
|
-
}),
|
|
125
|
+
signJwt: createSignJwtFromCryptoContext(dPopCryptoContext),
|
|
127
126
|
},
|
|
128
127
|
signer: {
|
|
129
128
|
method: "jwk",
|
|
130
129
|
alg: "ES256",
|
|
131
|
-
publicJwk:
|
|
130
|
+
publicJwk: await dPopCryptoContext.getPublicKey(),
|
|
132
131
|
},
|
|
132
|
+
jti: uuidv4(),
|
|
133
133
|
tokenRequest: {
|
|
134
134
|
method: "POST",
|
|
135
135
|
url: issuerConf.credential_endpoint,
|
|
@@ -3,7 +3,8 @@ import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
|
|
|
3
3
|
import { startUserAuthorization } from "./02-start-user-authorization";
|
|
4
4
|
import {
|
|
5
5
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
6
|
-
|
|
6
|
+
completePidUserAuthorizationWithQueryMode,
|
|
7
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
7
8
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
8
9
|
buildAuthorizationUrl,
|
|
9
10
|
getRequestedCredentialToBePresented,
|
|
@@ -14,13 +15,14 @@ import {
|
|
|
14
15
|
obtainCredentialsBatch,
|
|
15
16
|
} from "./05-obtain-credential";
|
|
16
17
|
import { verifyAndParseCredential } from "./06-verify-and-parse-credential";
|
|
17
|
-
import {
|
|
18
|
+
import { MRTDPoPv1_3 } from "../mrtd-pop";
|
|
18
19
|
|
|
19
20
|
export const Issuance: IssuanceApi = {
|
|
20
21
|
evaluateIssuerTrust,
|
|
21
22
|
startUserAuthorization,
|
|
22
23
|
buildAuthorizationUrl,
|
|
23
|
-
|
|
24
|
+
completePidUserAuthorizationWithQueryMode,
|
|
25
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
24
26
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
25
27
|
getRequestedCredentialToBePresented,
|
|
26
28
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
@@ -28,5 +30,5 @@ export const Issuance: IssuanceApi = {
|
|
|
28
30
|
obtainCredential,
|
|
29
31
|
obtainCredentialsBatch,
|
|
30
32
|
verifyAndParseCredential,
|
|
31
|
-
MRTDPoP,
|
|
33
|
+
MRTDPoP: MRTDPoPv1_3,
|
|
32
34
|
};
|