@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
@@ -20,11 +20,11 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
20
20
|
x5c?: string[] | undefined;
|
21
21
|
trust_chain?: string[] | undefined;
|
22
22
|
}>, z.ZodObject<{
|
23
|
-
typ: z.ZodLiteral<"war+jwt">;
|
23
|
+
typ: z.ZodLiteral<"wp-war+jwt">;
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
25
|
-
typ: "war+jwt";
|
25
|
+
typ: "wp-war+jwt";
|
26
26
|
}, {
|
27
|
-
typ: "war+jwt";
|
27
|
+
typ: "wp-war+jwt";
|
28
28
|
}>>;
|
29
29
|
payload: z.ZodIntersection<z.ZodObject<{
|
30
30
|
iss: z.ZodString;
|
@@ -228,27 +228,24 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
228
228
|
};
|
229
229
|
}>, z.ZodObject<{
|
230
230
|
aud: z.ZodString;
|
231
|
-
jti: z.ZodString;
|
232
231
|
nonce: z.ZodString;
|
232
|
+
hardware_signature: z.ZodString;
|
233
|
+
integrity_assertion: z.ZodString;
|
234
|
+
hardware_key_tag: z.ZodString;
|
233
235
|
}, "strip", z.ZodTypeAny, {
|
234
236
|
nonce: string;
|
237
|
+
hardware_key_tag: string;
|
235
238
|
aud: string;
|
236
|
-
|
239
|
+
hardware_signature: string;
|
240
|
+
integrity_assertion: string;
|
237
241
|
}, {
|
238
242
|
nonce: string;
|
243
|
+
hardware_key_tag: string;
|
239
244
|
aud: string;
|
240
|
-
|
245
|
+
hardware_signature: string;
|
246
|
+
integrity_assertion: string;
|
241
247
|
}>>;
|
242
248
|
}, "strip", z.ZodTypeAny, {
|
243
|
-
header: {
|
244
|
-
alg: string;
|
245
|
-
kid: string;
|
246
|
-
typ: string;
|
247
|
-
x5c?: string[] | undefined;
|
248
|
-
trust_chain?: string[] | undefined;
|
249
|
-
} & {
|
250
|
-
typ: "war+jwt";
|
251
|
-
};
|
252
249
|
payload: {
|
253
250
|
iss: string;
|
254
251
|
iat: number;
|
@@ -283,10 +280,11 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
283
280
|
};
|
284
281
|
} & {
|
285
282
|
nonce: string;
|
283
|
+
hardware_key_tag: string;
|
286
284
|
aud: string;
|
287
|
-
|
285
|
+
hardware_signature: string;
|
286
|
+
integrity_assertion: string;
|
288
287
|
};
|
289
|
-
}, {
|
290
288
|
header: {
|
291
289
|
alg: string;
|
292
290
|
kid: string;
|
@@ -294,8 +292,9 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
294
292
|
x5c?: string[] | undefined;
|
295
293
|
trust_chain?: string[] | undefined;
|
296
294
|
} & {
|
297
|
-
typ: "war+jwt";
|
295
|
+
typ: "wp-war+jwt";
|
298
296
|
};
|
297
|
+
}, {
|
299
298
|
payload: {
|
300
299
|
iss: string;
|
301
300
|
iat: number;
|
@@ -330,8 +329,19 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
330
329
|
};
|
331
330
|
} & {
|
332
331
|
nonce: string;
|
332
|
+
hardware_key_tag: string;
|
333
333
|
aud: string;
|
334
|
-
|
334
|
+
hardware_signature: string;
|
335
|
+
integrity_assertion: string;
|
336
|
+
};
|
337
|
+
header: {
|
338
|
+
alg: string;
|
339
|
+
kid: string;
|
340
|
+
typ: string;
|
341
|
+
x5c?: string[] | undefined;
|
342
|
+
trust_chain?: string[] | undefined;
|
343
|
+
} & {
|
344
|
+
typ: "wp-war+jwt";
|
335
345
|
};
|
336
346
|
}>;
|
337
347
|
export type WalletInstanceAttestationJwt = z.infer<typeof WalletInstanceAttestationJwt>;
|
@@ -355,11 +365,14 @@ export declare const WalletInstanceAttestationJwt: z.ZodObject<{
|
|
355
365
|
x5c?: string[] | undefined;
|
356
366
|
trust_chain?: string[] | undefined;
|
357
367
|
}>, z.ZodObject<{
|
358
|
-
typ: z.ZodLiteral<"
|
368
|
+
typ: z.ZodLiteral<"oauth-client-attestation+jwt">;
|
369
|
+
trust_chain: z.ZodArray<z.ZodString, "many">;
|
359
370
|
}, "strip", z.ZodTypeAny, {
|
360
|
-
typ: "
|
371
|
+
typ: "oauth-client-attestation+jwt";
|
372
|
+
trust_chain: string[];
|
361
373
|
}, {
|
362
|
-
typ: "
|
374
|
+
typ: "oauth-client-attestation+jwt";
|
375
|
+
trust_chain: string[];
|
363
376
|
}>>;
|
364
377
|
payload: z.ZodIntersection<z.ZodObject<{
|
365
378
|
iss: z.ZodString;
|
@@ -564,81 +577,20 @@ export declare const WalletInstanceAttestationJwt: z.ZodObject<{
|
|
564
577
|
}>, z.ZodObject<{
|
565
578
|
sub: z.ZodString;
|
566
579
|
aal: z.ZodString;
|
567
|
-
|
568
|
-
|
569
|
-
vp_formats_supported: z.ZodObject<{
|
570
|
-
"vc+sd-jwt": z.ZodOptional<z.ZodObject<{
|
571
|
-
"sd-jwt_alg_values": z.ZodArray<z.ZodString, "many">;
|
572
|
-
}, "strip", z.ZodTypeAny, {
|
573
|
-
"sd-jwt_alg_values": string[];
|
574
|
-
}, {
|
575
|
-
"sd-jwt_alg_values": string[];
|
576
|
-
}>>;
|
577
|
-
"vp+sd-jwt": z.ZodOptional<z.ZodObject<{
|
578
|
-
"sd-jwt_alg_values": z.ZodArray<z.ZodString, "many">;
|
579
|
-
}, "strip", z.ZodTypeAny, {
|
580
|
-
"sd-jwt_alg_values": string[];
|
581
|
-
}, {
|
582
|
-
"sd-jwt_alg_values": string[];
|
583
|
-
}>>;
|
584
|
-
}, "strip", z.ZodTypeAny, {
|
585
|
-
"vc+sd-jwt"?: {
|
586
|
-
"sd-jwt_alg_values": string[];
|
587
|
-
} | undefined;
|
588
|
-
"vp+sd-jwt"?: {
|
589
|
-
"sd-jwt_alg_values": string[];
|
590
|
-
} | undefined;
|
591
|
-
}, {
|
592
|
-
"vc+sd-jwt"?: {
|
593
|
-
"sd-jwt_alg_values": string[];
|
594
|
-
} | undefined;
|
595
|
-
"vp+sd-jwt"?: {
|
596
|
-
"sd-jwt_alg_values": string[];
|
597
|
-
} | undefined;
|
598
|
-
}>;
|
599
|
-
request_object_signing_alg_values_supported: z.ZodArray<z.ZodString, "many">;
|
600
|
-
presentation_definition_uri_supported: z.ZodBoolean;
|
580
|
+
wallet_link: z.ZodOptional<z.ZodString>;
|
581
|
+
wallet_name: z.ZodOptional<z.ZodString>;
|
601
582
|
}, "strip", z.ZodTypeAny, {
|
602
|
-
authorization_endpoint: string;
|
603
583
|
sub: string;
|
604
584
|
aal: string;
|
605
|
-
|
606
|
-
|
607
|
-
"vc+sd-jwt"?: {
|
608
|
-
"sd-jwt_alg_values": string[];
|
609
|
-
} | undefined;
|
610
|
-
"vp+sd-jwt"?: {
|
611
|
-
"sd-jwt_alg_values": string[];
|
612
|
-
} | undefined;
|
613
|
-
};
|
614
|
-
request_object_signing_alg_values_supported: string[];
|
615
|
-
presentation_definition_uri_supported: boolean;
|
585
|
+
wallet_link?: string | undefined;
|
586
|
+
wallet_name?: string | undefined;
|
616
587
|
}, {
|
617
|
-
authorization_endpoint: string;
|
618
588
|
sub: string;
|
619
589
|
aal: string;
|
620
|
-
|
621
|
-
|
622
|
-
"vc+sd-jwt"?: {
|
623
|
-
"sd-jwt_alg_values": string[];
|
624
|
-
} | undefined;
|
625
|
-
"vp+sd-jwt"?: {
|
626
|
-
"sd-jwt_alg_values": string[];
|
627
|
-
} | undefined;
|
628
|
-
};
|
629
|
-
request_object_signing_alg_values_supported: string[];
|
630
|
-
presentation_definition_uri_supported: boolean;
|
590
|
+
wallet_link?: string | undefined;
|
591
|
+
wallet_name?: string | undefined;
|
631
592
|
}>>;
|
632
593
|
}, "strip", z.ZodTypeAny, {
|
633
|
-
header: {
|
634
|
-
alg: string;
|
635
|
-
kid: string;
|
636
|
-
typ: string;
|
637
|
-
x5c?: string[] | undefined;
|
638
|
-
trust_chain?: string[] | undefined;
|
639
|
-
} & {
|
640
|
-
typ: "wallet-attestation+jwt";
|
641
|
-
};
|
642
594
|
payload: {
|
643
595
|
iss: string;
|
644
596
|
iat: number;
|
@@ -672,22 +624,11 @@ export declare const WalletInstanceAttestationJwt: z.ZodObject<{
|
|
672
624
|
};
|
673
625
|
};
|
674
626
|
} & {
|
675
|
-
authorization_endpoint: string;
|
676
627
|
sub: string;
|
677
628
|
aal: string;
|
678
|
-
|
679
|
-
|
680
|
-
"vc+sd-jwt"?: {
|
681
|
-
"sd-jwt_alg_values": string[];
|
682
|
-
} | undefined;
|
683
|
-
"vp+sd-jwt"?: {
|
684
|
-
"sd-jwt_alg_values": string[];
|
685
|
-
} | undefined;
|
686
|
-
};
|
687
|
-
request_object_signing_alg_values_supported: string[];
|
688
|
-
presentation_definition_uri_supported: boolean;
|
629
|
+
wallet_link?: string | undefined;
|
630
|
+
wallet_name?: string | undefined;
|
689
631
|
};
|
690
|
-
}, {
|
691
632
|
header: {
|
692
633
|
alg: string;
|
693
634
|
kid: string;
|
@@ -695,8 +636,10 @@ export declare const WalletInstanceAttestationJwt: z.ZodObject<{
|
|
695
636
|
x5c?: string[] | undefined;
|
696
637
|
trust_chain?: string[] | undefined;
|
697
638
|
} & {
|
698
|
-
typ: "
|
639
|
+
typ: "oauth-client-attestation+jwt";
|
640
|
+
trust_chain: string[];
|
699
641
|
};
|
642
|
+
}, {
|
700
643
|
payload: {
|
701
644
|
iss: string;
|
702
645
|
iat: number;
|
@@ -730,28 +673,43 @@ export declare const WalletInstanceAttestationJwt: z.ZodObject<{
|
|
730
673
|
};
|
731
674
|
};
|
732
675
|
} & {
|
733
|
-
authorization_endpoint: string;
|
734
676
|
sub: string;
|
735
677
|
aal: string;
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
678
|
+
wallet_link?: string | undefined;
|
679
|
+
wallet_name?: string | undefined;
|
680
|
+
};
|
681
|
+
header: {
|
682
|
+
alg: string;
|
683
|
+
kid: string;
|
684
|
+
typ: string;
|
685
|
+
x5c?: string[] | undefined;
|
686
|
+
trust_chain?: string[] | undefined;
|
687
|
+
} & {
|
688
|
+
typ: "oauth-client-attestation+jwt";
|
689
|
+
trust_chain: string[];
|
747
690
|
};
|
748
691
|
}>;
|
749
|
-
export type
|
750
|
-
export declare const
|
751
|
-
|
692
|
+
export type WalletAttestationResponse = z.infer<typeof WalletAttestationResponse>;
|
693
|
+
export declare const WalletAttestationResponse: z.ZodObject<{
|
694
|
+
wallet_attestations: z.ZodArray<z.ZodObject<{
|
695
|
+
wallet_attestation: z.ZodString;
|
696
|
+
format: z.ZodEnum<["jwt", "dc+sd-jwt", "mso_mdoc"]>;
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
698
|
+
format: "jwt" | "dc+sd-jwt" | "mso_mdoc";
|
699
|
+
wallet_attestation: string;
|
700
|
+
}, {
|
701
|
+
format: "jwt" | "dc+sd-jwt" | "mso_mdoc";
|
702
|
+
wallet_attestation: string;
|
703
|
+
}>, "many">;
|
752
704
|
}, "strip", z.ZodTypeAny, {
|
753
|
-
|
705
|
+
wallet_attestations: {
|
706
|
+
format: "jwt" | "dc+sd-jwt" | "mso_mdoc";
|
707
|
+
wallet_attestation: string;
|
708
|
+
}[];
|
754
709
|
}, {
|
755
|
-
|
710
|
+
wallet_attestations: {
|
711
|
+
format: "jwt" | "dc+sd-jwt" | "mso_mdoc";
|
712
|
+
wallet_attestation: string;
|
713
|
+
}[];
|
756
714
|
}>;
|
757
715
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA2BzB,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAC;AACF,eAAO,MAAM,mCAAmC
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA2BzB,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAC;AACF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB9C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAC;AACF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBvC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pagopa/io-react-native-wallet",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0-next.0",
|
4
4
|
"description": "Provide data structures, helpers and API for IO Wallet",
|
5
5
|
"main": "lib/commonjs/index",
|
6
6
|
"module": "lib/module/index",
|
@@ -55,7 +55,6 @@
|
|
55
55
|
"devDependencies": {
|
56
56
|
"@pagopa/io-react-native-crypto": "^0.2.3",
|
57
57
|
"@pagopa/io-react-native-jwt": "^2.1.0",
|
58
|
-
"@pagopa/io-react-native-cbor": "^1.2.4",
|
59
58
|
"@react-native/eslint-config": "^0.75.5",
|
60
59
|
"@rushstack/eslint-patch": "^1.3.2",
|
61
60
|
"@types/jest": "^28.1.2",
|
@@ -80,7 +79,6 @@
|
|
80
79
|
"peerDependencies": {
|
81
80
|
"@pagopa/io-react-native-crypto": "*",
|
82
81
|
"@pagopa/io-react-native-jwt": "*",
|
83
|
-
"@pagopa/io-react-native-cbor": "*",
|
84
82
|
"react": "*",
|
85
83
|
"react-native": "*"
|
86
84
|
},
|
@@ -95,7 +93,10 @@
|
|
95
93
|
"<rootDir>/lib/"
|
96
94
|
],
|
97
95
|
"transformIgnorePatterns": [
|
98
|
-
"node_modules/(?!(jest-)?@react-native|react-native|uuid
|
96
|
+
"node_modules/(?!(jest-)?@react-native|react-native|uuid)"
|
97
|
+
],
|
98
|
+
"setupFiles": [
|
99
|
+
"<rootDir>/jestSetup.js"
|
99
100
|
]
|
100
101
|
},
|
101
102
|
"react-native-builder-bob": {
|
@@ -113,16 +114,14 @@
|
|
113
114
|
]
|
114
115
|
},
|
115
116
|
"dependencies": {
|
116
|
-
"
|
117
|
-
"ajv": "^8.17.1",
|
118
|
-
"dcql": "^0.2.22",
|
117
|
+
"dcql": "^0.2.21",
|
119
118
|
"js-base64": "^3.7.7",
|
120
119
|
"js-sha256": "^0.9.0",
|
121
|
-
"jsonpath-plus": "^10.
|
122
|
-
"jsrsasign": "^11.1.0",
|
120
|
+
"jsonpath-plus": "^10.2.0",
|
123
121
|
"parse-url": "^9.2.0",
|
124
122
|
"react-native-url-polyfill": "^2.0.0",
|
125
123
|
"react-native-uuid": "^2.0.1",
|
124
|
+
"uuid": "^11.0.3",
|
126
125
|
"zod": "^3.21.4"
|
127
126
|
}
|
128
127
|
}
|
@@ -10,6 +10,16 @@ export const WalletAttestationView = z.object({
|
|
10
10
|
wallet_attestation: z.string(),
|
11
11
|
});
|
12
12
|
|
13
|
+
export type WalletAttestationsView = z.infer<typeof WalletAttestationsView>;
|
14
|
+
export const WalletAttestationsView = z.object({
|
15
|
+
wallet_attestations: z.array(
|
16
|
+
z.object({
|
17
|
+
format: z.union([z.literal("jwt"), z.literal("dc+sd-jwt")]),
|
18
|
+
wallet_attestation: z.string(),
|
19
|
+
}),
|
20
|
+
),
|
21
|
+
});
|
22
|
+
|
13
23
|
export type CreateWalletInstanceBody = z.infer<typeof CreateWalletInstanceBody>;
|
14
24
|
export const CreateWalletInstanceBody = z.object({
|
15
25
|
challenge: z.string(),
|
@@ -23,13 +33,9 @@ export const CreateWalletAttestationBody = z.object({
|
|
23
33
|
assertion: z.string(),
|
24
34
|
});
|
25
35
|
|
26
|
-
export type
|
27
|
-
export const
|
28
|
-
|
29
|
-
title: z.string().optional(),
|
30
|
-
status: z.number().optional(),
|
31
|
-
detail: z.string().optional(),
|
32
|
-
instance: z.string().optional(),
|
36
|
+
export type CreateWalletAttestationV2Body = z.infer<typeof CreateWalletAttestationV2Body>;
|
37
|
+
export const CreateWalletAttestationV2Body = z.object({
|
38
|
+
assertion: z.string(),
|
33
39
|
});
|
34
40
|
|
35
41
|
export type SetWalletInstanceStatusBody = z.infer<typeof SetWalletInstanceStatusBody>;
|
@@ -51,6 +57,15 @@ export const WalletInstanceData = z.object({
|
|
51
57
|
revocation_reason: z.union([RevocationReason, z.undefined()]).optional(),
|
52
58
|
});
|
53
59
|
|
60
|
+
export type ProblemDetail = z.infer<typeof ProblemDetail>;
|
61
|
+
export const ProblemDetail = z.object({
|
62
|
+
type: z.string().optional(),
|
63
|
+
title: z.string().optional(),
|
64
|
+
status: z.number().optional(),
|
65
|
+
detail: z.string().optional(),
|
66
|
+
instance: z.string().optional(),
|
67
|
+
});
|
68
|
+
|
54
69
|
export type get_GetNonce = typeof get_GetNonce;
|
55
70
|
export const get_GetNonce = {
|
56
71
|
method: z.literal("GET"),
|
@@ -69,6 +84,34 @@ export const post_CreateWalletInstance = {
|
|
69
84
|
response: z.unknown(),
|
70
85
|
};
|
71
86
|
|
87
|
+
export type post_CreateWalletAttestation = typeof post_CreateWalletAttestation;
|
88
|
+
export const post_CreateWalletAttestation = {
|
89
|
+
method: z.literal("POST"),
|
90
|
+
path: z.literal("/token"),
|
91
|
+
parameters: z.object({
|
92
|
+
body: CreateWalletAttestationBody,
|
93
|
+
}),
|
94
|
+
response: WalletAttestationView,
|
95
|
+
};
|
96
|
+
|
97
|
+
export type post_CreateWalletAttestationV2 = typeof post_CreateWalletAttestationV2;
|
98
|
+
export const post_CreateWalletAttestationV2 = {
|
99
|
+
method: z.literal("POST"),
|
100
|
+
path: z.literal("/wallet-attestations"),
|
101
|
+
parameters: z.object({
|
102
|
+
body: CreateWalletAttestationV2Body,
|
103
|
+
}),
|
104
|
+
response: WalletAttestationsView,
|
105
|
+
};
|
106
|
+
|
107
|
+
export type get_GetCurrentWalletInstanceStatus = typeof get_GetCurrentWalletInstanceStatus;
|
108
|
+
export const get_GetCurrentWalletInstanceStatus = {
|
109
|
+
method: z.literal("GET"),
|
110
|
+
path: z.literal("/wallet-instances/current/status"),
|
111
|
+
parameters: z.never(),
|
112
|
+
response: WalletInstanceData,
|
113
|
+
};
|
114
|
+
|
72
115
|
export type get_GetWalletInstanceStatus = typeof get_GetWalletInstanceStatus;
|
73
116
|
export const get_GetWalletInstanceStatus = {
|
74
117
|
method: z.literal("GET"),
|
@@ -94,25 +137,17 @@ export const put_SetWalletInstanceStatus = {
|
|
94
137
|
response: z.unknown(),
|
95
138
|
};
|
96
139
|
|
97
|
-
export type post_CreateWalletAttestation = typeof post_CreateWalletAttestation;
|
98
|
-
export const post_CreateWalletAttestation = {
|
99
|
-
method: z.literal("POST"),
|
100
|
-
path: z.literal("/token"),
|
101
|
-
parameters: z.object({
|
102
|
-
body: CreateWalletAttestationBody,
|
103
|
-
}),
|
104
|
-
response: WalletAttestationView,
|
105
|
-
};
|
106
|
-
|
107
140
|
// <EndpointByMethod>
|
108
141
|
export const EndpointByMethod = {
|
109
142
|
get: {
|
110
143
|
"/nonce": get_GetNonce,
|
144
|
+
"/wallet-instances/current/status": get_GetCurrentWalletInstanceStatus,
|
111
145
|
"/wallet-instances/{id}/status": get_GetWalletInstanceStatus,
|
112
146
|
},
|
113
147
|
post: {
|
114
148
|
"/wallet-instances": post_CreateWalletInstance,
|
115
149
|
"/token": post_CreateWalletAttestation,
|
150
|
+
"/wallet-attestations": post_CreateWalletAttestationV2,
|
116
151
|
},
|
117
152
|
put: {
|
118
153
|
"/wallet-instances/{id}/status": put_SetWalletInstanceStatus,
|
package/src/credential/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link
|
2
|
+
* WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link evaluateIssuerTrust}.
|
3
3
|
* The beginning of the issuing flow.
|
4
4
|
* To be implemented accordind to the user touchpoint
|
5
5
|
*
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { getCredentialIssuerEntityConfiguration } from "../../trust";
|
2
|
+
import { CredentialIssuerEntityConfiguration } from "../../trust/types";
|
3
|
+
import type { StartFlow } from "./01-start-flow";
|
4
|
+
import type { Out } from "../../utils/misc";
|
5
|
+
|
6
|
+
export type EvaluateIssuerTrust = (
|
7
|
+
issuerUrl: Out<StartFlow>["issuerUrl"],
|
8
|
+
context?: {
|
9
|
+
appFetch?: GlobalFetch["fetch"];
|
10
|
+
}
|
11
|
+
) => Promise<{
|
12
|
+
issuerConf: CredentialIssuerEntityConfiguration["payload"]["metadata"];
|
13
|
+
}>;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
|
17
|
+
* The Issuer trust evaluation phase.
|
18
|
+
* Fetch the Issuer's configuration and verify trust.
|
19
|
+
*
|
20
|
+
* @param issuerUrl The base url of the Issuer returned by {@link startFlow}
|
21
|
+
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
22
|
+
* @returns The Issuer's configuration
|
23
|
+
*/
|
24
|
+
export const evaluateIssuerTrust: EvaluateIssuerTrust = async (
|
25
|
+
issuerUrl,
|
26
|
+
context = {}
|
27
|
+
) => {
|
28
|
+
const issuerConf = await getCredentialIssuerEntityConfiguration(issuerUrl, {
|
29
|
+
appFetch: context.appFetch,
|
30
|
+
}).then((_) => _.payload.metadata);
|
31
|
+
return { issuerConf };
|
32
|
+
};
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
2
2
|
import type { ResponseMode } from "./types";
|
3
3
|
import { generateRandomAlphaNumericString, type Out } from "../../utils/misc";
|
4
|
+
import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
4
5
|
import type { StartFlow } from "./01-start-flow";
|
5
6
|
import { AuthorizationDetail, makeParRequest } from "../../utils/par";
|
6
|
-
import
|
7
|
+
import { ASSERTION_TYPE } from "./const";
|
8
|
+
import { LogLevel, Logger } from "../../utils/logging";
|
7
9
|
|
8
10
|
export type StartUserAuthorization = (
|
9
|
-
issuerConf: Out<
|
11
|
+
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
10
12
|
credentialType: Out<StartFlow>["credentialType"],
|
11
13
|
context: {
|
12
14
|
wiaCryptoContext: CryptoContext;
|
@@ -24,7 +26,7 @@ export type StartUserAuthorization = (
|
|
24
26
|
/**
|
25
27
|
* Ensures that the credential type requested is supported by the issuer and contained in the
|
26
28
|
* issuer configuration.
|
27
|
-
* @param issuerConf The issuer configuration returned by {@link
|
29
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
28
30
|
* @param credentialType The type of the credential to be requested returned by {@link startFlow}
|
29
31
|
* @param context.wiaCryptoContext The Wallet Instance's crypto context
|
30
32
|
* @param context.walletInstanceAttestation The Wallet Instance's attestation
|
@@ -33,24 +35,27 @@ export type StartUserAuthorization = (
|
|
33
35
|
* @returns The credential definition to be used in the request which includes the format and the type and its type
|
34
36
|
*/
|
35
37
|
const selectCredentialDefinition = (
|
36
|
-
issuerConf: Out<
|
38
|
+
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
37
39
|
credentialType: Out<StartFlow>["credentialType"]
|
38
40
|
): AuthorizationDetail => {
|
39
41
|
const credential_configurations_supported =
|
40
|
-
issuerConf.credential_configurations_supported;
|
42
|
+
issuerConf.openid_credential_issuer.credential_configurations_supported;
|
41
43
|
|
42
|
-
const
|
44
|
+
const [result] = Object.keys(credential_configurations_supported)
|
45
|
+
.filter((e) => e.includes(credentialType))
|
46
|
+
.map((e) => ({
|
47
|
+
credential_configuration_id: credentialType,
|
48
|
+
format: credential_configurations_supported[e]!.format,
|
49
|
+
type: "openid_credential" as const,
|
50
|
+
}));
|
43
51
|
|
44
|
-
if (!
|
52
|
+
if (!result) {
|
53
|
+
Logger.log(
|
54
|
+
LogLevel.ERROR,
|
55
|
+
`Requested credential type ${credentialType} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`
|
56
|
+
);
|
45
57
|
throw new Error(`No credential support the type '${credentialType}'`);
|
46
58
|
}
|
47
|
-
|
48
|
-
const result = {
|
49
|
-
credential_configuration_id: credentialType,
|
50
|
-
format: credential.format,
|
51
|
-
type: "openid_credential" as const,
|
52
|
-
};
|
53
|
-
|
54
59
|
return result;
|
55
60
|
};
|
56
61
|
|
@@ -58,21 +63,36 @@ const selectCredentialDefinition = (
|
|
58
63
|
* Ensures that the response mode requested is supported by the issuer and contained in the issuer configuration.
|
59
64
|
* @param issuerConf The issuer configuration
|
60
65
|
* @param credentialType The type of the credential to be requested
|
61
|
-
* @returns The response mode to be used in the request, "query" for
|
66
|
+
* @returns The response mode to be used in the request, "query" for PersonIdentificationData and "form_post.jwt" for all other types.
|
62
67
|
*/
|
63
68
|
const selectResponseMode = (
|
69
|
+
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
64
70
|
credentialType: Out<StartFlow>["credentialType"]
|
65
71
|
): ResponseMode => {
|
72
|
+
const responseModeSupported =
|
73
|
+
issuerConf.oauth_authorization_server.response_modes_supported;
|
74
|
+
|
66
75
|
const responseMode =
|
67
|
-
credentialType === "
|
68
|
-
|
69
|
-
|
76
|
+
credentialType === "PersonIdentificationData" ? "query" : "form_post.jwt";
|
77
|
+
|
78
|
+
Logger.log(
|
79
|
+
LogLevel.DEBUG,
|
80
|
+
`Selected response mode ${responseMode} for credential type ${credentialType}`
|
81
|
+
);
|
82
|
+
|
83
|
+
if (!responseModeSupported.includes(responseMode)) {
|
84
|
+
Logger.log(
|
85
|
+
LogLevel.ERROR,
|
86
|
+
`Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`
|
87
|
+
);
|
88
|
+
throw new Error(`No response mode support the type '${credentialType}'`);
|
89
|
+
}
|
70
90
|
|
71
91
|
return responseMode;
|
72
92
|
};
|
73
93
|
|
74
94
|
/**
|
75
|
-
* WARNING: This function must be called after {@link
|
95
|
+
* WARNING: This function must be called after {@link evaluateIssuerTrust} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
|
76
96
|
* Creates and sends a PAR request to the /as/par endpoint of the authorization server.
|
77
97
|
* This starts the authentication flow to obtain an access token.
|
78
98
|
* This token enables the Wallet Instance to request a digital credential from the Credential Endpoint of the Credential Issuer.
|
@@ -103,15 +123,20 @@ export const startUserAuthorization: StartUserAuthorization = async (
|
|
103
123
|
|
104
124
|
const clientId = await wiaCryptoContext.getPublicKey().then((_) => _.kid);
|
105
125
|
if (!clientId) {
|
126
|
+
Logger.log(
|
127
|
+
LogLevel.ERROR,
|
128
|
+
`Public key associated with kid ${clientId} not found in the device`
|
129
|
+
);
|
106
130
|
throw new Error("No public key found");
|
107
131
|
}
|
108
132
|
const codeVerifier = generateRandomAlphaNumericString(64);
|
109
|
-
const parEndpoint =
|
133
|
+
const parEndpoint =
|
134
|
+
issuerConf.oauth_authorization_server.pushed_authorization_request_endpoint;
|
110
135
|
const credentialDefinition = selectCredentialDefinition(
|
111
136
|
issuerConf,
|
112
137
|
credentialType
|
113
138
|
);
|
114
|
-
const responseMode = selectResponseMode(credentialType);
|
139
|
+
const responseMode = selectResponseMode(issuerConf, credentialType);
|
115
140
|
|
116
141
|
const getPar = makeParRequest({ wiaCryptoContext, appFetch });
|
117
142
|
const issuerRequestUri = await getPar(
|
@@ -121,7 +146,8 @@ export const startUserAuthorization: StartUserAuthorization = async (
|
|
121
146
|
responseMode,
|
122
147
|
parEndpoint,
|
123
148
|
walletInstanceAttestation,
|
124
|
-
[credentialDefinition]
|
149
|
+
[credentialDefinition],
|
150
|
+
ASSERTION_TYPE
|
125
151
|
);
|
126
152
|
|
127
153
|
return { issuerRequestUri, clientId, codeVerifier, credentialDefinition };
|