@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,3 +1,4 @@
|
|
|
1
|
+
import { IoWalletError } from "../../../utils/errors";
|
|
1
2
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
2
3
|
/**
|
|
3
4
|
* Ensures that the credential type requested is supported by the issuer and contained in the
|
|
@@ -14,7 +15,7 @@ export const selectCredentialDefinition = (issuerConf, credentialId) => {
|
|
|
14
15
|
}));
|
|
15
16
|
if (!result) {
|
|
16
17
|
Logger.log(LogLevel.ERROR, `Requested credential ${credentialId} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`);
|
|
17
|
-
throw new
|
|
18
|
+
throw new IoWalletError(`No credential support the type '${credentialId}'`);
|
|
18
19
|
}
|
|
19
20
|
return result;
|
|
20
21
|
};
|
|
@@ -33,14 +34,14 @@ export const selectResponseMode = (issuerConf, credentialIds) => {
|
|
|
33
34
|
}
|
|
34
35
|
if (responseModeSet.size !== 1) {
|
|
35
36
|
Logger.log(LogLevel.ERROR, `${credentialIds} have incompatible response_mode: ${[...responseModeSet.values()]}`);
|
|
36
|
-
throw new
|
|
37
|
+
throw new IoWalletError("Requested credentials have incompatible response_mode and cannot be requested with the same PAR request");
|
|
37
38
|
}
|
|
38
39
|
const [responseMode] = responseModeSet.values();
|
|
39
40
|
Logger.log(LogLevel.DEBUG, `Selected response mode ${responseMode} for credential IDs ${credentialIds}`);
|
|
40
41
|
const responseModeSupported = issuerConf.response_modes_supported;
|
|
41
42
|
if (responseModeSupported && !responseModeSupported.includes(responseMode)) {
|
|
42
43
|
Logger.log(LogLevel.ERROR, `Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`);
|
|
43
|
-
throw new
|
|
44
|
+
throw new IoWalletError(`No response mode support for IDs '${credentialIds}'`);
|
|
44
45
|
}
|
|
45
46
|
return responseMode;
|
|
46
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LogLevel","Logger","selectCredentialDefinition","issuerConf","credentialId","credential_configurations_supported","result","Object","keys","filter","e","includes","map","credential_configuration_id","type","log","ERROR","JSON","stringify","
|
|
1
|
+
{"version":3,"names":["IoWalletError","LogLevel","Logger","selectCredentialDefinition","issuerConf","credentialId","credential_configurations_supported","result","Object","keys","filter","e","includes","map","credential_configuration_id","type","log","ERROR","JSON","stringify","selectResponseMode","credentialIds","responseModeSet","Set","add","match","size","values","responseMode","DEBUG","responseModeSupported","response_modes_supported"],"sourceRoot":"../../../../../src","sources":["credential/issuance/common/02-start-user-authorization.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAw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YAAY,CAAC,GAAGN,eAAe,CAACK,MAAM,CAAC,CAAC;EAE/CzB,MAAM,CAACc,GAAG,CACRf,QAAQ,CAAC4B,KAAK,EACb,0BAAyBD,YAAa,uBAAsBP,aAAc,EAC7E,CAAC;EAED,MAAMS,qBAAqB,GAAG1B,UAAU,CAAC2B,wBAAwB;EACjE,IAAID,qBAAqB,IAAI,CAACA,qBAAqB,CAAClB,QAAQ,CAACgB,YAAa,CAAC,EAAE;IAC3E1B,MAAM,CAACc,GAAG,CACRf,QAAQ,CAACgB,KAAK,EACb,2BAA0BW,YAAa,kEAAiEV,IAAI,CAACC,SAAS,CAACW,qBAAqB,CAAE,EACjJ,CAAC;IACD,MAAM,IAAI9B,aAAa,CACpB,qCAAoCqB,aAAc,GACrD,CAAC;EACH;EAEA,OAAOO,YAAY;AACrB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
import { SDJwtInstance } from "@sd-jwt/core";
|
|
3
|
-
import { digest
|
|
3
|
+
import { digest } from "@sd-jwt/crypto-nodejs";
|
|
4
4
|
import { isPathEqual, isPrefixOf } from "../../../utils/parser";
|
|
5
5
|
import { IoWalletError } from "../../../utils/errors";
|
|
6
6
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
7
7
|
import { isSameThumbprint } from "../../../utils/jwk";
|
|
8
8
|
import { fixLegacyCredentialSdJwt } from "../../../utils/credentials";
|
|
9
|
+
import { verifyX509Chain } from "../../../utils/x509";
|
|
10
|
+
import { MissingX509CertsError } from "../../../trust/common/errors";
|
|
9
11
|
/**
|
|
10
12
|
* Parse a Sd-Jwt credential according to the issuer configuration
|
|
11
13
|
* @param credentialConfig - the list of supported credentials, as defined in the issuer configuration with their claims metadata
|
|
@@ -111,6 +113,24 @@ const parseCredentialSdJwt = function (credentialConfig, parsedCredentialRaw) {
|
|
|
111
113
|
};
|
|
112
114
|
return processLevel(parsedCredentialRaw, []);
|
|
113
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* JWT verifier implementing the interface expected by the SD-JWT library.
|
|
118
|
+
* Verification is delegated to `io-react-native-jwt` to leverage its support for multiple algorithms.
|
|
119
|
+
* @returns Boolean indicating whether the verification succeeded or not
|
|
120
|
+
*/
|
|
121
|
+
const sdJwtInstanceVerifier = async (data, signature, options) => {
|
|
122
|
+
if (!(options !== null && options !== void 0 && options.issuerKeys)) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
await verifyJwt(`${data}.${signature}`, options.issuerKeys, {
|
|
127
|
+
clockTolerance: options.skewSeconds
|
|
128
|
+
});
|
|
129
|
+
return true;
|
|
130
|
+
} catch {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
114
134
|
|
|
115
135
|
/**
|
|
116
136
|
* Given a credential, verify it's in the supported format
|
|
@@ -128,15 +148,14 @@ const parseCredentialSdJwt = function (credentialConfig, parsedCredentialRaw) {
|
|
|
128
148
|
*
|
|
129
149
|
*/
|
|
130
150
|
async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingContext) {
|
|
131
|
-
const {
|
|
132
|
-
protectedHeader
|
|
133
|
-
} = decode(rawCredential);
|
|
134
|
-
const verifierJwk = getJwkFromHeader(protectedHeader, issuerKeys);
|
|
135
151
|
const sdJwtInstance = new SDJwtInstance({
|
|
136
152
|
hasher: digest,
|
|
137
|
-
verifier:
|
|
153
|
+
verifier: sdJwtInstanceVerifier
|
|
138
154
|
});
|
|
139
|
-
const [verifiedCredential, holderBindingKey] = await Promise.all([sdJwtInstance.verify(rawCredential
|
|
155
|
+
const [verifiedCredential, holderBindingKey] = await Promise.all([sdJwtInstance.verify(rawCredential, {
|
|
156
|
+
issuerKeys,
|
|
157
|
+
skewSeconds: 30
|
|
158
|
+
}), holderBindingContext.getPublicKey()]);
|
|
140
159
|
const {
|
|
141
160
|
cnf
|
|
142
161
|
} = verifiedCredential.payload;
|
|
@@ -147,14 +166,26 @@ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingCon
|
|
|
147
166
|
}
|
|
148
167
|
return await sdJwtInstance.decode(fixLegacyCredentialSdJwt(rawCredential));
|
|
149
168
|
}
|
|
150
|
-
export const verifyAndParseCredentialSdJwt = async (issuerConf, credential, credentialConfigurationId, _ref) => {
|
|
169
|
+
export const verifyAndParseCredentialSdJwt = async (issuerConf, credential, credentialConfigurationId, _ref, x509CertRoot) => {
|
|
151
170
|
let {
|
|
152
171
|
credentialCryptoContext,
|
|
153
172
|
ignoreMissingAttributes,
|
|
154
|
-
includeUndefinedAttributes
|
|
173
|
+
includeUndefinedAttributes,
|
|
174
|
+
validateCertificateChain
|
|
155
175
|
} = _ref;
|
|
156
176
|
const decoded = await verifyCredentialSdJwt(credential, issuerConf.keys, credentialCryptoContext);
|
|
157
177
|
Logger.log(LogLevel.DEBUG, `Decoded credential: ${JSON.stringify(decoded)}`);
|
|
178
|
+
if (validateCertificateChain) {
|
|
179
|
+
var _decoded$jwt;
|
|
180
|
+
if (!x509CertRoot) {
|
|
181
|
+
throw new IoWalletError("Missing x509CertRoot");
|
|
182
|
+
}
|
|
183
|
+
const x5c = (_decoded$jwt = decoded.jwt) === null || _decoded$jwt === void 0 || (_decoded$jwt = _decoded$jwt.header) === null || _decoded$jwt === void 0 ? void 0 : _decoded$jwt.x5c;
|
|
184
|
+
if (!x5c || !Array.isArray(x5c) || x5c.length === 0) {
|
|
185
|
+
throw new MissingX509CertsError("Missing x509 certificates");
|
|
186
|
+
}
|
|
187
|
+
await verifyX509Chain(x5c, x509CertRoot);
|
|
188
|
+
}
|
|
158
189
|
const credentialConfig = issuerConf.credential_configurations_supported[credentialConfigurationId];
|
|
159
190
|
if (!credentialConfig) {
|
|
160
191
|
Logger.log(LogLevel.ERROR, `Credential type not supported by the issuer: ${credentialConfigurationId}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["verify","verifyJwt","SDJwtInstance","digest","isPathEqual","isPrefixOf","IoWalletError","LogLevel","Logger","isSameThumbprint","fixLegacyCredentialSdJwt","verifyX509Chain","MissingX509CertsError","parseCredentialSdJwt","credentialConfig","parsedCredentialRaw","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","claimsMetadata","claims","missingPaths","rootKeysToVerify","Set","map","c","path","filter","p","rootKey","push","missing","join","received","Object","keys","getDisplayNames","match","find","nameMap","entry","display","locale","name","processLevel","currentData","currentPath","Array","isArray","item","dataObj","result","processedKeys","configKeysAtThisLevel","claim","nextPart","includes","key","stringKey","toString","dataValue","newPath","localizedNames","value","add","entries","has","sdJwtInstanceVerifier","data","signature","options","issuerKeys","clockTolerance","skewSeconds","verifyCredentialSdJwt","rawCredential","holderBindingContext","sdJwtInstance","hasher","verifier","verifiedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","payload","jwk","message","kid","log","ERROR","decode","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref","x509CertRoot","credentialCryptoContext","validateCertificateChain","decoded","DEBUG","JSON","stringify","_decoded$jwt","x5c","jwt","header","credential_configurations_supported","getClaims","parsedCredential","issuedAt","iat","Date","exp","expiration"],"sourceRoot":"../../../../../src","sources":["credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts"],"mappings":"AAAA,SAEEA,MAAM,IAAIC,SAAS,QACd,6BAA6B;AACpC,SAA2CC,aAAa,QAAQ,cAAc;AAC9E,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,SAASC,WAAW,EAAEC,UAAU,QAAQ,uBAAuB;AAC/D,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,gBAAgB,QAAkB,oBAAoB;AAE/D,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,qBAAqB,QAAQ,8BAA8B;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AC;EACxE;EAEA,MAAMS,mBAAmB,GAAI,MAAMwF,OAAO,CAACS,SAAS,CAAC7G,MAAM,CAG1D;EAED,MAAM8G,gBAAgB,GAAGpG,oBAAoB,CAC3CC,gBAAgB,EAChBC,mBAAmB,EACnBC,uBAAuB,EACvBI,0BACF,CAAC;EAED,MAAM8F,QAAQ,GACZ,OAAOnG,mBAAmB,CAACoG,GAAG,KAAK,QAAQ,GACvC,IAAIC,IAAI,CAACrG,mBAAmB,CAACoG,GAAG,GAAG,IAAI,CAAC,GACxChG,SAAS;EAEf,IAAI,OAAOJ,mBAAmB,CAACsG,GAAG,KAAK,QAAQ,EAAE;IAC/C,MAAM,IAAI/G,aAAa,CAAC,2CAA2C,CAAC;EACtE;EACA,MAAMgH,UAAU,GAAG,IAAIF,IAAI,CAACrG,mBAAmB,CAACsG,GAAG,GAAG,IAAI,CAAC;EAE3D7G,MAAM,CAACoF,GAAG,CACRrF,QAAQ,CAACiG,KAAK,EACb,sBAAqBC,IAAI,CAACC,SAAS,CAACO,gBAAgB,CAAE,gBAAeC,QAAS,EACjF,CAAC;EAED,OAAO;IACLD,gBAAgB;IAChBK,UAAU;IACVJ;EACF,CAAC;AACH,CAAC"}
|
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fetchMrtdPopInit } from "@pagopa/io-wallet-oauth2";
|
|
1
|
+
import { createClientAttestationPopJwt, fetchMrtdPopInit } from "@pagopa/io-wallet-oauth2";
|
|
3
2
|
import { UnexpectedStatusCodeError as SdkUnexpectedStatusCodeError } from "@pagopa/io-wallet-utils";
|
|
4
|
-
import { createPopToken } from "../../../utils/pop";
|
|
5
3
|
import { Logger, LogLevel } from "../../../utils/logging";
|
|
6
|
-
import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from version 1.0.0
|
|
7
4
|
import { IssuerResponseError, IssuerResponseErrorCodes, ResponseErrorBuilder } from "../../../utils/errors";
|
|
8
|
-
import { createVerifyJwtFromJwks } from "../../../utils/callbacks";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
import { createSignJwtFromCryptoContext, createVerifyJwtFromJwks, partialCallbacks } from "../../../utils/callbacks";
|
|
6
|
+
/**
|
|
7
|
+
* Factory function to create `initChallenge` for MRTD PoP flow.
|
|
8
|
+
* The factory is needed to inject version specific SDK configuration.
|
|
9
|
+
* @param config Configuration object containing the IO Wallet SDK configuration
|
|
10
|
+
* @returns `initChallenge` function compliant with the public API
|
|
11
|
+
*/
|
|
12
|
+
export function createInitChallenge(config) {
|
|
13
|
+
return async function initChallenge(issuerConf, initUrl, mrtd_auth_session, mrtd_pop_jwt_nonce, context) {
|
|
14
|
+
const {
|
|
15
|
+
appFetch = fetch,
|
|
16
|
+
walletInstanceAttestation,
|
|
17
|
+
wiaCryptoContext
|
|
18
|
+
} = context;
|
|
19
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
20
|
+
config: config.sdkConfig,
|
|
21
|
+
callbacks: {
|
|
22
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
23
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext)
|
|
24
|
+
},
|
|
25
|
+
clientAttestation: walletInstanceAttestation,
|
|
26
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
27
|
+
signer: {
|
|
28
|
+
method: "jwk",
|
|
29
|
+
alg: "ES256",
|
|
30
|
+
publicJwk: await wiaCryptoContext.getPublicKey()
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const initResult = await fetchMrtdPopInit({
|
|
34
|
+
popInitEndpoint: initUrl,
|
|
35
|
+
mrtdAuthSession: mrtd_auth_session,
|
|
36
|
+
mrtdPopJwtNonce: mrtd_pop_jwt_nonce,
|
|
37
|
+
walletAttestation: walletInstanceAttestation,
|
|
38
|
+
clientAttestationDPoP,
|
|
39
|
+
callbacks: {
|
|
40
|
+
verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
|
|
41
|
+
fetch: appFetch
|
|
42
|
+
}
|
|
43
|
+
}).catch(handleInitChallengeError);
|
|
44
|
+
return {
|
|
45
|
+
challenge: initResult.challenge,
|
|
46
|
+
mrtd_pop_nonce: initResult.mrtdPopNonce,
|
|
47
|
+
pop_verify_endpoint: initResult.popVerifyEndpoint,
|
|
48
|
+
mrz: initResult.mrz
|
|
49
|
+
};
|
|
37
50
|
};
|
|
38
|
-
}
|
|
51
|
+
}
|
|
39
52
|
const handleInitChallengeError = e => {
|
|
40
53
|
Logger.log(LogLevel.ERROR, `Failed to get MRTD challenge: ${e}`);
|
|
41
54
|
if (!(e instanceof SdkUnexpectedStatusCodeError)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createClientAttestationPopJwt","fetchMrtdPopInit","UnexpectedStatusCodeError","SdkUnexpectedStatusCodeError","Logger","LogLevel","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","createSignJwtFromCryptoContext","createVerifyJwtFromJwks","partialCallbacks","createInitChallenge","config","initChallenge","issuerConf","initUrl","mrtd_auth_session","mrtd_pop_jwt_nonce","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","clientAttestationDPoP","sdkConfig","callbacks","generateRandom","signJwt","clientAttestation","authorizationServer","credential_issuer","signer","method","alg","publicJwk","getPublicKey","initResult","popInitEndpoint","mrtdAuthSession","mrtdPopJwtNonce","walletAttestation","verifyJwt","keys","catch","handleInitChallengeError","challenge","mrtd_pop_nonce","mrtdPopNonce","pop_verify_endpoint","popVerifyEndpoint","mrz","e","log","ERROR","handle","code","MrtdChallengeInitRequestFailed","message","buildFrom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/02-init-challenge.ts"],"mappings":"AAAA,SACEA,6BAA6B,EAC7BC,gBAAgB,QACX,0BAA0B;AACjC,SAEEC,yBAAyB,IAAIC,4BAA4B,QACpD,yBAAyB;AAChC,SAASC,MAAM,EAAEC,QAAQ,QAAQ,wBAAwB;AACzD,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,QACf,uBAAuB;AAE9B,SACEC,8BAA8B,EAC9BC,uBAAuB,EACvBC,gBAAgB,QACX,0BAA0B;AAMjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CACjCC,MAAc,EACe;EAC7B,OAAO,eAAeC,aAAaA,CACjCC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,kBAAkB,EAClBC,OAAO,EACP;IACA,MAAM;MACJC,QAAQ,GAAGC,KAAK;MAChBC,yBAAyB;MACzBC;IACF,CAAC,GAAGJ,OAAO;IAEX,MAAMK,qBAAqB,GAAG,MAAMxB,6BAA6B,CAAC;MAChEa,MAAM,EAAEA,MAAM,CAACY,SAAS;MACxBC,SAAS,EAAE;QACTC,cAAc,EAAEhB,gBAAgB,CAACgB,cAAc;QAC/CC,OAAO,EAAEnB,8BAA8B,CAACc,gBAAgB;MAC1D,CAAC;MACDM,iBAAiB,EAAEP,yBAAyB;MAC5CQ,mBAAmB,EAAEf,UAAU,CAACgB,iBAAiB;MACjDC,MAAM,EAAE;QACNC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,OAAO;QACZC,SAAS,EAAE,MAAMZ,gBAAgB,CAACa,YAAY,CAAC;MACjD;IACF,CAAC,CAAC;IAEF,MAAMC,UAAU,GAAG,MAAMpC,gBAAgB,CAAC;MACxCqC,eAAe,EAAEtB,OAAO;MACxBuB,eAAe,EAAEtB,iBAAiB;MAClCuB,eAAe,EAAEtB,kBAAkB;MACnCuB,iBAAiB,EAAEnB,yBAAyB;MAC5CE,qBAAqB;MACrBE,SAAS,EAAE;QACTgB,SAAS,EAAEhC,uBAAuB,CAACK,UAAU,CAAC4B,IAAI,CAAC;QACnDtB,KAAK,EAAED;MACT;IACF,CAAC,CAAC,CAACwB,KAAK,CAACC,wBAAwB,CAAC;IAElC,OAAO;MACLC,SAAS,EAAET,UAAU,CAACS,SAAS;MAC/BC,cAAc,EAAEV,UAAU,CAACW,YAAY;MACvCC,mBAAmB,EAAEZ,UAAU,CAACa,iBAAiB;MACjDC,GAAG,EAAEd,UAAU,CAACc;IAClB,CAAC;EACH,CAAC;AACH;AAEA,MAAMN,wBAAwB,GAAIO,CAAU,IAAK;EAC/ChD,MAAM,CAACiD,GAAG,CAAChD,QAAQ,CAACiD,KAAK,EAAG,iCAAgCF,CAAE,EAAC,CAAC;EAEhE,IAAI,EAAEA,CAAC,YAAYjD,4BAA4B,CAAC,EAAE;IAChD,MAAMiD,CAAC;EACT;EAEA,MAAM,IAAI5C,oBAAoB,CAACF,mBAAmB,CAAC,CAChDiD,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEjD,wBAAwB,CAACkD,8BAA8B;IAC7DC,OAAO,EAAE;EACX,CAAC,CAAC,CACDC,SAAS,CAACP,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -1,53 +1,64 @@
|
|
|
1
1
|
import { SignJWT } from "@pagopa/io-react-native-jwt";
|
|
2
|
-
import { fetchMrtdPopVerify } from "@pagopa/io-wallet-oauth2";
|
|
3
|
-
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import { createPopToken } from "../../../utils/pop";
|
|
5
|
-
import * as WalletInstanceAttestation from "../../../wallet-instance-attestation/v1.0.0/utils"; // TODO: decouple from 1.0.0 version
|
|
2
|
+
import { createClientAttestationPopJwt, fetchMrtdPopVerify } from "@pagopa/io-wallet-oauth2";
|
|
6
3
|
import { sdkUnexpectedStatusCodeToIssuerError } from "../../../utils/errors";
|
|
7
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
4
|
+
import { createSignJwtFromCryptoContext, partialCallbacks } from "../../../utils/callbacks";
|
|
5
|
+
/**
|
|
6
|
+
* Factory function to create `validateChallenge` for MRTD PoP flow.
|
|
7
|
+
* The factory is needed to inject version specific SDK configuration.
|
|
8
|
+
* @param config Configuration object containing the IO Wallet SDK configuration
|
|
9
|
+
* @returns `validateChallenge` function compliant with the public API
|
|
10
|
+
*/
|
|
11
|
+
export function createValidateChallenge(config) {
|
|
12
|
+
return async function validateChallenge(issuerConf, verifyUrl, mrtd_auth_session, mrtd_pop_nonce, mrtd, ias, context) {
|
|
13
|
+
const {
|
|
14
|
+
appFetch = fetch,
|
|
15
|
+
walletInstanceAttestation,
|
|
16
|
+
wiaCryptoContext
|
|
17
|
+
} = context;
|
|
18
|
+
const aud = issuerConf.credential_issuer;
|
|
19
|
+
const wiaPublicJwk = await wiaCryptoContext.getPublicKey();
|
|
20
|
+
const clientAttestationDPoP = await createClientAttestationPopJwt({
|
|
21
|
+
config: config.sdkConfig,
|
|
22
|
+
callbacks: {
|
|
23
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
24
|
+
signJwt: createSignJwtFromCryptoContext(wiaCryptoContext)
|
|
25
|
+
},
|
|
26
|
+
clientAttestation: walletInstanceAttestation,
|
|
27
|
+
authorizationServer: aud,
|
|
28
|
+
signer: {
|
|
29
|
+
method: "jwk",
|
|
30
|
+
alg: "ES256",
|
|
31
|
+
publicJwk: wiaPublicJwk
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const mrtdValidationJwt = await new SignJWT(wiaCryptoContext).setProtectedHeader({
|
|
35
|
+
typ: "mrtd-ias+jwt",
|
|
36
|
+
kid: wiaPublicJwk.kid
|
|
37
|
+
}).setPayload({
|
|
38
|
+
iss: wiaPublicJwk.kid,
|
|
39
|
+
aud,
|
|
40
|
+
document_type: "cie",
|
|
41
|
+
mrtd,
|
|
42
|
+
ias
|
|
43
|
+
}).setIssuedAt().setExpirationTime("5m").sign();
|
|
44
|
+
const verifyResult = await fetchMrtdPopVerify({
|
|
45
|
+
popVerifyEndpoint: verifyUrl,
|
|
46
|
+
mrtdAuthSession: mrtd_auth_session,
|
|
47
|
+
mrtdPopNonce: mrtd_pop_nonce,
|
|
48
|
+
clientAttestationDPoP,
|
|
49
|
+
mrtdValidationJwt,
|
|
50
|
+
walletAttestation: walletInstanceAttestation,
|
|
51
|
+
callbacks: {
|
|
52
|
+
fetch: appFetch,
|
|
53
|
+
...partialCallbacks
|
|
54
|
+
}
|
|
55
|
+
}).catch(sdkUnexpectedStatusCodeToIssuerError);
|
|
56
|
+
return {
|
|
57
|
+
redirect_uri: verifyResult.redirectUri,
|
|
58
|
+
mrtd_val_pop_nonce: verifyResult.mrtdValPopNonce
|
|
59
|
+
};
|
|
49
60
|
};
|
|
50
|
-
}
|
|
61
|
+
}
|
|
51
62
|
export const buildChallengeCallbackUrl = async (redirectUri, valPopNonce, authSession) => {
|
|
52
63
|
const params = new URLSearchParams({
|
|
53
64
|
mrtd_val_pop_nonce: valPopNonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SignJWT","
|
|
1
|
+
{"version":3,"names":["SignJWT","createClientAttestationPopJwt","fetchMrtdPopVerify","sdkUnexpectedStatusCodeToIssuerError","createSignJwtFromCryptoContext","partialCallbacks","createValidateChallenge","config","validateChallenge","issuerConf","verifyUrl","mrtd_auth_session","mrtd_pop_nonce","mrtd","ias","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","aud","credential_issuer","wiaPublicJwk","getPublicKey","clientAttestationDPoP","sdkConfig","callbacks","generateRandom","signJwt","clientAttestation","authorizationServer","signer","method","alg","publicJwk","mrtdValidationJwt","setProtectedHeader","typ","kid","setPayload","iss","document_type","setIssuedAt","setExpirationTime","sign","verifyResult","popVerifyEndpoint","mrtdAuthSession","mrtdPopNonce","walletAttestation","catch","redirect_uri","redirectUri","mrtd_val_pop_nonce","mrtdValPopNonce","buildChallengeCallbackUrl","valPopNonce","authSession","params","URLSearchParams","callbackUrl"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/03-validate-challenge.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,6BAA6B;AACrD,SACEC,6BAA6B,EAC7BC,kBAAkB,QACb,0BAA0B;AAEjC,SAASC,oCAAoC,QAAQ,uBAAuB;AAC5E,SACEC,8BAA8B,EAC9BC,gBAAgB,QACX,0BAA0B;AAOjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,MAAc,EACmB;EACjC,OAAO,eAAeC,iBAAiBA,CACrCC,UAAU,EACVC,SAAS,EACTC,iBAAiB,EACjBC,cAAc,EACdC,IAAI,EACJC,GAAG,EACHC,OAAO,EACP;IACA,MAAM;MACJC,QAAQ,GAAGC,KAAK;MAChBC,yBAAyB;MACzBC;IACF,CAAC,GAAGJ,OAAO;IAEX,MAAMK,GAAG,GAAGX,UAAU,CAACY,iBAAiB;IAExC,MAAMC,YAAY,GAAG,MAAMH,gBAAgB,CAACI,YAAY,CAAC,CAAC;IAE1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E,MAAAA,CAAOH,WAAW,EAAEI,WAAW,EAAEC,WAAW,KAAK;EAC/C,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCN,kBAAkB,EAAEG,WAAW;IAC/B7C,iBAAiB,EAAE8C;EACrB,CAAC,CAAC;EAEF,MAAMG,WAAW,GAAI,GAAER,WAAY,IAAGM,MAAO,EAAC;EAC9C,OAAO;IAAEE;EAAY,CAAC;AACxB,CAAC"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { sdkConfigV1_0, sdkConfigV1_3 } from "../../../utils/config";
|
|
1
2
|
import { verifyAndParseChallengeInfo } from "./01-verify-and-parse-challenge-info";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export const
|
|
3
|
+
import { createInitChallenge } from "./02-init-challenge";
|
|
4
|
+
import { createValidateChallenge, buildChallengeCallbackUrl } from "./03-validate-challenge";
|
|
5
|
+
export const MRTDPoPv1_0 = {
|
|
5
6
|
verifyAndParseChallengeInfo,
|
|
6
|
-
initChallenge
|
|
7
|
-
|
|
7
|
+
initChallenge: createInitChallenge({
|
|
8
|
+
sdkConfig: sdkConfigV1_0
|
|
9
|
+
}),
|
|
10
|
+
validateChallenge: createValidateChallenge({
|
|
11
|
+
sdkConfig: sdkConfigV1_0
|
|
12
|
+
}),
|
|
13
|
+
buildChallengeCallbackUrl
|
|
14
|
+
};
|
|
15
|
+
export const MRTDPoPv1_3 = {
|
|
16
|
+
verifyAndParseChallengeInfo,
|
|
17
|
+
initChallenge: createInitChallenge({
|
|
18
|
+
sdkConfig: sdkConfigV1_3
|
|
19
|
+
}),
|
|
20
|
+
validateChallenge: createValidateChallenge({
|
|
21
|
+
sdkConfig: sdkConfigV1_3
|
|
22
|
+
}),
|
|
8
23
|
buildChallengeCallbackUrl
|
|
9
24
|
};
|
|
10
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["verifyAndParseChallengeInfo","
|
|
1
|
+
{"version":3,"names":["sdkConfigV1_0","sdkConfigV1_3","verifyAndParseChallengeInfo","createInitChallenge","createValidateChallenge","buildChallengeCallbackUrl","MRTDPoPv1_0","initChallenge","sdkConfig","validateChallenge","MRTDPoPv1_3"],"sourceRoot":"../../../../../src","sources":["credential/issuance/mrtd-pop/index.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,aAAa,QAAQ,uBAAuB;AAEpE,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SACEC,uBAAuB,EACvBC,yBAAyB,QACpB,yBAAyB;AAEhC,OAAO,MAAMC,WAAuB,GAAG;EACrCJ,2BAA2B;EAC3BK,aAAa,EAAEJ,mBAAmB,CAAC;IAAEK,SAAS,EAAER;EAAc,CAAC,CAAC;EAChES,iBAAiB,EAAEL,uBAAuB,CAAC;IAAEI,SAAS,EAAER;EAAc,CAAC,CAAC;EACxEK;AACF,CAAC;AAED,OAAO,MAAMK,WAAuB,GAAG;EACrCR,2BAA2B;EAC3BK,aAAa,EAAEJ,mBAAmB,CAAC;IAAEK,SAAS,EAAEP;EAAc,CAAC,CAAC;EAChEQ,iBAAiB,EAAEL,uBAAuB,CAAC;IAAEI,SAAS,EAAEP;EAAc,CAAC,CAAC;EACxEI;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { generateRandomAlphaNumericString } from "../../../utils/misc";
|
|
|
2
2
|
import { makeParRequest } from "../../../utils/par";
|
|
3
3
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
4
4
|
import { IoWalletError } from "../../../utils/errors";
|
|
5
|
-
import { selectCredentialDefinition, selectResponseMode } from "../common/authorization";
|
|
5
|
+
import { selectCredentialDefinition, selectResponseMode } from "../common/02-start-user-authorization";
|
|
6
6
|
export const startUserAuthorization = async (issuerConf, credentialIds, proof, ctx) => {
|
|
7
7
|
const {
|
|
8
8
|
wiaCryptoContext,
|
|
@@ -50,7 +50,8 @@ export const startUserAuthorization = async (issuerConf, credentialIds, proof, c
|
|
|
50
50
|
issuerRequestUri,
|
|
51
51
|
clientId,
|
|
52
52
|
codeVerifier,
|
|
53
|
-
credentialDefinition
|
|
53
|
+
credentialDefinition,
|
|
54
|
+
responseMode
|
|
54
55
|
};
|
|
55
56
|
};
|
|
56
57
|
//# sourceMappingURL=02-start-user-authorization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateRandomAlphaNumericString","makeParRequest","LogLevel","Logger","IoWalletError","selectCredentialDefinition","selectResponseMode","startUserAuthorization","issuerConf","credentialIds","proof","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","log","ERROR","codeVerifier","parEndpoint","pushed_authorization_request_endpoint","aud","credential_issuer","responseMode","getPar","credentialDefinition","map","c","proofType","push","type","idphinting","idpHinting","challenge_method","challenge_redirect_uri","issuerRequestUri","authorizationDetails"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/02-start-user-authorization.ts"],"mappings":"AAAA,SAASA,gCAAgC,QAAQ,qBAAqB;AACtE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,uBAAuB;AAErD,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,
|
|
1
|
+
{"version":3,"names":["generateRandomAlphaNumericString","makeParRequest","LogLevel","Logger","IoWalletError","selectCredentialDefinition","selectResponseMode","startUserAuthorization","issuerConf","credentialIds","proof","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","log","ERROR","codeVerifier","parEndpoint","pushed_authorization_request_endpoint","aud","credential_issuer","responseMode","getPar","credentialDefinition","map","c","proofType","push","type","idphinting","idpHinting","challenge_method","challenge_redirect_uri","issuerRequestUri","authorizationDetails"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/02-start-user-authorization.ts"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,IAAI,CAAC;MACxBC,IAAI,EAAE,sBAAsB;MAC5BC,UAAU,EAAE3B,KAAK,CAAC4B,UAAU;MAC5BC,gBAAgB,EAAE,UAAU;MAC5BC,sBAAsB,EAAE1B;IAC1B,CAAC,CAAC;EACJ;EAEA,MAAM2B,gBAAgB,GAAG,MAAMX,MAAM,CACnCL,WAAW,EACXZ,yBAAyB,EACzB;IACEc,GAAG;IACHV,QAAQ;IACRO,YAAY;IACZV,WAAW;IACXe,YAAY;IACZa,oBAAoB,EAAEX;EACxB,CACF,CAAC;EAED,OAAO;IACLU,gBAAgB;IAChBxB,QAAQ;IACRO,YAAY;IACZO,oBAAoB;IACpBF;EACF,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuthorizationChallengeResultShape, AuthorizationErrorShape, AuthorizationResultShape } from "../../../utils/auth";
|
|
2
2
|
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
3
3
|
import parseUrl from "parse-url";
|
|
4
|
-
import { IssuerResponseError, ValidationFailed } from "../../../utils/errors";
|
|
4
|
+
import { IssuerResponseError, UnimplementedFeatureError, ValidationFailed } from "../../../utils/errors";
|
|
5
5
|
import { decode, SignJWT } from "@pagopa/io-react-native-jwt";
|
|
6
6
|
import { ResponseUriResultShape } from "./types";
|
|
7
7
|
import { getJwtFromFormPost } from "../../../utils/decoder";
|
|
@@ -39,11 +39,14 @@ export const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerCo
|
|
|
39
39
|
authUrl
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
export const
|
|
42
|
+
export const completePidUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
|
43
43
|
Logger.log(LogLevel.DEBUG, `The requested credential is a PersonIdentificationData, completing the user authorization with query mode`);
|
|
44
44
|
const query = parseUrl(authRedirectUrl).query;
|
|
45
45
|
return parseAuthorizationResponse(query);
|
|
46
46
|
};
|
|
47
|
+
export const completeEaaUserAuthorizationWithQueryMode = () => {
|
|
48
|
+
throw new UnimplementedFeatureError("completeEaaUserAuthorizationWithQueryMode", "1.0.0");
|
|
49
|
+
};
|
|
47
50
|
export const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
|
|
48
51
|
let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
|
49
52
|
Logger.log(LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, requesting the credential to be presented`);
|
|
@@ -71,11 +74,10 @@ export const getRequestedCredentialToBePresented = async function (issuerRequest
|
|
|
71
74
|
export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, _issuerConfig, pid, _ref) => {
|
|
72
75
|
let {
|
|
73
76
|
wiaCryptoContext,
|
|
74
|
-
pidKeyTag,
|
|
75
77
|
appFetch = fetch
|
|
76
78
|
} = _ref;
|
|
77
79
|
Logger.log(LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, completing the user authorization with form_post.jwt mode`);
|
|
78
|
-
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(requestObject.dcql_query, [
|
|
80
|
+
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(requestObject.dcql_query, [pid]);
|
|
79
81
|
const authRequestObject = {
|
|
80
82
|
nonce: requestObject.nonce,
|
|
81
83
|
clientId: requestObject.client_id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AuthorizationChallengeResultShape","AuthorizationErrorShape","AuthorizationResultShape","hasStatusOrThrow","parseUrl","IssuerResponseError","ValidationFailed","decode","SignJWT","ResponseUriResultShape","getJwtFromFormPost","AuthorizationError","AuthorizationIdpError","LogLevel","Logger","RawRequestObject","RemotePresentation","RemotePresentationFlow","continueUserAuthorizationWithMRTDPoPChallenge","authRedirectUrl","log","DEBUG","query","authResParsed","safeParse","success","authErr","ERROR","error","message","JSON","stringify","data","error_description","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","
|
|
1
|
+
{"version":3,"names":["AuthorizationChallengeResultShape","AuthorizationErrorShape","AuthorizationResultShape","hasStatusOrThrow","parseUrl","IssuerResponseError","UnimplementedFeatureError","ValidationFailed","decode","SignJWT","ResponseUriResultShape","getJwtFromFormPost","AuthorizationError","AuthorizationIdpError","LogLevel","Logger","RawRequestObject","RemotePresentation","RemotePresentationFlow","continueUserAuthorizationWithMRTDPoPChallenge","authRedirectUrl","log","DEBUG","query","authResParsed","safeParse","success","authErr","ERROR","error","message","JSON","stringify","data","error_description","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","completePidUserAuthorizationWithQueryMode","parseAuthorizationResponse","completeEaaUserAuthorizationWithQueryMode","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObject","method","then","res","text","jws","reqObj","header","protectedHeader","payload","reason","completeUserAuthorizationWithFormPostJwtMode","_issuerConfig","pid","_ref","wiaCryptoContext","dcqlQueryResult","evaluateDcqlQuery","dcql_query","authRequestObject","nonce","responseUri","response_uri","remotePresentation","prepareRemotePresentations","authzResponsePayload","createAuthzResponsePayload","state","body","response","resUriRes","headers","reqUri","json","redirect_uri","cbRes","decodedJwt","authRes","_ref2","kid","getPublicKey","setProtectedHeader","typ","setPayload","vp_token","presentations","reduce","_ref3","credentialId","vpToken","setIssuedAt","setExpirationTime","sign"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.0.0/03-complete-user-authorization.ts"],"mappings":"AAAA,SACEA,iCAAiC,EACjCC,uBAAuB,EACvBC,wBAAwB,QAEnB,qBAAqB;AAC5B,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,OAAOC,QAAQ,MAAM,WAAW;AAEhC,SACEC,mBAAmB,EACnBC,yBAAyB,EACzBC,gBAAgB,QACX,uBAAuB;AAC9B,SACEC,MAAM,EACNC,OAAO,QAEF,6BAA6B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