@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
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.parseAuthorizationResponse = exports.getRequestedCredentialToBePresented = exports.continueUserAuthorizationWithMRTDPoPChallenge = exports.
|
|
6
|
+
exports.parseAuthorizationResponse = exports.getRequestedCredentialToBePresented = exports.continueUserAuthorizationWithMRTDPoPChallenge = exports.completeUserAuthorizationWithFormPostJwtMode = exports.completePidUserAuthorizationWithQueryMode = exports.completeEaaUserAuthorizationWithQueryMode = exports.buildAuthorizationUrl = void 0;
|
|
7
7
|
var _auth = require("../../../utils/auth");
|
|
8
8
|
var _parseUrl = _interopRequireDefault(require("parse-url"));
|
|
9
9
|
var _ioWalletOid4vp = require("@pagopa/io-wallet-oid4vp");
|
|
10
10
|
var _ioWalletOid4vci = require("@pagopa/io-wallet-oid4vci");
|
|
11
11
|
var _ioWalletOauth = require("@pagopa/io-wallet-oauth2");
|
|
12
|
-
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
|
13
12
|
var _errors = require("../common/errors");
|
|
14
13
|
var _logging = require("../../../utils/logging");
|
|
15
14
|
var _v = require("../../presentation/v1.3.3");
|
|
@@ -17,9 +16,10 @@ var _callbacks = require("../../../utils/callbacks");
|
|
|
17
16
|
var _config = require("../../../utils/config");
|
|
18
17
|
var _errors2 = require("../../../utils/errors");
|
|
19
18
|
var _mappers = require("./mappers");
|
|
19
|
+
var _misc = require("../../../utils/misc");
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
const continueUserAuthorizationWithMRTDPoPChallenge = async authRedirectUrl => {
|
|
22
|
-
_logging.Logger.log(_logging.LogLevel.DEBUG,
|
|
22
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, "The requested credential is a PID and requires MRTD PoP, starting MRTD PoP validation from auth redirect");
|
|
23
23
|
try {
|
|
24
24
|
const parsedChallenge = (0, _ioWalletOauth.parseMrtdChallenge)({
|
|
25
25
|
redirectUrl: authRedirectUrl
|
|
@@ -49,55 +49,47 @@ const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idp
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
exports.buildAuthorizationUrl = buildAuthorizationUrl;
|
|
52
|
-
const
|
|
53
|
-
_logging.Logger.log(_logging.LogLevel.DEBUG,
|
|
52
|
+
const completePidUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
|
53
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, "The requested credential is a PID, completing the user authorization with query mode");
|
|
54
54
|
const query = (0, _parseUrl.default)(authRedirectUrl).query;
|
|
55
55
|
return parseAuthorizationResponse(query);
|
|
56
56
|
};
|
|
57
|
-
exports.
|
|
57
|
+
exports.completePidUserAuthorizationWithQueryMode = completePidUserAuthorizationWithQueryMode;
|
|
58
58
|
const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
|
|
59
59
|
let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
|
60
|
-
_logging.Logger.log(_logging.LogLevel.DEBUG,
|
|
60
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, "The requested credential is not a PID, requesting the credential to be presented");
|
|
61
61
|
const authzRequestEndpoint = issuerConf.authorization_endpoint;
|
|
62
62
|
const params = new URLSearchParams({
|
|
63
63
|
client_id: clientId,
|
|
64
64
|
request_uri: issuerRequestUri
|
|
65
65
|
});
|
|
66
66
|
_logging.Logger.log(_logging.LogLevel.DEBUG, `Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
fetch: appFetch
|
|
71
|
-
}
|
|
72
|
-
}).catch(_errors2.sdkUnexpectedStatusCodeToIssuerError);
|
|
67
|
+
const requestObjectJwt = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
|
|
68
|
+
method: "GET"
|
|
69
|
+
}).then((0, _misc.hasStatusOrThrow)(200, _errors2.IssuerResponseError)).then(res => res.text());
|
|
73
70
|
const parsedAuthRequest = await (0, _ioWalletOid4vp.parseAuthorizeRequest)({
|
|
74
71
|
config: _config.sdkConfigV1_3,
|
|
75
|
-
requestObjectJwt
|
|
76
|
-
callbacks:
|
|
72
|
+
requestObjectJwt,
|
|
73
|
+
callbacks: {
|
|
74
|
+
verifyJwt: (0, _callbacks.createVerifyJwtFromJwks)(issuerConf.keys)
|
|
75
|
+
}
|
|
77
76
|
});
|
|
78
77
|
return (0, _mappers.mapToRequestObject)(parsedAuthRequest);
|
|
79
78
|
};
|
|
79
|
+
|
|
80
|
+
// NOTE: this function is not used in the 1.3 issuance flow. It may be removed in the future.
|
|
80
81
|
exports.getRequestedCredentialToBePresented = getRequestedCredentialToBePresented;
|
|
81
82
|
const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, issuerConfig, pid, _ref) => {
|
|
82
83
|
let {
|
|
83
|
-
wiaCryptoContext,
|
|
84
|
-
pidKeyTag,
|
|
85
84
|
appFetch = fetch
|
|
86
85
|
} = _ref;
|
|
87
|
-
_logging.Logger.log(_logging.LogLevel.DEBUG,
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
responseUri: requestObject.response_uri
|
|
93
|
-
};
|
|
94
|
-
const remotePresentation = await _v.RemotePresentation.prepareRemotePresentations(dcqlQueryResult, authRequestObject);
|
|
95
|
-
const authzResponsePayload = await createAuthzResponsePayload({
|
|
96
|
-
state: requestObject.state,
|
|
97
|
-
remotePresentation,
|
|
98
|
-
wiaCryptoContext
|
|
86
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, "The requested credential is not a PID, completing the user authorization with form_post.jwt mode");
|
|
87
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
88
|
+
requestObject,
|
|
89
|
+
issuerConfig,
|
|
90
|
+
pid
|
|
99
91
|
});
|
|
100
|
-
_logging.Logger.log(_logging.LogLevel.DEBUG, `Authz response
|
|
92
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
101
93
|
const issuerSigKey = issuerConfig.keys.find(key => key.use === "sig");
|
|
102
94
|
if (!issuerSigKey) {
|
|
103
95
|
const errorMessage = "No signature key found in Issuer Metadata JWKS";
|
|
@@ -105,13 +97,13 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, issue
|
|
|
105
97
|
throw new _errors2.IoWalletError(errorMessage);
|
|
106
98
|
}
|
|
107
99
|
return (0, _ioWalletOid4vci.sendAuthorizationResponseAndExtractCode)({
|
|
108
|
-
authorizationResponseJarm:
|
|
100
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
109
101
|
callbacks: {
|
|
110
102
|
..._callbacks.partialCallbacks,
|
|
111
103
|
fetch: appFetch
|
|
112
104
|
},
|
|
113
105
|
iss: requestObject.iss,
|
|
114
|
-
state: requestObject.state,
|
|
106
|
+
state: requestObject.state ?? "",
|
|
115
107
|
presentationResponseUri: requestObject.response_uri,
|
|
116
108
|
signer: {
|
|
117
109
|
alg: "ES256",
|
|
@@ -120,6 +112,47 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, issue
|
|
|
120
112
|
}
|
|
121
113
|
});
|
|
122
114
|
};
|
|
115
|
+
exports.completeUserAuthorizationWithFormPostJwtMode = completeUserAuthorizationWithFormPostJwtMode;
|
|
116
|
+
const completeEaaUserAuthorizationWithQueryMode = async function (requestObject, issuerConfig, pid, clientRedirectUri) {
|
|
117
|
+
let {
|
|
118
|
+
appFetch = fetch
|
|
119
|
+
} = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
120
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, "The requested credential is not a PID, completing the user authorization with query mode");
|
|
121
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
122
|
+
requestObject,
|
|
123
|
+
issuerConfig,
|
|
124
|
+
pid
|
|
125
|
+
});
|
|
126
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
127
|
+
const {
|
|
128
|
+
redirect_uri
|
|
129
|
+
} = await (0, _ioWalletOid4vp.fetchAuthorizationResponse)({
|
|
130
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
131
|
+
presentationResponseUri: requestObject.response_uri,
|
|
132
|
+
callbacks: {
|
|
133
|
+
..._callbacks.partialCallbacks,
|
|
134
|
+
fetch: appFetch
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
if (!redirect_uri) {
|
|
138
|
+
const errorMessage = "The authorization server did not return a redirect_uri to continue the authorization flow";
|
|
139
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, errorMessage);
|
|
140
|
+
throw new _errors.AuthorizationError(errorMessage);
|
|
141
|
+
}
|
|
142
|
+
const response = await appFetch(redirect_uri).catch(() => null);
|
|
143
|
+
if (!response || !response.ok) {
|
|
144
|
+
const errorMessage = `An error occurred while completing the authorization flow. Ensure ${clientRedirectUri} is a valid HTTP url for redirect`;
|
|
145
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, errorMessage);
|
|
146
|
+
throw new _errors.AuthorizationError(errorMessage);
|
|
147
|
+
}
|
|
148
|
+
const finalRedirectUri = response.url;
|
|
149
|
+
if (!finalRedirectUri || !finalRedirectUri.startsWith(clientRedirectUri)) {
|
|
150
|
+
const errorMessage = `The authorization server did not redirect to the provided client redirect URI. Expected: ${clientRedirectUri}, got: ${finalRedirectUri}`;
|
|
151
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, errorMessage);
|
|
152
|
+
throw new _errors.AuthorizationError(errorMessage);
|
|
153
|
+
}
|
|
154
|
+
return parseAuthorizationResponse((0, _parseUrl.default)(finalRedirectUri).query);
|
|
155
|
+
};
|
|
123
156
|
|
|
124
157
|
/**
|
|
125
158
|
* Parse the authorization response and return the result which contains code, state and iss.
|
|
@@ -128,7 +161,7 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, issue
|
|
|
128
161
|
* @param authRes the authorization response to be parsed
|
|
129
162
|
* @returns the authorization result which contains code, state and iss
|
|
130
163
|
*/
|
|
131
|
-
exports.
|
|
164
|
+
exports.completeEaaUserAuthorizationWithQueryMode = completeEaaUserAuthorizationWithQueryMode;
|
|
132
165
|
const parseAuthorizationResponse = authRes => {
|
|
133
166
|
const authResParsed = _auth.AuthorizationResultShape.safeParse(authRes);
|
|
134
167
|
if (!authResParsed.success) {
|
|
@@ -145,45 +178,51 @@ const parseAuthorizationResponse = authRes => {
|
|
|
145
178
|
};
|
|
146
179
|
|
|
147
180
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @param
|
|
152
|
-
* @
|
|
153
|
-
* @returns The Base64 encoded authorization response payload.
|
|
181
|
+
* Utility function to process the DCQL query for PID presentation and to create the authorization response to send to the Issuer.
|
|
182
|
+
* @param params.requestObject - The request object containing the DCQL query
|
|
183
|
+
* @param params.issuerConfig - The Issuer unified configuration
|
|
184
|
+
* @param params.pid - The PID credential to be presented, as a tuple of [keyTag, credential]
|
|
185
|
+
* @returns The authorization response containing the JARM to be sent to the Issuer
|
|
154
186
|
*/
|
|
155
187
|
exports.parseAuthorizationResponse = parseAuthorizationResponse;
|
|
156
|
-
const
|
|
188
|
+
const processPidPresentationAndCreateAuthzResponse = async _ref2 => {
|
|
157
189
|
let {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
190
|
+
requestObject,
|
|
191
|
+
issuerConfig,
|
|
192
|
+
pid
|
|
161
193
|
} = _ref2;
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
194
|
+
const dcqlQueryResult = await _v.RemotePresentation.evaluateDcqlQuery(requestObject.dcql_query, [pid]);
|
|
195
|
+
const remotePresentation = await _v.RemotePresentation.prepareRemotePresentations(dcqlQueryResult, {
|
|
196
|
+
clientId: requestObject.client_id,
|
|
197
|
+
nonce: requestObject.nonce,
|
|
198
|
+
responseUri: requestObject.response_uri
|
|
199
|
+
});
|
|
200
|
+
const vp_token = remotePresentation.presentations.reduce((acc, _ref3) => {
|
|
201
|
+
let {
|
|
202
|
+
credentialId,
|
|
203
|
+
vpToken
|
|
204
|
+
} = _ref3;
|
|
205
|
+
return {
|
|
206
|
+
...acc,
|
|
207
|
+
[credentialId]: [vpToken]
|
|
208
|
+
};
|
|
209
|
+
}, {});
|
|
210
|
+
return (0, _ioWalletOid4vp.createAuthorizationResponse)({
|
|
211
|
+
// The SDK 1.4 config is used here in order to resolve the encryption data from the Request Object
|
|
212
|
+
// client_metadata, otherwise OpenID Federation clients always ignore client_metadata as per 1.3.3 specs.
|
|
213
|
+
config: _config.sdkConfigV1_4,
|
|
214
|
+
requestObject,
|
|
215
|
+
rpJwks: {
|
|
216
|
+
jwks: {
|
|
217
|
+
keys: issuerConfig.keys
|
|
218
|
+
},
|
|
219
|
+
encrypted_response_enc_values_supported: issuerConfig.encrypted_response_enc_values_supported
|
|
220
|
+
},
|
|
221
|
+
vp_token,
|
|
222
|
+
callbacks: {
|
|
223
|
+
encryptJwe: _callbacks.partialCallbacks.encryptJwe,
|
|
224
|
+
generateRandom: _callbacks.partialCallbacks.generateRandom
|
|
225
|
+
}
|
|
226
|
+
});
|
|
188
227
|
};
|
|
189
228
|
//# sourceMappingURL=03-complete-user-authorization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_auth","require","_parseUrl","_interopRequireDefault","_ioWalletOid4vp","_ioWalletOid4vci","_ioWalletOauth","
|
|
1
|
+
{"version":3,"names":["_auth","require","_parseUrl","_interopRequireDefault","_ioWalletOid4vp","_ioWalletOid4vci","_ioWalletOauth","_errors","_logging","_v","_callbacks","_config","_errors2","_mappers","_misc","obj","__esModule","default","continueUserAuthorizationWithMRTDPoPChallenge","authRedirectUrl","Logger","log","LogLevel","DEBUG","parsedChallenge","parseMrtdChallenge","redirectUrl","challenge_info","challengeJwt","err","errorMessage","Error","message","ERROR","AuthorizationError","exports","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","completePidUserAuthorizationWithQueryMode","query","parseUrl","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObjectJwt","method","then","hasStatusOrThrow","IssuerResponseError","res","text","parsedAuthRequest","parseAuthorizeRequest","config","sdkConfigV1_3","callbacks","verifyJwt","createVerifyJwtFromJwks","keys","mapToRequestObject","completeUserAuthorizationWithFormPostJwtMode","requestObject","issuerConfig","pid","_ref","authzResponse","processPidPresentationAndCreateAuthzResponse","issuerSigKey","find","key","use","IoWalletError","sendAuthorizationResponseAndExtractCode","authorizationResponseJarm","jarm","responseJwe","partialCallbacks","iss","state","presentationResponseUri","response_uri","signer","alg","publicJwk","completeEaaUserAuthorizationWithQueryMode","clientRedirectUri","redirect_uri","fetchAuthorizationResponse","response","catch","ok","finalRedirectUri","url","startsWith","authRes","authResParsed","AuthorizationResultShape","safeParse","success","authErr","AuthorizationErrorShape","error","JSON","stringify","AuthorizationIdpError","data","error_description","_ref2","dcqlQueryResult","RemotePresentationFlow","evaluateDcqlQuery","dcql_query","remotePresentation","prepareRemotePresentations","nonce","responseUri","vp_token","presentations","reduce","acc","_ref3","credentialId","vpToken","createAuthorizationResponse","sdkConfigV1_4","rpJwks","jwks","encrypted_response_enc_values_supported","encryptJwe","generateRandom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/03-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AAMA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,EAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAIA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA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B,CAAC;IACDX,QAAQ;IACR7D,SAAS,EAAE;MACTyE,UAAU,EAAEpD,2BAAgB,CAACoD,UAAU;MACvCC,cAAc,EAAErD,2BAAgB,CAACqD;IACnC;EACF,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -4,15 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.authorizeAccess = void 0;
|
|
7
|
-
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
|
8
7
|
var _ioWalletOauth = require("@pagopa/io-wallet-oauth2");
|
|
9
8
|
var _uuid = require("uuid");
|
|
10
|
-
var _pop = require("../../../utils/pop");
|
|
11
|
-
var WalletInstanceAttestation = _interopRequireWildcard(require("../../../wallet-instance-attestation/v1.0.0/utils"));
|
|
12
9
|
var _callbacks = require("../../../utils/callbacks");
|
|
13
10
|
var _errors = require("../../../utils/errors");
|
|
14
|
-
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
var _config = require("../../../utils/config");
|
|
16
12
|
const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifier, context) => {
|
|
17
13
|
const {
|
|
18
14
|
appFetch = fetch,
|
|
@@ -20,31 +16,36 @@ const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifier, cont
|
|
|
20
16
|
wiaCryptoContext,
|
|
21
17
|
dPopCryptoContext
|
|
22
18
|
} = context;
|
|
23
|
-
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
24
19
|
const tokenDPoP = await (0, _ioWalletOauth.createTokenDPoP)({
|
|
25
20
|
callbacks: {
|
|
26
21
|
..._callbacks.partialCallbacks,
|
|
27
|
-
signJwt:
|
|
28
|
-
jwt: await new _ioReactNativeJwt.SignJWT(wiaCryptoContext).setPayload(payload).sign(),
|
|
29
|
-
signerJwk: dPopSignerJwk
|
|
30
|
-
})
|
|
22
|
+
signJwt: (0, _callbacks.createSignJwtFromCryptoContext)(dPopCryptoContext)
|
|
31
23
|
},
|
|
32
24
|
signer: {
|
|
33
|
-
alg: "ES256",
|
|
34
25
|
method: "jwk",
|
|
35
|
-
|
|
26
|
+
alg: "ES256",
|
|
27
|
+
publicJwk: await dPopCryptoContext.getPublicKey()
|
|
36
28
|
},
|
|
29
|
+
jti: (0, _uuid.v4)(),
|
|
37
30
|
tokenRequest: {
|
|
38
31
|
method: "POST",
|
|
39
32
|
url: issuerConf.token_endpoint
|
|
40
33
|
}
|
|
41
34
|
});
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const clientAttestationDPoP = await (0, _ioWalletOauth.createClientAttestationPopJwt)({
|
|
36
|
+
config: _config.sdkConfigV1_3,
|
|
37
|
+
callbacks: {
|
|
38
|
+
generateRandom: _callbacks.partialCallbacks.generateRandom,
|
|
39
|
+
signJwt: (0, _callbacks.createSignJwtFromCryptoContext)(wiaCryptoContext)
|
|
40
|
+
},
|
|
41
|
+
clientAttestation: walletInstanceAttestation,
|
|
42
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
43
|
+
signer: {
|
|
44
|
+
method: "jwk",
|
|
45
|
+
alg: "ES256",
|
|
46
|
+
publicJwk: await wiaCryptoContext.getPublicKey()
|
|
47
|
+
}
|
|
48
|
+
});
|
|
48
49
|
const tokenResponse = await (0, _ioWalletOauth.fetchTokenResponse)({
|
|
49
50
|
accessTokenEndpoint: issuerConf.token_endpoint,
|
|
50
51
|
callbacks: {
|
|
@@ -53,7 +54,7 @@ const authorizeAccess = async (issuerConf, code, redirectUri, codeVerifier, cont
|
|
|
53
54
|
},
|
|
54
55
|
walletAttestation: walletInstanceAttestation,
|
|
55
56
|
dPoP: tokenDPoP.jwt,
|
|
56
|
-
clientAttestationDPoP
|
|
57
|
+
clientAttestationDPoP,
|
|
57
58
|
accessTokenRequest: {
|
|
58
59
|
code,
|
|
59
60
|
grant_type: "authorization_code",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_ioWalletOauth","require","_uuid","_callbacks","_errors","_config","authorizeAccess","issuerConf","code","redirectUri","codeVerifier","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","dPopCryptoContext","tokenDPoP","createTokenDPoP","callbacks","partialCallbacks","signJwt","createSignJwtFromCryptoContext","signer","method","alg","publicJwk","getPublicKey","jti","uuidv4","tokenRequest","url","token_endpoint","clientAttestationDPoP","createClientAttestationPopJwt","config","sdkConfigV1_3","generateRandom","clientAttestation","authorizationServer","credential_issuer","tokenResponse","fetchTokenResponse","accessTokenEndpoint","walletAttestation","dPoP","jwt","accessTokenRequest","grant_type","code_verifier","redirect_uri","authorization_details","IoWalletError","accessToken","exports"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/04-authorize-access.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAGO,MAAMK,eAA+C,GAAG,MAAAA,CAC7DC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,YAAY,EACZC,OAAO,KACJ;EACH,MAAM;IACJC,QAAQ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AI;MACJwC,UAAU,EAAE,oBAAoB;MAChCC,aAAa,EAAEvC,YAAY;MAC3BwC,YAAY,EAAEzC;IAChB;EACF,CAAC,CAAC;;EAEF;EACA;EACA,IAAI,CAACgC,aAAa,CAACU,qBAAqB,EAAE;IACxC,MAAM,IAAIC,qBAAa,CACrB,6DACF,CAAC;EACH;EAEA,OAAO;IACLC,WAAW,EAAEZ;EACf,CAAC;AACH,CAAC;AAACa,OAAA,CAAAhD,eAAA,GAAAA,eAAA"}
|
|
@@ -8,6 +8,7 @@ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
|
|
8
8
|
var _ioWalletOauth = require("@pagopa/io-wallet-oauth2");
|
|
9
9
|
var _ioWalletOid4vci = require("@pagopa/io-wallet-oid4vci");
|
|
10
10
|
var _ioWalletUtils = require("@pagopa/io-wallet-utils");
|
|
11
|
+
var _uuid = require("uuid");
|
|
11
12
|
var _misc = require("../../../utils/misc");
|
|
12
13
|
var _errors = require("../../../utils/errors");
|
|
13
14
|
var _logging = require("../../../utils/logging");
|
|
@@ -89,26 +90,23 @@ const requestCredentials = async _ref => {
|
|
|
89
90
|
},
|
|
90
91
|
clientId,
|
|
91
92
|
credential_identifier: credentialIdentifier,
|
|
92
|
-
issuerIdentifier: issuerConf.
|
|
93
|
+
issuerIdentifier: issuerConf.credential_endpoint,
|
|
93
94
|
maxBatchSize: issuerConf.credential_issuance_batch_size,
|
|
94
95
|
nonce: c_nonce,
|
|
95
96
|
keyAttestation: keyAttestationJwt,
|
|
96
97
|
signers
|
|
97
98
|
});
|
|
98
|
-
const dPopSignerJwk = await dPopCryptoContext.getPublicKey();
|
|
99
99
|
const credentialDPoP = await (0, _ioWalletOauth.createTokenDPoP)({
|
|
100
100
|
callbacks: {
|
|
101
101
|
..._callbacks.partialCallbacks,
|
|
102
|
-
signJwt:
|
|
103
|
-
jwt: await new _ioReactNativeJwt.SignJWT(dPopCryptoContext).setPayload(payload).sign(),
|
|
104
|
-
signerJwk: dPopSignerJwk
|
|
105
|
-
})
|
|
102
|
+
signJwt: (0, _callbacks.createSignJwtFromCryptoContext)(dPopCryptoContext)
|
|
106
103
|
},
|
|
107
104
|
signer: {
|
|
108
105
|
method: "jwk",
|
|
109
106
|
alg: "ES256",
|
|
110
|
-
publicJwk:
|
|
107
|
+
publicJwk: await dPopCryptoContext.getPublicKey()
|
|
111
108
|
},
|
|
109
|
+
jti: (0, _uuid.v4)(),
|
|
112
110
|
tokenRequest: {
|
|
113
111
|
method: "POST",
|
|
114
112
|
url: issuerConf.credential_endpoint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_ioWalletOauth","_ioWalletOid4vci","_ioWalletUtils","_misc","_errors","_logging","_config","_callbacks","_types","requestCredentials","_ref","issuerConf","accessToken","credentialIdentifier","clientId","keyAttestationJwt","credentialCryptoContexts","dPopCryptoContext","appFetch","fetch","c_nonce","nonce_endpoint","method","headers","then","hasStatusOrThrow","res","json","NonceResponse","parse","keys","Promise","all","map","ctx","publicJwk","getPublicKey","cryptoContext","signJwt","jwtSigner","_ref2","header","payload","IoWalletError","find","_ref3","kid","jwt","SignJWT","setProtectedHeader","setPayload","sign","signerJwk","signers","_ref4","alg","credentialRequest","createCredentialRequest","config","sdkConfigV1_3","callbacks","hash","partialCallbacks","credential_identifier","issuerIdentifier","
|
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_ioWalletOauth","_ioWalletOid4vci","_ioWalletUtils","_uuid","_misc","_errors","_logging","_config","_callbacks","_types","requestCredentials","_ref","issuerConf","accessToken","credentialIdentifier","clientId","keyAttestationJwt","credentialCryptoContexts","dPopCryptoContext","appFetch","fetch","c_nonce","nonce_endpoint","method","headers","then","hasStatusOrThrow","res","json","NonceResponse","parse","keys","Promise","all","map","ctx","publicJwk","getPublicKey","cryptoContext","signJwt","jwtSigner","_ref2","header","payload","IoWalletError","find","_ref3","kid","jwt","SignJWT","setProtectedHeader","setPayload","sign","signerJwk","signers","_ref4","alg","credentialRequest","createCredentialRequest","config","sdkConfigV1_3","callbacks","hash","partialCallbacks","credential_identifier","issuerIdentifier","credential_endpoint","maxBatchSize","credential_issuance_batch_size","nonce","keyAttestation","credentialDPoP","createTokenDPoP","createSignJwtFromCryptoContext","signer","jti","uuidv4","tokenRequest","url","access_token","fetchCredentialResponse","credentialEndpoint","dPoP","catch","handleObtainCredentialError","exports","obtainCredential","credentialDefinition","context","credentialCryptoContext","walletUnitAttestation","ValidationFailed","message","credential_configuration_id","containsCredentialDefinition","authorization_details","some","c","credential_identifiers","includes","Logger","log","LogLevel","ERROR","credentialRes","DEBUG","JSON","stringify","issuerCredentialConfig","credential_configurations_supported","credential","credentials","at","format","obtainCredentialsBatch","_ref5","e","SdkUnexpectedStatusCodeError","ResponseErrorBuilder","IssuerResponseError","handle","code","IssuerResponseErrorCodes","CredentialInvalidStatus","CredentialRequestFailed","buildFrom"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/05-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAKA,IAAAE,gBAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAOA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,kBAAkB,GAAG,MAAAC,IAAA,IASP;EAAA,IATc;IACvCC,UAAU;IACVC,WAAW;IACXC,oBAAoB;IACpBC,QAAQ;IACRC,iBAAiB;IACjBC,wBAAwB;IACxBC,iBAAiB;IACjBC,QAAQ,GAAGC;EACQ,CAAC,GAAAT,IAAA;EACpB,MAAM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15
|
case "dc+sd-jwt":
|
|
16
16
|
{
|
|
17
17
|
_logging.Logger.log(_logging.LogLevel.DEBUG, "Parsing credential in dc+sd-jwt format");
|
|
18
|
-
return (0, _verifyAndParseCredential2.verifyAndParseCredentialSdJwt)(issuerConf, credential, credentialConfigurationId,
|
|
18
|
+
return (0, _verifyAndParseCredential2.verifyAndParseCredentialSdJwt)(issuerConf, credential, credentialConfigurationId, {
|
|
19
|
+
validateCertificateChain: true,
|
|
20
|
+
...context
|
|
21
|
+
}, x509CertRoot);
|
|
19
22
|
}
|
|
20
23
|
case "mso_mdoc":
|
|
21
24
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_errors","require","_logging","_verifyAndParseCredential","_verifyAndParseCredential2","verifyAndParseCredential","issuerConf","credential","credentialConfigurationId","context","x509CertRoot","_issuerConf$credentia","format","credential_configurations_supported","Logger","log","LogLevel","DEBUG","verifyAndParseCredentialSdJwt","verifyAndParseCredentialMDoc","message","ERROR","IoWalletError","exports"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/06-verify-and-parse-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAH,OAAA;AAEO,MAAMI,wBAAiE,GAC5E,MAAAA,CACEC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBC,OAAO,EACPC,YAAY,KACT;EAAA,IAAAC,qBAAA;EACH,MAAMC,MAAM,IAAAD,qBAAA,GACVL,UAAU,CAACO,mCAAmC,CAACL,yBAAyB,CAAC,cAAAG,qBAAA,uBAAzEA,qBAAA,CACIC,MAAM;EAEZ,QAAQA,MAAM;IACZ,KAAK,WAAW;MAAE;QAChBE,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAE,wCAAwC,CAAC;QACpE,OAAO,IAAAC,wDAA6B,EAClCZ,UAAU,EACVC,UAAU,EACVC,yBAAyB,
|
|
1
|
+
{"version":3,"names":["_errors","require","_logging","_verifyAndParseCredential","_verifyAndParseCredential2","verifyAndParseCredential","issuerConf","credential","credentialConfigurationId","context","x509CertRoot","_issuerConf$credentia","format","credential_configurations_supported","Logger","log","LogLevel","DEBUG","verifyAndParseCredentialSdJwt","validateCertificateChain","verifyAndParseCredentialMDoc","message","ERROR","IoWalletError","exports"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/06-verify-and-parse-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAH,OAAA;AAEO,MAAMI,wBAAiE,GAC5E,MAAAA,CACEC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBC,OAAO,EACPC,YAAY,KACT;EAAA,IAAAC,qBAAA;EACH,MAAMC,MAAM,IAAAD,qBAAA,GACVL,UAAU,CAACO,mCAAmC,CAACL,yBAAyB,CAAC,cAAAG,qBAAA,uBAAzEA,qBAAA,CACIC,MAAM;EAEZ,QAAQA,MAAM;IACZ,KAAK,WAAW;MAAE;QAChBE,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAE,wCAAwC,CAAC;QACpE,OAAO,IAAAC,wDAA6B,EAClCZ,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzB;UAAEW,wBAAwB,EAAE,IAAI;UAAE,GAAGV;QAAQ,CAAC,EAC9CC,YACF,CAAC;MACH;IACA,KAAK,UAAU;MAAE;QACfI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAE,uCAAuC,CAAC;QACnE,OAAO,IAAAG,sDAA4B,EACjCd,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBC,OAAO,EACPC,YACF,CAAC;MACH;IAEA;MAAS;QACP,MAAMW,OAAO,GAAI,kCAAiCT,MAAO,EAAC;QAC1DE,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACM,KAAK,EAAED,OAAO,CAAC;QACnC,MAAM,IAAIE,qBAAa,CAACF,OAAO,CAAC;MAClC;EACF;AACF,CAAC;AAACG,OAAA,CAAAnB,wBAAA,GAAAA,wBAAA"}
|
|
@@ -15,7 +15,8 @@ const Issuance = {
|
|
|
15
15
|
evaluateIssuerTrust: _evaluateIssuerTrust.evaluateIssuerTrust,
|
|
16
16
|
startUserAuthorization: _startUserAuthorization.startUserAuthorization,
|
|
17
17
|
buildAuthorizationUrl: _completeUserAuthorization.buildAuthorizationUrl,
|
|
18
|
-
|
|
18
|
+
completePidUserAuthorizationWithQueryMode: _completeUserAuthorization.completePidUserAuthorizationWithQueryMode,
|
|
19
|
+
completeEaaUserAuthorizationWithQueryMode: _completeUserAuthorization.completeEaaUserAuthorizationWithQueryMode,
|
|
19
20
|
continueUserAuthorizationWithMRTDPoPChallenge: _completeUserAuthorization.continueUserAuthorizationWithMRTDPoPChallenge,
|
|
20
21
|
getRequestedCredentialToBePresented: _completeUserAuthorization.getRequestedCredentialToBePresented,
|
|
21
22
|
completeUserAuthorizationWithFormPostJwtMode: _completeUserAuthorization.completeUserAuthorizationWithFormPostJwtMode,
|
|
@@ -23,7 +24,7 @@ const Issuance = {
|
|
|
23
24
|
obtainCredential: _obtainCredential.obtainCredential,
|
|
24
25
|
obtainCredentialsBatch: _obtainCredential.obtainCredentialsBatch,
|
|
25
26
|
verifyAndParseCredential: _verifyAndParseCredential.verifyAndParseCredential,
|
|
26
|
-
MRTDPoP: _mrtdPop.
|
|
27
|
+
MRTDPoP: _mrtdPop.MRTDPoPv1_3
|
|
27
28
|
};
|
|
28
29
|
exports.Issuance = Issuance;
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential","_mrtdPop","Issuance","evaluateIssuerTrust","startUserAuthorization","buildAuthorizationUrl","
|
|
1
|
+
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential","_mrtdPop","Issuance","evaluateIssuerTrust","startUserAuthorization","buildAuthorizationUrl","completePidUserAuthorizationWithQueryMode","completeEaaUserAuthorizationWithQueryMode","continueUserAuthorizationWithMRTDPoPChallenge","getRequestedCredentialToBePresented","completeUserAuthorizationWithFormPostJwtMode","authorizeAccess","obtainCredential","obtainCredentialsBatch","verifyAndParseCredential","MRTDPoP","MRTDPoPv1_3","exports"],"sourceRoot":"../../../../../src","sources":["credential/issuance/v1.3.3/index.ts"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAQA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEO,MAAMO,QAAqB,GAAG;EACnCC,mBAAmB,EAAnBA,wCAAmB;EACnBC,sBAAsB,EAAtBA,8CAAsB;EACtBC,qBAAqB,EAArBA,gDAAqB;EACrBC,yCAAyC,EAAzCA,oEAAyC;EACzCC,yCAAyC,EAAzCA,oEAAyC;EACzCC,6CAA6C,EAA7CA,wEAA6C;EAC7CC,mCAAmC,EAAnCA,8DAAmC;EACnCC,4CAA4C,EAA5CA,uEAA4C;EAC5CC,eAAe,EAAfA,gCAAe;EACfC,gBAAgB,EAAhBA,kCAAgB;EAChBC,sBAAsB,EAAtBA,wCAAsB;EACtBC,wBAAwB,EAAxBA,kDAAwB;EACxBC,OAAO,EAAEC;AACX,CAAC;AAACC,OAAA,CAAAf,QAAA,GAAAA,QAAA"}
|
|
@@ -32,6 +32,7 @@ const mapToIssuerConfig = (0, _mappers.createMapper)(x => {
|
|
|
32
32
|
const {
|
|
33
33
|
oauth_authorization_server,
|
|
34
34
|
openid_credential_issuer,
|
|
35
|
+
openid_credential_verifier,
|
|
35
36
|
federation_entity
|
|
36
37
|
} = x.metadata;
|
|
37
38
|
(0, _misc.assert)(oauth_authorization_server, "oauth_authorization_server is required in Issuer metadata");
|
|
@@ -41,12 +42,13 @@ const mapToIssuerConfig = (0, _mappers.createMapper)(x => {
|
|
|
41
42
|
credential_endpoint: openid_credential_issuer.credential_endpoint,
|
|
42
43
|
credential_issuer: openid_credential_issuer.credential_issuer,
|
|
43
44
|
credential_configurations_supported: mapCredentialConfigurationsSupported(openid_credential_issuer),
|
|
44
|
-
keys: openid_credential_issuer.jwks.keys,
|
|
45
|
+
keys: [...openid_credential_issuer.jwks.keys, ...oauth_authorization_server.jwks.keys],
|
|
45
46
|
pushed_authorization_request_endpoint: oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
46
47
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
47
|
-
nonce_endpoint: openid_credential_issuer.nonce_endpoint,
|
|
48
|
+
nonce_endpoint: openid_credential_issuer.nonce_endpoint ?? "",
|
|
48
49
|
federation_entity: federation_entity ?? {},
|
|
49
|
-
credential_issuance_batch_size: (_openid_credential_is = openid_credential_issuer.batch_credential_issuance) === null || _openid_credential_is === void 0 ? void 0 : _openid_credential_is.batch_size
|
|
50
|
+
credential_issuance_batch_size: (_openid_credential_is = openid_credential_issuer.batch_credential_issuance) === null || _openid_credential_is === void 0 ? void 0 : _openid_credential_is.batch_size,
|
|
51
|
+
encrypted_response_enc_values_supported: openid_credential_verifier === null || openid_credential_verifier === void 0 ? void 0 : openid_credential_verifier.encrypted_response_enc_values_supported
|
|
50
52
|
};
|
|
51
53
|
}, {
|
|
52
54
|
outputSchema: _IssuerConfig.IssuerConfig
|
|
@@ -55,17 +57,14 @@ const mapToIssuerConfig = (0, _mappers.createMapper)(x => {
|
|
|
55
57
|
exports.mapToIssuerConfig = mapToIssuerConfig;
|
|
56
58
|
const mapToRequestObject = (0, _mappers.createMapper)(_ref2 => {
|
|
57
59
|
let {
|
|
60
|
+
header,
|
|
58
61
|
payload
|
|
59
62
|
} = _ref2;
|
|
60
63
|
return {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
response_uri: payload.response_uri,
|
|
66
|
-
state: payload.state,
|
|
67
|
-
response_mode: payload.response_mode,
|
|
68
|
-
response_type: payload.response_type
|
|
64
|
+
...payload,
|
|
65
|
+
iss: payload.iss ?? "",
|
|
66
|
+
trust_chain: header.trust_chain,
|
|
67
|
+
x5c: header.x5c
|
|
69
68
|
};
|
|
70
69
|
});
|
|
71
70
|
exports.mapToRequestObject = mapToRequestObject;
|