@pagopa/io-react-native-wallet 1.7.0 → 2.0.0-next.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 +47 -1
- package/lib/commonjs/client/generated/wallet-provider.js +49 -20
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
- package/lib/commonjs/credential/index.js +5 -1
- package/lib/commonjs/credential/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +27 -0
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +25 -16
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +30 -18
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +17 -12
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +36 -29
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +27 -207
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +23 -20
- package/lib/commonjs/credential/issuance/const.js +1 -1
- package/lib/commonjs/credential/issuance/const.js.map +1 -1
- package/lib/commonjs/credential/issuance/index.js +3 -3
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +14 -15
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +6 -4
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js +34 -7
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js +4 -126
- package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +80 -25
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js +6 -30
- package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +97 -117
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +86 -191
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +112 -176
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/README.md +74 -79
- package/lib/commonjs/credential/presentation/errors.js +42 -21
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +13 -13
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +53 -29
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/credential/status/01-start-flow.js +2 -0
- package/lib/commonjs/credential/status/01-start-flow.js.map +1 -0
- package/lib/commonjs/credential/status/02-status-attestation.js +73 -0
- package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +55 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
- package/lib/commonjs/credential/status/README.md +67 -0
- package/lib/commonjs/credential/status/index.js +27 -0
- package/lib/commonjs/credential/status/index.js.map +1 -0
- package/lib/commonjs/credential/status/types.js +48 -0
- package/lib/commonjs/credential/status/types.js.map +1 -0
- package/lib/commonjs/credential/trustmark/README.md +62 -0
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +86 -0
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -0
- package/lib/commonjs/credential/trustmark/index.js +13 -0
- package/lib/commonjs/credential/trustmark/index.js.map +1 -0
- package/lib/commonjs/index.js +5 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/types.js +18 -2
- package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +22 -34
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +11 -23
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +1 -7
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +5 -21
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/{entity/trust → trust}/chain.js +49 -55
- package/lib/commonjs/trust/chain.js.map +1 -0
- package/lib/commonjs/trust/errors.js +110 -0
- package/lib/commonjs/trust/errors.js.map +1 -0
- package/lib/commonjs/trust/index.js +282 -0
- package/lib/commonjs/trust/index.js.map +1 -0
- package/lib/commonjs/{entity/trust → trust}/types.js +27 -47
- package/lib/commonjs/trust/types.js.map +1 -0
- package/lib/commonjs/trust/utils.js +41 -0
- package/lib/commonjs/trust/utils.js.map +1 -0
- package/lib/commonjs/utils/crypto.js +5 -112
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/decoder.js +2 -0
- package/lib/commonjs/utils/decoder.js.map +1 -1
- package/lib/commonjs/utils/error-codes.js +22 -2
- package/lib/commonjs/utils/error-codes.js.map +1 -1
- package/lib/commonjs/utils/errors.js +72 -4
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/logging.js +68 -0
- package/lib/commonjs/utils/logging.js.map +1 -0
- package/lib/commonjs/utils/misc.js +2 -0
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/commonjs/utils/par.js +17 -10
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/string.js +1 -12
- package/lib/commonjs/utils/string.js.map +1 -1
- package/lib/commonjs/wallet-instance/index.js +14 -0
- package/lib/commonjs/wallet-instance/index.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/README.md +8 -3
- package/lib/commonjs/wallet-instance-attestation/issuing.js +15 -8
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +16 -20
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +40 -15
- package/lib/module/client/generated/wallet-provider.js.map +1 -1
- package/lib/module/credential/index.js +3 -1
- package/lib/module/credential/index.js.map +1 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +20 -0
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js +25 -16
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +30 -18
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +17 -11
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +36 -28
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +27 -205
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +23 -20
- package/lib/module/credential/issuance/const.js +1 -1
- package/lib/module/credential/issuance/const.js.map +1 -1
- package/lib/module/credential/issuance/index.js +2 -2
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +14 -15
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +5 -3
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +34 -7
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +2 -124
- package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js +78 -23
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/06-fetch-presentation-definition.js +6 -30
- package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +97 -118
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +83 -186
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +107 -170
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/README.md +74 -79
- package/lib/module/credential/presentation/errors.js +30 -17
- package/lib/module/credential/presentation/errors.js.map +1 -1
- package/lib/module/credential/presentation/index.js +6 -6
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +49 -27
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/credential/status/01-start-flow.js +2 -0
- package/lib/module/credential/status/01-start-flow.js.map +1 -0
- package/lib/module/credential/status/02-status-attestation.js +66 -0
- package/lib/module/credential/status/02-status-attestation.js.map +1 -0
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +49 -0
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
- package/lib/module/credential/status/README.md +67 -0
- package/lib/module/credential/status/index.js +5 -0
- package/lib/module/credential/status/index.js.map +1 -0
- package/lib/module/credential/status/types.js +40 -0
- package/lib/module/credential/status/types.js.map +1 -0
- package/lib/module/credential/trustmark/README.md +62 -0
- package/lib/module/credential/trustmark/get-credential-trustmark.js +77 -0
- package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -0
- package/lib/module/credential/trustmark/index.js +3 -0
- package/lib/module/credential/trustmark/index.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/sd-jwt/types.js +16 -1
- package/lib/module/pid/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +22 -34
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +11 -23
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/index.js +1 -7
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +4 -19
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/trust/chain.js +108 -0
- package/lib/module/trust/chain.js.map +1 -0
- package/lib/module/trust/errors.js +94 -0
- package/lib/module/trust/errors.js.map +1 -0
- package/lib/module/trust/index.js +263 -0
- package/lib/module/trust/index.js.map +1 -0
- package/lib/module/{entity/trust → trust}/types.js +25 -46
- package/lib/module/trust/types.js.map +1 -0
- package/lib/module/trust/utils.js +33 -0
- package/lib/module/trust/utils.js.map +1 -0
- package/lib/module/utils/crypto.js +4 -107
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/decoder.js +3 -0
- package/lib/module/utils/decoder.js.map +1 -1
- package/lib/module/utils/error-codes.js +20 -1
- package/lib/module/utils/error-codes.js.map +1 -1
- package/lib/module/utils/errors.js +61 -4
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/logging.js +62 -0
- package/lib/module/utils/logging.js.map +1 -0
- package/lib/module/utils/misc.js +2 -0
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/module/utils/par.js +17 -9
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/string.js +0 -10
- package/lib/module/utils/string.js.map +1 -1
- package/lib/module/wallet-instance/index.js +13 -0
- package/lib/module/wallet-instance/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/README.md +8 -3
- package/lib/module/wallet-instance-attestation/index.js +2 -2
- package/lib/module/wallet-instance-attestation/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/issuing.js +16 -9
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +14 -18
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +206 -51
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
- package/lib/typescript/credential/index.d.ts +3 -1
- package/lib/typescript/credential/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +19 -0
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -9
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +4 -4
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -15
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/const.d.ts +1 -1
- package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +3 -3
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +8 -3
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +28 -9
- package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +2 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -5
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +4 -30
- package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +17 -4
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +4 -9
- package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -12
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +40 -42
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -43
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +25 -10
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +7 -8
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +137 -307
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
- package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
- package/lib/typescript/credential/status/02-status-attestation.d.ts +19 -0
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
- package/lib/typescript/credential/status/index.d.ts +7 -0
- package/lib/typescript/credential/status/index.d.ts.map +1 -0
- package/lib/typescript/credential/status/types.d.ts +305 -0
- package/lib/typescript/credential/status/types.d.ts.map +1 -0
- package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +52 -0
- package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -0
- package/lib/typescript/credential/trustmark/index.d.ts +4 -0
- package/lib/typescript/credential/trustmark/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +103 -25
- package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +30 -82
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +29 -134
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/{entity/trust → trust}/chain.d.ts +5 -10
- package/lib/typescript/trust/chain.d.ts.map +1 -0
- package/lib/typescript/trust/errors.d.ts +80 -0
- package/lib/typescript/trust/errors.d.ts.map +1 -0
- package/lib/typescript/{entity/trust → trust}/index.d.ts +211 -186
- package/lib/typescript/trust/index.d.ts.map +1 -0
- package/lib/typescript/{entity/trust → trust}/types.d.ts +1533 -1120
- package/lib/typescript/{entity/trust → trust}/types.d.ts.map +1 -1
- package/lib/typescript/trust/utils.d.ts +12 -0
- package/lib/typescript/trust/utils.d.ts.map +1 -0
- package/lib/typescript/utils/crypto.d.ts +0 -32
- package/lib/typescript/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/utils/decoder.d.ts.map +1 -1
- package/lib/typescript/utils/error-codes.d.ts +20 -0
- package/lib/typescript/utils/error-codes.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +55 -10
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/logging.d.ts +35 -0
- package/lib/typescript/utils/logging.d.ts.map +1 -0
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +8 -1
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/utils/string.d.ts +0 -7
- package/lib/typescript/utils/string.d.ts.map +1 -1
- package/lib/typescript/wallet-instance/index.d.ts +8 -0
- package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/index.d.ts +1 -2
- package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts +4 -2
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +78 -120
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +8 -9
- package/src/client/generated/wallet-provider.ts +52 -17
- package/src/credential/index.ts +4 -1
- package/src/credential/issuance/01-start-flow.ts +1 -1
- package/src/credential/issuance/02-evaluate-issuer-trust.ts +32 -0
- package/src/credential/issuance/03-start-user-authorization.ts +48 -22
- package/src/credential/issuance/04-complete-user-authorization.ts +74 -18
- package/src/credential/issuance/05-authorize-access.ts +29 -11
- package/src/credential/issuance/06-obtain-credential.ts +61 -36
- package/src/credential/issuance/07-verify-and-parse-credential.ts +37 -264
- package/src/credential/issuance/README.md +23 -20
- package/src/credential/issuance/const.ts +1 -1
- package/src/credential/issuance/index.ts +6 -3
- package/src/credential/presentation/01-start-flow.ts +19 -22
- package/src/credential/presentation/02-evaluate-rp-trust.ts +5 -4
- package/src/credential/presentation/03-get-request-object.ts +36 -8
- package/src/credential/presentation/04-retrieve-rp-jwks.ts +6 -148
- package/src/credential/presentation/05-verify-request-object.ts +115 -30
- package/src/credential/presentation/06-fetch-presentation-definition.ts +5 -35
- package/src/credential/presentation/07-evaluate-dcql-query.ts +132 -161
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +136 -254
- package/src/credential/presentation/08-send-authorization-response.ts +178 -260
- package/src/credential/presentation/README.md +74 -79
- package/src/credential/presentation/errors.ts +38 -15
- package/src/credential/presentation/index.ts +18 -19
- package/src/credential/presentation/types.ts +67 -64
- package/src/credential/status/01-start-flow.ts +9 -0
- package/src/credential/status/02-status-attestation.ts +105 -0
- package/src/credential/status/03-verify-and-parse-status-attestation.ts +70 -0
- package/src/credential/status/README.md +67 -0
- package/src/credential/status/index.ts +22 -0
- package/src/credential/status/types.ts +43 -0
- package/src/credential/trustmark/README.md +62 -0
- package/src/credential/trustmark/get-credential-trustmark.ts +139 -0
- package/src/credential/trustmark/index.ts +8 -0
- package/src/index.ts +4 -0
- package/src/pid/sd-jwt/types.ts +18 -1
- package/src/sd-jwt/__test__/index.test.ts +36 -55
- package/src/sd-jwt/__test__/types.test.ts +16 -29
- package/src/sd-jwt/index.ts +1 -5
- package/src/sd-jwt/types.ts +2 -19
- package/src/trust/chain.ts +151 -0
- package/src/trust/errors.ts +105 -0
- package/src/{entity/trust → trust}/index.ts +198 -23
- package/src/{entity/trust → trust}/types.ts +24 -37
- package/src/trust/utils.ts +35 -0
- package/src/utils/crypto.ts +4 -106
- package/src/utils/decoder.ts +6 -1
- package/src/utils/error-codes.ts +23 -0
- package/src/utils/errors.ts +119 -15
- package/src/utils/logging.ts +68 -0
- package/src/utils/misc.ts +5 -0
- package/src/utils/par.ts +19 -6
- package/src/utils/string.ts +0 -10
- package/src/wallet-instance/index.ts +30 -1
- package/src/wallet-instance-attestation/README.md +8 -3
- package/src/wallet-instance-attestation/index.ts +2 -2
- package/src/wallet-instance-attestation/issuing.ts +33 -12
- package/src/wallet-instance-attestation/types.ts +18 -22
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js +0 -48
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +0 -1
- package/lib/commonjs/entity/openid-connect/issuer/index.js +0 -25
- package/lib/commonjs/entity/openid-connect/issuer/index.js.map +0 -1
- package/lib/commonjs/entity/openid-connect/issuer/types.js +0 -64
- package/lib/commonjs/entity/openid-connect/issuer/types.js.map +0 -1
- package/lib/commonjs/entity/trust/chain.js.map +0 -1
- package/lib/commonjs/entity/trust/index.js +0 -148
- package/lib/commonjs/entity/trust/index.js.map +0 -1
- package/lib/commonjs/entity/trust/types.js.map +0 -1
- package/lib/commonjs/mdoc/converters.js +0 -26
- package/lib/commonjs/mdoc/converters.js.map +0 -1
- package/lib/commonjs/mdoc/index.js +0 -68
- package/lib/commonjs/mdoc/index.js.map +0 -1
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -469
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -90
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
- package/lib/module/credential/issuance/02-get-issuer-config.js +0 -42
- package/lib/module/credential/issuance/02-get-issuer-config.js.map +0 -1
- package/lib/module/entity/openid-connect/issuer/index.js +0 -20
- package/lib/module/entity/openid-connect/issuer/index.js.map +0 -1
- package/lib/module/entity/openid-connect/issuer/types.js +0 -48
- package/lib/module/entity/openid-connect/issuer/types.js.map +0 -1
- package/lib/module/entity/trust/chain.js +0 -113
- package/lib/module/entity/trust/chain.js.map +0 -1
- package/lib/module/entity/trust/index.js +0 -131
- package/lib/module/entity/trust/index.js.map +0 -1
- package/lib/module/entity/trust/types.js.map +0 -1
- package/lib/module/mdoc/converters.js +0 -20
- package/lib/module/mdoc/converters.js.map +0 -1
- package/lib/module/mdoc/index.js +0 -60
- package/lib/module/mdoc/index.js.map +0 -1
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -462
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -83
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +0 -32
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +0 -1
- package/lib/typescript/entity/openid-connect/issuer/index.d.ts +0 -12
- package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +0 -1
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts +0 -777
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +0 -1
- package/lib/typescript/entity/trust/chain.d.ts.map +0 -1
- package/lib/typescript/entity/trust/index.d.ts.map +0 -1
- package/lib/typescript/mdoc/converters.d.ts +0 -8
- package/lib/typescript/mdoc/converters.d.ts.map +0 -1
- package/lib/typescript/mdoc/index.d.ts +0 -10
- package/lib/typescript/mdoc/index.d.ts.map +0 -1
- package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts +0 -3
- package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts.map +0 -1
- package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts +0 -42
- package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +0 -1
- package/src/credential/issuance/02-get-issuer-config.ts +0 -67
- package/src/entity/openid-connect/issuer/index.ts +0 -27
- package/src/entity/openid-connect/issuer/types.ts +0 -76
- package/src/entity/trust/chain.ts +0 -154
- package/src/mdoc/converters.ts +0 -26
- package/src/mdoc/index.ts +0 -95
- package/src/utils/credential/issuance/07-verify-and-parse-credentials-inputs.ts +0 -615
- package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +0 -171
package/README.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# 🪪 @pagopa/io-react-native-wallet
|
2
2
|
|
3
|
+
> [!WARNING]
|
4
|
+
> The work to align the library to IT-Wallet v1.0.0 is still ongoing. After implementing the updated specs, the library will be published as v2. For IT-Wallet v0.7.1 please use v0.3.0.
|
5
|
+
|
3
6
|
Library which provides a high level abstraction to interact with the IT-Wallet ecosystem via a predefined flows, a set of utilities and helpers.
|
4
|
-
Follows the [eudi-wallet-it-docs](https://github.com/italia/eudi-wallet-it-docs) specifications, currently aligned with version [0.
|
7
|
+
Follows the [eudi-wallet-it-docs](https://github.com/italia/eudi-wallet-it-docs) specifications, currently aligned with version [1.0.0](https://github.com/italia/eudi-wallet-it-docs/releases/tag/1.0.0).
|
5
8
|
|
6
9
|
## Dependencies
|
7
10
|
|
@@ -96,6 +99,45 @@ The suggested library to manage integrity is [io-react-native-integrity](https:/
|
|
96
99
|
|
97
100
|
</details>
|
98
101
|
|
102
|
+
<details>
|
103
|
+
<summary>LoggingContext (logging)</summary>
|
104
|
+
|
105
|
+
In order to log useful information while implementing the flows, the library supports custom logging logic by providing a `loggingContext` to the static `Logger` class:
|
106
|
+
|
107
|
+
```ts
|
108
|
+
export interface LoggingContext {
|
109
|
+
logDebug: (msg: string) => void;
|
110
|
+
logInfo: (msg: string) => void;
|
111
|
+
logWarn: (msg: string) => void;
|
112
|
+
logError: (msg: string) => void;
|
113
|
+
}
|
114
|
+
```
|
115
|
+
|
116
|
+
An example of a custom logging context:
|
117
|
+
|
118
|
+
```ts
|
119
|
+
import { Logging } from "@pagopa/io-react-native-wallet";
|
120
|
+
|
121
|
+
const loggingContext: Logging.LoggingContext = {
|
122
|
+
logDebug(msg: string) {
|
123
|
+
console.log("debug", msg);
|
124
|
+
},
|
125
|
+
logInfo(msg: string) {
|
126
|
+
console.log("info", msg);
|
127
|
+
},
|
128
|
+
logWarn(msg: string) {
|
129
|
+
console.log("warn", msg);
|
130
|
+
},
|
131
|
+
logError(msg: string) {
|
132
|
+
console.log("error", msg);
|
133
|
+
},
|
134
|
+
};
|
135
|
+
|
136
|
+
Logging.Logger.getInstance().initLogging(loggingContext);
|
137
|
+
```
|
138
|
+
|
139
|
+
</details>
|
140
|
+
|
99
141
|
<details>
|
100
142
|
<summary>appFetch (making HTTP requests)</summary>
|
101
143
|
|
@@ -120,6 +162,10 @@ Different flows are provided to perform common operations. Each flow is a set of
|
|
120
162
|
|
121
163
|
An example app is provided in [example](./example) folder which demostrates how to implemente these flows. To run it, follow the instructions in the [README](./example/README.md).
|
122
164
|
|
165
|
+
### Debug logging server
|
166
|
+
|
167
|
+
A debug logging server can be used with the example app to receive logs from the app. To run it, follow the instructions in the [README](./debug-logging-server/README.md).
|
168
|
+
|
123
169
|
### Ecosystem
|
124
170
|
|
125
171
|
`io-react-native-wallet` is designed to be used in [io-app](https://github.com/pagopa/io-app) and its ecosystem. There are a few libraries that can be used to implement the context required to implement the flows defined by this package.
|
@@ -3,9 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.WalletInstanceData = exports.WalletAttestationView = exports.SetWalletInstanceStatusBody = exports.RevocationReason = exports.ProblemDetail = exports.NonceDetailView = exports.EndpointByMethod = exports.CreateWalletInstanceBody = exports.CreateWalletAttestationBody = exports.ApiClient = void 0;
|
6
|
+
exports.WalletInstanceData = exports.WalletAttestationsView = exports.WalletAttestationView = exports.SetWalletInstanceStatusBody = exports.RevocationReason = exports.ProblemDetail = exports.NonceDetailView = exports.EndpointByMethod = exports.CreateWalletInstanceBody = exports.CreateWalletAttestationV2Body = exports.CreateWalletAttestationBody = exports.ApiClient = void 0;
|
7
7
|
exports.createApiClient = createApiClient;
|
8
|
-
exports.put_SetWalletInstanceStatus = exports.post_CreateWalletInstance = exports.post_CreateWalletAttestation = exports.get_GetWalletInstanceStatus = exports.get_GetNonce = void 0;
|
8
|
+
exports.put_SetWalletInstanceStatus = exports.post_CreateWalletInstance = exports.post_CreateWalletAttestationV2 = exports.post_CreateWalletAttestation = exports.get_GetWalletInstanceStatus = exports.get_GetNonce = exports.get_GetCurrentWalletInstanceStatus = void 0;
|
9
9
|
var _zod = _interopRequireDefault(require("zod"));
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
const NonceDetailView = _zod.default.object({
|
@@ -16,6 +16,13 @@ const WalletAttestationView = _zod.default.object({
|
|
16
16
|
wallet_attestation: _zod.default.string()
|
17
17
|
});
|
18
18
|
exports.WalletAttestationView = WalletAttestationView;
|
19
|
+
const WalletAttestationsView = _zod.default.object({
|
20
|
+
wallet_attestations: _zod.default.array(_zod.default.object({
|
21
|
+
format: _zod.default.union([_zod.default.literal("jwt"), _zod.default.literal("dc+sd-jwt")]),
|
22
|
+
wallet_attestation: _zod.default.string()
|
23
|
+
}))
|
24
|
+
});
|
25
|
+
exports.WalletAttestationsView = WalletAttestationsView;
|
19
26
|
const CreateWalletInstanceBody = _zod.default.object({
|
20
27
|
challenge: _zod.default.string(),
|
21
28
|
key_attestation: _zod.default.string(),
|
@@ -27,14 +34,10 @@ const CreateWalletAttestationBody = _zod.default.object({
|
|
27
34
|
assertion: _zod.default.string()
|
28
35
|
});
|
29
36
|
exports.CreateWalletAttestationBody = CreateWalletAttestationBody;
|
30
|
-
const
|
31
|
-
|
32
|
-
title: _zod.default.string().optional(),
|
33
|
-
status: _zod.default.number().optional(),
|
34
|
-
detail: _zod.default.string().optional(),
|
35
|
-
instance: _zod.default.string().optional()
|
37
|
+
const CreateWalletAttestationV2Body = _zod.default.object({
|
38
|
+
assertion: _zod.default.string()
|
36
39
|
});
|
37
|
-
exports.
|
40
|
+
exports.CreateWalletAttestationV2Body = CreateWalletAttestationV2Body;
|
38
41
|
const SetWalletInstanceStatusBody = _zod.default.object({
|
39
42
|
status: _zod.default.literal("REVOKED")
|
40
43
|
});
|
@@ -47,6 +50,14 @@ const WalletInstanceData = _zod.default.object({
|
|
47
50
|
revocation_reason: _zod.default.union([RevocationReason, _zod.default.undefined()]).optional()
|
48
51
|
});
|
49
52
|
exports.WalletInstanceData = WalletInstanceData;
|
53
|
+
const ProblemDetail = _zod.default.object({
|
54
|
+
type: _zod.default.string().optional(),
|
55
|
+
title: _zod.default.string().optional(),
|
56
|
+
status: _zod.default.number().optional(),
|
57
|
+
detail: _zod.default.string().optional(),
|
58
|
+
instance: _zod.default.string().optional()
|
59
|
+
});
|
60
|
+
exports.ProblemDetail = ProblemDetail;
|
50
61
|
const get_GetNonce = {
|
51
62
|
method: _zod.default.literal("GET"),
|
52
63
|
path: _zod.default.literal("/nonce"),
|
@@ -63,6 +74,31 @@ const post_CreateWalletInstance = {
|
|
63
74
|
response: _zod.default.unknown()
|
64
75
|
};
|
65
76
|
exports.post_CreateWalletInstance = post_CreateWalletInstance;
|
77
|
+
const post_CreateWalletAttestation = {
|
78
|
+
method: _zod.default.literal("POST"),
|
79
|
+
path: _zod.default.literal("/token"),
|
80
|
+
parameters: _zod.default.object({
|
81
|
+
body: CreateWalletAttestationBody
|
82
|
+
}),
|
83
|
+
response: WalletAttestationView
|
84
|
+
};
|
85
|
+
exports.post_CreateWalletAttestation = post_CreateWalletAttestation;
|
86
|
+
const post_CreateWalletAttestationV2 = {
|
87
|
+
method: _zod.default.literal("POST"),
|
88
|
+
path: _zod.default.literal("/wallet-attestations"),
|
89
|
+
parameters: _zod.default.object({
|
90
|
+
body: CreateWalletAttestationV2Body
|
91
|
+
}),
|
92
|
+
response: WalletAttestationsView
|
93
|
+
};
|
94
|
+
exports.post_CreateWalletAttestationV2 = post_CreateWalletAttestationV2;
|
95
|
+
const get_GetCurrentWalletInstanceStatus = {
|
96
|
+
method: _zod.default.literal("GET"),
|
97
|
+
path: _zod.default.literal("/wallet-instances/current/status"),
|
98
|
+
parameters: _zod.default.never(),
|
99
|
+
response: WalletInstanceData
|
100
|
+
};
|
101
|
+
exports.get_GetCurrentWalletInstanceStatus = get_GetCurrentWalletInstanceStatus;
|
66
102
|
const get_GetWalletInstanceStatus = {
|
67
103
|
method: _zod.default.literal("GET"),
|
68
104
|
path: _zod.default.literal("/wallet-instances/{id}/status"),
|
@@ -85,26 +121,19 @@ const put_SetWalletInstanceStatus = {
|
|
85
121
|
}),
|
86
122
|
response: _zod.default.unknown()
|
87
123
|
};
|
88
|
-
exports.put_SetWalletInstanceStatus = put_SetWalletInstanceStatus;
|
89
|
-
const post_CreateWalletAttestation = {
|
90
|
-
method: _zod.default.literal("POST"),
|
91
|
-
path: _zod.default.literal("/token"),
|
92
|
-
parameters: _zod.default.object({
|
93
|
-
body: CreateWalletAttestationBody
|
94
|
-
}),
|
95
|
-
response: WalletAttestationView
|
96
|
-
};
|
97
124
|
|
98
125
|
// <EndpointByMethod>
|
99
|
-
exports.
|
126
|
+
exports.put_SetWalletInstanceStatus = put_SetWalletInstanceStatus;
|
100
127
|
const EndpointByMethod = {
|
101
128
|
get: {
|
102
129
|
"/nonce": get_GetNonce,
|
130
|
+
"/wallet-instances/current/status": get_GetCurrentWalletInstanceStatus,
|
103
131
|
"/wallet-instances/{id}/status": get_GetWalletInstanceStatus
|
104
132
|
},
|
105
133
|
post: {
|
106
134
|
"/wallet-instances": post_CreateWalletInstance,
|
107
|
-
"/token": post_CreateWalletAttestation
|
135
|
+
"/token": post_CreateWalletAttestation,
|
136
|
+
"/wallet-attestations": post_CreateWalletAttestationV2
|
108
137
|
},
|
109
138
|
put: {
|
110
139
|
"/wallet-instances/{id}/status": put_SetWalletInstanceStatus
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_zod","_interopRequireDefault","require","obj","__esModule","default","NonceDetailView","z","object","nonce","string","exports","WalletAttestationView","wallet_attestation","CreateWalletInstanceBody","challenge","key_attestation","hardware_key_tag","CreateWalletAttestationBody","grant_type","
|
1
|
+
{"version":3,"names":["_zod","_interopRequireDefault","require","obj","__esModule","default","NonceDetailView","z","object","nonce","string","exports","WalletAttestationView","wallet_attestation","WalletAttestationsView","wallet_attestations","array","format","union","literal","CreateWalletInstanceBody","challenge","key_attestation","hardware_key_tag","CreateWalletAttestationBody","grant_type","assertion","CreateWalletAttestationV2Body","SetWalletInstanceStatusBody","status","RevocationReason","WalletInstanceData","id","is_revoked","boolean","revocation_reason","undefined","optional","ProblemDetail","type","title","number","detail","instance","get_GetNonce","method","path","parameters","never","response","post_CreateWalletInstance","body","unknown","post_CreateWalletAttestation","post_CreateWalletAttestationV2","get_GetCurrentWalletInstanceStatus","get_GetWalletInstanceStatus","put_SetWalletInstanceStatus","EndpointByMethod","get","post","put","ApiClient","baseUrl","constructor","fetcher","setBaseUrl","arguments","length","createApiClient"],"sourceRoot":"../../../../src","sources":["client/generated/wallet-provider.ts"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoB,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGb,MAAMG,eAAe,GAAGC,YAAC,CAACC,MAAM,CAAC;EACtCC,KAAK,EAAEF,YAAC,CAACG,MAAM,CAAC;AAClB,CAAC,CAAC;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAGI,MAAMM,qBAAqB,GAAGL,YAAC,CAACC,MAAM,CAAC;EAC5CK,kBAAkB,EAAEN,YAAC,CAACG,MAAM,CAAC;AAC/B,CAAC,CAAC;AAACC,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGI,MAAME,sBAAsB,GAAGP,YAAC,CAACC,MAAM,CAAC;EAC7CO,mBAAmB,EAAER,YAAC,CAACS,KAAK,CAC1BT,YAAC,CAACC,MAAM,CAAC;IACPS,MAAM,EAAEV,YAAC,CAACW,KAAK,CAAC,CAACX,YAAC,CAACY,OAAO,CAAC,KAAK,CAAC,EAAEZ,YAAC,CAACY,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3DN,kBAAkB,EAAEN,YAAC,CAACG,MAAM,CAAC;EAC/B,CAAC,CACH;AACF,CAAC,CAAC;AAACC,OAAA,CAAAG,sBAAA,GAAAA,sBAAA;AAGI,MAAMM,wBA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O,IAAI,CAACmB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC5D;EACA;;EAEA;EACAP,IAAIA,CACFd,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACmB,OAAO,CAAC,MAAM,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC7D;EACA;;EAEA;EACAN,GAAGA,CACDf,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACmB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC5D;EACA;AACF;AAACxD,OAAA,CAAAmD,SAAA,GAAAA,SAAA;AAEM,SAASO,eAAeA,CAACJ,OAAgB,EAAEF,OAAgB,EAAE;EAClE,OAAO,IAAID,SAAS,CAACG,OAAO,CAAC,CAACC,UAAU,CAACH,OAAO,IAAI,EAAE,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA"}
|
@@ -3,11 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.Presentation = exports.Issuance = void 0;
|
6
|
+
exports.Trustmark = exports.Status = exports.Presentation = exports.Issuance = void 0;
|
7
7
|
var Issuance = _interopRequireWildcard(require("./issuance"));
|
8
8
|
exports.Issuance = Issuance;
|
9
9
|
var Presentation = _interopRequireWildcard(require("./presentation"));
|
10
10
|
exports.Presentation = Presentation;
|
11
|
+
var Status = _interopRequireWildcard(require("./status"));
|
12
|
+
exports.Status = Status;
|
13
|
+
var Trustmark = _interopRequireWildcard(require("./trustmark"));
|
14
|
+
exports.Trustmark = Trustmark;
|
11
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
12
16
|
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; }
|
13
17
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../src","sources":["credential/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,QAAA,GAAAA,QAAA;AACvC,IAAAI,YAAA,GAAAH,uBAAA,CAAAC,OAAA;AAA+CC,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,
|
1
|
+
{"version":3,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","Status","Trustmark","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../src","sources":["credential/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,QAAA,GAAAA,QAAA;AACvC,IAAAI,YAAA,GAAAH,uBAAA,CAAAC,OAAA;AAA+CC,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAC/C,IAAAC,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAmCC,OAAA,CAAAE,MAAA,GAAAA,MAAA;AACnC,IAAAC,SAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAyCC,OAAA,CAAAG,SAAA,GAAAA,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.evaluateIssuerTrust = void 0;
|
7
|
+
var _trust = require("../../trust");
|
8
|
+
/**
|
9
|
+
* WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
|
10
|
+
* The Issuer trust evaluation phase.
|
11
|
+
* Fetch the Issuer's configuration and verify trust.
|
12
|
+
*
|
13
|
+
* @param issuerUrl The base url of the Issuer returned by {@link startFlow}
|
14
|
+
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
15
|
+
* @returns The Issuer's configuration
|
16
|
+
*/
|
17
|
+
const evaluateIssuerTrust = async function (issuerUrl) {
|
18
|
+
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
19
|
+
const issuerConf = await (0, _trust.getCredentialIssuerEntityConfiguration)(issuerUrl, {
|
20
|
+
appFetch: context.appFetch
|
21
|
+
}).then(_ => _.payload.metadata);
|
22
|
+
return {
|
23
|
+
issuerConf
|
24
|
+
};
|
25
|
+
};
|
26
|
+
exports.evaluateIssuerTrust = evaluateIssuerTrust;
|
27
|
+
//# sourceMappingURL=02-evaluate-issuer-trust.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_trust","require","evaluateIssuerTrust","issuerUrl","context","arguments","length","undefined","issuerConf","getCredentialIssuerEntityConfiguration","appFetch","then","_","payload","metadata","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/02-evaluate-issuer-trust.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAwC,GAAG,eAAAA,CACtDC,SAAS,EAEN;EAAA,IADHC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEZ,MAAMG,UAAU,GAAG,MAAM,IAAAC,6CAAsC,EAACN,SAAS,EAAE;IACzEO,QAAQ,EAAEN,OAAO,CAACM;EACpB,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,CAACC,QAAQ,CAAC;EAClC,OAAO;IAAEN;EAAW,CAAC;AACvB,CAAC;AAACO,OAAA,CAAAb,mBAAA,GAAAA,mBAAA"}
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.startUserAuthorization = void 0;
|
7
7
|
var _misc = require("../../utils/misc");
|
8
8
|
var _par = require("../../utils/par");
|
9
|
+
var _const = require("./const");
|
10
|
+
var _logging = require("../../utils/logging");
|
9
11
|
/**
|
10
12
|
* Ensures that the credential type requested is supported by the issuer and contained in the
|
11
13
|
* issuer configuration.
|
12
|
-
* @param issuerConf The issuer configuration returned by {@link
|
14
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
13
15
|
* @param credentialType The type of the credential to be requested returned by {@link startFlow}
|
14
16
|
* @param context.wiaCryptoContext The Wallet Instance's crypto context
|
15
17
|
* @param context.walletInstanceAttestation The Wallet Instance's attestation
|
@@ -18,16 +20,16 @@ var _par = require("../../utils/par");
|
|
18
20
|
* @returns The credential definition to be used in the request which includes the format and the type and its type
|
19
21
|
*/
|
20
22
|
const selectCredentialDefinition = (issuerConf, credentialType) => {
|
21
|
-
const credential_configurations_supported = issuerConf.credential_configurations_supported;
|
22
|
-
const
|
23
|
-
if (!credential) {
|
24
|
-
throw new Error(`No credential support the type '${credentialType}'`);
|
25
|
-
}
|
26
|
-
const result = {
|
23
|
+
const credential_configurations_supported = issuerConf.openid_credential_issuer.credential_configurations_supported;
|
24
|
+
const [result] = Object.keys(credential_configurations_supported).filter(e => e.includes(credentialType)).map(e => ({
|
27
25
|
credential_configuration_id: credentialType,
|
28
|
-
format:
|
26
|
+
format: credential_configurations_supported[e].format,
|
29
27
|
type: "openid_credential"
|
30
|
-
};
|
28
|
+
}));
|
29
|
+
if (!result) {
|
30
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Requested credential type ${credentialType} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`);
|
31
|
+
throw new Error(`No credential support the type '${credentialType}'`);
|
32
|
+
}
|
31
33
|
return result;
|
32
34
|
};
|
33
35
|
|
@@ -35,15 +37,21 @@ const selectCredentialDefinition = (issuerConf, credentialType) => {
|
|
35
37
|
* Ensures that the response mode requested is supported by the issuer and contained in the issuer configuration.
|
36
38
|
* @param issuerConf The issuer configuration
|
37
39
|
* @param credentialType The type of the credential to be requested
|
38
|
-
* @returns The response mode to be used in the request, "query" for
|
40
|
+
* @returns The response mode to be used in the request, "query" for PersonIdentificationData and "form_post.jwt" for all other types.
|
39
41
|
*/
|
40
|
-
const selectResponseMode = credentialType => {
|
41
|
-
const
|
42
|
+
const selectResponseMode = (issuerConf, credentialType) => {
|
43
|
+
const responseModeSupported = issuerConf.oauth_authorization_server.response_modes_supported;
|
44
|
+
const responseMode = credentialType === "PersonIdentificationData" ? "query" : "form_post.jwt";
|
45
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Selected response mode ${responseMode} for credential type ${credentialType}`);
|
46
|
+
if (!responseModeSupported.includes(responseMode)) {
|
47
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`);
|
48
|
+
throw new Error(`No response mode support the type '${credentialType}'`);
|
49
|
+
}
|
42
50
|
return responseMode;
|
43
51
|
};
|
44
52
|
|
45
53
|
/**
|
46
|
-
* WARNING: This function must be called after {@link
|
54
|
+
* WARNING: This function must be called after {@link evaluateIssuerTrust} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
|
47
55
|
* Creates and sends a PAR request to the /as/par endpoint of the authorization server.
|
48
56
|
* This starts the authentication flow to obtain an access token.
|
49
57
|
* This token enables the Wallet Instance to request a digital credential from the Credential Endpoint of the Credential Issuer.
|
@@ -69,17 +77,18 @@ const startUserAuthorization = async (issuerConf, credentialType, ctx) => {
|
|
69
77
|
} = ctx;
|
70
78
|
const clientId = await wiaCryptoContext.getPublicKey().then(_ => _.kid);
|
71
79
|
if (!clientId) {
|
80
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Public key associated with kid ${clientId} not found in the device`);
|
72
81
|
throw new Error("No public key found");
|
73
82
|
}
|
74
83
|
const codeVerifier = (0, _misc.generateRandomAlphaNumericString)(64);
|
75
|
-
const parEndpoint = issuerConf.pushed_authorization_request_endpoint;
|
84
|
+
const parEndpoint = issuerConf.oauth_authorization_server.pushed_authorization_request_endpoint;
|
76
85
|
const credentialDefinition = selectCredentialDefinition(issuerConf, credentialType);
|
77
|
-
const responseMode = selectResponseMode(credentialType);
|
86
|
+
const responseMode = selectResponseMode(issuerConf, credentialType);
|
78
87
|
const getPar = (0, _par.makeParRequest)({
|
79
88
|
wiaCryptoContext,
|
80
89
|
appFetch
|
81
90
|
});
|
82
|
-
const issuerRequestUri = await getPar(clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, [credentialDefinition]);
|
91
|
+
const issuerRequestUri = await getPar(clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, [credentialDefinition], _const.ASSERTION_TYPE);
|
83
92
|
return {
|
84
93
|
issuerRequestUri,
|
85
94
|
clientId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_misc","require","_par","selectCredentialDefinition","issuerConf","credentialType","credential_configurations_supported","
|
1
|
+
{"version":3,"names":["_misc","require","_par","_const","_logging","selectCredentialDefinition","issuerConf","credentialType","credential_configurations_supported","openid_credential_issuer","result","Object","keys","filter","e","includes","map","credential_configuration_id","format","type","Logger","log","LogLevel","ERROR","JSON","stringify","Error","selectResponseMode","responseModeSupported","oauth_authorization_server","response_modes_supported","responseMode","DEBUG","startUserAuthorization","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","codeVerifier","generateRandomAlphaNumericString","parEndpoint","pushed_authorization_request_endpoint","credentialDefinition","getPar","makeParRequest","issuerRequestUri","ASSERTION_TYPE","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/03-start-user-authorization.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,0BAA0B,GAAGA,CACjCC,UAAkD,EAClDC,cAAgD,KACxB;EACxB,MAAMC,mCAAmC,GACvCF,UAAU,CAACG,wBAAwB,CAACD,mCAAmC;EAEzE,MAAM,CAACE,MAAM,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACJ,mCAAmC,CAAC,CAC9DK,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,Q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VC,cAAc,EACd2B,GAAG,KACA;EACH,MAAM;IACJC,gBAAgB;IAChBC,yBAAyB;IACzBC,WAAW;IACXC,QAAQ,GAAGC;EACb,CAAC,GAAGL,GAAG;EAEP,MAAMM,QAAQ,GAAG,MAAML,gBAAgB,CAACM,YAAY,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,GAAG,CAAC;EACzE,IAAI,CAACJ,QAAQ,EAAE;IACbpB,eAAM,CAACC,GAAG,CACRC,iBAAQ,CAACC,KAAK,EACb,kCAAiCiB,QAAS,0BAC7C,CAAC;IACD,MAAM,IAAId,KAAK,CAAC,qBAAqB,CAAC;EACxC;EACA,MAAMmB,YAAY,GAAG,IAAAC,sCAAgC,EAAC,EAAE,CAAC;EACzD,MAAMC,WAAW,GACfzC,UAAU,CAACuB,0BAA0B,CAACmB,qCAAqC;EAC7E,MAAMC,oBAAoB,GAAG5C,0BAA0B,CACrDC,UAAU,EACVC,cACF,CAAC;EACD,MAAMwB,YAAY,GAAGJ,kBAAkB,CAACrB,UAAU,EAAEC,cAAc,CAAC;EAEnE,MAAM2C,MAAM,GAAG,IAAAC,mBAAc,EAAC;IAAEhB,gBAAgB;IAAEG;EAAS,CAAC,CAAC;EAC7D,MAAMc,gBAAgB,GAAG,MAAMF,MAAM,CACnCV,QAAQ,EACRK,YAAY,EACZR,WAAW,EACXN,YAAY,EACZgB,WAAW,EACXX,yBAAyB,EACzB,CAACa,oBAAoB,CAAC,EACtBI,qBACF,CAAC;EAED,OAAO;IAAED,gBAAgB;IAAEZ,QAAQ;IAAEK,YAAY;IAAEI;EAAqB,CAAC;AAC3E,CAAC;AAACK,OAAA,CAAArB,sBAAA,GAAAA,sBAAA"}
|
@@ -10,13 +10,14 @@ var _parseUrl = _interopRequireDefault(require("parse-url"));
|
|
10
10
|
var _errors = require("../../utils/errors");
|
11
11
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
12
12
|
var _types = require("../presentation/types");
|
13
|
-
var
|
13
|
+
var _uuid = require("uuid");
|
14
14
|
var _types2 = require("./types");
|
15
15
|
var _decoder = require("../../utils/decoder");
|
16
16
|
var _errors2 = require("./errors");
|
17
|
+
var _logging = require("../../utils/logging");
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
19
|
/**
|
19
|
-
* The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a
|
20
|
+
* The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
|
20
21
|
*/
|
21
22
|
|
22
23
|
/**
|
@@ -24,19 +25,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
24
25
|
* Builds the authorization URL to which the end user should be redirected to continue the authentication flow.
|
25
26
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
26
27
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
27
|
-
* @param issuerConf The issuer configuration returned by {@link
|
28
|
-
* @param idpHint Unique identifier of the IDP selected by the user
|
28
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
29
|
+
* @param idpHint Unique identifier of the IDP selected by the user (optional)
|
29
30
|
* @returns An object containing the authorization URL
|
30
31
|
*/
|
31
32
|
const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idpHint) => {
|
32
|
-
const authzRequestEndpoint = issuerConf.authorization_endpoint;
|
33
|
+
const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
|
33
34
|
const params = new URLSearchParams({
|
34
35
|
client_id: clientId,
|
35
|
-
request_uri: issuerRequestUri
|
36
|
-
...(idpHint && {
|
37
|
-
idphint: idpHint
|
38
|
-
})
|
36
|
+
request_uri: issuerRequestUri
|
39
37
|
});
|
38
|
+
if (idpHint) {
|
39
|
+
params.append("idphint", idpHint);
|
40
|
+
}
|
40
41
|
const authUrl = `${authzRequestEndpoint}?${params}`;
|
41
42
|
return {
|
42
43
|
authUrl
|
@@ -45,13 +46,14 @@ const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idp
|
|
45
46
|
|
46
47
|
/**
|
47
48
|
* WARNING: This function must be called after obtaining the authorization redirect URL from the webviews (SPID and CIE L3) or browser for CIEID.
|
48
|
-
* Complete User authorization via strong identification when the response mode is "query" and the request credential is a
|
49
|
+
* Complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
|
49
50
|
* This function parses the authorization redirect URL to extract the authorization response.
|
50
51
|
* @param authRedirectUrl The URL to which the end user should be redirected to start the authentication flow
|
51
52
|
* @returns the authorization response which contains code, state and iss
|
52
53
|
*/
|
53
54
|
exports.buildAuthorizationUrl = buildAuthorizationUrl;
|
54
55
|
const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
56
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is a PersonIdentificationData, completing the user authorization with query mode`);
|
55
57
|
const query = (0, _parseUrl.default)(authRedirectUrl).query;
|
56
58
|
return parseAuthorizationResponse(query);
|
57
59
|
};
|
@@ -63,7 +65,7 @@ const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
|
63
65
|
* The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
|
64
66
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
65
67
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
66
|
-
* @param issuerConf The issuer configuration returned by {@link
|
68
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
67
69
|
* @param appFetch (optional) fetch api implementation. Default: built-in fetch
|
68
70
|
* @throws {ValidationFailed} if an error while validating the response
|
69
71
|
* @returns the request object which contains the credential to be presented in order to obtain the requested credential
|
@@ -71,15 +73,18 @@ const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
|
|
71
73
|
exports.completeUserAuthorizationWithQueryMode = completeUserAuthorizationWithQueryMode;
|
72
74
|
const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
|
73
75
|
let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
74
|
-
|
76
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, requesting the credential to be presented`);
|
77
|
+
const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
|
75
78
|
const params = new URLSearchParams({
|
76
79
|
client_id: clientId,
|
77
80
|
request_uri: issuerRequestUri
|
78
81
|
});
|
82
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`);
|
79
83
|
const requestObject = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
|
80
84
|
method: "GET"
|
81
85
|
}).then((0, _misc.hasStatusOrThrow)(200, _errors.IssuerResponseError)).then(res => res.text()).then(jws => (0, _ioReactNativeJwt.decode)(jws)).then(reqObj => _types.RequestObject.safeParse(reqObj.payload));
|
82
86
|
if (!requestObject.success) {
|
87
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Error while validating the response object: ${requestObject.error.message}`);
|
83
88
|
throw new _errors.ValidationFailed({
|
84
89
|
message: "Request Object validation failed",
|
85
90
|
reason: requestObject.error.message
|
@@ -95,7 +100,7 @@ const getRequestedCredentialToBePresented = async function (issuerRequestUri, cl
|
|
95
100
|
* The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
|
96
101
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
97
102
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
98
|
-
* @param issuerConf The issuer configuration returned by {@link
|
103
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
99
104
|
* @param context.walletInstanceAccestation the Wallet Instance's attestation to be presented
|
100
105
|
* @param context.pid the PID to be presented
|
101
106
|
* @param context.wiaCryptoContext The Wallet Instance's crypto context associated with the walletInstanceAttestation parameter
|
@@ -106,6 +111,7 @@ const getRequestedCredentialToBePresented = async function (issuerRequestUri, cl
|
|
106
111
|
*/
|
107
112
|
exports.getRequestedCredentialToBePresented = getRequestedCredentialToBePresented;
|
108
113
|
const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx) => {
|
114
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, completing the user authorization with form_post.jwt mode`);
|
109
115
|
const {
|
110
116
|
wiaCryptoContext,
|
111
117
|
pidCryptoContext,
|
@@ -118,7 +124,7 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
|
|
118
124
|
typ: "JWT"
|
119
125
|
}).setPayload({
|
120
126
|
vp: walletInstanceAttestation,
|
121
|
-
jti:
|
127
|
+
jti: (0, _uuid.v4)().toString(),
|
122
128
|
nonce: requestObject.nonce
|
123
129
|
}).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
|
124
130
|
const pidWpToken = await new _ioReactNativeJwt.SignJWT(pidCryptoContext).setProtectedHeader({
|
@@ -126,18 +132,19 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
|
|
126
132
|
typ: "JWT"
|
127
133
|
}).setPayload({
|
128
134
|
vp: pid,
|
129
|
-
jti:
|
135
|
+
jti: (0, _uuid.v4)().toString(),
|
130
136
|
nonce: requestObject.nonce
|
131
137
|
}).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
|
138
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Wallet instance attestation JWT token: ${wiaWpToken}`);
|
132
139
|
|
133
140
|
/* The path parameter refers to the vp_token variable of the authzResponsePayload and must point to the plain credential which
|
134
141
|
* is cointaned in the `vp` property of the signed jwt token payload
|
135
142
|
*/
|
136
143
|
const presentationSubmission = {
|
137
|
-
definition_id: `${
|
138
|
-
id: `${
|
144
|
+
definition_id: `${(0, _uuid.v4)()}`,
|
145
|
+
id: `${(0, _uuid.v4)()}`,
|
139
146
|
descriptor_map: [{
|
140
|
-
id: "
|
147
|
+
id: "PersonIdentificationData",
|
141
148
|
path: "$.vp_token[0].vp",
|
142
149
|
format: "vc+sd-jwt"
|
143
150
|
}, {
|
@@ -146,11 +153,13 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
|
|
146
153
|
format: "jwt"
|
147
154
|
}]
|
148
155
|
};
|
156
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Presentation submission: ${JSON.stringify(presentationSubmission)}`);
|
149
157
|
const authzResponsePayload = (0, _ioReactNativeJwt.encodeBase64)(JSON.stringify({
|
150
158
|
state: requestObject.state,
|
151
159
|
presentation_submission: presentationSubmission,
|
152
160
|
vp_token: [pidWpToken, wiaWpToken]
|
153
161
|
}));
|
162
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Authz response payload: ${authzResponsePayload}`);
|
154
163
|
|
155
164
|
// Note: according to the spec, the response should be encrypted with the public key of the RP however this is not implemented yet
|
156
165
|
// https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-signed-and-encrypted-response
|
@@ -173,6 +182,7 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
|
|
173
182
|
}).then((0, _misc.hasStatusOrThrow)(200, _errors.IssuerResponseError)).then(reqUri => reqUri.json());
|
174
183
|
const responseUri = _types2.ResponseUriResultShape.safeParse(resUriRes);
|
175
184
|
if (!responseUri.success) {
|
185
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Error while validating the response uri: ${responseUri.error.message}`);
|
176
186
|
throw new _errors.ValidationFailed({
|
177
187
|
message: "Response Uri validation failed",
|
178
188
|
reason: responseUri.error.message
|
@@ -194,9 +204,11 @@ const parseAuthorizationResponse = authRes => {
|
|
194
204
|
if (!authResParsed.success) {
|
195
205
|
const authErr = _auth.AuthorizationErrorShape.safeParse(authRes);
|
196
206
|
if (!authErr.success) {
|
207
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Error while parsing the authorization response: ${authResParsed.error.message}`);
|
197
208
|
throw new _errors2.AuthorizationError(authResParsed.error.message); // an error occured while parsing the result and the error
|
198
209
|
}
|
199
210
|
|
211
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, `Error while authorizating with the idp: ${JSON.stringify(authErr)}`);
|
200
212
|
throw new _errors2.AuthorizationIdpError(authErr.data.error, authErr.data.error_description);
|
201
213
|
}
|
202
214
|
return authResParsed.data;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","
|
1
|
+
{"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","_uuid","_types2","_decoder","_errors2","_logging","obj","__esModule","default","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","exports","completeUserAuthorizationWithQueryMode","authRedirectUrl","Logger","log","LogLevel","DEBUG","query","parseUrl","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObject","method","then","hasStatusOrThrow","IssuerResponseError","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ERROR","error","message","ValidationFailed","reason","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuidv4","nonce","setIssuedAt","setExpirationTime","setAudience","response_uri","sign","pidWpToken","presentationSubmission","definition_id","id","descriptor_map","path","format","JSON","stringify","authzResponsePayload","encodeBase64","state","presentation_submission","vp_token","body","response","resUriRes","headers","reqUri","json","responseUri","ResponseUriResultShape","redirect_uri","getJwtFromFormPost","cbRes","decodedJwt","authRes","authResParsed","AuthorizationResultShape","authErr","AuthorizationErrorShape","AuthorizationError","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","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