@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
@@ -3,24 +3,22 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.prepareLegacyRemotePresentations = exports.findCredentialSdJwt = exports.evaluateInputDescriptors = exports.evaluateInputDescriptorForSdJwt4VC = void 0;
|
7
7
|
var _sdJwt = require("../../sd-jwt");
|
8
|
+
var _crypto = require("../../utils/crypto");
|
8
9
|
var _jsonpathPlus = require("jsonpath-plus");
|
9
10
|
var _errors = require("./errors");
|
10
11
|
var _ajv = _interopRequireDefault(require("ajv"));
|
11
|
-
var _ioReactNativeCbor = require("@pagopa/io-react-native-cbor");
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
const ajv = new _ajv.default({
|
14
14
|
allErrors: true
|
15
15
|
});
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
};
|
23
|
-
exports.disclosureWithEncodedToEvaluatedDisclosure = disclosureWithEncodedToEvaluatedDisclosure;
|
16
|
+
const INDEX_CLAIM_NAME = 1;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
20
|
+
*/
|
21
|
+
|
24
22
|
/**
|
25
23
|
* Transforms an array of DisclosureWithEncoded objects into a key-value map.
|
26
24
|
* @param disclosures - An array of DisclosureWithEncoded, each containing a decoded property with [?, claimName, claimValue].
|
@@ -37,22 +35,6 @@ const mapDisclosuresToObject = disclosures => {
|
|
37
35
|
}, {});
|
38
36
|
};
|
39
37
|
|
40
|
-
/**
|
41
|
-
* Transforms the issuer's namespaces from a CBOR structure into a plain JavaScript object.
|
42
|
-
*
|
43
|
-
* @param namespaces - The CBOR-based namespaces object where each key corresponds to a namespace,
|
44
|
-
* and each value is an array of elements containing identifiers and values.
|
45
|
-
* @returns A record (plain object) where each key is a namespace, and its value is another object
|
46
|
-
* mapping element identifiers to their corresponding element values.
|
47
|
-
*/
|
48
|
-
const mapNamespacesToObject = namespaces => {
|
49
|
-
return Object.entries(namespaces).reduce((obj, _ref2) => {
|
50
|
-
let [namespace, elements] = _ref2;
|
51
|
-
obj[namespace] = Object.fromEntries(elements.map(element => [element.elementIdentifier, element.elementValue]));
|
52
|
-
return obj;
|
53
|
-
}, {});
|
54
|
-
};
|
55
|
-
|
56
38
|
/**
|
57
39
|
* Finds a claim within the payload based on provided JSONPath expressions.
|
58
40
|
* @param paths - An array of JSONPath expressions to search for in the payload.
|
@@ -100,91 +82,10 @@ const extractClaimName = path => {
|
|
100
82
|
// match[2] corresponds to the second capture group (\w+) inside [""] or ['']
|
101
83
|
return match[1] || match[2];
|
102
84
|
}
|
103
|
-
throw new Error(`Invalid input format: "${path}". Expected formats are "$.propertyName", "$['propertyName']", or '$["propertyName"]'.`);
|
104
|
-
};
|
105
85
|
|
106
|
-
|
107
|
-
* Extracts the namespace and claim name from a path in the following format:
|
108
|
-
* $['nameSpace']['propertyName']
|
109
|
-
*
|
110
|
-
* @param path - The path string containing the claim reference.
|
111
|
-
* @returns An object with the extracted namespace and claim name.
|
112
|
-
* @throws An error if the input format is invalid.
|
113
|
-
*/
|
114
|
-
const extractNamespaceAndClaimName = path => {
|
115
|
-
const regex = /^\$\[(?:'|")([^'"\]]+)(?:'|")\]\[(?:'|")([^'"\]]+)(?:'|")\]$/;
|
116
|
-
const match = path.match(regex);
|
117
|
-
if (match) {
|
118
|
-
return {
|
119
|
-
nameSpace: match[1],
|
120
|
-
propertyName: match[2]
|
121
|
-
};
|
122
|
-
}
|
123
|
-
throw new Error(`Invalid input format: "${path}". Expected format is "$['nameSpace']['propertyName']".`);
|
124
|
-
};
|
125
|
-
/**
|
126
|
-
* Evaluates the input descriptor for an mDoc by verifying that the issuerSigned claims meet
|
127
|
-
* the constraints defined in the input descriptor. It categorizes disclosures as either required
|
128
|
-
* or optional based on the field definitions.
|
129
|
-
*
|
130
|
-
* @param inputDescriptor - Contains constraints and field definitions specifying required/optional claims.
|
131
|
-
* @param issuerSigned - Contains the issuerSigned with namespaces and their associated claims.
|
132
|
-
* @returns An object with two arrays: one for required disclosures and one for optional disclosures.
|
133
|
-
* @throws MissingDataError - If a required field is missing or if a claim fails JSON Schema validation.
|
134
|
-
*/
|
135
|
-
const evaluateInputDescriptorForMdoc = (inputDescriptor, issuerSigned) => {
|
136
|
-
var _inputDescriptor$cons;
|
137
|
-
if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$cons = inputDescriptor.constraints) !== null && _inputDescriptor$cons !== void 0 && _inputDescriptor$cons.fields)) {
|
138
|
-
// No validation, no field are required
|
139
|
-
return {
|
140
|
-
requiredDisclosures: [],
|
141
|
-
optionalDisclosures: []
|
142
|
-
};
|
143
|
-
}
|
144
|
-
const requiredDisclosures = [];
|
145
|
-
const optionalDisclosures = [];
|
146
|
-
|
147
|
-
// Convert issuer's namespaces into an object for easier lookup of claim values.
|
148
|
-
const namespacesAsPayload = mapNamespacesToObject(issuerSigned.nameSpaces);
|
149
|
-
const allFieldsValid = inputDescriptor.constraints.fields.every(field => {
|
150
|
-
const [matchedPath, matchedValue] = findMatchedClaim(field.path, namespacesAsPayload);
|
86
|
+
// If the input doesn't match any of the expected formats, return null
|
151
87
|
|
152
|
-
|
153
|
-
if (matchedValue === undefined || !matchedPath) {
|
154
|
-
return field === null || field === void 0 ? void 0 : field.optional;
|
155
|
-
} else {
|
156
|
-
// Extract the namespace and property name from the matched path.
|
157
|
-
const {
|
158
|
-
nameSpace,
|
159
|
-
propertyName
|
160
|
-
} = extractNamespaceAndClaimName(matchedPath);
|
161
|
-
if (nameSpace && propertyName) {
|
162
|
-
(field !== null && field !== void 0 && field.optional ? optionalDisclosures : requiredDisclosures).push({
|
163
|
-
namespace: nameSpace,
|
164
|
-
name: propertyName,
|
165
|
-
value: matchedValue
|
166
|
-
});
|
167
|
-
}
|
168
|
-
}
|
169
|
-
if (field.filter) {
|
170
|
-
try {
|
171
|
-
const validateSchema = ajv.compile(field.filter);
|
172
|
-
if (!validateSchema(matchedValue)) {
|
173
|
-
throw new _errors.MissingDataError(`Claim value "${matchedValue}" for path "${matchedPath}" does not match the provided JSON Schema.`);
|
174
|
-
}
|
175
|
-
} catch (error) {
|
176
|
-
return false;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
return true;
|
180
|
-
});
|
181
|
-
if (!allFieldsValid) {
|
182
|
-
throw new _errors.MissingDataError("Credential validation failed: Required fields are missing or do not match the input descriptor.");
|
183
|
-
}
|
184
|
-
return {
|
185
|
-
requiredDisclosures,
|
186
|
-
optionalDisclosures
|
187
|
-
};
|
88
|
+
throw new Error(`Invalid input format: "${path}". Expected formats are "$.propertyName", "$['propertyName']", or '$["propertyName"]'.`);
|
188
89
|
};
|
189
90
|
|
190
91
|
/**
|
@@ -195,28 +96,30 @@ const evaluateInputDescriptorForMdoc = (inputDescriptor, issuerSigned) => {
|
|
195
96
|
* - Validates whether required fields are present (unless marked optional)
|
196
97
|
* and match any specified JSONPath.
|
197
98
|
* - If a field includes a JSON Schema filter, validates the claim value against that schema.
|
99
|
+
* - Enforces `limit_disclosure` rules by returning only disclosures, required and optional, matching the specified fields
|
100
|
+
* if set to "required". Otherwise also return the array unrequestedDisclosures with disclosures which can be passed for a particular use case.
|
198
101
|
* - Throws an error if a required field is invalid or missing.
|
199
102
|
*
|
200
103
|
* @param inputDescriptor - Describes constraints (fields, filters, etc.) that must be satisfied.
|
201
104
|
* @param payloadCredential - The credential payload to check against.
|
202
105
|
* @param disclosures - An array of DisclosureWithEncoded objects representing selective disclosures.
|
203
|
-
* @returns
|
106
|
+
* @returns A filtered list of disclosures satisfying the descriptor constraints, or throws an error if not.
|
204
107
|
* @throws Will throw an error if any required constraint fails or if JSONPath lookups are invalid.
|
205
108
|
*/
|
206
|
-
exports.evaluateInputDescriptorForMdoc = evaluateInputDescriptorForMdoc;
|
207
109
|
const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCredential, disclosures) => {
|
208
|
-
var _inputDescriptor$
|
209
|
-
if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$
|
110
|
+
var _inputDescriptor$cons;
|
111
|
+
if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$cons = inputDescriptor.constraints) !== null && _inputDescriptor$cons !== void 0 && _inputDescriptor$cons.fields)) {
|
210
112
|
// No validation, all field are optional
|
211
113
|
return {
|
212
114
|
requiredDisclosures: [],
|
213
|
-
optionalDisclosures: []
|
115
|
+
optionalDisclosures: [],
|
116
|
+
unrequestedDisclosures: disclosures
|
214
117
|
};
|
215
118
|
}
|
216
|
-
const
|
217
|
-
const
|
119
|
+
const requiredClaimNames = [];
|
120
|
+
const optionalClaimNames = [];
|
218
121
|
|
219
|
-
// Transform disclosures
|
122
|
+
// Transform disclosures to find claim using JSONPath
|
220
123
|
const disclosuresAsPayload = mapDisclosuresToObject(disclosures);
|
221
124
|
|
222
125
|
// For each field, we need at least one matching path
|
@@ -236,10 +139,7 @@ const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCredential,
|
|
236
139
|
// if match a disclouse we save which is required or optional
|
237
140
|
const claimName = extractClaimName(matchedPath);
|
238
141
|
if (claimName) {
|
239
|
-
(field !== null && field !== void 0 && field.optional ?
|
240
|
-
value: matchedValue,
|
241
|
-
name: claimName
|
242
|
-
});
|
142
|
+
(field !== null && field !== void 0 && field.optional ? optionalClaimNames : requiredClaimNames).push(claimName);
|
243
143
|
}
|
244
144
|
}
|
245
145
|
|
@@ -263,19 +163,26 @@ const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCredential,
|
|
263
163
|
if (!allFieldsValid) {
|
264
164
|
throw new _errors.MissingDataError("Credential validation failed: Required fields are missing or do not match the input descriptor.");
|
265
165
|
}
|
166
|
+
|
167
|
+
// Categorizes disclosures into required and optional based on claim names and disclosure constraints.
|
168
|
+
|
169
|
+
const requiredDisclosures = disclosures.filter(disclosure => requiredClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]));
|
170
|
+
const optionalDisclosures = disclosures.filter(disclosure => optionalClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]));
|
171
|
+
const isNotLimitDisclosure = !(inputDescriptor.constraints.limit_disclosure === "required");
|
172
|
+
const unrequestedDisclosures = isNotLimitDisclosure ? disclosures.filter(disclosure => !optionalClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]) && !requiredClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME])) : [];
|
266
173
|
return {
|
267
174
|
requiredDisclosures,
|
268
|
-
optionalDisclosures
|
175
|
+
optionalDisclosures,
|
176
|
+
unrequestedDisclosures
|
269
177
|
};
|
270
178
|
};
|
271
|
-
|
179
|
+
exports.evaluateInputDescriptorForSdJwt4VC = evaluateInputDescriptorForSdJwt4VC;
|
272
180
|
/**
|
273
181
|
* Finds the first credential that satisfies the input descriptor constraints.
|
274
182
|
* @param inputDescriptor The input descriptor to evaluate.
|
275
183
|
* @param decodedSdJwtCredentials An array of decoded SD-JWT credentials.
|
276
184
|
* @returns An object containing the matched evaluation, keyTag, and credential.
|
277
185
|
*/
|
278
|
-
exports.evaluateInputDescriptorForSdJwt4VC = evaluateInputDescriptorForSdJwt4VC;
|
279
186
|
const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) => {
|
280
187
|
for (const {
|
281
188
|
keyTag,
|
@@ -295,35 +202,10 @@ const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) => {
|
|
295
202
|
continue;
|
296
203
|
}
|
297
204
|
}
|
298
|
-
throw new _errors.
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
* Finds the first credential that satisfies the input descriptor constraints.
|
303
|
-
* @param inputDescriptor The input descriptor to evaluate.
|
304
|
-
* @param decodedMdocCredentials An array of decoded MDOC credentials.
|
305
|
-
* @returns An object containing the matched evaluation, keyTag, and credential.
|
306
|
-
*/
|
307
|
-
exports.findCredentialSdJwt = findCredentialSdJwt;
|
308
|
-
const findCredentialMDoc = (inputDescriptor, decodedMDocCredentials) => {
|
309
|
-
for (const {
|
310
|
-
keyTag,
|
311
|
-
credential,
|
312
|
-
issuerSigned
|
313
|
-
} of decodedMDocCredentials) {
|
314
|
-
try {
|
315
|
-
const evaluatedDisclosure = evaluateInputDescriptorForMdoc(inputDescriptor, issuerSigned);
|
316
|
-
return {
|
317
|
-
matchedEvaluation: evaluatedDisclosure,
|
318
|
-
matchedKeyTag: keyTag,
|
319
|
-
matchedCredential: credential
|
320
|
-
};
|
321
|
-
} catch {
|
322
|
-
// skip to next credential
|
323
|
-
continue;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
throw new _errors.CredentialNotFoundError("None of the mso_mdoc credentials satisfy the requirements.");
|
205
|
+
throw new _errors.CredentialsNotFoundError([{
|
206
|
+
id: "",
|
207
|
+
reason: "None of the vc+sd-jwt credentials satisfy the requirements."
|
208
|
+
}]);
|
327
209
|
};
|
328
210
|
|
329
211
|
/**
|
@@ -336,16 +218,15 @@ const findCredentialMDoc = (inputDescriptor, decodedMDocCredentials) => {
|
|
336
218
|
*
|
337
219
|
* @param inputDescriptors - An array of input descriptors.
|
338
220
|
* @param credentialsSdJwt - An array of tuples containing keyTag and SD-JWT credential.
|
339
|
-
* @param credentialsMdoc - An array of tuples containing keyTag and MDOC credential.
|
340
221
|
* @returns An array of objects, each containing the evaluated disclosures,
|
341
222
|
* the input descriptor, the credential, and the keyTag.
|
342
223
|
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
343
224
|
*/
|
344
|
-
exports.
|
345
|
-
const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt
|
225
|
+
exports.findCredentialSdJwt = findCredentialSdJwt;
|
226
|
+
const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt) => {
|
346
227
|
// We need decode SD-JWT credentials for evaluation
|
347
|
-
const decodedSdJwtCredentials = (credentialsSdJwt === null || credentialsSdJwt === void 0 ? void 0 : credentialsSdJwt.map(
|
348
|
-
let [
|
228
|
+
const decodedSdJwtCredentials = (credentialsSdJwt === null || credentialsSdJwt === void 0 ? void 0 : credentialsSdJwt.map(_ref2 => {
|
229
|
+
let [keyTag, credential] = _ref2;
|
349
230
|
const {
|
350
231
|
sdJwt,
|
351
232
|
disclosures
|
@@ -357,31 +238,20 @@ const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt, cred
|
|
357
238
|
disclosures
|
358
239
|
};
|
359
240
|
})) || [];
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
return {
|
369
|
-
keyTag,
|
370
|
-
credential,
|
371
|
-
issuerSigned
|
372
|
-
};
|
373
|
-
}))) || [];
|
374
|
-
const results = Promise.all(inputDescriptors.map(async descriptor => {
|
375
|
-
var _descriptor$format, _descriptor$format2;
|
376
|
-
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format.mso_mdoc) {
|
377
|
-
if (!credentialsMdoc.length) {
|
378
|
-
throw new _errors.CredentialNotFoundError("mso_mdoc credential is not supported.");
|
241
|
+
return Promise.all(inputDescriptors.map(async descriptor => {
|
242
|
+
var _descriptor$format;
|
243
|
+
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["vc+sd-jwt"]) {
|
244
|
+
if (!decodedSdJwtCredentials.length) {
|
245
|
+
throw new _errors.CredentialsNotFoundError([{
|
246
|
+
id: descriptor.id,
|
247
|
+
reason: "vc+sd-jwt credential is not supported."
|
248
|
+
}]);
|
379
249
|
}
|
380
250
|
const {
|
381
251
|
matchedEvaluation,
|
382
252
|
matchedKeyTag,
|
383
253
|
matchedCredential
|
384
|
-
} =
|
254
|
+
} = findCredentialSdJwt(descriptor, decodedSdJwtCredentials);
|
385
255
|
return {
|
386
256
|
evaluatedDisclosure: matchedEvaluation,
|
387
257
|
inputDescriptor: descriptor,
|
@@ -389,25 +259,50 @@ const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt, cred
|
|
389
259
|
keyTag: matchedKeyTag
|
390
260
|
};
|
391
261
|
}
|
262
|
+
throw new _errors.CredentialsNotFoundError([{
|
263
|
+
id: descriptor.id,
|
264
|
+
reason: `${descriptor.format} format is not supported.`
|
265
|
+
}]);
|
266
|
+
}));
|
267
|
+
};
|
268
|
+
|
269
|
+
/**
|
270
|
+
* Prepares remote presentations for a set of credentials based on input descriptors.
|
271
|
+
*
|
272
|
+
* For each credential and its corresponding input descriptor, this function:
|
273
|
+
* - Validates the credential format.
|
274
|
+
* - Generates a verifiable presentation token (vpToken) using the provided nonce and client identifier.
|
275
|
+
*
|
276
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
277
|
+
*
|
278
|
+
* @param credentialAndDescriptors - An array containing objects with requested claims,
|
279
|
+
* input descriptor, credential, and keyTag.
|
280
|
+
* @param nonce - A unique nonce for the verifiable presentation token.
|
281
|
+
* @param client_id - The client identifier.
|
282
|
+
* @returns A promise that resolves to an array of RemotePresentation objects.
|
283
|
+
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
284
|
+
*/
|
285
|
+
exports.evaluateInputDescriptors = evaluateInputDescriptors;
|
286
|
+
const prepareLegacyRemotePresentations = async (credentialAndDescriptors, nonce, client_id) => {
|
287
|
+
return Promise.all(credentialAndDescriptors.map(async item => {
|
288
|
+
var _descriptor$format2;
|
289
|
+
const descriptor = item.inputDescriptor;
|
392
290
|
if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["vc+sd-jwt"]) {
|
393
|
-
if (!decodedSdJwtCredentials.length) {
|
394
|
-
throw new _errors.CredentialNotFoundError("vc+sd-jwt credential is not supported.");
|
395
|
-
}
|
396
291
|
const {
|
397
|
-
|
398
|
-
|
399
|
-
matchedCredential
|
400
|
-
} = findCredentialSdJwt(descriptor, decodedSdJwtCredentials);
|
292
|
+
vp_token
|
293
|
+
} = await (0, _sdJwt.prepareVpToken)(nonce, client_id, [item.credential, item.requestedClaims, (0, _crypto.createCryptoContextFor)(item.keyTag)]);
|
401
294
|
return {
|
402
|
-
|
295
|
+
requestedClaims: item.requestedClaims,
|
403
296
|
inputDescriptor: descriptor,
|
404
|
-
|
405
|
-
|
297
|
+
vpToken: vp_token,
|
298
|
+
format: "vc+sd-jwt"
|
406
299
|
};
|
407
300
|
}
|
408
|
-
throw new _errors.
|
301
|
+
throw new _errors.CredentialsNotFoundError([{
|
302
|
+
id: descriptor.id,
|
303
|
+
reason: `${descriptor.format} format is not supported.`
|
304
|
+
}]);
|
409
305
|
}));
|
410
|
-
return results;
|
411
306
|
};
|
412
|
-
exports.
|
307
|
+
exports.prepareLegacyRemotePresentations = prepareLegacyRemotePresentations;
|
413
308
|
//# sourceMappingURL=07-evaluate-input-descriptor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_sdJwt","require","_jsonpathPlus","_errors","_ajv","_interopRequireDefault","_ioReactNativeCbor","obj","__esModule","default","ajv","Ajv","allErrors","disclosureWithEncodedToEvaluatedDisclosure","disclosure","claimName","claimValue","decoded","name","value","exports","mapDisclosuresToObject","disclosures","reduce","_ref","mapNamespacesToObject","namespaces","Object","entries","_ref2","namespace","elements","fromEntries","map","element","elementIdentifier","elementValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","JSONPath","path","json","length","error","MissingDataError","extractClaimName","regex","match","Error","extractNamespaceAndClaimName","nameSpace","propertyName","evaluateInputDescriptorForMdoc","inputDescriptor","issuerSigned","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","namespacesAsPayload","nameSpaces","allFieldsValid","every","field","undefined","optional","push","filter","validateSchema","compile","evaluateInputDescriptorForSdJwt4VC","payloadCredential","_inputDescriptor$cons2","disclosuresAsPayload","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","CredentialNotFoundError","findCredentialMDoc","decodedMDocCredentials","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","credentialsMdoc","_ref3","decode","decodedMdocCredentials","Promise","all","_ref4","CBOR","decodeIssuerSigned","results","descriptor","_descriptor$format","_descriptor$format2","format","mso_mdoc"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAAoD,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpD,MAAMG,GAAG,GAAG,IAAIC,YAAG,CAAC;EAAEC,SAAS,EAAE;AAAK,CAAC,CAAC;AA+BjC,MAAMC,0CAA0C,GACrDC,UAAiC,IACT;EACxB,MAAM,GAAGC,SAAS,EAAEC,UAAU,CAAC,GAAGF,UAAU,CAACG,OAAO;EACpD,OAAO;IACLC,IAAI,EAAEH,SAAS;IACfI,KAAK,EAAEH;EACT,CAAC;AACH,CAAC;AAACI,OAAA,CAAAP,0CAAA,GAAAA,0CAAA;AAeF;AACA;AACA;AACA;AACA;AACA,MAAMQ,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAAChB,GAAG,EAAAiB,IAAA,KAAkB;IAAA,IAAhB;MAAEP;IAAQ,CAAC,GAAAO,IAAA;IACf,MAAM,GAAGT,SAAS,EAAEC,UAAU,CAAC,GAAGC,OAAO;IACzCV,GAAG,CAACQ,SAAS,CAAC,GAAGC,UAAU;IAC3B,OAAOT,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMkB,qBAAqB,GACzBC,UAA2C,IACf;EAC5B,OAAOC,MAAM,CAACC,OAAO,CAACF,UAAU,CAAC,CAACH,MAAM,CACtC,CAAChB,GAAG,EAAAsB,KAAA,KAA4B;IAA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mBAAA;IACzC,KAAAD,kBAAA,GAAID,UAAU,CAACG,MAAM,cAAAF,kBAAA,eAAjBA,kBAAA,CAAmBG,QAAQ,EAAE;MAC/B,IAAI,CAACd,eAAe,CAAChD,MAAM,EAAE;QAC3B,MAAM,IAAI0C,+BAAuB,CAC/B,uCACF,CAAC;MACH;MAEA,MAAM;QAAEH,iBAAiB;QAAEC,aAAa;QAAEC;MAAkB,CAAC,GAC3DE,kBAAkB,CAACe,UAAU,EAAEP,sBAAsB,CAAC;MAExD,OAAO;QACLb,mBAAmB,EAAEC,iBAAiB;QACtC5B,eAAe,EAAE+C,UAAU;QAC3BtB,UAAU,EAAEK,iBAAiB;QAC7BN,MAAM,EAAEK;MACV,CAAC;IACH;IAEA,KAAAoB,mBAAA,GAAIF,UAAU,CAACG,MAAM,cAAAD,mBAAA,eAAjBA,mBAAA,CAAoB,WAAW,CAAC,EAAE;MACpC,IAAI,CAAC1B,uBAAuB,CAAClC,MAAM,EAAE;QACnC,MAAM,IAAI0C,+BAAuB,CAC/B,wCACF,CAAC;MACH;MAEA,MAAM;QAAEH,iBAAiB;QAAEC,aAAa;QAAEC;MAAkB,CAAC,GAC3DR,mBAAmB,CAACyB,UAAU,EAAExB,uBAAuB,CAAC;MAE1D,OAAO;QACLI,mBAAmB,EAAEC,iBAAiB;QACtC5B,eAAe,EAAE+C,UAAU;QAC3BtB,UAAU,EAAEK,iBAAiB;QAC7BN,MAAM,EAAEK;MACV,CAAC;IACH;IAEA,MAAM,IAAIE,+BAAuB,CAC9B,GAAEgB,UAAU,CAACG,MAAO,2BACvB,CAAC;EACH,CAAC,CACH,CAAC;EAED,OAAOJ,OAAO;AAChB,CAAC;AAACrF,OAAA,CAAAyE,wBAAA,GAAAA,wBAAA"}
|
1
|
+
{"version":3,"names":["_sdJwt","require","_crypto","_jsonpathPlus","_errors","_ajv","_interopRequireDefault","obj","__esModule","default","ajv","Ajv","allErrors","INDEX_CLAIM_NAME","mapDisclosuresToObject","disclosures","reduce","_ref","decoded","claimName","claimValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","JSONPath","path","json","length","error","MissingDataError","extractClaimName","regex","match","Error","evaluateInputDescriptorForSdJwt4VC","inputDescriptor","payloadCredential","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","unrequestedDisclosures","requiredClaimNames","optionalClaimNames","disclosuresAsPayload","allFieldsValid","every","field","optional","push","filter","validateSchema","compile","disclosure","includes","isNotLimitDisclosure","limit_disclosure","exports","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","CredentialsNotFoundError","id","reason","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","map","_ref2","decode","Promise","all","descriptor","_descriptor$format","format","prepareLegacyRemotePresentations","credentialAndDescriptors","nonce","client_id","item","_descriptor$format2","vp_token","prepareVpToken","requestedClaims","createCryptoContextFor","vpToken"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsB,SAAAK,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtB,MAAMG,GAAG,GAAG,IAAIC,YAAG,CAAC;EAAEC,SAAS,EAAE;AAAK,CAAC,CAAC;AACxC,MAAMC,gBAAgB,GAAG,CAAC;;AA0B1B;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAACT,GAAG,EAAAU,IAAA,KAAkB;IAAA,IAAhB;MAAE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