@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
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
|
|
2
2
|
import { startUserAuthorization } from "./02-start-user-authorization";
|
|
3
|
-
import { continueUserAuthorizationWithMRTDPoPChallenge,
|
|
3
|
+
import { continueUserAuthorizationWithMRTDPoPChallenge, completePidUserAuthorizationWithQueryMode, completeEaaUserAuthorizationWithQueryMode, completeUserAuthorizationWithFormPostJwtMode, buildAuthorizationUrl, getRequestedCredentialToBePresented } from "./03-complete-user-authorization";
|
|
4
4
|
import { authorizeAccess } from "./04-authorize-access";
|
|
5
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,
|
|
11
11
|
buildAuthorizationUrl,
|
|
12
|
-
|
|
12
|
+
completePidUserAuthorizationWithQueryMode,
|
|
13
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
13
14
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
14
15
|
getRequestedCredentialToBePresented,
|
|
15
16
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
@@ -17,6 +18,6 @@ export const Issuance = {
|
|
|
17
18
|
obtainCredential,
|
|
18
19
|
obtainCredentialsBatch,
|
|
19
20
|
verifyAndParseCredential,
|
|
20
|
-
MRTDPoP
|
|
21
|
+
MRTDPoP: MRTDPoPv1_0
|
|
21
22
|
};
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","continueUserAuthorizationWithMRTDPoPChallenge","
|
|
1
|
+
{"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","continueUserAuthorizationWithMRTDPoPChallenge","completePidUserAuthorizationWithQueryMode","completeEaaUserAuthorizationWithQueryMode","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,yCAAyC,EACzCC,yCAAyC,EACzCC,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;EACnCb,mBAAmB;EACnBC,sBAAsB;EACtBK,qBAAqB;EACrBH,yCAAyC;EACzCC,yCAAyC;EACzCF,6CAA6C;EAC7CK,mCAAmC;EACnCF,4CAA4C;EAC5CG,eAAe;EACfC,gBAAgB;EAChBC,sBAAsB;EACtBC,wBAAwB;EACxBG,OAAO,EAAEF;AACX,CAAC"}
|
|
@@ -3,6 +3,7 @@ export const mapToIssuerConfig = createMapper(x => {
|
|
|
3
3
|
const {
|
|
4
4
|
oauth_authorization_server,
|
|
5
5
|
openid_credential_issuer,
|
|
6
|
+
openid_credential_verifier,
|
|
6
7
|
federation_entity
|
|
7
8
|
} = x.payload.metadata;
|
|
8
9
|
return {
|
|
@@ -10,12 +11,13 @@ export const mapToIssuerConfig = createMapper(x => {
|
|
|
10
11
|
credential_endpoint: openid_credential_issuer.credential_endpoint,
|
|
11
12
|
credential_issuer: openid_credential_issuer.credential_issuer,
|
|
12
13
|
credential_configurations_supported: openid_credential_issuer.credential_configurations_supported,
|
|
13
|
-
keys: openid_credential_issuer.jwks.keys,
|
|
14
|
+
keys: [...openid_credential_issuer.jwks.keys, ...oauth_authorization_server.jwks.keys],
|
|
14
15
|
pushed_authorization_request_endpoint: oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
15
16
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
16
17
|
status_assertion_endpoint: openid_credential_issuer.status_attestation_endpoint,
|
|
17
18
|
nonce_endpoint: openid_credential_issuer.nonce_endpoint,
|
|
18
|
-
federation_entity
|
|
19
|
+
federation_entity,
|
|
20
|
+
encrypted_response_enc_values_supported: openid_credential_verifier !== null && openid_credential_verifier !== void 0 && openid_credential_verifier.authorization_encrypted_response_enc ? [openid_credential_verifier.authorization_encrypted_response_enc] : undefined
|
|
19
21
|
};
|
|
20
22
|
});
|
|
21
23
|
//# sourceMappingURL=mappers.js.map
|
|
@@ -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,
|
|
1
|
+
{"version":3,"names":["createMapper","mapToIssuerConfig","x","oauth_authorization_server","openid_credential_issuer","openid_credential_verifier","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","encrypted_response_enc_values_supported","authorization_encrypted_response_enc","undefined"],"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,0BAA0B;IAC1BC;EACF,CAAC,GAAGJ,CAAC,CAACK,OAAO,CAACC,QAAQ;EACtB,OAAO;IACLC,sBAAsB,EAAEN,0BAA0B,CAACM,sBAAsB;IACzEC,mBAAmB,EAAEN,wBAAwB,CAACM,mBAAmB;IACjEC,iBAAiB,EAAEP,wBAAwB,CAACO,iBAAiB;IAC7DC,mCAAmC,EACjCR,wBAAwB,CAACQ,mCAAmC;IAC9DC,IAAI,EAAE,CACJ,GAAGT,wBAAwB,CAACU,IAAI,CAACD,IAAI,EACrC,GAAGV,0BAA0B,CAACW,IAAI,CAACD,IAAI,CACxC;IACDE,qCAAqC,EACnCZ,0BAA0B,CAACY,qCAAqC;IAClEC,cAAc,EAAEb,0BAA0B,CAACa,cAAc;IACzDC,yBAAyB,EACvBb,wBAAwB,CAACc,2BAA2B;IACtDC,cAAc,EAAEf,wBAAwB,CAACe,cAAc;IACvDb,iBAAiB;IACjBc,uCAAuC,EACrCf,0BAA0B,aAA1BA,0BAA0B,eAA1BA,0BAA0B,CAAEgB,oCAAoC,GAC5D,CAAChB,0BAA0B,CAACgB,oCAAoC,CAAC,GACjEC;EACR,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
|
-
authorizationServer: issuerConf.
|
|
61
|
-
signer:
|
|
62
|
-
|
|
63
|
-
alg: "ES256",
|
|
64
|
-
publicJwk: signerJwk
|
|
65
|
-
}
|
|
67
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
68
|
+
signer: wiaSigner,
|
|
69
|
+
jti: uuidv4()
|
|
66
70
|
});
|
|
67
71
|
const {
|
|
68
72
|
request_uri
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPushedAuthorizationRequest","fetchPushedAuthorizationResponse","createClientAttestationPopJwt","LogLevel","Logger","
|
|
1
|
+
{"version":3,"names":["createPushedAuthorizationRequest","fetchPushedAuthorizationResponse","createClientAttestationPopJwt","v4","uuidv4","LogLevel","Logger","createSignJwtFromCryptoContext","partialCallbacks","IoWalletError","sdkConfigV1_3","selectCredentialDefinition","startUserAuthorization","issuerConf","credentialIds","proof","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","log","ERROR","credentialDefinition","map","c","proofType","push","type","idphinting","idpHinting","challenge_method","challenge_redirect_uri","wiaSigner","method","alg","publicJwk","signJwt","parRequest","config","callbacks","authorizationServerMetadata","require_signed_request_object","jti","audience","credential_issuer","authorization_details","codeChallengeMethodsSupported","dpop","signer","clientAttestationPoP","generateRandom","clientAttestation","authorizationServer","request_uri","pushedAuthorizationRequestEndpoint","pushed_authorization_request_endpoint","pushedAuthorizationRequest","clientAttestationDPoP","walletAttestation","issuerRequestUri","codeVerifier","pkceCodeVerifier"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/02-start-user-authorization.ts"],"mappings":"AAAA,SACEA,gCAAgC,EAChCC,gCAAgC,EAChCC,6BAA6B,QACxB,0BAA0B;AAEjC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AAEzD,SACEC,8BAA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2
|
import parseUrl from "parse-url";
|
|
3
|
-
import {
|
|
3
|
+
import { createAuthorizationResponse, parseAuthorizeRequest, fetchAuthorizationResponse } from "@pagopa/io-wallet-oid4vp";
|
|
4
4
|
import { sendAuthorizationResponseAndExtractCode } from "@pagopa/io-wallet-oid4vci";
|
|
5
5
|
import { parseMrtdChallenge } from "@pagopa/io-wallet-oauth2";
|
|
6
|
-
import { SignJWT } from "@pagopa/io-react-native-jwt";
|
|
7
6
|
import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
|
|
8
7
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
9
8
|
import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.3.3";
|
|
10
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
11
|
-
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
12
|
-
import { IoWalletError,
|
|
9
|
+
import { createVerifyJwtFromJwks, partialCallbacks } from "../../../utils/callbacks";
|
|
10
|
+
import { sdkConfigV1_3, sdkConfigV1_4 } from "../../../utils/config";
|
|
11
|
+
import { IoWalletError, IssuerResponseError } from "../../../utils/errors";
|
|
13
12
|
import { mapToRequestObject } from "./mappers";
|
|
13
|
+
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
14
14
|
export const continueUserAuthorizationWithMRTDPoPChallenge = async authRedirectUrl => {
|
|
15
|
-
Logger.log(LogLevel.DEBUG,
|
|
15
|
+
Logger.log(LogLevel.DEBUG, "The requested credential is a PID and requires MRTD PoP, starting MRTD PoP validation from auth redirect");
|
|
16
16
|
try {
|
|
17
17
|
const parsedChallenge = parseMrtdChallenge({
|
|
18
18
|
redirectUrl: authRedirectUrl
|
|
@@ -40,53 +40,45 @@ export const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerCo
|
|
|
40
40
|
authUrl
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
export const
|
|
44
|
-
Logger.log(LogLevel.DEBUG,
|
|
43
|
+
export const completePidUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
|
44
|
+
Logger.log(LogLevel.DEBUG, "The requested credential is a PID, completing the user authorization with query mode");
|
|
45
45
|
const query = parseUrl(authRedirectUrl).query;
|
|
46
46
|
return parseAuthorizationResponse(query);
|
|
47
47
|
};
|
|
48
48
|
export const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
|
|
49
49
|
let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
|
50
|
-
Logger.log(LogLevel.DEBUG,
|
|
50
|
+
Logger.log(LogLevel.DEBUG, "The requested credential is not a PID, requesting the credential to be presented");
|
|
51
51
|
const authzRequestEndpoint = issuerConf.authorization_endpoint;
|
|
52
52
|
const params = new URLSearchParams({
|
|
53
53
|
client_id: clientId,
|
|
54
54
|
request_uri: issuerRequestUri
|
|
55
55
|
});
|
|
56
56
|
Logger.log(LogLevel.DEBUG, `Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
fetch: appFetch
|
|
61
|
-
}
|
|
62
|
-
}).catch(sdkUnexpectedStatusCodeToIssuerError);
|
|
57
|
+
const requestObjectJwt = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
|
|
58
|
+
method: "GET"
|
|
59
|
+
}).then(hasStatusOrThrow(200, IssuerResponseError)).then(res => res.text());
|
|
63
60
|
const parsedAuthRequest = await parseAuthorizeRequest({
|
|
64
61
|
config: sdkConfigV1_3,
|
|
65
|
-
requestObjectJwt
|
|
66
|
-
callbacks:
|
|
62
|
+
requestObjectJwt,
|
|
63
|
+
callbacks: {
|
|
64
|
+
verifyJwt: createVerifyJwtFromJwks(issuerConf.keys)
|
|
65
|
+
}
|
|
67
66
|
});
|
|
68
67
|
return mapToRequestObject(parsedAuthRequest);
|
|
69
68
|
};
|
|
69
|
+
|
|
70
|
+
// NOTE: this function is not used in the 1.3 issuance flow. It may be removed in the future.
|
|
70
71
|
export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, issuerConfig, pid, _ref) => {
|
|
71
72
|
let {
|
|
72
|
-
wiaCryptoContext,
|
|
73
|
-
pidKeyTag,
|
|
74
73
|
appFetch = fetch
|
|
75
74
|
} = _ref;
|
|
76
|
-
Logger.log(LogLevel.DEBUG,
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
responseUri: requestObject.response_uri
|
|
82
|
-
};
|
|
83
|
-
const remotePresentation = await RemotePresentationFlow.prepareRemotePresentations(dcqlQueryResult, authRequestObject);
|
|
84
|
-
const authzResponsePayload = await createAuthzResponsePayload({
|
|
85
|
-
state: requestObject.state,
|
|
86
|
-
remotePresentation,
|
|
87
|
-
wiaCryptoContext
|
|
75
|
+
Logger.log(LogLevel.DEBUG, "The requested credential is not a PID, completing the user authorization with form_post.jwt mode");
|
|
76
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
77
|
+
requestObject,
|
|
78
|
+
issuerConfig,
|
|
79
|
+
pid
|
|
88
80
|
});
|
|
89
|
-
Logger.log(LogLevel.DEBUG, `Authz response
|
|
81
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
90
82
|
const issuerSigKey = issuerConfig.keys.find(key => key.use === "sig");
|
|
91
83
|
if (!issuerSigKey) {
|
|
92
84
|
const errorMessage = "No signature key found in Issuer Metadata JWKS";
|
|
@@ -94,13 +86,13 @@ export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject
|
|
|
94
86
|
throw new IoWalletError(errorMessage);
|
|
95
87
|
}
|
|
96
88
|
return sendAuthorizationResponseAndExtractCode({
|
|
97
|
-
authorizationResponseJarm:
|
|
89
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
98
90
|
callbacks: {
|
|
99
91
|
...partialCallbacks,
|
|
100
92
|
fetch: appFetch
|
|
101
93
|
},
|
|
102
94
|
iss: requestObject.iss,
|
|
103
|
-
state: requestObject.state,
|
|
95
|
+
state: requestObject.state ?? "",
|
|
104
96
|
presentationResponseUri: requestObject.response_uri,
|
|
105
97
|
signer: {
|
|
106
98
|
alg: "ES256",
|
|
@@ -109,6 +101,46 @@ export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject
|
|
|
109
101
|
}
|
|
110
102
|
});
|
|
111
103
|
};
|
|
104
|
+
export const completeEaaUserAuthorizationWithQueryMode = async function (requestObject, issuerConfig, pid, clientRedirectUri) {
|
|
105
|
+
let {
|
|
106
|
+
appFetch = fetch
|
|
107
|
+
} = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
108
|
+
Logger.log(LogLevel.DEBUG, "The requested credential is not a PID, completing the user authorization with query mode");
|
|
109
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
110
|
+
requestObject,
|
|
111
|
+
issuerConfig,
|
|
112
|
+
pid
|
|
113
|
+
});
|
|
114
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
115
|
+
const {
|
|
116
|
+
redirect_uri
|
|
117
|
+
} = await fetchAuthorizationResponse({
|
|
118
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
119
|
+
presentationResponseUri: requestObject.response_uri,
|
|
120
|
+
callbacks: {
|
|
121
|
+
...partialCallbacks,
|
|
122
|
+
fetch: appFetch
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (!redirect_uri) {
|
|
126
|
+
const errorMessage = "The authorization server did not return a redirect_uri to continue the authorization flow";
|
|
127
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
128
|
+
throw new AuthorizationError(errorMessage);
|
|
129
|
+
}
|
|
130
|
+
const response = await appFetch(redirect_uri).catch(() => null);
|
|
131
|
+
if (!response || !response.ok) {
|
|
132
|
+
const errorMessage = `An error occurred while completing the authorization flow. Ensure ${clientRedirectUri} is a valid HTTP url for redirect`;
|
|
133
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
134
|
+
throw new AuthorizationError(errorMessage);
|
|
135
|
+
}
|
|
136
|
+
const finalRedirectUri = response.url;
|
|
137
|
+
if (!finalRedirectUri || !finalRedirectUri.startsWith(clientRedirectUri)) {
|
|
138
|
+
const errorMessage = `The authorization server did not redirect to the provided client redirect URI. Expected: ${clientRedirectUri}, got: ${finalRedirectUri}`;
|
|
139
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
140
|
+
throw new AuthorizationError(errorMessage);
|
|
141
|
+
}
|
|
142
|
+
return parseAuthorizationResponse(parseUrl(finalRedirectUri).query);
|
|
143
|
+
};
|
|
112
144
|
|
|
113
145
|
/**
|
|
114
146
|
* Parse the authorization response and return the result which contains code, state and iss.
|
|
@@ -133,44 +165,50 @@ export const parseAuthorizationResponse = authRes => {
|
|
|
133
165
|
};
|
|
134
166
|
|
|
135
167
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* @param
|
|
140
|
-
* @
|
|
141
|
-
* @returns The Base64 encoded authorization response payload.
|
|
168
|
+
* Utility function to process the DCQL query for PID presentation and to create the authorization response to send to the Issuer.
|
|
169
|
+
* @param params.requestObject - The request object containing the DCQL query
|
|
170
|
+
* @param params.issuerConfig - The Issuer unified configuration
|
|
171
|
+
* @param params.pid - The PID credential to be presented, as a tuple of [keyTag, credential]
|
|
172
|
+
* @returns The authorization response containing the JARM to be sent to the Issuer
|
|
142
173
|
*/
|
|
143
|
-
const
|
|
174
|
+
const processPidPresentationAndCreateAuthzResponse = async _ref2 => {
|
|
144
175
|
let {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
176
|
+
requestObject,
|
|
177
|
+
issuerConfig,
|
|
178
|
+
pid
|
|
148
179
|
} = _ref2;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(requestObject.dcql_query, [pid]);
|
|
181
|
+
const remotePresentation = await RemotePresentationFlow.prepareRemotePresentations(dcqlQueryResult, {
|
|
182
|
+
clientId: requestObject.client_id,
|
|
183
|
+
nonce: requestObject.nonce,
|
|
184
|
+
responseUri: requestObject.response_uri
|
|
185
|
+
});
|
|
186
|
+
const vp_token = remotePresentation.presentations.reduce((acc, _ref3) => {
|
|
187
|
+
let {
|
|
188
|
+
credentialId,
|
|
189
|
+
vpToken
|
|
190
|
+
} = _ref3;
|
|
191
|
+
return {
|
|
192
|
+
...acc,
|
|
193
|
+
[credentialId]: [vpToken]
|
|
194
|
+
};
|
|
195
|
+
}, {});
|
|
196
|
+
return createAuthorizationResponse({
|
|
197
|
+
// The SDK 1.4 config is used here in order to resolve the encryption data from the Request Object
|
|
198
|
+
// client_metadata, otherwise OpenID Federation clients always ignore client_metadata as per 1.3.3 specs.
|
|
199
|
+
config: sdkConfigV1_4,
|
|
200
|
+
requestObject,
|
|
201
|
+
rpJwks: {
|
|
202
|
+
jwks: {
|
|
203
|
+
keys: issuerConfig.keys
|
|
204
|
+
},
|
|
205
|
+
encrypted_response_enc_values_supported: issuerConfig.encrypted_response_enc_values_supported
|
|
206
|
+
},
|
|
207
|
+
vp_token,
|
|
208
|
+
callbacks: {
|
|
209
|
+
encryptJwe: partialCallbacks.encryptJwe,
|
|
210
|
+
generateRandom: partialCallbacks.generateRandom
|
|
211
|
+
}
|
|
212
|
+
});
|
|
175
213
|
};
|
|
176
214
|
//# sourceMappingURL=03-complete-user-authorization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AuthorizationErrorShape","AuthorizationResultShape","parseUrl","
|
|
1
|
+
{"version":3,"names":["AuthorizationErrorShape","AuthorizationResultShape","parseUrl","createAuthorizationResponse","parseAuthorizeRequest","fetchAuthorizationResponse","sendAuthorizationResponseAndExtractCode","parseMrtdChallenge","AuthorizationError","AuthorizationIdpError","LogLevel","Logger","RemotePresentation","RemotePresentationFlow","createVerifyJwtFromJwks","partialCallbacks","sdkConfigV1_3","sdkConfigV1_4","IoWalletError","IssuerResponseError","mapToRequestObject","hasStatusOrThrow","continueUserAuthorizationWithMRTDPoPChallenge","authRedirectUrl","log","DEBUG","parsedChallenge","redirectUrl","challenge_info","challengeJwt","err","errorMessage","Error","message","ERROR","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","completePidUserAuthorizationWithQueryMode","query","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObjectJwt","method","then","res","text","parsedAuthRequest","config","callbacks","verifyJwt","keys","completeUserAuthorizationWithFormPostJwtMode","requestObject","issuerConfig","pid","_ref","authzResponse","processPidPresentationAndCreateAuthzResponse","issuerSigKey","find","key","use","authorizationResponseJarm","jarm","responseJwe","iss","state","presentationResponseUri","response_uri","signer","alg","publicJwk","completeEaaUserAuthorizationWithQueryMode","clientRedirectUri","redirect_uri","response","catch","ok","finalRedirectUri","url","startsWith","authRes","authResParsed","safeParse","success","authErr","error","JSON","stringify","data","error_description","_ref2","dcqlQueryResult","evaluateDcqlQuery","dcql_query","remotePresentation","prepareRemotePresentations","nonce","responseUri","vp_token","presentations","reduce","acc","_ref3","credentialId","vpToken","rpJwks","jwks","encrypted_response_enc_values_supported","encryptJwe","generateRandom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/03-complete-user-authorization.ts"],"mappings":"AAAA,SACEA,uBAAuB,EACvBC,wBAAwB,QAEnB,qBAAqB;AAC5B,OAAOC,QAAQ,MAAM,WAAW;AAEhC,SAC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,EACrCvD,YAAY,CAACuD;IACjB,CAAC;IACDT,QAAQ;IACRnD,SAAS,EAAE;MACT6D,UAAU,EAAE/G,gBAAgB,CAAC+G,UAAU;MACvCC,cAAc,EAAEhH,gBAAgB,CAACgH;IACnC;EACF,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createTokenDPoP, fetchTokenResponse } from "@pagopa/io-wallet-oauth2";
|
|
1
|
+
import { createClientAttestationPopJwt, createTokenDPoP, fetchTokenResponse } from "@pagopa/io-wallet-oauth2";
|
|
3
2
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import {
|
|
5
|
-
import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils";
|
|
6
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
3
|
+
import { createSignJwtFromCryptoContext, partialCallbacks } from "../../../utils/callbacks";
|
|
7
4
|
import { IoWalletError } from "../../../utils/errors";
|
|
5
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
8
6
|
export const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifier, context) => {
|
|
9
7
|
const {
|
|
10
8
|
appFetch = fetch,
|
|
@@ -12,31 +10,36 @@ export const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifie
|
|
|
12
10
|
wiaCryptoContext,
|
|
13
11
|
dPopCryptoContext
|
|
14
12
|
} = context;
|
|
15
|
-
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
16
13
|
const tokenDPoP = await createTokenDPoP({
|
|
17
14
|
callbacks: {
|
|
18
15
|
...partialCallbacks,
|
|
19
|
-
signJwt:
|
|
20
|
-
jwt: await new SignJWT(wiaCryptoContext).setPayload(payload).sign(),
|
|
21
|
-
signerJwk: dPopSignerJwk
|
|
22
|
-
})
|
|
16
|
+
signJwt: createSignJwtFromCryptoContext(dPopCryptoContext)
|
|
23
17
|
},
|
|
24
18
|
signer: {
|
|
25
|
-
alg: "ES256",
|
|
26
19
|
method: "jwk",
|
|
27
|
-
|
|
20
|
+
alg: "ES256",
|
|
21
|
+
publicJwk: await dPopCryptoContext.getPublicKey()
|
|
28
22
|
},
|
|
23
|
+
jti: uuidv4(),
|
|
29
24
|
tokenRequest: {
|
|
30
25
|
method: "POST",
|
|
31
26
|
url: issuerConf.token_endpoint
|
|
32
27
|
}
|
|
33
28
|
});
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
30
|
+
config: sdkConfigV1_3,
|
|
31
|
+
callbacks: {
|
|
32
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
33
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext)
|
|
34
|
+
},
|
|
35
|
+
clientAttestation: walletInstanceAttestation,
|
|
36
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
37
|
+
signer: {
|
|
38
|
+
method: "jwk",
|
|
39
|
+
alg: "ES256",
|
|
40
|
+
publicJwk: await wiaCryptoContext.getPublicKey()
|
|
41
|
+
}
|
|
42
|
+
});
|
|
40
43
|
const tokenResponse = await fetchTokenResponse({
|
|
41
44
|
accessTokenEndpoint: issuerConf.token_endpoint,
|
|
42
45
|
callbacks: {
|
|
@@ -45,7 +48,7 @@ export const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifie
|
|
|
45
48
|
},
|
|
46
49
|
walletAttestation: walletInstanceAttestation,
|
|
47
50
|
dPoP: tokenDPoP.jwt,
|
|
48
|
-
clientAttestationDPoP
|
|
51
|
+
clientAttestationDPoP,
|
|
49
52
|
accessTokenRequest: {
|
|
50
53
|
code,
|
|
51
54
|
grant_type: "authorization_code",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createClientAttestationPopJwt","createTokenDPoP","fetchTokenResponse","v4","uuidv4","createSignJwtFromCryptoContext","partialCallbacks","IoWalletError","sdkConfigV1_3","authorizeAccess","issuerConf","code","redirectUri","codeVerifier","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","dPopCryptoContext","tokenDPoP","callbacks","signJwt","signer","method","alg","publicJwk","getPublicKey","jti","tokenRequest","url","token_endpoint","clientAttestationDPoP","config","generateRandom","clientAttestation","authorizationServer","credential_issuer","tokenResponse","accessTokenEndpoint","walletAttestation","dPoP","jwt","accessTokenRequest","grant_type","code_verifier","redirect_uri","authorization_details","accessToken"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/04-authorize-access.ts"],"mappings":"AAAA,SACEA,6BAA6B,EAC7BC,eAAe,EACfC,kBAAkB,QACb,0BAA0B;AACjC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SACEC,8BAA8B,EAC9BC,gBAAgB,QACX,0BAA0B;AACjC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,aAAa,QAAQ,uBAAuB;AAGrD,OAAO,MAAMC,eAA+C,GAAG,MAAAA,CAC7DC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,YAAY,EACZC,OAAO,KACJ;EACH,MAAM;IACJC,QAAQ,GAAGC,KAAK;IAChBC,yBAAyB;IACzBC,gBAAgB;IAChBC;EACF,CAAC,GAAGL,OAAO;EAEX,MAAMM,SAAS,GAAG,MAAMnB,eAAe,CAAC;IACtCoB,SAAS,EAAE;MACT,GAAGf,gBAAgB;MACnBgB,OAAO,EAAEjB,8BAA8B,CAACc,iBAAiB;IAC3D,CAAC;IACDI,MAAM,EAAE;MACNC,MAAM,EAAE,KAAK;MACbC,GAAG,EAAE,OAAO;MACZC,SAAS,EAAE,MAAMP,iBAAiB,CAACQ,YAAY,CAAC;IAClD,CAAC;IACDC,GAAG,EAAExB,MAAM,CAAC,CAAC;IACbyB,YAAY,EAAE;MACZL,MAAM,EAAE,MAAM;MACdM,GAAG,EAAEpB,UAAU,CAACqB;IAClB;EACF,CAAC,CAA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