From a3dec0b6bc52f20246a65ed5255768fcf585147a Mon Sep 17 00:00:00 2001 From: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:10:18 +0530 Subject: [PATCH] refactor(core): move authentication data fields to authentication table (#4093) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: sai-harsha-vardhan Co-authored-by: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com> --- Cargo.lock | 869 +++++++++--------- crates/api_models/src/payments.rs | 34 +- crates/common_enums/src/enums.rs | 41 + crates/common_utils/Cargo.toml | 1 + crates/common_utils/src/types.rs | 66 +- crates/diesel_models/src/authentication.rs | 259 +++++- crates/diesel_models/src/schema.rs | 24 + crates/openapi/src/openapi.rs | 2 +- .../src/connector/checkout/transformers.rs | 4 +- crates/router/src/connector/threedsecureio.rs | 6 +- .../connector/threedsecureio/transformers.rs | 77 +- crates/router/src/core/authentication.rs | 51 +- .../src/core/authentication/transformers.rs | 40 +- .../router/src/core/authentication/types.rs | 46 +- .../router/src/core/authentication/utils.rs | 199 ++-- crates/router/src/core/payments.rs | 13 +- .../payments/operations/payment_confirm.rs | 50 +- .../payments/operations/payment_response.rs | 4 +- .../payments/operations/payment_status.rs | 33 +- .../router/src/core/payments/transformers.rs | 26 +- crates/router/src/core/payments/types.rs | 57 +- crates/router/src/db/authentication.rs | 19 +- crates/router/src/types.rs | 6 +- crates/router/src/types/api/authentication.rs | 2 +- crates/router/src/types/authentication.rs | 61 +- crates/router/src/types/transformers.rs | 37 +- .../down.sql | 19 + .../up.sql | 20 + openapi/openapi_spec.json | 4 +- 29 files changed, 1175 insertions(+), 895 deletions(-) create mode 100644 migrations/2024-03-11-102743_add_additional_authentication_fields/down.sql create mode 100644 migrations/2024-03-11-102743_add_additional_authentication_fields/up.sql diff --git a/Cargo.lock b/Cargo.lock index 49290228e5..03f7868698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,11 +4,11 @@ version = 3 [[package]] name = "actix-codec" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" +checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" dependencies = [ - "bitflags 2.4.0", + "bitflags 1.3.2", "bytes 1.5.0", "futures-core", "futures-sink", @@ -31,22 +31,22 @@ dependencies = [ "futures-util", "log", "once_cell", - "smallvec 1.13.1", + "smallvec 1.11.1", ] [[package]] name = "actix-http" -version = "3.6.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d223b13fd481fc0d1f83bb12659ae774d9e3601814c68a0bc539731698cca743" +checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" dependencies = [ "actix-codec", "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.11", - "base64 0.21.7", - "bitflags 2.4.0", + "ahash 0.8.6", + "base64 0.21.5", + "bitflags 1.3.2", "brotli", "bytes 1.5.0", "bytestring", @@ -55,7 +55,7 @@ dependencies = [ "flate2", "futures-core", "h2", - "http 0.2.12", + "http 0.2.9", "httparse", "httpdate", "itoa", @@ -66,7 +66,7 @@ dependencies = [ "pin-project-lite", "rand 0.8.5", "sha1", - "smallvec 1.13.1", + "smallvec 1.11.1", "tokio 1.36.0", "tokio-util", "tracing", @@ -80,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -118,17 +118,17 @@ dependencies = [ "parse-size", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "actix-router" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" +checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" dependencies = [ "bytestring", - "http 0.2.12", + "http 0.2.9", "regex", "serde", "tracing", @@ -156,8 +156,8 @@ dependencies = [ "actix-utils", "futures-core", "futures-util", - "mio 0.8.11", - "socket2 0.5.6", + "mio 0.8.10", + "socket2 0.5.5", "tokio 1.36.0", "tracing", ] @@ -183,7 +183,7 @@ dependencies = [ "actix-service", "actix-utils", "futures-core", - "http 0.2.12", + "http 0.2.9", "impl-more", "pin-project-lite", "rustls 0.21.10", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.5.1" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a6556ddebb638c2358714d853257ed226ece6023ef9364f23f0c70737ea984" +checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" dependencies = [ "actix-codec", "actix-http", @@ -220,7 +220,7 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.8.11", + "ahash 0.7.7", "bytes 1.5.0", "bytestring", "cfg-if 1.0.0", @@ -229,6 +229,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", + "http 0.2.9", "itoa", "language-tags", "log", @@ -239,8 +240,8 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "smallvec 1.13.1", - "socket2 0.5.6", + "smallvec 1.11.1", + "socket2 0.4.9", "time", "url", ] @@ -254,7 +255,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -284,19 +285,19 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.11", "once_cell", "version_check", "zerocopy", @@ -304,9 +305,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -339,9 +340,9 @@ dependencies = [ "actix-web", "api_models", "async-trait", - "aws-config 1.1.7", + "aws-config 1.1.8", "aws-sdk-lambda", - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "bigdecimal", "common_utils", "diesel_models", @@ -565,7 +566,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -576,7 +577,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -613,7 +614,7 @@ dependencies = [ "actix-tls", "actix-utils", "ahash 0.7.7", - "base64 0.21.7", + "base64 0.21.5", "bytes 1.5.0", "cfg-if 1.0.0", "cookie 0.16.2", @@ -621,7 +622,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.12", + "http 0.2.9", "itoa", "log", "mime", @@ -655,7 +656,7 @@ dependencies = [ "bytes 1.5.0", "fastrand 1.9.0", "hex", - "http 0.2.12", + "http 0.2.9", "hyper", "ring 0.16.20", "time", @@ -667,26 +668,26 @@ dependencies = [ [[package]] name = "aws-config" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b96342ea8948ab9bef3e6234ea97fc32e2d8a88d8fb6a084e52267317f94b6b" +checksum = "4f4084d18094aec9f79d509f4cb6ccf6b613c5037e32f32e74312e52b836e366" dependencies = [ - "aws-credential-types 1.1.7", + "aws-credential-types 1.1.8", "aws-runtime", - "aws-sdk-sso 1.15.0", + "aws-sdk-sso 1.17.0", "aws-sdk-ssooidc", - "aws-sdk-sts 1.15.0", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", - "aws-smithy-json 0.60.6", + "aws-sdk-sts 1.17.0", + "aws-smithy-async 1.1.8", + "aws-smithy-http 0.60.7", + "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-types 1.1.7", + "aws-smithy-types 1.1.8", + "aws-types 1.1.8", "bytes 1.5.0", "fastrand 2.0.1", "hex", - "http 0.2.12", + "http 0.2.9", "hyper", "ring 0.17.8", "time", @@ -711,13 +712,13 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273fa47dafc9ef14c2c074ddddbea4561ff01b7f68d5091c0e9737ced605c01d" +checksum = "fa8587ae17c8e967e4b05a62d495be2fb7701bec52a97f7acfe8a29f938384c8" dependencies = [ - "aws-smithy-async 1.1.7", + "aws-smithy-async 1.1.8", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "zeroize", ] @@ -730,7 +731,7 @@ dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "http 0.2.12", + "http 0.2.9", "regex", "tracing", ] @@ -746,7 +747,7 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "http-body", "lazy_static", "percent-encoding", @@ -756,20 +757,21 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e38bab716c8bf07da24be07ecc02e0f5656ce8f30a891322ecdcb202f943b85" +checksum = "b13dc54b4b49f8288532334bba8f87386a40571c47c37b1304979b556dc613c8" dependencies = [ - "aws-credential-types 1.1.7", - "aws-sigv4 1.1.7", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", + "aws-credential-types 1.1.8", + "aws-sigv4 1.2.0", + "aws-smithy-async 1.1.8", + "aws-smithy-eventstream 0.60.4", + "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-types 1.1.7", + "aws-smithy-types 1.1.8", + "aws-types 1.1.8", "bytes 1.5.0", "fastrand 2.0.1", - "http 0.2.12", + "http 0.2.9", "http-body", "percent-encoding", "pin-project-lite", @@ -795,7 +797,7 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "regex", "tokio-stream", "tower", @@ -804,21 +806,22 @@ dependencies = [ [[package]] name = "aws-sdk-lambda" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4714bdfe1171542377f84c1034b1c64e3e7544119765f205402ae159b5b9b4" +checksum = "a2e4c45d7ce6e957489b9be24963c7fb04a6b0d2e8c7dfcbca032f9bf25b0d4d" dependencies = [ - "aws-credential-types 1.1.7", + "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", - "aws-smithy-json 0.60.6", + "aws-smithy-async 1.1.8", + "aws-smithy-eventstream 0.60.4", + "aws-smithy-http 0.60.7", + "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-types 1.1.7", + "aws-smithy-types 1.1.8", + "aws-types 1.1.8", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "once_cell", "regex-lite", "tracing", @@ -838,7 +841,7 @@ dependencies = [ "aws-smithy-async 0.55.3", "aws-smithy-checksums", "aws-smithy-client", - "aws-smithy-eventstream", + "aws-smithy-eventstream 0.55.3", "aws-smithy-http 0.55.3", "aws-smithy-http-tower", "aws-smithy-json 0.55.3", @@ -846,7 +849,7 @@ dependencies = [ "aws-smithy-xml 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "http-body", "once_cell", "percent-encoding", @@ -875,7 +878,7 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "regex", "tokio-stream", "tower", @@ -900,7 +903,7 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "regex", "tokio-stream", "tower", @@ -909,21 +912,21 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84bd3925a17c9adbf6ec65d52104a44a09629d8f70290542beeee69a95aee7f" +checksum = "c5cc34f5925899739a3f125bd3f7d37d081234a3df218feb9c9d337fd4c70e72" dependencies = [ - "aws-credential-types 1.1.7", + "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", - "aws-smithy-json 0.60.6", + "aws-smithy-async 1.1.8", + "aws-smithy-http 0.60.7", + "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-types 1.1.7", + "aws-smithy-types 1.1.8", + "aws-types 1.1.8", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "once_cell", "regex-lite", "tracing", @@ -931,21 +934,21 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c2dae39e997f58bc4d6292e6244b26ba630c01ab671b6f9f44309de3eb80ab8" +checksum = "7327cddd32b1a6f2aaeaadb1336b671a7975e96a999d3b1bcf5aa47932dc6ddb" dependencies = [ - "aws-credential-types 1.1.7", + "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", - "aws-smithy-json 0.60.6", + "aws-smithy-async 1.1.8", + "aws-smithy-http 0.60.7", + "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-types 1.1.7", + "aws-smithy-types 1.1.8", + "aws-types 1.1.8", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "once_cell", "regex-lite", "tracing", @@ -971,7 +974,7 @@ dependencies = [ "aws-smithy-xml 0.55.3", "aws-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "regex", "tower", "tracing", @@ -979,22 +982,22 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fd9a53869fee17cea77e352084e1aa71e2c5e323d974c13a9c2bcfd9544c7f" +checksum = "6c11981cdb80e8e205e22beb6630a8bdec380a1256bd29efaab34aaebd07cfb9" dependencies = [ - "aws-credential-types 1.1.7", + "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", - "aws-smithy-json 0.60.6", - "aws-smithy-query 0.60.6", + "aws-smithy-async 1.1.8", + "aws-smithy-http 0.60.7", + "aws-smithy-json 0.60.7", + "aws-smithy-query 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "aws-smithy-xml 0.60.6", - "aws-types 1.1.7", - "http 0.2.12", + "aws-smithy-types 1.1.8", + "aws-smithy-xml 0.60.7", + "aws-types 1.1.8", + "http 0.2.9", "once_cell", "regex-lite", "tracing", @@ -1008,10 +1011,10 @@ checksum = "3b94acb10af0c879ecd5c7bdf51cda6679a0a4f4643ce630905a77673bfa3c61" dependencies = [ "aws-credential-types 0.55.3", "aws-sigv4 0.55.3", - "aws-smithy-eventstream", + "aws-smithy-eventstream 0.55.3", "aws-smithy-http 0.55.3", "aws-types 0.55.3", - "http 0.2.12", + "http 0.2.9", "tracing", ] @@ -1021,13 +1024,13 @@ version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d2ce6f507be68e968a33485ced670111d1cbad161ddbbab1e313c03d37d8f4c" dependencies = [ - "aws-smithy-eventstream", + "aws-smithy-eventstream 0.55.3", "aws-smithy-http 0.55.3", "bytes 1.5.0", "form_urlencoded", "hex", "hmac", - "http 0.2.12", + "http 0.2.9", "once_cell", "percent-encoding", "regex", @@ -1038,19 +1041,20 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.1.7" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ada00a4645d7d89f296fe0ddbc3fe3554f03035937c849a05d37ddffc1f29a1" +checksum = "11d6f29688a4be9895c0ba8bef861ad0c0dac5c15e9618b9b7a6c233990fc263" dependencies = [ - "aws-credential-types 1.1.7", - "aws-smithy-http 0.60.6", + "aws-credential-types 1.1.8", + "aws-smithy-eventstream 0.60.4", + "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "bytes 1.5.0", "form_urlencoded", "hex", "hmac", - "http 0.2.12", + "http 0.2.9", "http 1.1.0", "once_cell", "percent-encoding", @@ -1073,9 +1077,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf7f09a27286d84315dfb9346208abb3b0973a692454ae6d0bc8d803fcce3b4" +checksum = "d26ea8fa03025b2face2b3038a63525a10891e3d8829901d502e5384a0d8cd46" dependencies = [ "futures-util", "pin-project-lite", @@ -1094,7 +1098,7 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http 0.2.12", + "http 0.2.9", "http-body", "md-5", "pin-project-lite", @@ -1115,7 +1119,7 @@ dependencies = [ "aws-smithy-types 0.55.3", "bytes 1.5.0", "fastrand 1.9.0", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "hyper-rustls 0.23.2", @@ -1138,18 +1142,29 @@ dependencies = [ "crc32fast", ] +[[package]] +name = "aws-smithy-eventstream" +version = "0.60.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" +dependencies = [ + "aws-smithy-types 1.1.8", + "bytes 1.5.0", + "crc32fast", +] + [[package]] name = "aws-smithy-http" version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b3b693869133551f135e1f2c77cb0b8277d9e3e17feaf2213f735857c4f0d28" dependencies = [ - "aws-smithy-eventstream", + "aws-smithy-eventstream 0.55.3", "aws-smithy-types 0.55.3", "bytes 1.5.0", "bytes-utils", "futures-core", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "once_cell", @@ -1163,16 +1178,17 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ca214a6a26f1b7ebd63aa8d4f5e2194095643023f9608edf99a58247b9d80d" +checksum = "3f10fa66956f01540051b0aa7ad54574640f748f9839e843442d99b970d3aff9" dependencies = [ + "aws-smithy-eventstream 0.60.4", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "bytes 1.5.0", "bytes-utils", "futures-core", - "http 0.2.12", + "http 0.2.9", "http-body", "once_cell", "percent-encoding", @@ -1190,7 +1206,7 @@ dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "http-body", "pin-project-lite", "tower", @@ -1208,11 +1224,11 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af80ecf3057fb25fe38d1687e94c4601a7817c6a1e87c1b0635f7ecb644ace5" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", ] [[package]] @@ -1227,28 +1243,28 @@ dependencies = [ [[package]] name = "aws-smithy-query" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb27084f72ea5fc20033efe180618677ff4a2f474b53d84695cfe310a6526cbc" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" dependencies = [ - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "urlencoding", ] [[package]] name = "aws-smithy-runtime" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb5fca54a532a36ff927fbd7407a7c8eb9c3b4faf72792ba2965ea2cad8ed55" +checksum = "ec81002d883e5a7fd2bb063d6fb51c4999eb55d404f4fff3dd878bf4733b9f01" dependencies = [ - "aws-smithy-async 1.1.7", - "aws-smithy-http 0.60.6", + "aws-smithy-async 1.1.8", + "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", + "aws-smithy-types 1.1.8", "bytes 1.5.0", "fastrand 2.0.1", "h2", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "hyper-rustls 0.24.2", @@ -1262,14 +1278,14 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.1.7" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22389cb6f7cac64f266fb9f137745a9349ced7b47e0d2ba503e9e40ede4f7060" +checksum = "9acb931e0adaf5132de878f1398d83f8677f90ba70f01f65ff87f6d7244be1c5" dependencies = [ - "aws-smithy-async 1.1.7", - "aws-smithy-types 1.1.7", + "aws-smithy-async 1.1.8", + "aws-smithy-types 1.1.8", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "http 1.1.0", "pin-project-lite", "tokio 1.36.0", @@ -1292,15 +1308,15 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f081da5481210523d44ffd83d9f0740320050054006c719eae0232d411f024d3" +checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" dependencies = [ "base64-simd", "bytes 1.5.0", "bytes-utils", "futures-core", - "http 0.2.12", + "http 0.2.9", "http-body", "itoa", "num-integer", @@ -1324,9 +1340,9 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fccd8f595d0ca839f9f2548e66b99514a85f92feb4c01cf2868d93eb4888a42" +checksum = "872c68cf019c0e4afc5de7753c4f7288ce4b71663212771bf5e4542eb9346ca9" dependencies = [ "xmlparser", ] @@ -1342,22 +1358,22 @@ dependencies = [ "aws-smithy-client", "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", - "http 0.2.12", + "http 0.2.9", "rustc_version 0.4.0", "tracing", ] [[package]] name = "aws-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07c63521aa1ea9a9f92a701f1a08ce3fd20b46c6efc0d5c8947c1fd879e3df1" +checksum = "0dbf2f3da841a8930f159163175cf6a3d16ddde517c1b0fba7aa776822800f40" dependencies = [ - "aws-credential-types 1.1.7", - "aws-smithy-async 1.1.7", + "aws-credential-types 1.1.8", + "aws-smithy-async 1.1.8", "aws-smithy-runtime-api", - "aws-smithy-types 1.1.7", - "http 0.2.12", + "aws-smithy-types 1.1.8", + "http 0.2.9", "rustc_version 0.4.0", "tracing", ] @@ -1373,7 +1389,7 @@ dependencies = [ "bitflags 1.3.2", "bytes 1.5.0", "futures-util", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "itoa", @@ -1399,7 +1415,7 @@ dependencies = [ "async-trait", "bytes 1.5.0", "futures-util", - "http 0.2.12", + "http 0.2.9", "http-body", "mime", "rustversion", @@ -1417,7 +1433,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.2", + "miniz_oxide 0.7.1", "object", "rustc-demangle", ] @@ -1430,9 +1446,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64-simd" @@ -1584,7 +1600,7 @@ dependencies = [ "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "syn_derive", ] @@ -1693,9 +1709,9 @@ dependencies = [ [[package]] name = "bytestring" -version = "1.3.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" dependencies = [ "bytes 1.5.0", ] @@ -1768,9 +1784,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -1906,7 +1922,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1954,7 +1970,7 @@ dependencies = [ "fake", "futures 0.3.28", "hex", - "http 0.2.12", + "http 0.2.9", "masking", "md5", "nanoid", @@ -1968,6 +1984,7 @@ dependencies = [ "ring 0.16.20", "router_env", "rustc-hash", + "semver 1.0.22", "serde", "serde_json", "serde_urlencoded", @@ -1987,7 +2004,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", ] [[package]] @@ -2015,7 +2032,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "indexmap 2.2.5", + "indexmap 2.1.0", "serde", "serde_json", "toml 0.7.4", @@ -2089,9 +2106,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -2128,9 +2145,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] @@ -2173,11 +2190,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "crossbeam-utils 0.8.19", + "cfg-if 1.0.0", + "crossbeam-utils 0.8.16", ] [[package]] @@ -2199,7 +2217,7 @@ checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch 0.9.15", - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", ] [[package]] @@ -2225,7 +2243,7 @@ checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if 1.0.0", - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", "memoffset 0.9.0", "scopeguard", ] @@ -2248,7 +2266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", ] [[package]] @@ -2264,9 +2282,12 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] name = "crypto-common" @@ -2334,7 +2355,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2356,7 +2377,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2367,9 +2388,9 @@ checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", - "lock_api 0.4.11", + "lock_api 0.4.10", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.8", ] [[package]] @@ -2438,16 +2459,6 @@ dependencies = [ "rusticata-macros", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - [[package]] name = "derive_builder" version = "0.12.0" @@ -2534,7 +2545,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2564,7 +2575,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2621,7 +2632,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2771,7 +2782,7 @@ dependencies = [ "connector_configs", "currency_conversion", "euclid", - "getrandom 0.2.12", + "getrandom 0.2.11", "kgraph_utils", "once_cell", "ron-parser", @@ -2798,7 +2809,7 @@ dependencies = [ "aws-sdk-sesv2", "aws-sdk-sts 0.28.0", "aws-smithy-client", - "base64 0.21.7", + "base64 0.21.5", "common_utils", "dyn-clone", "error-stack", @@ -2835,7 +2846,7 @@ dependencies = [ "cookie 0.16.2", "futures-core", "futures-util", - "http 0.2.12", + "http 0.2.9", "hyper", "hyper-rustls 0.23.2", "mime", @@ -2870,12 +2881,12 @@ checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", - "miniz_oxide 0.7.2", + "miniz_oxide 0.7.1", ] [[package]] @@ -2910,9 +2921,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -2935,7 +2946,7 @@ dependencies = [ "rand 0.8.5", "redis-protocol", "semver 1.0.22", - "socket2 0.5.6", + "socket2 0.5.5", "tokio 1.36.0", "tokio-stream", "tokio-util", @@ -2970,7 +2981,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2982,7 +2993,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2994,7 +3005,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -3058,9 +3069,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -3074,7 +3085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" dependencies = [ "futures-core", - "lock_api 0.4.11", + "lock_api 0.4.10", "parking_lot 0.11.2", ] @@ -3107,7 +3118,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -3179,9 +3190,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3202,9 +3213,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git2" @@ -3260,8 +3271,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.12", - "indexmap 2.2.5", + "http 0.2.9", + "indexmap 2.1.0", "slab", "tokio 1.36.0", "tokio-util", @@ -3289,7 +3300,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.6", "allocator-api2", ] @@ -3308,10 +3319,10 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "bytes 1.5.0", "headers-core", - "http 0.2.12", + "http 0.2.9", "httpdate", "mime", "sha1", @@ -3323,7 +3334,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.12", + "http 0.2.9", ] [[package]] @@ -3337,9 +3348,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -3367,9 +3378,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes 1.5.0", "fnv", @@ -3394,7 +3405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "pin-project-lite", ] @@ -3408,7 +3419,7 @@ dependencies = [ "async-channel", "base64 0.13.1", "futures-lite", - "http 0.2.12", + "http 0.2.9", "infer 0.2.3", "pin-project-lite", "rand 0.7.3", @@ -3451,7 +3462,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.12", + "http 0.2.9", "http-body", "httparse", "httpdate", @@ -3473,7 +3484,7 @@ dependencies = [ "bytes 1.5.0", "futures 0.3.28", "headers", - "http 0.2.12", + "http 0.2.9", "hyper", "hyper-tls", "native-tls", @@ -3488,7 +3499,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "http 0.2.12", + "http 0.2.9", "hyper", "log", "rustls 0.20.9", @@ -3504,7 +3515,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.12", + "http 0.2.9", "hyper", "log", "rustls 0.21.10", @@ -3589,16 +3600,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "ignore" version = "0.4.20" @@ -3654,9 +3655,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3761,15 +3762,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -3781,7 +3782,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33a96c4f2128a6f44ecf7c36df2b03dddf5a07b060a4d5ebc0a81e9821f7c60e" dependencies = [ "anyhow", - "base64 0.21.7", + "base64 0.21.5", "flate2", "once_cell", "openssl", @@ -3803,9 +3804,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -3827,7 +3828,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "pem", "ring 0.16.20", "serde", @@ -3873,9 +3874,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libgit2-sys" @@ -3931,9 +3932,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "local-channel" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" +checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178" dependencies = [ "futures-core", "futures-sink", @@ -3942,9 +3943,9 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" +checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" [[package]] name = "lock_api" @@ -3957,9 +3958,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -3967,9 +3968,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru-cache" @@ -4074,9 +4075,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -4148,9 +4149,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -4176,9 +4177,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -4219,14 +4220,14 @@ dependencies = [ "async-trait", "crossbeam-channel", "crossbeam-epoch 0.9.15", - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", "futures-util", "once_cell", "parking_lot 0.12.1", "quanta", "rustc_version 0.4.0", "skeptic", - "smallvec 1.13.1", + "smallvec 1.11.1", "tagptr", "thiserror", "triomphe", @@ -4308,12 +4309,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.45" @@ -4389,9 +4384,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -4407,9 +4402,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "oncemutex" @@ -4444,11 +4439,11 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd2846759315751e04d8b45a0bdbd89ce442282ffb916cf54f6b0adf8df4b44c" dependencies = [ - "aws-credential-types 1.1.7", - "aws-sigv4 1.1.7", + "aws-credential-types 1.1.8", + "aws-sigv4 1.2.0", "aws-smithy-runtime-api", - "aws-types 1.1.7", - "base64 0.21.7", + "aws-types 1.1.8", + "base64 0.21.5", "bytes 1.5.0", "dyn-clone", "lazy_static", @@ -4485,7 +4480,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4525,7 +4520,7 @@ dependencies = [ "async-trait", "futures 0.3.28", "futures-util", - "http 0.2.12", + "http 0.2.9", "opentelemetry", "opentelemetry-proto", "prost", @@ -4631,7 +4626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", - "lock_api 0.4.11", + "lock_api 0.4.10", "parking_lot_core 0.8.6", ] @@ -4641,8 +4636,8 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.4.11", - "parking_lot_core 0.9.9", + "lock_api 0.4.10", + "parking_lot_core 0.9.8", ] [[package]] @@ -4670,20 +4665,20 @@ dependencies = [ "instant", "libc", "redox_syscall 0.2.16", - "smallvec 1.13.1", + "smallvec 1.11.1", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", - "smallvec 1.13.1", + "redox_syscall 0.3.5", + "smallvec 1.11.1", "windows-targets 0.48.5", ] @@ -4736,9 +4731,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -4771,7 +4766,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4846,22 +4841,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4878,9 +4873,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plotters" @@ -4920,7 +4915,7 @@ dependencies = [ "common_enums", "common_utils", "error-stack", - "http 0.2.12", + "http 0.2.9", "masking", "mime", "router_derive", @@ -4943,12 +4938,6 @@ dependencies = [ "miniz_oxide 0.3.7", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -5009,9 +4998,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -5106,7 +5095,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", "libc", "mach2", "once_cell", @@ -5227,7 +5216,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.11", ] [[package]] @@ -5274,7 +5263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ "crossbeam-deque 0.8.3", - "crossbeam-utils 0.8.19", + "crossbeam-utils 0.8.16", ] [[package]] @@ -5360,22 +5349,13 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.11", "redox_syscall 0.2.16", "thiserror", ] @@ -5388,7 +5368,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -5403,9 +5383,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -5464,13 +5444,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "async-compression", - "base64 0.21.7", + "base64 0.21.5", "bytes 1.5.0", "encoding_rs", "futures-core", "futures-util", "h2", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "hyper-rustls 0.24.2", @@ -5532,7 +5512,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.11", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5606,7 +5586,7 @@ dependencies = [ "async-bb8-diesel", "async-trait", "awc", - "base64 0.21.7", + "base64 0.21.5", "bb8", "bigdecimal", "blake3", @@ -5631,7 +5611,7 @@ dependencies = [ "external_services", "futures 0.3.28", "hex", - "http 0.2.12", + "http 0.2.9", "hyper", "hyperswitch_interfaces", "image", @@ -5697,13 +5677,13 @@ name = "router_derive" version = "0.1.0" dependencies = [ "diesel", - "indexmap 2.2.5", + "indexmap 2.1.0", "proc-macro2", "quote", "serde", "serde_json", "strum 0.24.1", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5816,7 +5796,7 @@ dependencies = [ "anyhow", "async-trait", "bytes 1.5.0", - "http 0.2.12", + "http 0.2.9", "reqwest", "rustify_derive", "serde", @@ -5896,7 +5876,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", ] [[package]] @@ -5937,9 +5917,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -6097,16 +6077,16 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -6161,7 +6141,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6191,11 +6171,11 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.5", + "indexmap 2.1.0", "serde", "serde_json", "serde_with_macros", @@ -6211,7 +6191,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6236,7 +6216,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6382,9 +6362,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -6398,12 +6378,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6481,7 +6461,7 @@ dependencies = [ "serde_json", "sha1", "sha2", - "smallvec 1.13.1", + "smallvec 1.11.1", "sqlformat", "sqlx-rt", "stringprep", @@ -6542,7 +6522,7 @@ dependencies = [ "dyn-clone", "error-stack", "futures 0.3.28", - "http 0.2.12", + "http 0.2.9", "masking", "mime", "moka", @@ -6624,7 +6604,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6646,9 +6626,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -6664,7 +6644,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6772,7 +6752,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6784,7 +6764,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "test-case-core", ] @@ -6793,7 +6773,7 @@ name = "test_utils" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.21.5", "clap", "masking", "rand 0.8.5", @@ -6821,7 +6801,7 @@ dependencies = [ "cookie 0.16.2", "fantoccini", "futures 0.3.28", - "http 0.2.12", + "http 0.2.9", "log", "parking_lot 0.12.1", "serde", @@ -6849,29 +6829,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -6890,14 +6870,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ - "deranged", "itoa", - "num-conv", - "powerfmt", "serde", "time-core", "time-macros", @@ -6905,17 +6882,16 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ - "num-conv", "time-core", ] @@ -6977,12 +6953,12 @@ dependencies = [ "backtrace", "bytes 1.5.0", "libc", - "mio 0.8.11", + "mio 0.8.10", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -7058,7 +7034,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7211,9 +7187,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes 1.5.0", "futures-core", @@ -7260,7 +7236,7 @@ version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -7273,7 +7249,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.1.0", "toml_datetime", "winnow", ] @@ -7292,7 +7268,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.12", + "http 0.2.9", "http-body", "hyper", "hyper-timeout", @@ -7388,7 +7364,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7414,23 +7390,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ + "lazy_static", "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", "tracing-core", ] @@ -7444,7 +7409,7 @@ dependencies = [ "opentelemetry", "tracing", "tracing-core", - "tracing-log 0.1.4", + "tracing-log", "tracing-subscriber", ] @@ -7460,9 +7425,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -7471,11 +7436,11 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.13.1", + "smallvec 1.11.1", "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-serde", ] @@ -7570,9 +7535,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -7582,9 +7547,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -7627,12 +7592,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] @@ -7655,7 +7620,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d82b1bc5417102a73e8464c686eef947bdfb99fcdfc0a4f228e81afa9526470a" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.1.0", "serde", "serde_json", "utoipa-gen", @@ -7670,7 +7635,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7680,7 +7645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "atomic", - "getrandom 0.2.12", + "getrandom 0.2.11", ] [[package]] @@ -7689,7 +7654,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" dependencies = [ - "idna 0.4.0", + "idna", "lazy_static", "regex", "serde", @@ -7713,7 +7678,7 @@ dependencies = [ "async-trait", "bytes 1.5.0", "derive_builder", - "http 0.2.12", + "http 0.2.9", "reqwest", "rustify", "rustify_derive", @@ -7809,9 +7774,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -7819,16 +7784,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -7846,9 +7811,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7856,22 +7821,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" @@ -7892,7 +7857,7 @@ dependencies = [ "base64 0.13.1", "bytes 1.5.0", "cookie 0.16.2", - "http 0.2.12", + "http 0.2.9", "log", "serde", "serde_derive", @@ -8154,7 +8119,7 @@ checksum = "bd7b0b5b253ebc0240d6aac6dd671c495c467420577bf634d3064ae7e6fa2b4c" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.21.7", + "base64 0.21.5", "deadpool", "futures 0.3.28", "futures-timer", @@ -8221,22 +8186,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -8247,28 +8212,30 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zstd" -version = "0.13.0" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.0.0" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ + "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", + "libc", "pkg-config", ] diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index fa96ea3475..b5a47a57a2 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -2307,7 +2307,7 @@ pub enum ThreeDsMethodData { /// Whether ThreeDS method data submission is required three_ds_method_data_submission: bool, /// ThreeDS method data - three_ds_method_data: String, + three_ds_method_data: Option, /// ThreeDS method url three_ds_method_url: Option, }, @@ -3637,40 +3637,12 @@ pub struct SdkInformation { pub sdk_max_timeout: u8, } -#[derive(Clone, Default, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq, ToSchema)] -pub enum TransactionStatus { - /// Authentication/ Account Verification Successful - #[serde(rename = "Y")] - Success, - /// Not Authenticated /Account Not Verified; Transaction denied - #[default] - #[serde(rename = "N")] - Failure, - /// Authentication/ Account Verification Could Not Be Performed; Technical or other problem, as indicated in Authentication Response(ARes) or Result Request (RReq) - #[serde(rename = "U")] - VerificationNotPerformed, - /// Attempts Processing Performed; Not Authenticated/Verified , but a proof of attempted authentication/verification is provided - #[serde(rename = "A")] - NotVerified, - /// Authentication/ Account Verification Rejected; Issuer is rejecting authentication/verification and request that authorisation not be attempted. - #[serde(rename = "R")] - Rejected, - /// Challenge Required; Additional authentication is required using the Challenge Request (CReq) / Challenge Response (CRes) - #[serde(rename = "C")] - ChallengeRequired, - /// Challenge Required; Decoupled Authentication confirmed. - #[serde(rename = "D")] - ChallengeRequiredDecoupledAuthentication, - /// Informational Only; 3DS Requestor challenge preference acknowledged. - #[serde(rename = "I")] - InformationOnly, -} - #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)] pub struct PaymentsExternalAuthenticationResponse { /// Indicates the trans status #[serde(rename = "trans_status")] - pub transaction_status: TransactionStatus, + #[schema(value_type = TransactionStatus)] + pub transaction_status: common_enums::TransactionStatus, /// Access Server URL to be used for challenge submission pub acs_url: Option, /// Challenge request which should be sent to acs_url diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 1b38907211..fd4f473c3f 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -2363,6 +2363,47 @@ pub enum RoleScope { Organization, } +#[derive( + Clone, + Default, + Debug, + serde::Serialize, + serde::Deserialize, + Eq, + PartialEq, + ToSchema, + strum::Display, + strum::EnumString, +)] +#[router_derive::diesel_enum(storage_type = "text")] +pub enum TransactionStatus { + /// Authentication/ Account Verification Successful + #[serde(rename = "Y")] + Success, + /// Not Authenticated /Account Not Verified; Transaction denied + #[default] + #[serde(rename = "N")] + Failure, + /// Authentication/ Account Verification Could Not Be Performed; Technical or other problem, as indicated in Authentication Response(ARes) or Result Request (RReq) + #[serde(rename = "U")] + VerificationNotPerformed, + /// Attempts Processing Performed; Not Authenticated/Verified , but a proof of attempted authentication/verification is provided + #[serde(rename = "A")] + NotVerified, + /// Authentication/ Account Verification Rejected; Issuer is rejecting authentication/verification and request that authorisation not be attempted. + #[serde(rename = "R")] + Rejected, + /// Challenge Required; Additional authentication is required using the Challenge Request (CReq) / Challenge Response (CRes) + #[serde(rename = "C")] + ChallengeRequired, + /// Challenge Required; Decoupled Authentication confirmed. + #[serde(rename = "D")] + ChallengeRequiredDecoupledAuthentication, + /// Informational Only; 3DS Requestor challenge preference acknowledged. + #[serde(rename = "I")] + InformationOnly, +} + #[derive( Clone, Copy, diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml index 6aca12cef0..e8b3b726ce 100644 --- a/crates/common_utils/Cargo.toml +++ b/crates/common_utils/Cargo.toml @@ -38,6 +38,7 @@ strum = { version = "0.24.1", features = ["derive"] } thiserror = "1.0.40" time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"], optional = true } +semver = { version = "1.0.22", features = ["serde"] } uuid = { version = "1.7.0", features = ["v7"] } # First party crates diff --git a/crates/common_utils/src/types.rs b/crates/common_utils/src/types.rs index cf94f2fe26..7dfadd54a8 100644 --- a/crates/common_utils/src/types.rs +++ b/crates/common_utils/src/types.rs @@ -1,12 +1,21 @@ //! Types that can be used in other crates +use std::{fmt::Display, str::FromStr}; + +use diesel::{ + backend::Backend, + deserialize::FromSql, + serialize::{Output, ToSql}, + sql_types::Jsonb, + AsExpression, FromSqlRow, +}; use error_stack::{IntoReport, ResultExt}; +use semver::Version; use serde::{de::Visitor, Deserialize, Deserializer}; use crate::{ consts, - errors::{CustomResult, PercentageError}, + errors::{CustomResult, ParsingError, PercentageError}, }; - /// Represents Percentage Value between 0 and 100 both inclusive #[derive(Clone, Default, Debug, PartialEq, serde::Serialize)] pub struct Percentage { @@ -149,3 +158,56 @@ pub enum Surcharge { /// Surcharge percentage Rate(Percentage<{ consts::SURCHARGE_PERCENTAGE_PRECISION_LENGTH }>), } + +/// This struct lets us represent a semantic version type +#[derive(Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression)] +#[diesel(sql_type = Jsonb)] +#[derive(serde::Serialize, serde::Deserialize)] +pub struct SemanticVersion(#[serde(with = "Version")] Version); + +impl SemanticVersion { + /// returns major version number + pub fn get_major(&self) -> u64 { + self.0.major + } +} + +impl Display for SemanticVersion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } +} + +impl FromStr for SemanticVersion { + type Err = error_stack::Report; + + fn from_str(s: &str) -> Result { + Ok(Self(Version::from_str(s).into_report().change_context( + ParsingError::StructParseFailure("SemanticVersion"), + )?)) + } +} + +impl FromSql for SemanticVersion +where + serde_json::Value: FromSql, +{ + fn from_sql(bytes: DB::RawValue<'_>) -> diesel::deserialize::Result { + let value = >::from_sql(bytes)?; + Ok(serde_json::from_value(value)?) + } +} + +impl ToSql for SemanticVersion +where + serde_json::Value: ToSql, +{ + fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::pg::Pg>) -> diesel::serialize::Result { + let value = serde_json::to_value(self)?; + + // the function `reborrow` only works in case of `Pg` backend. But, in case of other backends + // please refer to the diesel migration blog: + // https://github.com/Diesel-rs/Diesel/blob/master/guide_drafts/migration_guide.md#changed-tosql-implementations + >::to_sql(&value, &mut out.reborrow()) + } +} diff --git a/crates/diesel_models/src/authentication.rs b/crates/diesel_models/src/authentication.rs index f9380cf398..cc675a06ac 100644 --- a/crates/diesel_models/src/authentication.rs +++ b/crates/diesel_models/src/authentication.rs @@ -23,6 +23,31 @@ pub struct Authentication { pub error_message: Option, pub error_code: Option, pub connector_metadata: Option, + pub maximum_supported_version: Option, + pub threeds_server_transaction_id: Option, + pub cavv: Option, + pub authentication_flow_type: Option, + pub message_version: Option, + pub eci: Option, + pub trans_status: Option, + pub acquirer_bin: Option, + pub acquirer_merchant_id: Option, + pub three_ds_method_data: Option, + pub three_ds_method_url: Option, + pub acs_url: Option, + pub challenge_request: Option, + pub acs_reference_number: Option, + pub acs_trans_id: Option, + pub three_ds_server_trans_id: Option, + pub acs_signed_content: Option, +} + +impl Authentication { + pub fn is_separate_authn_required(&self) -> bool { + self.maximum_supported_version + .as_ref() + .is_some_and(|version| version.get_major() == 2) + } } #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Insertable)] @@ -32,7 +57,7 @@ pub struct AuthenticationNew { pub merchant_id: String, pub authentication_connector: String, pub connector_authentication_id: Option, - pub authentication_data: Option, + // pub authentication_data: Option, pub payment_method_id: String, pub authentication_type: Option, pub authentication_status: common_enums::AuthenticationStatus, @@ -40,21 +65,56 @@ pub struct AuthenticationNew { pub error_message: Option, pub error_code: Option, pub connector_metadata: Option, + pub maximum_supported_version: Option, + pub threeds_server_transaction_id: Option, + pub cavv: Option, + pub authentication_flow_type: Option, + pub message_version: Option, + pub eci: Option, + pub trans_status: Option, + pub acquirer_bin: Option, + pub acquirer_merchant_id: Option, + pub three_ds_method_data: Option, + pub three_ds_method_url: Option, + pub acs_url: Option, + pub challenge_request: Option, + pub acs_reference_number: Option, + pub acs_trans_id: Option, + pub three_dsserver_trans_id: Option, + pub acs_signed_content: Option, } #[derive(Debug)] pub enum AuthenticationUpdate { - AuthenticationDataUpdate { - authentication_data: Option, - connector_authentication_id: Option, - payment_method_id: Option, - authentication_type: Option, - authentication_status: Option, - authentication_lifecycle_status: Option, + PreAuthenticationUpdate { + threeds_server_transaction_id: String, + maximum_supported_3ds_version: common_utils::types::SemanticVersion, + connector_authentication_id: String, + three_ds_method_data: String, + three_ds_method_url: Option, + message_version: common_utils::types::SemanticVersion, connector_metadata: Option, + authentication_status: common_enums::AuthenticationStatus, + payment_method_id: Option, + acquirer_bin: Option, + acquirer_merchant_id: Option, }, - PostAuthorizationUpdate { - authentication_lifecycle_status: common_enums::AuthenticationLifecycleStatus, + AuthenticationUpdate { + authentication_value: Option, + trans_status: common_enums::TransactionStatus, + authentication_type: common_enums::DecoupledAuthenticationType, + acs_url: Option, + challenge_request: Option, + acs_reference_number: Option, + acs_trans_id: Option, + acs_signed_content: Option, + authentication_status: common_enums::AuthenticationStatus, + }, + PostAuthenticationUpdate { + trans_status: common_enums::TransactionStatus, + authentication_value: Option, + eci: Option, + authentication_status: common_enums::AuthenticationStatus, }, ErrorUpdate { error_message: Option, @@ -62,13 +122,16 @@ pub enum AuthenticationUpdate { authentication_status: common_enums::AuthenticationStatus, connector_authentication_id: Option, }, + PostAuthorizationUpdate { + authentication_lifecycle_status: common_enums::AuthenticationLifecycleStatus, + }, } #[derive(Clone, Debug, Eq, PartialEq, AsChangeset, Serialize, Deserialize)] #[diesel(table_name = authentication)] pub struct AuthenticationUpdateInternal { pub connector_authentication_id: Option, - pub authentication_data: Option, + // pub authentication_data: Option, pub payment_method_id: Option, pub authentication_type: Option, pub authentication_status: Option, @@ -77,13 +140,62 @@ pub struct AuthenticationUpdateInternal { pub error_message: Option, pub error_code: Option, pub connector_metadata: Option, + pub maximum_supported_version: Option, + pub threeds_server_transaction_id: Option, + pub cavv: Option, + pub authentication_flow_type: Option, + pub message_version: Option, + pub eci: Option, + pub trans_status: Option, + pub acquirer_bin: Option, + pub acquirer_merchant_id: Option, + pub three_ds_method_data: Option, + pub three_ds_method_url: Option, + pub acs_url: Option, + pub challenge_request: Option, + pub acs_reference_number: Option, + pub acs_trans_id: Option, + pub three_dsserver_trans_id: Option, + pub acs_signed_content: Option, +} + +impl Default for AuthenticationUpdateInternal { + fn default() -> Self { + Self { + connector_authentication_id: Default::default(), + payment_method_id: Default::default(), + authentication_type: Default::default(), + authentication_status: Default::default(), + authentication_lifecycle_status: Default::default(), + modified_at: common_utils::date_time::now(), + error_message: Default::default(), + error_code: Default::default(), + connector_metadata: Default::default(), + maximum_supported_version: Default::default(), + threeds_server_transaction_id: Default::default(), + cavv: Default::default(), + authentication_flow_type: Default::default(), + message_version: Default::default(), + eci: Default::default(), + trans_status: Default::default(), + acquirer_bin: Default::default(), + acquirer_merchant_id: Default::default(), + three_ds_method_data: Default::default(), + three_ds_method_url: Default::default(), + acs_url: Default::default(), + challenge_request: Default::default(), + acs_reference_number: Default::default(), + acs_trans_id: Default::default(), + three_dsserver_trans_id: Default::default(), + acs_signed_content: Default::default(), + } + } } impl AuthenticationUpdateInternal { pub fn apply_changeset(self, source: Authentication) -> Authentication { let Self { connector_authentication_id, - authentication_data, payment_method_id, authentication_type, authentication_status, @@ -92,11 +204,27 @@ impl AuthenticationUpdateInternal { error_code, error_message, connector_metadata, + maximum_supported_version, + threeds_server_transaction_id, + cavv, + authentication_flow_type, + message_version, + eci, + trans_status, + acquirer_bin, + acquirer_merchant_id, + three_ds_method_data, + three_ds_method_url, + acs_url, + challenge_request, + acs_reference_number, + acs_trans_id, + three_dsserver_trans_id, + acs_signed_content, } = self; Authentication { connector_authentication_id: connector_authentication_id .or(source.connector_authentication_id), - authentication_data: authentication_data.or(source.authentication_data), payment_method_id: payment_method_id.unwrap_or(source.payment_method_id), authentication_type: authentication_type.or(source.authentication_type), authentication_status: authentication_status.unwrap_or(source.authentication_status), @@ -106,6 +234,25 @@ impl AuthenticationUpdateInternal { error_code: error_code.or(source.error_code), error_message: error_message.or(source.error_message), connector_metadata: connector_metadata.or(source.connector_metadata), + maximum_supported_version: maximum_supported_version + .or(source.maximum_supported_version), + threeds_server_transaction_id: threeds_server_transaction_id + .or(source.threeds_server_transaction_id), + cavv: cavv.or(source.cavv), + authentication_flow_type: authentication_flow_type.or(source.authentication_flow_type), + message_version: message_version.or(source.message_version), + eci: eci.or(source.eci), + trans_status: trans_status.or(source.trans_status), + acquirer_bin: acquirer_bin.or(source.acquirer_bin), + acquirer_merchant_id: acquirer_merchant_id.or(source.acquirer_merchant_id), + three_ds_method_data: three_ds_method_data.or(source.three_ds_method_data), + three_ds_method_url: three_ds_method_url.or(source.three_ds_method_url), + acs_url: acs_url.or(source.acs_url), + challenge_request: challenge_request.or(source.challenge_request), + acs_reference_number: acs_reference_number.or(source.acs_reference_number), + acs_trans_id: acs_trans_id.or(source.acs_trans_id), + three_ds_server_trans_id: three_dsserver_trans_id.or(source.three_ds_server_trans_id), + acs_signed_content: acs_signed_content.or(source.acs_signed_content), ..source } } @@ -114,26 +261,6 @@ impl AuthenticationUpdateInternal { impl From for AuthenticationUpdateInternal { fn from(auth_update: AuthenticationUpdate) -> Self { match auth_update { - AuthenticationUpdate::AuthenticationDataUpdate { - authentication_data, - connector_authentication_id, - authentication_type, - authentication_status, - payment_method_id, - authentication_lifecycle_status, - connector_metadata, - } => Self { - authentication_data, - connector_authentication_id, - authentication_type, - authentication_status, - authentication_lifecycle_status, - modified_at: common_utils::date_time::now(), - payment_method_id, - error_message: None, - error_code: None, - connector_metadata, - }, AuthenticationUpdate::ErrorUpdate { error_message, error_code, @@ -143,19 +270,20 @@ impl From for AuthenticationUpdateInternal { error_code, error_message, authentication_status: Some(authentication_status), - authentication_data: None, + connector_authentication_id, authentication_type: None, authentication_lifecycle_status: None, modified_at: common_utils::date_time::now(), payment_method_id: None, connector_metadata: None, + ..Default::default() }, AuthenticationUpdate::PostAuthorizationUpdate { authentication_lifecycle_status, } => Self { connector_authentication_id: None, - authentication_data: None, + payment_method_id: None, authentication_type: None, authentication_status: None, @@ -164,6 +292,67 @@ impl From for AuthenticationUpdateInternal { error_message: None, error_code: None, connector_metadata: None, + ..Default::default() + }, + AuthenticationUpdate::PreAuthenticationUpdate { + threeds_server_transaction_id, + maximum_supported_3ds_version, + connector_authentication_id, + three_ds_method_data, + three_ds_method_url, + message_version, + connector_metadata, + authentication_status, + payment_method_id, + acquirer_bin, + acquirer_merchant_id, + } => Self { + threeds_server_transaction_id: Some(threeds_server_transaction_id), + maximum_supported_version: Some(maximum_supported_3ds_version), + connector_authentication_id: Some(connector_authentication_id), + three_ds_method_data: Some(three_ds_method_data), + three_ds_method_url, + message_version: Some(message_version), + connector_metadata, + authentication_status: Some(authentication_status), + payment_method_id, + acquirer_bin, + acquirer_merchant_id, + ..Default::default() + }, + AuthenticationUpdate::AuthenticationUpdate { + authentication_value, + trans_status, + authentication_type, + acs_url, + challenge_request, + acs_reference_number, + acs_trans_id, + acs_signed_content, + authentication_status, + } => Self { + cavv: authentication_value, + trans_status: Some(trans_status), + authentication_type: Some(authentication_type), + acs_url, + challenge_request, + acs_reference_number, + acs_trans_id, + acs_signed_content, + authentication_status: Some(authentication_status), + ..Default::default() + }, + AuthenticationUpdate::PostAuthenticationUpdate { + trans_status, + authentication_value, + eci, + authentication_status, + } => Self { + trans_status: Some(trans_status), + cavv: authentication_value, + eci, + authentication_status: Some(authentication_status), + ..Default::default() }, } } diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index dcae7e6d86..9f794b1ae3 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -87,6 +87,30 @@ diesel::table! { #[max_length = 64] error_code -> Nullable, connector_metadata -> Nullable, + maximum_supported_version -> Nullable, + #[max_length = 64] + threeds_server_transaction_id -> Nullable, + #[max_length = 64] + cavv -> Nullable, + #[max_length = 64] + authentication_flow_type -> Nullable, + message_version -> Nullable, + #[max_length = 64] + eci -> Nullable, + #[max_length = 64] + trans_status -> Nullable, + #[max_length = 64] + acquirer_bin -> Nullable, + #[max_length = 64] + acquirer_merchant_id -> Nullable, + three_ds_method_data -> Nullable, + three_ds_method_url -> Nullable, + acs_url -> Nullable, + challenge_request -> Nullable, + acs_reference_number -> Nullable, + acs_trans_id -> Nullable, + three_dsserver_trans_id -> Nullable, + acs_signed_content -> Nullable, } } diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs index 77035b536b..a341493f98 100644 --- a/crates/openapi/src/openapi.rs +++ b/crates/openapi/src/openapi.rs @@ -384,7 +384,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::SdkInformation, api_models::payments::DeviceChannel, api_models::payments::ThreeDsCompletionIndicator, - api_models::payments::TransactionStatus, + api_models::enums::TransactionStatus, api_models::payments::BrowserInformation, api_models::payments::PaymentCreatePaymentLinkConfig, api_models::payments::ThreeDsData, diff --git a/crates/router/src/connector/checkout/transformers.rs b/crates/router/src/connector/checkout/transformers.rs index 5acf2324f2..01ce57d10e 100644 --- a/crates/router/src/connector/checkout/transformers.rs +++ b/crates/router/src/connector/checkout/transformers.rs @@ -391,8 +391,8 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme enums::AuthenticationType::ThreeDs => CheckoutThreeDS { enabled: true, force_3ds: true, - eci: authentication_data.and_then(|auth| auth.eci.clone()), - cryptogram: authentication_data.and_then(|auth| auth.cavv.clone()), + eci: authentication_data.map(|auth| auth.eci.clone()), + cryptogram: authentication_data.map(|auth| auth.cavv.clone()), xid: authentication_data.map(|auth| auth.threeds_server_transaction_id.clone()), version: authentication_data.map(|auth| auth.message_version.clone()), }, diff --git a/crates/router/src/connector/threedsecureio.rs b/crates/router/src/connector/threedsecureio.rs index 71c23ab732..818f2ebcec 100644 --- a/crates/router/src/connector/threedsecureio.rs +++ b/crates/router/src/connector/threedsecureio.rs @@ -457,11 +457,7 @@ impl _connectors: &settings::Connectors, ) -> CustomResult { let req_obj = threedsecureio::ThreedsecureioPostAuthenticationRequest { - three_ds_server_trans_id: req - .request - .authentication_data - .threeds_server_transaction_id - .clone(), + three_ds_server_trans_id: req.request.threeds_server_transaction_id.clone(), }; Ok(RequestContent::Json(Box::new(req_obj))) } diff --git a/crates/router/src/connector/threedsecureio/transformers.rs b/crates/router/src/connector/threedsecureio/transformers.rs index b61196ab9d..42a453f5ce 100644 --- a/crates/router/src/connector/threedsecureio/transformers.rs +++ b/crates/router/src/connector/threedsecureio/transformers.rs @@ -1,7 +1,9 @@ +use std::str::FromStr; + use api_models::payments::{DeviceChannel, ThreeDsCompletionIndicator}; use base64::Engine; use common_utils::date_time; -use error_stack::{report, IntoReport, ResultExt}; +use error_stack::{IntoReport, ResultExt}; use iso_currency::Currency; use isocountry; use masking::{ExposeInterface, Secret}; @@ -16,7 +18,6 @@ use crate::{ self, api::{self, MessageCategory}, authentication::ChallengeParams, - transformers::ForeignTryFrom, }, utils::OptionExt, }; @@ -100,13 +101,18 @@ impl threeds_server_transaction_id: pre_authn_response .threeds_server_trans_id .clone(), - maximum_supported_3ds_version: ForeignTryFrom::foreign_try_from( - pre_authn_response.acs_end_protocol_version.clone(), - )?, + maximum_supported_3ds_version: + common_utils::types::SemanticVersion::from_str( + &pre_authn_response.acs_end_protocol_version, + ) + .change_context(errors::ConnectorError::ParsingFailed)?, connector_authentication_id: pre_authn_response.threeds_server_trans_id, three_ds_method_data: three_ds_method_data_base64, three_ds_method_url: pre_authn_response.threeds_method_url, - message_version: pre_authn_response.acs_end_protocol_version.clone(), + message_version: common_utils::types::SemanticVersion::from_str( + &pre_authn_response.acs_end_protocol_version, + ) + .change_context(errors::ConnectorError::ParsingFailed)?, connector_metadata: Some(connector_metadata), }, ) @@ -307,7 +313,7 @@ impl TryFrom<&ThreedsecureioRouterData<&types::authentication::ConnectorAuthenti .parse_value("ThreeDSecureIoMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; - let authentication_data = &request.authentication_data.0; + let pre_authentication_data = &request.pre_authentication_data; let sdk_information = match request.device_channel { DeviceChannel::App => Some(item.router_data.request.sdk_information.clone().ok_or( errors::ConnectorError::MissingRequiredField { @@ -316,21 +322,24 @@ impl TryFrom<&ThreedsecureioRouterData<&types::authentication::ConnectorAuthenti )?), DeviceChannel::Browser => None, }; - let acquirer_details = authentication_data - .acquirer_details + let (acquirer_bin, acquirer_merchant_id) = pre_authentication_data + .acquirer_bin .clone() + .zip(pre_authentication_data.acquirer_merchant_id.clone()) .get_required_value("acquirer_details") .change_context(errors::ConnectorError::MissingRequiredField { field_name: "acquirer_details", })?; let meta: ThreeDSecureIoConnectorMetaData = - to_connector_meta(request.authentication_data.1.connector_metadata.clone())?; + to_connector_meta(request.pre_authentication_data.connector_metadata.clone())?; Ok(Self { ds_start_protocol_version: meta.ds_start_protocol_version.clone(), ds_end_protocol_version: meta.ds_end_protocol_version.clone(), acs_start_protocol_version: meta.acs_start_protocol_version.clone(), acs_end_protocol_version: meta.acs_end_protocol_version.clone(), - three_dsserver_trans_id: authentication_data.threeds_server_transaction_id.clone(), + three_dsserver_trans_id: pre_authentication_data + .threeds_server_transaction_id + .clone(), acct_number: card_details.card_number.clone(), notification_url: request .return_url @@ -342,8 +351,8 @@ impl TryFrom<&ThreedsecureioRouterData<&types::authentication::ConnectorAuthenti request.threeds_method_comp_ind.clone(), ), three_dsrequestor_url: request.three_ds_requestor_url.clone(), - acquirer_bin: acquirer_details.acquirer_bin, - acquirer_merchant_id: acquirer_details.acquirer_merchant_id, + acquirer_bin, + acquirer_merchant_id, card_expiry_date: card_details.get_expiry_date_as_yymm()?.expose(), bill_addr_city: billing_address .city @@ -410,7 +419,7 @@ impl TryFrom<&ThreedsecureioRouterData<&types::authentication::ConnectorAuthenti merchant_country_code: connector_meta_data.merchant_country_code, merchant_name: connector_meta_data.merchant_name, message_type: "AReq".to_string(), - message_version: authentication_data.message_version.clone(), + message_version: pre_authentication_data.message_version.clone(), purchase_amount: item.amount.clone(), purchase_currency: purchase_currency.numeric().to_string(), trans_type: "01".to_string(), @@ -644,7 +653,7 @@ impl From for ThreeDSecureIoThreeDsCompletionIndicat } } -impl From for api_models::payments::TransactionStatus { +impl From for common_enums::TransactionStatus { fn from(value: ThreedsecureioTransStatus) -> Self { match value { ThreedsecureioTransStatus::Y => Self::Success, @@ -707,41 +716,3 @@ impl TryFrom<&ThreedsecureioRouterData<&types::authentication::PreAuthNRouterDat }) } } - -impl ForeignTryFrom for (i64, i64, i64) { - type Error = error_stack::Report; - fn foreign_try_from(value: String) -> Result { - let mut split_version = value.split('.'); - let version_string = { - let major_version = split_version.next().ok_or(report!( - errors::ConnectorError::ResponseDeserializationFailed - ))?; - let minor_version = split_version.next().ok_or(report!( - errors::ConnectorError::ResponseDeserializationFailed - ))?; - let patch_version = split_version.next().ok_or(report!( - errors::ConnectorError::ResponseDeserializationFailed - ))?; - (major_version, minor_version, patch_version) - }; - let int_representation = { - let major_version = version_string - .0 - .parse() - .into_report() - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - let minor_version = version_string - .1 - .parse() - .into_report() - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - let patch_version = version_string - .2 - .parse() - .into_report() - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - (major_version, minor_version, patch_version) - }; - Ok(int_representation) - } -} diff --git a/crates/router/src/core/authentication.rs b/crates/router/src/core/authentication.rs index c7ce64c54b..fa77ac1b5d 100644 --- a/crates/router/src/core/authentication.rs +++ b/crates/router/src/core/authentication.rs @@ -32,7 +32,7 @@ pub async fn perform_authentication( currency: Option, message_category: api::authentication::MessageCategory, device_channel: payments::DeviceChannel, - authentication_data: (types::AuthenticationData, storage::Authentication), + authentication_data: storage::Authentication, return_url: Option, sdk_information: Option, threeds_method_comp_ind: api_models::payments::ThreeDsCompletionIndicator, @@ -59,8 +59,7 @@ pub async fn perform_authentication( )?; let response = utils::do_auth_connector_call(state, authentication_connector.clone(), router_data).await?; - let (_authentication, _authentication_data) = - utils::update_trackers(state, response.clone(), authentication_data.1, None, None).await?; + utils::update_trackers(state, response.clone(), authentication_data, None, None).await?; let authentication_response = response .response @@ -115,42 +114,37 @@ pub async fn perform_post_authentication( match authentication_flow_input { types::PostAuthenthenticationFlowInput::PaymentAuthNFlow { payment_data, - authentication_data: (authentication, authentication_data), + authentication, should_continue_confirm_transaction, } => { // let (auth, authentication_data) = authentication; - let updated_authentication = + let authentication_status = if !authentication.authentication_status.is_terminal_status() { let router_data = transformers::construct_post_authentication_router_data( authentication_connector.clone(), business_profile, merchant_connector_account, - authentication_data, + &authentication, )?; let router_data = utils::do_auth_connector_call(state, authentication_connector, router_data) .await?; - let (updated_authentication, updated_authentication_data) = - utils::update_trackers( - state, - router_data, - authentication, - payment_data.token.clone(), - None, - ) - .await?; - payment_data.authentication = Some(( - updated_authentication.clone(), - updated_authentication_data.unwrap_or_default(), - )); - updated_authentication + let updated_authentication = utils::update_trackers( + state, + router_data, + authentication, + payment_data.token.clone(), + None, + ) + .await?; + let authentication_status = updated_authentication.authentication_status; + payment_data.authentication = Some(updated_authentication); + authentication_status } else { - authentication + authentication.authentication_status }; //If authentication is not successful, skip the payment connector flows and mark the payment as failure - if !(updated_authentication.authentication_status - == api_models::enums::AuthenticationStatus::Success) - { + if !(authentication_status == api_models::enums::AuthenticationStatus::Success) { *should_continue_confirm_transaction = false; } } @@ -198,7 +192,7 @@ pub async fn perform_pre_authentication( .parse_value("AcquirerDetails") .change_context(ApiErrorResponse::PreconditionFailed { message: "acquirer_bin and acquirer_merchant_id not found in Payment Connector's Metadata".to_string()})?; - let (authentication, authentication_data) = utils::update_trackers( + let authentication = utils::update_trackers( state, router_data, authentication, @@ -206,15 +200,12 @@ pub async fn perform_pre_authentication( Some(acquirer_details), ) .await?; - if authentication_data - .as_ref() - .is_some_and(|authentication_data| authentication_data.is_separate_authn_required()) + if authentication.is_separate_authn_required() || authentication.authentication_status.is_failed() { *should_continue_confirm_transaction = false; } - payment_data.authentication = - Some((authentication, authentication_data.unwrap_or_default())); + payment_data.authentication = Some(authentication); } types::PreAuthenthenticationFlowInput::PaymentMethodAuthNFlow { card_number: _, diff --git a/crates/router/src/core/authentication/transformers.rs b/crates/router/src/core/authentication/transformers.rs index 870a356b19..f098c85326 100644 --- a/crates/router/src/core/authentication/transformers.rs +++ b/crates/router/src/core/authentication/transformers.rs @@ -10,7 +10,10 @@ use crate::{ errors::{self, RouterResult}, payments::helpers as payments_helpers, }, - types::{self, storage, transformers::ForeignFrom}, + types::{ + self, storage, + transformers::{ForeignFrom, ForeignTryFrom}, + }, utils::ext_traits::OptionExt, }; @@ -35,7 +38,7 @@ pub fn construct_authentication_router_data( device_channel: payments::DeviceChannel, business_profile: storage::BusinessProfile, merchant_connector_account: payments_helpers::MerchantConnectorAccountType, - authentication_data: (super::types::AuthenticationData, storage::Authentication), + authentication_data: storage::Authentication, return_url: Option, sdk_information: Option, threeds_method_comp_ind: api_models::payments::ThreeDsCompletionIndicator, @@ -61,7 +64,9 @@ pub fn construct_authentication_router_data( currency, message_category, device_channel, - authentication_data, + pre_authentication_data: super::types::PreAuthenticationData::foreign_try_from( + &authentication_data, + )?, return_url, sdk_information, email, @@ -82,10 +87,15 @@ pub fn construct_post_authentication_router_data( authentication_connector: String, business_profile: storage::BusinessProfile, merchant_connector_account: payments_helpers::MerchantConnectorAccountType, - authentication_data: super::types::AuthenticationData, + authentication_data: &storage::Authentication, ) -> RouterResult { + let threeds_server_transaction_id = authentication_data + .threeds_server_transaction_id + .clone() + .get_required_value("threeds_server_transaction_id") + .change_context(errors::ApiErrorResponse::InternalServerError)?; let router_request = types::authentication::ConnectorPostAuthenticationRequestData { - authentication_data, + threeds_server_transaction_id, }; construct_router_data( authentication_connector, @@ -174,17 +184,17 @@ pub fn construct_router_data( }) } -impl ForeignFrom for common_enums::AuthenticationStatus { - fn foreign_from(trans_status: payments::TransactionStatus) -> Self { +impl ForeignFrom for common_enums::AuthenticationStatus { + fn foreign_from(trans_status: common_enums::TransactionStatus) -> Self { match trans_status { - api_models::payments::TransactionStatus::Success => Self::Success, - api_models::payments::TransactionStatus::Failure - | api_models::payments::TransactionStatus::Rejected - | api_models::payments::TransactionStatus::VerificationNotPerformed - | api_models::payments::TransactionStatus::NotVerified => Self::Failed, - api_models::payments::TransactionStatus::ChallengeRequired - | api_models::payments::TransactionStatus::ChallengeRequiredDecoupledAuthentication - | api_models::payments::TransactionStatus::InformationOnly => Self::Pending, + common_enums::TransactionStatus::Success => Self::Success, + common_enums::TransactionStatus::Failure + | common_enums::TransactionStatus::Rejected + | common_enums::TransactionStatus::VerificationNotPerformed + | common_enums::TransactionStatus::NotVerified => Self::Failed, + common_enums::TransactionStatus::ChallengeRequired + | common_enums::TransactionStatus::ChallengeRequiredDecoupledAuthentication + | common_enums::TransactionStatus::InformationOnly => Self::Pending, } } } diff --git a/crates/router/src/core/authentication/types.rs b/crates/router/src/core/authentication/types.rs index b7c61c14d4..6035d8fa37 100644 --- a/crates/router/src/core/authentication/types.rs +++ b/crates/router/src/core/authentication/types.rs @@ -1,9 +1,11 @@ use cards::CardNumber; +use error_stack::{Report, ResultExt}; use serde::{Deserialize, Serialize}; use crate::{ - core::payments, - types::{authentication::AuthNFlowType, storage}, + core::{errors, payments}, + types::{storage, transformers::ForeignTryFrom}, + utils::OptionExt, }; pub enum PreAuthenthenticationFlowInput<'a, F: Clone> { PaymentAuthNFlow { @@ -20,7 +22,7 @@ pub enum PreAuthenthenticationFlowInput<'a, F: Clone> { pub enum PostAuthenthenticationFlowInput<'a, F: Clone> { PaymentAuthNFlow { payment_data: &'a mut payments::PaymentData, - authentication_data: (storage::Authentication, AuthenticationData), + authentication: storage::Authentication, should_continue_confirm_transaction: &'a mut bool, }, PaymentMethodAuthNFlow { @@ -28,22 +30,36 @@ pub enum PostAuthenthenticationFlowInput<'a, F: Clone> { }, } -#[derive(Clone, Default, Debug, Serialize, Deserialize)] -pub struct AuthenticationData { - pub maximum_supported_version: (i64, i64, i64), +#[derive(Clone, Debug)] +pub struct PreAuthenticationData { pub threeds_server_transaction_id: String, - pub cavv: Option, - pub authn_flow_type: Option, - pub three_ds_method_data: ThreeDsMethodData, pub message_version: String, - pub eci: Option, - pub trans_status: api_models::payments::TransactionStatus, - pub acquirer_details: Option, + pub acquirer_bin: Option, + pub acquirer_merchant_id: Option, + pub connector_metadata: Option, } -impl AuthenticationData { - pub fn is_separate_authn_required(&self) -> bool { - self.maximum_supported_version.0 == 2 +impl ForeignTryFrom<&storage::Authentication> for PreAuthenticationData { + type Error = Report; + + fn foreign_try_from(authentication: &storage::Authentication) -> Result { + let error_message = errors::ApiErrorResponse::UnprocessableEntity { message: "Pre Authentication must be completed successfully before Authentication can be performed".to_string() }; + let threeds_server_transaction_id = authentication + .threeds_server_transaction_id + .clone() + .get_required_value("threeds_server_transaction_id") + .change_context(error_message)?; + let message_version = authentication + .message_version + .as_ref() + .get_required_value("message_version")?; + Ok(Self { + threeds_server_transaction_id, + message_version: message_version.to_string(), + acquirer_bin: authentication.acquirer_bin.clone(), + acquirer_merchant_id: authentication.acquirer_merchant_id.clone(), + connector_metadata: authentication.connector_metadata.clone(), + }) } } diff --git a/crates/router/src/core/authentication/utils.rs b/crates/router/src/core/authentication/utils.rs index a2138ff1c0..8d6efc4d68 100644 --- a/crates/router/src/core/authentication/utils.rs +++ b/crates/router/src/core/authentication/utils.rs @@ -1,12 +1,9 @@ -use common_enums::DecoupledAuthenticationType; -use common_utils::ext_traits::{Encode, ValueExt}; use error_stack::ResultExt; -use super::types::{AuthenticationData, ThreeDsMethodData}; use crate::{ consts, core::{ - errors::{ApiErrorResponse, ConnectorErrorExt, StorageErrorExt}, + errors::{self, ConnectorErrorExt, StorageErrorExt}, payments, }, errors::RouterResult, @@ -14,12 +11,11 @@ use crate::{ services::{self, execute_connector_processing_step}, types::{ api::{self, ConnectorCallType}, - authentication::{AuthNFlowType, AuthenticationResponseData}, + authentication::AuthenticationResponseData, storage, transformers::ForeignFrom, RouterData, }, - utils::OptionExt, }; pub fn get_connector_name_if_separate_authn_supported( @@ -56,19 +52,8 @@ pub async fn update_trackers( authentication: storage::Authentication, token: Option, acquirer_details: Option, -) -> RouterResult<(storage::Authentication, Option)> { - let authentication_data_option = authentication - .authentication_data - .as_ref() - .map(|authentication_data| { - authentication_data - .to_owned() - .parse_value::("AuthenticationData") - .change_context(ApiErrorResponse::InternalServerError) - }) - .transpose()?; - - let (authentication_update, updated_authentication_data) = match router_data.response { +) -> RouterResult { + let authentication_update = match router_data.response { Ok(response) => match response { AuthenticationResponseData::PreAuthNResponse { threeds_server_transaction_id, @@ -78,132 +63,70 @@ pub async fn update_trackers( three_ds_method_url, message_version, connector_metadata, - } => { - let three_ds_method_data = ThreeDsMethodData { - three_ds_method_data, - three_ds_method_data_submission: three_ds_method_url.is_some(), - three_ds_method_url, - }; - let authentication_data = AuthenticationData { - maximum_supported_version: maximum_supported_3ds_version, - threeds_server_transaction_id, - three_ds_method_data, - message_version, - acquirer_details, - ..Default::default() - }; - ( - storage::AuthenticationUpdate::AuthenticationDataUpdate { - authentication_data: Some( - Encode::encode_to_value(&authentication_data) - .change_context(ApiErrorResponse::InternalServerError)?, - ), - connector_authentication_id: Some(connector_authentication_id), - payment_method_id: token.map(|token| format!("eph_{}", token)), - authentication_type: None, - authentication_status: Some(common_enums::AuthenticationStatus::Started), - authentication_lifecycle_status: None, - connector_metadata, - }, - Some(authentication_data), - ) - } + } => storage::AuthenticationUpdate::PreAuthenticationUpdate { + threeds_server_transaction_id, + maximum_supported_3ds_version, + connector_authentication_id, + three_ds_method_data, + three_ds_method_url, + message_version, + connector_metadata, + authentication_status: common_enums::AuthenticationStatus::Pending, + payment_method_id: token.map(|token| format!("eph_{}", token)), + acquirer_bin: acquirer_details + .as_ref() + .map(|acquirer_details| acquirer_details.acquirer_bin.clone()), + acquirer_merchant_id: acquirer_details + .map(|acquirer_details| acquirer_details.acquirer_merchant_id), + }, AuthenticationResponseData::AuthNResponse { authn_flow_type, - authentication_value: cavv, + authentication_value, trans_status, } => { - let authentication_data = authentication_data_option - .get_required_value("authentication_data") - .attach_printable( - "AuthenticationData is required to make Authentication call", - )?; - let authentication_data = AuthenticationData { - authn_flow_type: Some(authn_flow_type.clone()), - cavv, - trans_status: trans_status.clone(), - ..authentication_data - }; - ( - storage::AuthenticationUpdate::AuthenticationDataUpdate { - authentication_data: Some( - Encode::encode_to_value(&authentication_data) - .change_context(ApiErrorResponse::InternalServerError)?, - ), - connector_authentication_id: None, - payment_method_id: None, - authentication_type: Some(match authn_flow_type { - AuthNFlowType::Challenge { .. } => { - DecoupledAuthenticationType::Challenge - } - AuthNFlowType::Frictionless => { - DecoupledAuthenticationType::Frictionless - } - }), - authentication_status: Some( - common_enums::AuthenticationStatus::foreign_from(trans_status), - ), - authentication_lifecycle_status: None, - connector_metadata: None, - }, - Some(authentication_data), - ) + let authentication_status = + common_enums::AuthenticationStatus::foreign_from(trans_status.clone()); + storage::AuthenticationUpdate::AuthenticationUpdate { + authentication_value, + trans_status, + acs_url: authn_flow_type.get_acs_url(), + challenge_request: authn_flow_type.get_challenge_request(), + acs_reference_number: authn_flow_type.get_acs_reference_number(), + acs_trans_id: authn_flow_type.get_acs_trans_id(), + acs_signed_content: authn_flow_type.get_acs_signed_content(), + authentication_type: authn_flow_type.get_decoupled_authentication_type(), + authentication_status, + } } AuthenticationResponseData::PostAuthNResponse { trans_status, authentication_value, eci, - } => { - let authentication_data = authentication_data_option - .get_required_value("authentication_data") - .attach_printable( - "AuthenticationData is required to make Post Authentication call", - )?; - let authentication_data = AuthenticationData { - cavv: authentication_value, - eci, - trans_status: trans_status.clone(), - ..authentication_data - }; - ( - storage::AuthenticationUpdate::AuthenticationDataUpdate { - authentication_data: Some( - Encode::encode_to_value(&authentication_data) - .change_context(ApiErrorResponse::InternalServerError)?, - ), - connector_authentication_id: None, - payment_method_id: None, - authentication_type: None, - authentication_status: Some( - common_enums::AuthenticationStatus::foreign_from(trans_status), - ), - authentication_lifecycle_status: None, - connector_metadata: None, - }, - Some(authentication_data), - ) - } - }, - Err(error) => ( - storage::AuthenticationUpdate::ErrorUpdate { - connector_authentication_id: error.connector_transaction_id, - authentication_status: common_enums::AuthenticationStatus::Failed, - error_message: Some(error.message), - error_code: Some(error.code), + } => storage::AuthenticationUpdate::PostAuthenticationUpdate { + authentication_status: common_enums::AuthenticationStatus::foreign_from( + trans_status.clone(), + ), + trans_status, + authentication_value, + eci, }, - authentication_data_option, - ), + }, + Err(error) => storage::AuthenticationUpdate::ErrorUpdate { + connector_authentication_id: error.connector_transaction_id, + authentication_status: common_enums::AuthenticationStatus::Failed, + error_message: Some(error.message), + error_code: Some(error.code), + }, }; - let authentication_result = state + state .store .update_authentication_by_merchant_id_authentication_id( authentication, authentication_update, ) .await - .change_context(ApiErrorResponse::InternalServerError) - .attach_printable("Error while updating authentication"); - authentication_result.map(|authentication| (authentication, updated_authentication_data)) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Error while updating authentication") } impl ForeignFrom for common_enums::AttemptStatus { @@ -229,7 +152,6 @@ pub async fn create_new_authentication( merchant_id, authentication_connector, connector_authentication_id: None, - authentication_data: None, payment_method_id: "".into(), authentication_type: None, authentication_status: common_enums::AuthenticationStatus::Started, @@ -237,12 +159,29 @@ pub async fn create_new_authentication( error_message: None, error_code: None, connector_metadata: None, + maximum_supported_version: None, + threeds_server_transaction_id: None, + cavv: None, + authentication_flow_type: None, + message_version: None, + eci: None, + trans_status: None, + acquirer_bin: None, + acquirer_merchant_id: None, + three_ds_method_data: None, + three_ds_method_url: None, + acs_url: None, + challenge_request: None, + acs_reference_number: None, + acs_trans_id: None, + three_dsserver_trans_id: None, + acs_signed_content: None, }; state .store .insert_authentication(new_authorization) .await - .to_duplicate_response(ApiErrorResponse::GenericDuplicateError { + .to_duplicate_response(errors::ApiErrorResponse::GenericDuplicateError { message: format!( "Authentication with authentication_id {} already exists", authentication_id diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 3f7da38554..efb3254841 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -45,8 +45,7 @@ use self::{ routing::{self as self_routing, SessionFlowRoutingInput}, }; use super::{ - authentication::types::AuthenticationData, errors::StorageErrorExt, - payment_methods::surcharge_decision_configs, routing::TransactionData, + errors::StorageErrorExt, payment_methods::surcharge_decision_configs, routing::TransactionData, }; #[cfg(feature = "frm")] use crate::core::fraud_check as frm_core; @@ -2220,7 +2219,7 @@ where pub payment_link_data: Option, pub incremental_authorization_details: Option, pub authorizations: Vec, - pub authentication: Option<(storage::Authentication, AuthenticationData)>, + pub authentication: Option, pub frm_metadata: Option, } @@ -3383,12 +3382,6 @@ pub async fn payment_external_authentication( .await .to_not_found_response(errors::ApiErrorResponse::InternalServerError) .attach_printable("Error while fetching authentication record")?; - let authentication_data: AuthenticationData = authentication - .authentication_data - .clone() - .parse_value("authentication data") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error while parsing authentication_data")?; let payment_method_details = helpers::get_payment_method_details_from_payment_token( &state, &payment_attempt, @@ -3446,7 +3439,7 @@ pub async fn payment_external_authentication( Some(currency), authentication::MessageCategory::Payment, req.device_channel, - (authentication_data, authentication), + authentication, return_url, req.sdk_information, req.threeds_method_comp_ind, diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 97b1d8e981..2ab98ae124 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -12,7 +12,7 @@ use tracing_futures::Instrument; use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest}; use crate::{ core::{ - authentication::{self, types}, + authentication, blocklist::utils as blocklist_utils, errors::{self, CustomResult, RouterResult, StorageErrorExt}, payment_methods::PaymentMethodRetrieve, @@ -554,27 +554,18 @@ impl .payment_method_data .apply_additional_payment_data(additional_payment_data) }); - let authentication = match payment_attempt.authentication_id.clone() { - Some(authentication_id) => { - let authentication = state - .store - .find_authentication_by_merchant_id_authentication_id( - merchant_id.to_string(), - authentication_id.clone(), - ) - .await - .to_not_found_response(errors::ApiErrorResponse::InternalServerError) - .attach_printable_lazy(|| format!("Error while fetching authentication record with authentication_id {authentication_id}"))?; - let authentication_data: authentication::types::AuthenticationData = authentication - .authentication_data - .clone() - .parse_value("authentication data") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error while parsing authentication_data")?; - Some((authentication, authentication_data)) - } - None => None, - }; + let authentication = payment_attempt.authentication_id.as_ref().async_map(|authentication_id| async move { + state + .store + .find_authentication_by_merchant_id_authentication_id( + merchant_id.to_string(), + authentication_id.clone(), + ) + .await + .to_not_found_response(errors::ApiErrorResponse::InternalServerError) + .attach_printable_lazy(|| format!("Error while fetching authentication record with authentication_id {authentication_id}")) + }).await + .transpose()?; payment_attempt.payment_method_billing_address_id = payment_method_billing .as_ref() @@ -806,7 +797,7 @@ impl Domain Domain }; let status_handler_for_authentication_results = - |(authentication, authentication_data): &( - storage::Authentication, - types::AuthenticationData, - )| { + |authentication: &storage::Authentication| { if authentication.authentication_status.is_failed() { ( storage_enums::IntentStatus::Failed, @@ -937,7 +925,7 @@ impl Some(Some("external authentication failure".to_string())), ), ) - } else if authentication_data.is_separate_authn_required() { + } else if authentication.is_separate_authn_required() { ( storage_enums::IntentStatus::RequiresCustomerAction, storage_enums::AttemptStatus::AuthenticationPending, @@ -1038,8 +1026,8 @@ impl authentication_connector, authentication_id, ) = match payment_data.authentication.as_ref() { - Some((authentication, authentication_data)) => ( - Some(authentication_data.is_separate_authn_required()), + Some(authentication) => ( + Some(authentication.is_separate_authn_required()), Some(authentication.authentication_connector.clone()), Some(authentication.authentication_id.clone()), ), diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs index 2afac8b613..b8456993eb 100644 --- a/crates/router/src/core/payments/operations/payment_response.rs +++ b/crates/router/src/core/payments/operations/payment_response.rs @@ -793,7 +793,7 @@ async fn payment_response_update_tracker( payment_data.payment_attempt = payment_attempt; payment_data.authentication = match payment_data.authentication { - Some((authentication, authentication_data)) => { + Some(authentication) => { let authentication_update = storage::AuthenticationUpdate::PostAuthorizationUpdate { authentication_lifecycle_status: storage::enums::AuthenticationLifecycleStatus::Used, @@ -806,7 +806,7 @@ async fn payment_response_update_tracker( ) .await .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?; - Some((updated_authentication, authentication_data)) + Some(updated_authentication) } None => None, }; diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs index fd28fbd18d..101d997db2 100644 --- a/crates/router/src/core/payments/operations/payment_status.rs +++ b/crates/router/src/core/payments/operations/payment_status.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use api_models::enums::FrmSuggestion; use async_trait::async_trait; -use common_utils::ext_traits::{AsyncExt, ValueExt}; +use common_utils::ext_traits::AsyncExt; use error_stack::ResultExt; use router_derive::PaymentOperation; use router_env::{instrument, tracing}; @@ -10,7 +10,6 @@ use router_env::{instrument, tracing}; use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest}; use crate::{ core::{ - authentication, errors::{self, CustomResult, RouterResult, StorageErrorExt}, payment_methods::PaymentMethodRetrieve, payments::{ @@ -400,33 +399,17 @@ async fn get_tracker_for_sync< .to_not_found_response(errors::ApiErrorResponse::BusinessProfileNotFound { id: profile_id.to_string(), })?; - - let authentication = match payment_attempt.authentication_id.clone() { - Some(authentication_id) => { - let authentication = db - .find_authentication_by_merchant_id_authentication_id( - merchant_account.merchant_id.to_string(), + let merchant_id = payment_intent.merchant_id.clone(); + let authentication = payment_attempt.authentication_id.clone().async_map(|authentication_id| async move { + db.find_authentication_by_merchant_id_authentication_id( + merchant_id, authentication_id.clone(), ) .await .to_not_found_response(errors::ApiErrorResponse::InternalServerError) - .attach_printable_lazy(|| format!("Error while fetching authentication record with authentication_id {authentication_id}"))?; - let authentication_data: authentication::types::AuthenticationData = authentication - .authentication_data - .clone() - .map(|authentication_data_value| { - authentication_data_value - .parse_value("AuthenticationData") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error while parsing authentication_data") - }) - .transpose()? - .unwrap_or_default(); - - Some((authentication, authentication_data)) - } - None => None, - }; + .attach_printable_lazy(|| format!("Error while fetching authentication record with authentication_id {authentication_id}")) + }).await + .transpose()?; let payment_data = PaymentData { flow: PhantomData, diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 2bd5c467b5..0597adedd2 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -8,7 +8,7 @@ use error_stack::{report, IntoReport, ResultExt}; use masking::Maskable; use router_env::{instrument, tracing}; -use super::{flows::Feature, PaymentData}; +use super::{flows::Feature, types::AuthenticationData, PaymentData}; use crate::{ configs::settings::{ConnectorRequestReferenceIdConfig, Server}, connector::{Helcim, Nexinets}, @@ -567,35 +567,29 @@ where } })) .or(match payment_data.authentication.as_ref(){ - Some((_authentication, authentication_data)) => { - if payment_intent.status == common_enums::IntentStatus::RequiresCustomerAction && authentication_data.cavv.is_none() && authentication_data.is_separate_authn_required(){ + Some(authentication) => { + if payment_intent.status == common_enums::IntentStatus::RequiresCustomerAction && authentication.cavv.is_none() && authentication.is_separate_authn_required(){ // if preAuthn and separate authentication needed. let payment_connector_name = payment_attempt.connector .as_ref() .get_required_value("connector")?; Some(api_models::payments::NextActionData::ThreeDsInvoke { three_ds_data: api_models::payments::ThreeDsData { - three_ds_authentication_url: helpers::create_authentication_url( - &server.base_url, - &payment_attempt, - ), + three_ds_authentication_url: helpers::create_authentication_url(&server.base_url, &payment_attempt), three_ds_authorize_url: helpers::create_authorize_url( &server.base_url, &payment_attempt, payment_connector_name, ), - three_ds_method_details: authentication_data.three_ds_method_data.three_ds_method_url.as_ref().map(|three_ds_method_url|{ + three_ds_method_details: authentication.three_ds_method_url.as_ref().zip(authentication.three_ds_method_data.as_ref()).map(|(three_ds_method_url,three_ds_method_data )|{ api_models::payments::ThreeDsMethodData::AcsThreeDsMethodData { three_ds_method_data_submission: true, - three_ds_method_data: authentication_data - .three_ds_method_data - .three_ds_method_data - .clone(), + three_ds_method_data: Some(three_ds_method_data.clone()), three_ds_method_url: Some(three_ds_method_url.to_owned()), } }).unwrap_or(api_models::payments::ThreeDsMethodData::AcsThreeDsMethodData { three_ds_method_data_submission: false, - three_ds_method_data: "".into(), + three_ds_method_data: None, three_ds_method_url: None, }), }, @@ -1212,7 +1206,11 @@ impl TryFrom> for types::PaymentsAuthoriz | Some(RequestIncrementalAuthorization::Default) ), metadata: additional_data.payment_data.payment_intent.metadata, - authentication_data: payment_data.authentication.map(|auth| auth.1), + authentication_data: payment_data + .authentication + .as_ref() + .map(AuthenticationData::foreign_try_from) + .transpose()?, customer_acceptance: payment_data.customer_acceptance, }) } diff --git a/crates/router/src/core/payments/types.rs b/crates/router/src/core/payments/types.rs index e957fe5faa..6e33b2f60e 100644 --- a/crates/router/src/core/payments/types.rs +++ b/crates/router/src/core/payments/types.rs @@ -1,7 +1,12 @@ use std::{collections::HashMap, num::TryFromIntError}; use api_models::{payment_methods::SurchargeDetailsResponse, payments::RequestSurchargeDetails}; -use common_utils::{consts, errors::CustomResult, ext_traits::Encode, types as common_types}; +use common_utils::{ + consts, + errors::CustomResult, + ext_traits::{Encode, OptionExt}, + types as common_types, +}; use data_models::payments::payment_attempt::PaymentAttempt; use diesel_models::business_profile::BusinessProfile; use error_stack::{IntoReport, ResultExt}; @@ -371,3 +376,53 @@ impl SurchargeMetadata { .await } } + +#[derive(Debug, Clone)] +pub struct AuthenticationData { + pub eci: String, + pub cavv: String, + pub threeds_server_transaction_id: String, + pub message_version: String, +} + +impl ForeignTryFrom<&storage::Authentication> for AuthenticationData { + type Error = error_stack::Report; + fn foreign_try_from(authentication: &storage::Authentication) -> Result { + if authentication.authentication_status == common_enums::AuthenticationStatus::Success { + let threeds_server_transaction_id = authentication + .threeds_server_transaction_id + .clone() + .get_required_value("threeds_server_transaction_id") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("threeds_server_transaction_id must not be null when authentication_status is success")?; + let message_version = authentication + .message_version + .clone() + .get_required_value("message_version") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable( + "message_version must not be null when authentication_status is success", + )?; + let cavv = authentication + .cavv + .clone() + .get_required_value("cavv") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("cavv must not be null when authentication_status is success")?; + let eci = authentication + .eci + .clone() + .get_required_value("eci") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("eci must not be null when authentication_status is success")?; + Ok(Self { + eci, + cavv, + threeds_server_transaction_id, + message_version: message_version.to_string(), + }) + } else { + Err(errors::ApiErrorResponse::PaymentAuthenticationFailed { data: None }.into()) + } + } +} diff --git a/crates/router/src/db/authentication.rs b/crates/router/src/db/authentication.rs index 1916a326c7..1460468486 100644 --- a/crates/router/src/db/authentication.rs +++ b/crates/router/src/db/authentication.rs @@ -103,13 +103,30 @@ impl AuthenticationInterface for MockDb { authentication_status: authentication.authentication_status, authentication_connector: authentication.authentication_connector, connector_authentication_id: authentication.connector_authentication_id, - authentication_data: authentication.authentication_data, + authentication_data: None, payment_method_id: authentication.payment_method_id, authentication_type: authentication.authentication_type, authentication_lifecycle_status: authentication.authentication_lifecycle_status, error_code: authentication.error_code, error_message: authentication.error_message, connector_metadata: authentication.connector_metadata, + maximum_supported_version: authentication.maximum_supported_version, + threeds_server_transaction_id: authentication.threeds_server_transaction_id, + cavv: authentication.cavv, + authentication_flow_type: authentication.authentication_flow_type, + message_version: authentication.message_version, + eci: authentication.eci, + trans_status: authentication.trans_status, + acquirer_bin: authentication.acquirer_bin, + acquirer_merchant_id: authentication.acquirer_merchant_id, + three_ds_method_data: authentication.three_ds_method_data, + three_ds_method_url: authentication.three_ds_method_url, + acs_url: authentication.acs_url, + challenge_request: authentication.challenge_request, + acs_reference_number: authentication.acs_reference_number, + acs_trans_id: authentication.acs_trans_id, + three_ds_server_trans_id: authentication.three_dsserver_trans_id, + acs_signed_content: authentication.acs_signed_content, }; authentications.push(authentication.clone()); Ok(authentication) diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index 5a24e4ff7c..82ab175279 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -36,15 +36,13 @@ pub use crate::core::payments::{payment_address::PaymentAddress, CustomerDetails use crate::core::utils::IRRELEVANT_CONNECTOR_REQUEST_REFERENCE_ID_IN_DISPUTE_FLOW; use crate::{ core::{ - authentication as authentication_core, errors::{self, RouterResult}, payments::{types, PaymentData, RecurringMandatePaymentData}, }, services, - types::transformers::ForeignFrom, + types::{transformers::ForeignFrom, types::AuthenticationData}, utils::OptionExt, }; - pub type PaymentsAuthorizeRouterData = RouterData; pub type PaymentsPreProcessingRouterData = @@ -425,7 +423,7 @@ pub struct PaymentsAuthorizeData { pub customer_id: Option, pub request_incremental_authorization: bool, pub metadata: Option, - pub authentication_data: Option, + pub authentication_data: Option, } #[derive(Debug, Clone, Default)] diff --git a/crates/router/src/types/api/authentication.rs b/crates/router/src/types/api/authentication.rs index f98688c559..d0c6884450 100644 --- a/crates/router/src/types/api/authentication.rs +++ b/crates/router/src/types/api/authentication.rs @@ -25,7 +25,7 @@ pub struct AcquirerDetails { #[derive(Clone, serde::Deserialize, Debug, serde::Serialize)] pub struct AuthenticationResponse { - pub trans_status: api_models::payments::TransactionStatus, + pub trans_status: common_enums::TransactionStatus, pub acs_url: Option, pub challenge_request: Option, pub acs_reference_number: Option, diff --git a/crates/router/src/types/authentication.rs b/crates/router/src/types/authentication.rs index 93eb5f37ff..4cd1f3faeb 100644 --- a/crates/router/src/types/authentication.rs +++ b/crates/router/src/types/authentication.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use super::{ api::{self, authentication}, - storage, BrowserInformation, RouterData, + BrowserInformation, RouterData, }; use crate::services; @@ -13,20 +13,20 @@ use crate::services; pub enum AuthenticationResponseData { PreAuthNResponse { threeds_server_transaction_id: String, - maximum_supported_3ds_version: (i64, i64, i64), + maximum_supported_3ds_version: common_utils::types::SemanticVersion, connector_authentication_id: String, three_ds_method_data: String, three_ds_method_url: Option, - message_version: String, + message_version: common_utils::types::SemanticVersion, connector_metadata: Option, }, AuthNResponse { authn_flow_type: AuthNFlowType, authentication_value: Option, - trans_status: api_models::payments::TransactionStatus, + trans_status: common_enums::TransactionStatus, }, PostAuthNResponse { - trans_status: api_models::payments::TransactionStatus, + trans_status: common_enums::TransactionStatus, authentication_value: Option, eci: Option, }, @@ -48,6 +48,50 @@ pub enum AuthNFlowType { Frictionless, } +impl AuthNFlowType { + pub fn get_acs_url(&self) -> Option { + if let Self::Challenge(challenge_params) = self { + challenge_params.acs_url.as_ref().map(ToString::to_string) + } else { + None + } + } + pub fn get_challenge_request(&self) -> Option { + if let Self::Challenge(challenge_params) = self { + challenge_params.challenge_request.clone() + } else { + None + } + } + pub fn get_acs_reference_number(&self) -> Option { + if let Self::Challenge(challenge_params) = self { + challenge_params.acs_reference_number.clone() + } else { + None + } + } + pub fn get_acs_trans_id(&self) -> Option { + if let Self::Challenge(challenge_params) = self { + challenge_params.acs_trans_id.clone() + } else { + None + } + } + pub fn get_acs_signed_content(&self) -> Option { + if let Self::Challenge(challenge_params) = self { + challenge_params.acs_signed_content.clone() + } else { + None + } + } + pub fn get_decoupled_authentication_type(&self) -> common_enums::DecoupledAuthenticationType { + match self { + Self::Challenge(_) => common_enums::DecoupledAuthenticationType::Challenge, + Self::Frictionless => common_enums::DecoupledAuthenticationType::Frictionless, + } + } +} + #[derive(Clone, Default, Debug)] pub struct PreAuthNRequestData { // card number @@ -65,10 +109,7 @@ pub struct ConnectorAuthenticationRequestData { pub currency: Option, pub message_category: authentication::MessageCategory, pub device_channel: api_models::payments::DeviceChannel, - pub authentication_data: ( - crate::core::authentication::types::AuthenticationData, - storage::Authentication, - ), + pub pre_authentication_data: crate::core::authentication::types::PreAuthenticationData, pub return_url: Option, pub sdk_information: Option, pub email: Option, @@ -78,7 +119,7 @@ pub struct ConnectorAuthenticationRequestData { #[derive(Clone, Debug)] pub struct ConnectorPostAuthenticationRequestData { - pub authentication_data: crate::core::authentication::types::AuthenticationData, + pub threeds_server_transaction_id: String, } pub type PreAuthNRouterData = diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index e9082299ab..637a4b077d 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -14,7 +14,7 @@ use masking::{ExposeInterface, PeekInterface}; use super::domain; use crate::{ - core::{authentication::types::AuthenticationData, errors}, + core::errors, services::authentication::get_header_value_by_key, types::{ api::{self as api_types, routing as routing_types}, @@ -745,31 +745,20 @@ impl ForeignFrom for payments::IncrementalAuthorizationR } } -impl ForeignFrom<&(storage::Authentication, AuthenticationData)> - for payments::ExternalAuthenticationDetailsResponse -{ - fn foreign_from(authn_data: &(storage::Authentication, AuthenticationData)) -> Self { - let (ds_transaction_id, version) = if authn_data.0.authentication_data.is_some() { - ( - Some(authn_data.1.threeds_server_transaction_id.clone()), - Some(format!( - "{}.{}.{}", - authn_data.1.maximum_supported_version.0, - authn_data.1.maximum_supported_version.1, - authn_data.1.maximum_supported_version.2 - )), - ) - } else { - (None, None) - }; +impl ForeignFrom<&storage::Authentication> for payments::ExternalAuthenticationDetailsResponse { + fn foreign_from(authn_data: &storage::Authentication) -> Self { + let version = authn_data + .maximum_supported_version + .as_ref() + .map(|version| version.to_string()); Self { - authentication_flow: authn_data.0.authentication_type, - electronic_commerce_indicator: authn_data.1.eci.clone(), - status: authn_data.0.authentication_status, - ds_transaction_id, + authentication_flow: authn_data.authentication_type, + electronic_commerce_indicator: authn_data.eci.clone(), + status: authn_data.authentication_status, + ds_transaction_id: authn_data.threeds_server_transaction_id.clone(), version, - error_code: authn_data.0.error_code.clone(), - error_message: authn_data.0.error_message.clone(), + error_code: authn_data.error_code.clone(), + error_message: authn_data.error_message.clone(), } } } diff --git a/migrations/2024-03-11-102743_add_additional_authentication_fields/down.sql b/migrations/2024-03-11-102743_add_additional_authentication_fields/down.sql new file mode 100644 index 0000000000..f08490b612 --- /dev/null +++ b/migrations/2024-03-11-102743_add_additional_authentication_fields/down.sql @@ -0,0 +1,19 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE authentication +DROP COLUMN IF EXISTS maximum_supported_version , +DROP COLUMN IF EXISTS threeds_server_transaction_id , +DROP COLUMN IF EXISTS cavv , +DROP COLUMN IF EXISTS authentication_flow_type , +DROP COLUMN IF EXISTS message_version , +DROP COLUMN IF EXISTS eci , +DROP COLUMN IF EXISTS trans_status , +DROP COLUMN IF EXISTS acquirer_bin , +DROP COLUMN IF EXISTS acquirer_merchant_id , +DROP COLUMN IF EXISTS three_ds_method_data , +DROP COLUMN IF EXISTS three_ds_method_url , +DROP COLUMN IF EXISTS acs_url , +DROP COLUMN IF EXISTS challenge_request , +DROP COLUMN IF EXISTS acs_reference_number , +DROP COLUMN IF EXISTS acs_trans_id , +DROP COLUMN IF EXISTS three_dsserver_trans_id , +DROP COLUMN IF EXISTS acs_signed_content; diff --git a/migrations/2024-03-11-102743_add_additional_authentication_fields/up.sql b/migrations/2024-03-11-102743_add_additional_authentication_fields/up.sql new file mode 100644 index 0000000000..0f7e3eeebb --- /dev/null +++ b/migrations/2024-03-11-102743_add_additional_authentication_fields/up.sql @@ -0,0 +1,20 @@ +-- Your SQL goes here +ALTER TABLE authentication +ADD COLUMN IF NOT EXISTS maximum_supported_version JSONB, +ADD COLUMN IF NOT EXISTS threeds_server_transaction_id VARCHAR(64), +ADD COLUMN IF NOT EXISTS cavv VARCHAR(64), +ADD COLUMN IF NOT EXISTS authentication_flow_type VARCHAR(64), +ADD COLUMN IF NOT EXISTS message_version JSONB, +ADD COLUMN IF NOT EXISTS eci VARCHAR(64), +ADD COLUMN IF NOT EXISTS trans_status VARCHAR(64), +ADD COLUMN IF NOT EXISTS acquirer_bin VARCHAR(64), +ADD COLUMN IF NOT EXISTS acquirer_merchant_id VARCHAR(64), +ADD COLUMN IF NOT EXISTS three_ds_method_data VARCHAR, +ADD COLUMN IF NOT EXISTS three_ds_method_url VARCHAR, +ADD COLUMN IF NOT EXISTS acs_url VARCHAR, +ADD COLUMN IF NOT EXISTS challenge_request VARCHAR, +ADD COLUMN IF NOT EXISTS acs_reference_number VARCHAR, +ADD COLUMN IF NOT EXISTS acs_trans_id VARCHAR, +ADD COLUMN IF NOT EXISTS three_dsserver_trans_id VARCHAR, +ADD COLUMN IF NOT EXISTS acs_signed_content VARCHAR, +ADD COLUMN IF NOT EXISTS connector_metadata JSONB; \ No newline at end of file diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index decb4af2db..dd33ca7274 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -16872,7 +16872,6 @@ "type": "object", "required": [ "three_ds_method_data_submission", - "three_ds_method_data", "three_ds_method_key" ], "properties": { @@ -16882,7 +16881,8 @@ }, "three_ds_method_data": { "type": "string", - "description": "ThreeDS method data" + "description": "ThreeDS method data", + "nullable": true }, "three_ds_method_url": { "type": "string",