Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor: pull `hyperswitch_masking` crate from crates.io (#11508)

Sahkal Poddard72a9d942e4c
diff --git a/Cargo.lock b/Cargo.lock
index 29a90aa756..9a7391e5bc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -361,7 +361,7 @@ dependencies = [
"error-stack 0.4.1",
"futures 0.3.31",
"hyperswitch_interfaces",
- "masking 0.1.0",
+ "hyperswitch_masking",
"opensearch",
"reqwest 0.11.27",
"router_env",
@@ -467,7 +467,7 @@ dependencies = [
"deserialize_form_style_query_parameter",
"error-stack 0.4.1",
"euclid",
- "masking 0.1.0",
+ "hyperswitch_masking",
"mime",
"nutype",
"reqwest 0.11.27",
@@ -1294,7 +1294,7 @@ dependencies = [
"pin-project-lite",
"rustversion",
"serde",
- "sync_wrapper 1.0.1",
+ "sync_wrapper 1.0.2",
"tower 0.4.13",
"tower-layer",
"tower-service",
@@ -1326,7 +1326,7 @@ dependencies = [
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
- "sync_wrapper 1.0.1",
+ "sync_wrapper 1.0.2",
"tokio 1.48.0",
"tower 0.5.2",
"tower-layer",
@@ -1368,7 +1368,7 @@ dependencies = [
"mime",
"pin-project-lite",
"rustversion",
- "sync_wrapper 1.0.1",
+ "sync_wrapper 1.0.2",
"tower-layer",
"tower-service",
"tracing",
@@ -1745,7 +1745,7 @@ version = "0.1.0"
dependencies = [
"common_utils",
"error-stack 0.4.1",
- "masking 0.1.0",
+ "hyperswitch_masking",
"regex",
"router_env",
"serde",
@@ -2057,7 +2057,7 @@ name = "common_enums"
version = "0.1.0"
dependencies = [
"diesel",
- "masking 0.1.0",
+ "hyperswitch_masking",
"router_derive",
"serde",
"serde_json",
@@ -2079,7 +2079,7 @@ dependencies = [
"diesel",
"error-stack 0.4.1",
"euclid",
- "masking 0.1.0",
+ "hyperswitch_masking",
"serde",
"serde_json",
"smithy",
@@ -2106,7 +2106,7 @@ dependencies = [
"globset",
"hex",
"http 0.2.12",
- "masking 0.1.0",
+ "hyperswitch_masking",
"md5",
"nanoid",
"nutype",
@@ -2184,7 +2184,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"proc-macro2",
"quote",
@@ -2889,7 +2889,7 @@ dependencies = [
"common_utils",
"diesel",
"error-stack 0.4.1",
- "masking 0.1.0",
+ "hyperswitch_masking",
"router_derive",
"router_env",
"serde",
@@ -2983,7 +2983,7 @@ dependencies = [
"error-stack 0.4.1",
"external_services",
"hyperswitch_interfaces",
- "masking 0.1.0",
+ "hyperswitch_masking",
"mime",
"redis_interface",
"reqwest 0.11.27",
@@ -3298,7 +3298,7 @@ name = "events"
version = "0.1.0"
dependencies = [
"error-stack 0.4.1",
- "masking 0.1.0",
+ "hyperswitch_masking",
"router_env",
"serde",
"serde_json",
@@ -3330,12 +3330,12 @@ dependencies = [
"hyper-proxy",
"hyper-util",
"hyperswitch_interfaces",
+ "hyperswitch_masking",
"lettre",
- "masking 0.1.0",
"once_cell",
"open-feature",
- "prost",
- "prost-types",
+ "prost 0.14.3",
+ "prost-types 0.14.3",
"quick-xml",
"reqwest 0.11.27",
"router_env",
@@ -3347,8 +3347,9 @@ dependencies = [
"thiserror 1.0.69",
"time",
"tokio 1.48.0",
- "tonic 0.13.1",
- "tonic-build",
+ "tonic 0.14.5",
+ "tonic-prost",
+ "tonic-prost-build",
"tonic-reflection",
"tonic-types",
"typed-builder 0.21.2",
@@ -3437,9 +3438,9 @@ checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3"
[[package]]
name = "fixedbitset"
-version = "0.4.2"
+version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
+checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
[[package]]
name = "flate2"
@@ -3697,17 +3698,17 @@ dependencies = [
[[package]]
name = "g2h"
version = "0.5.0"
-source = "git+https://github.com/juspay/g2h?rev=ebe5d2c38716abd7b1def43a6a0123a5e4193489#ebe5d2c38716abd7b1def43a6a0123a5e4193489"
+source = "git+https://github.com/juspay/g2h?rev=399d5257744cabffe88d9871a1192eacbbe9f484#399d5257744cabffe88d9871a1192eacbbe9f484"
dependencies = [
"cargo_metadata 0.19.2",
"heck 0.5.0",
"proc-macro2",
- "prost",
+ "prost 0.14.3",
"prost-build",
- "prost-types",
+ "prost-types 0.14.3",
"quote",
"thiserror 2.0.12",
- "tonic-build",
+ "tonic-prost-build",
]
[[package]]
@@ -3758,6 +3759,19 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "getrandom"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "r-efi",
+ "wasip2",
+ "wasip3",
+]
+
[[package]]
name = "git2"
version = "0.19.0"
@@ -3864,20 +3878,21 @@ dependencies = [
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"axum 0.8.4",
"error-stack 0.5.0",
"g2h",
"heck 0.5.0",
"http 1.3.1",
- "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0)",
- "prost",
+ "hyperswitch_masking",
+ "prost 0.14.3",
"prost-build",
- "prost-types",
+ "prost-types 0.14.3",
"serde",
- "tonic 0.13.1",
+ "tonic 0.14.5",
"tonic-build",
+ "tonic-prost",
"ucs_cards",
]
@@ -4040,12 +4055,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-[[package]]
-name = "histogram"
-version = "0.6.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669"
-
[[package]]
name = "hkdf"
version = "0.12.4"
@@ -4392,12 +4401,12 @@ dependencies = [
"http 0.2.12",
"hyperswitch_domain_models",
"hyperswitch_interfaces",
+ "hyperswitch_masking",
"image",
"iso_currency",
"isocountry",
"josekit",
"lazy_static",
- "masking 0.1.0",
"mime",
"nanoid",
"num-traits",
@@ -4457,7 +4466,7 @@ dependencies = [
"error-stack 0.4.1",
"futures 0.3.31",
"http 0.2.12",
- "masking 0.1.0",
+ "hyperswitch_masking",
"mime",
"payment_link",
"router_derive",
@@ -4486,8 +4495,7 @@ dependencies = [
"error-stack 0.4.1",
"http 0.2.12",
"hyperswitch_domain_models",
- "masking 0.1.0",
- "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0)",
+ "hyperswitch_masking",
"mime",
"reqwest 0.11.27",
"router_env",
@@ -4501,6 +4509,24 @@ dependencies = [
"url",
]
+[[package]]
+name = "hyperswitch_masking"
+version = "0.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d110ac2d2ce7a5f84c7172e710ca1241fd5ecec6e77aa83a85071b8d52e04f3"
+dependencies = [
+ "bytes 1.10.1",
+ "diesel",
+ "erased-serde 0.4.6",
+ "prost 0.14.3",
+ "serde",
+ "serde_json",
+ "subtle",
+ "time",
+ "url",
+ "zeroize",
+]
+
[[package]]
name = "iana-time-zone"
version = "0.1.60"
@@ -4642,6 +4668,12 @@ dependencies = [
"syn 2.0.101",
]
+[[package]]
+name = "id-arena"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
+
[[package]]
name = "ident_case"
version = "1.0.1"
@@ -4752,7 +4784,7 @@ dependencies = [
"base64 0.22.1",
"common_utils",
"error-stack 0.4.1",
- "masking 0.1.0",
+ "hyperswitch_masking",
"nom 7.1.3",
"reqwest 0.12.7",
"router_env",
@@ -4975,7 +5007,7 @@ dependencies = [
"criterion",
"euclid",
"hyperswitch_constraint_graph",
- "masking 0.1.0",
+ "hyperswitch_masking",
"serde",
"serde_json",
"strum 0.26.3",
@@ -5018,6 +5050,12 @@ dependencies = [
"spin 0.9.8",
]
+[[package]]
+name = "leb128fmt"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
+
[[package]]
name = "lettre"
version = "0.11.16"
@@ -5203,15 +5241,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-[[package]]
-name = "lz4_flex"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5"
-dependencies = [
- "twox-hash",
-]
-
[[package]]
name = "mac"
version = "0.1.1"
@@ -5238,40 +5267,6 @@ dependencies = [
"tendril",
]
-[[package]]
-name = "masking"
-version = "0.1.0"
-dependencies = [
- "bytes 1.10.1",
- "diesel",
- "erased-serde 0.4.6",
- "prost",
- "scylla",
- "serde",
- "serde_json",
- "subtle",
- "time",
- "url",
- "zeroize",
-]
-
-[[package]]
-name = "masking"
-version = "0.1.0"
-source = "git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0#19723f8c9c6c89057624061fef429f6f574dd358"
-dependencies = [
- "bytes 1.10.1",
- "diesel",
- "erased-serde 0.4.6",
- "prost",
- "serde",
- "serde_json",
- "subtle",
- "time",
- "url",
- "zeroize",
-]
-
[[package]]
name = "matchers"
version = "0.1.0"
@@ -5986,7 +5981,7 @@ dependencies = [
"opentelemetry",
"opentelemetry-proto",
"opentelemetry_sdk",
- "prost",
+ "prost 0.13.5",
"thiserror 1.0.69",
"tokio 1.48.0",
"tonic 0.12.3",
@@ -6000,7 +5995,7 @@ checksum = "a6e05acbfada5ec79023c85368af14abd0b307c015e9064d249b2a950ef459a6"
dependencies = [
"opentelemetry",
"opentelemetry_sdk",
- "prost",
+ "prost 0.13.5",
"tonic 0.12.3",
]
@@ -6225,7 +6220,7 @@ dependencies = [
"error-stack 0.4.1",
"hyperswitch_domain_models",
"hyperswitch_interfaces",
- "masking 0.1.0",
+ "hyperswitch_masking",
"rdkafka",
"router_env",
"scheduler",
@@ -6319,11 +6314,12 @@ dependencies = [
[[package]]
name = "petgraph"
-version = "0.6.5"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
+checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455"
dependencies = [
"fixedbitset",
+ "hashbrown 0.15.2",
"indexmap 2.9.0",
]
@@ -6537,7 +6533,7 @@ dependencies = [
"common_utils",
"error-stack 0.4.1",
"http 0.2.12",
- "masking 0.1.0",
+ "hyperswitch_masking",
"mime",
"serde",
"serde_json",
@@ -6712,24 +6708,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5"
dependencies = [
"bytes 1.10.1",
- "prost-derive",
+ "prost-derive 0.13.5",
+]
+
+[[package]]
+name = "prost"
+version = "0.14.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568"
+dependencies = [
+ "bytes 1.10.1",
+ "prost-derive 0.14.3",
]
[[package]]
name = "prost-build"
-version = "0.13.5"
+version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf"
+checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7"
dependencies = [
"heck 0.5.0",
"itertools 0.13.0",
"log",
"multimap",
- "once_cell",
"petgraph",
"prettyplease",
- "prost",
- "prost-types",
+ "prost 0.14.3",
+ "prost-types 0.14.3",
+ "pulldown-cmark 0.13.1",
+ "pulldown-cmark-to-cmark",
"regex",
"syn 2.0.101",
"tempfile",
@@ -6748,13 +6755,35 @@ dependencies = [
"syn 2.0.101",
]
+[[package]]
+name = "prost-derive"
+version = "0.14.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b"
+dependencies = [
+ "anyhow",
+ "itertools 0.13.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+]
+
[[package]]
name = "prost-types"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16"
dependencies = [
- "prost",
+ "prost 0.13.5",
+]
+
+[[package]]
+name = "prost-types"
+version = "0.14.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7"
+dependencies = [
+ "prost 0.14.3",
]
[[package]]
@@ -6797,6 +6826,26 @@ dependencies = [
"unicase",
]
+[[package]]
+name = "pulldown-cmark"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "83c41efbf8f90ac44de7f3a868f0867851d261b56291732d0cbf7cceaaeb55a6"
+dependencies = [
+ "bitflags 2.9.0",
+ "memchr",
+ "unicase",
+]
+
+[[package]]
+name = "pulldown-cmark-to-cmark"
+version = "22.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50793def1b900256624a709439404384204a5dc3a6ec580281bfaac35e882e90"
+dependencies = [
+ "pulldown-cmark 0.13.1",
+]
+
[[package]]
name = "qrcode"
version = "0.14.1"
@@ -6989,15 +7038,6 @@ dependencies = [
"getrandom 0.3.3",
]
-[[package]]
-name = "rand_pcg"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e"
-dependencies = [
- "rand_core 0.6.4",
-]
-
[[package]]
name = "rand_xorshift"
version = "0.3.0"
@@ -7263,7 +7303,7 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
- "sync_wrapper 1.0.1",
+ "sync_wrapper 1.0.2",
"system-configuration 0.6.1",
"tokio 1.48.0",
"tokio-native-tls",
@@ -7427,13 +7467,12 @@ dependencies = [
"hyperswitch_constraint_graph",
"hyperswitch_domain_models",
"hyperswitch_interfaces",
+ "hyperswitch_masking",
"infer",
"injector",
"josekit",
"jsonwebtoken",
"kgraph_utils",
- "masking 0.1.0",
- "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0)",
"maud",
"mimalloc",
"mime",
@@ -7448,7 +7487,7 @@ dependencies = [
"payment_link",
"payment_methods",
"pm_auth",
- "prost-types",
+ "prost-types 0.14.3",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rdkafka",
@@ -7571,7 +7610,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"grpc-api-types",
]
@@ -8007,65 +8046,6 @@ dependencies = [
"untrusted 0.9.0",
]
-[[package]]
-name = "scylla"
-version = "0.15.0"
-source = "git+https://github.com/juspay/scylla-rust-driver.git?rev=5700aa2847b25437cdd4fcf34d707aa90dca8b89#5700aa2847b25437cdd4fcf34d707aa90dca8b89"
-dependencies = [
- "arc-swap",
- "async-trait",
- "byteorder",
- "bytes 1.10.1",
- "chrono",
- "dashmap",
- "futures 0.3.31",
- "hashbrown 0.14.5",
- "histogram",
- "itertools 0.13.0",
- "lazy_static",
- "lz4_flex",
- "rand 0.8.5",
- "rand_pcg",
- "scylla-cql",
- "scylla-macros",
- "smallvec 1.15.0",
- "snap",
- "socket2 0.5.10",
- "thiserror 1.0.69",
- "tokio 1.48.0",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "scylla-cql"
-version = "0.4.0"
-source = "git+https://github.com/juspay/scylla-rust-driver.git?rev=5700aa2847b25437cdd4fcf34d707aa90dca8b89#5700aa2847b25437cdd4fcf34d707aa90dca8b89"
-dependencies = [
- "async-trait",
- "byteorder",
- "bytes 1.10.1",
- "lz4_flex",
- "scylla-macros",
- "snap",
- "stable_deref_trait",
- "thiserror 1.0.69",
- "tokio 1.48.0",
- "uuid",
- "yoke",
-]
-
-[[package]]
-name = "scylla-macros"
-version = "0.7.0"
-source = "git+https://github.com/juspay/scylla-rust-driver.git?rev=5700aa2847b25437cdd4fcf34d707aa90dca8b89#5700aa2847b25437cdd4fcf34d707aa90dca8b89"
-dependencies = [
- "darling 0.20.11",
- "proc-macro2",
- "quote",
- "syn 2.0.101",
-]
-
[[package]]
name = "sdd"
version = "3.0.2"
@@ -8168,10 +8148,11 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
-version = "1.0.219"
+version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
+ "serde_core",
"serde_derive",
]
@@ -8207,11 +8188,20 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "serde_core"
+version = "1.0.228"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
+dependencies = [
+ "serde_derive",
+]
+
[[package]]
name = "serde_derive"
-version = "1.0.219"
+version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
@@ -8508,7 +8498,7 @@ dependencies = [
"cargo_metadata 0.14.2",
"error-chain",
"glob",
- "pulldown-cmark",
+ "pulldown-cmark 0.9.6",
"tempfile",
"walkdir",
]
@@ -8589,12 +8579,6 @@ dependencies = [
"smithy-core",
]
-[[package]]
-name = "snap"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b"
-
[[package]]
name = "socket2"
version = "0.5.10"
@@ -8891,7 +8875,7 @@ dependencies = [
"error-stack 0.4.1",
"futures 0.3.31",
"hyperswitch_domain_models",
- "masking 0.1.0",
+ "hyperswitch_masking",
"moka",
"redis_interface",
"router_derive",
@@ -9016,7 +9000,7 @@ dependencies = [
"error-stack 0.4.1",
"hyperswitch_domain_models",
"hyperswitch_interfaces",
- "masking 0.1.0",
+ "hyperswitch_masking",
"router_env",
"scheduler",
"serde",
@@ -9252,9 +9236,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "sync_wrapper"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
+checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
dependencies = [
"futures-core",
]
@@ -9439,7 +9423,7 @@ dependencies = [
"base64 0.22.1",
"clap 4.5.38",
"common_enums",
- "masking 0.1.0",
+ "hyperswitch_masking",
"rand 0.8.5",
"regex",
"reqwest 0.11.27",
@@ -10009,7 +9993,7 @@ dependencies = [
"hyper-util",
"percent-encoding",
"pin-project",
- "prost",
+ "prost 0.13.5",
"socket2 0.5.10",
"tokio 1.48.0",
"tokio-stream",
@@ -10024,6 +10008,25 @@ name = "tonic"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9"
+dependencies = [
+ "base64 0.22.1",
+ "bytes 1.10.1",
+ "http 1.3.1",
+ "http-body 1.0.1",
+ "http-body-util",
+ "percent-encoding",
+ "pin-project",
+ "tokio-stream",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tonic"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec"
dependencies = [
"async-trait",
"axum 0.8.4",
@@ -10038,8 +10041,8 @@ dependencies = [
"hyper-util",
"percent-encoding",
"pin-project",
- "prost",
- "socket2 0.5.10",
+ "socket2 0.6.1",
+ "sync_wrapper 1.0.2",
"tokio 1.48.0",
"tokio-stream",
"tower 0.5.2",
@@ -10050,29 +10053,55 @@ dependencies = [
[[package]]
name = "tonic-build"
-version = "0.13.1"
+version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847"
+checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734"
+dependencies = [
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+]
+
+[[package]]
+name = "tonic-prost"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309"
+dependencies = [
+ "bytes 1.10.1",
+ "prost 0.14.3",
+ "tonic 0.14.5",
+]
+
+[[package]]
+name = "tonic-prost-build"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a"
dependencies = [
"prettyplease",
"proc-macro2",
"prost-build",
- "prost-types",
+ "prost-types 0.14.3",
"quote",
"syn 2.0.101",
+ "tempfile",
+ "tonic-build",
]
[[package]]
name = "tonic-reflection"
-version = "0.13.1"
+version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9687bd5bfeafebdded2356950f278bba8226f0b32109537c4253406e09aafe1"
+checksum = "aaf0685a51e6d02b502ba0764002e766b7f3042aed13d9234925b6ffbfa3fca7"
dependencies = [
- "prost",
- "prost-types",
+ "prost 0.14.3",
+ "prost-types 0.14.3",
"tokio 1.48.0",
"tokio-stream",
- "tonic 0.13.1",
+ "tonic 0.14.5",
+ "tonic-prost",
]
[[package]]
@@ -10081,8 +10110,8 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07439468da24d5f211d3f3bd7b63665d8f45072804457e838a87414a478e2db8"
dependencies = [
- "prost",
- "prost-types",
+ "prost 0.13.5",
+ "prost-types 0.13.5",
"tonic 0.13.1",
]
@@ -10133,7 +10162,7 @@ dependencies = [
"indexmap 2.9.0",
"pin-project-lite",
"slab",
- "sync_wrapper 1.0.1",
+ "sync_wrapper 1.0.2",
"tokio 1.48.0",
"tokio-util",
"tower-layer",
@@ -10301,16 +10330,6 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-[[package]]
-name = "twox-hash"
-version = "1.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
-dependencies = [
- "cfg-if 1.0.0",
- "static_assertions",
-]
-
[[package]]
name = "typed-builder"
version = "0.21.2"
@@ -10372,12 +10391,12 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
- "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0)",
- "prost",
+ "hyperswitch_masking",
+ "prost 0.14.3",
"regex",
"serde",
"thiserror 1.0.69",
@@ -10388,7 +10407,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"serde",
"strum 0.26.3",
@@ -10399,7 +10418,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=95144b0829b8b3d8c4b0914921b43540abb6ac50#95144b0829b8b3d8c4b0914921b43540abb6ac50"
+source = "git+https://github.com/juspay/connector-service?tag=2026.03.04.0-hotfix1#1e9287e60753e247c8ea584fbe5fde28e0563b1a"
dependencies = [
"anyhow",
"base64 0.21.7",
@@ -10410,7 +10429,7 @@ dependencies = [
"error-stack 0.4.1",
"hex",
"http 1.3.1",
- "masking 0.1.0 (git+https://github.com/juspay/hyperswitch?tag=2025.11.24.0)",
+ "hyperswitch_masking",
"md5",
"nanoid",
"once_cell",
@@ -10428,7 +10447,7 @@ dependencies = [
"strum 0.26.3",
"thiserror 1.0.69",
"time",
- "tonic 0.13.1",
+ "tonic 0.14.5",
"tracing",
"ucs_common_enums",
"url",
@@ -10759,13 +10778,13 @@ dependencies = [
[[package]]
name = "uuid"
-version = "1.18.1"
+version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2"
+checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
dependencies = [
- "getrandom 0.3.3",
+ "getrandom 0.4.1",
"js-sys",
- "serde",
+ "serde_core",
"wasm-bindgen",
]
@@ -10929,6 +10948,24 @@ dependencies = [
"wit-bindgen-rt",
]
+[[package]]
+name = "wasip2"
+version = "1.0.2+wasi-0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
+dependencies = [
+ "wit-bindgen",
+]
+
+[[package]]
+name = "wasip3"
+version = "0.4.0+wasi-0.3.0-rc-2026-01-06"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5"
+dependencies = [
+ "wit-bindgen",
+]
+
[[package]]
name = "wasite"
version = "0.1.0"
@@ -11005,6 +11042,28 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "wasm-encoder"
+version = "0.244.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319"
+dependencies = [
+ "leb128fmt",
+ "wasmparser",
+]
+
+[[package]]
+name = "wasm-metadata"
+version = "0.244.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
+dependencies = [
+ "anyhow",
+ "indexmap 2.9.0",
+ "wasm-encoder",
+ "wasmparser",
+]
+
[[package]]
name = "wasm-streams"
version = "0.4.1"
@@ -11018,6 +11077,18 @@ dependencies = [
"web-sys",
]
+[[package]]
+name = "wasmparser"
+version = "0.244.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
+dependencies = [
+ "bitflags 2.9.0",
+ "hashbrown 0.15.2",
+ "indexmap 2.9.0",
+ "semver 1.0.26",
+]
+
[[package]]
name = "web-sys"
version = "0.3.77"
@@ -11500,6 +11571,26 @@ dependencies = [
"url",
]
+[[package]]
+name = "wit-bindgen"
+version = "0.51.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
+dependencies = [
+ "wit-bindgen-rust-macro",
+]
+
+[[package]]
+name = "wit-bindgen-core"
+version = "0.51.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
+dependencies = [
+ "anyhow",
+ "heck 0.5.0",
+ "wit-parser",
+]
+
[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
@@ -11509,6 +11600,74 @@ dependencies = [
"bitflags 2.9.0",
]
+[[package]]
+name = "wit-bindgen-rust"
+version = "0.51.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
+dependencies = [
+ "anyhow",
+ "heck 0.5.0",
+ "indexmap 2.9.0",
+ "prettyplease",
+ "syn 2.0.101",
+ "wasm-metadata",
+ "wit-bindgen-core",
+ "wit-component",
+]
+
+[[package]]
+name = "wit-bindgen-rust-macro"
+version = "0.51.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a"
+dependencies = [
+ "anyhow",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+ "wit-bindgen-core",
+ "wit-bindgen-rust",
+]
+
+[[package]]
+name = "wit-component"
+version = "0.244.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
+dependencies = [
+ "anyhow",
+ "bitflags 2.9.0",
+ "indexmap 2.9.0",
+ "log",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "wasm-encoder",
+ "wasm-metadata",
+ "wasmparser",
+ "wit-parser",
+]
+
+[[package]]
+name = "wit-parser"
+version = "0.244.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
+dependencies = [
+ "anyhow",
+ "id-arena",
+ "indexmap 2.9.0",
+ "log",
+ "semver 1.0.26",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "unicode-xid",
+ "wasmparser",
+]
+
[[package]]
name = "write16"
version = "1.0.0"
diff --git a/add_connector.md b/add_connector.md
index 9c63f1d238..07fb443311 100644
--- a/add_connector.md
+++ b/add_connector.md
@@ -745,7 +745,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} {
connectors.{{project-name}}.base_url.as_ref()
}
- fn get_auth_header(&self, auth_type:&ConnectorAuthType)-> CustomResult<Vec<(String,masking::Maskable<String>)>,errors::ConnectorError> {
+ fn get_auth_header(&self, auth_type:&ConnectorAuthType)-> CustomResult<Vec<(String,hyperswitch_masking::Maskable<String>)>,errors::ConnectorError> {
let auth = {{project-name | downcase}}::{{project-name | downcase | pascal_case}}AuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(headers::AUTHORIZATION.to_string(), auth.api_key.expose().into_masked())])
@@ -810,7 +810,7 @@ fn id(&self) -> &'static str {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
let auth = BillwerkAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = BASE64_ENGINE.encode(format!("{}:", auth.api_key.peek()));
diff --git a/connector-template/mod.rs b/connector-template/mod.rs
index 048ceaf89e..3ce5dd5579 100644
--- a/connector-template/mod.rs
+++ b/connector-template/mod.rs
@@ -1,7 +1,7 @@
pub mod transformers;
use error_stack::{report, ResultExt};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use common_utils::{
errors::CustomResult,
@@ -96,7 +96,7 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -127,7 +127,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} {
connectors.{{project-name}}.base_url.as_ref()
}
- fn get_auth_header(&self, auth_type:&ConnectorAuthType)-> CustomResult<Vec<(String,masking::Maskable<String>)>,errors::ConnectorError> {
+ fn get_auth_header(&self, auth_type:&ConnectorAuthType)-> CustomResult<Vec<(String,hyperswitch_masking::Maskable<String>)>,errors::ConnectorError> {
let auth = {{project-name | downcase}}::{{project-name | downcase | pascal_case}}AuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(headers::AUTHORIZATION.to_string(), auth.api_key.expose().into_masked())])
@@ -220,7 +220,7 @@ impl
PaymentsAuthorizeData,
PaymentsResponseData,
> for {{project-name | downcase | pascal_case}} {
- fn get_headers(&self, req: &PaymentsAuthorizeRouterData, connectors: &Connectors,) -> CustomResult<Vec<(String, masking::Maskable<String>)>,errors::ConnectorError> {
+ fn get_headers(&self, req: &PaymentsAuthorizeRouterData, connectors: &Connectors,) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>,errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -300,7 +300,7 @@ impl
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -370,7 +370,7 @@ impl
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -454,7 +454,7 @@ impl
RefundsData,
RefundsResponseData,
> for {{project-name | downcase | pascal_case}} {
- fn get_headers(&self, req: &RefundsRouterData<Execute>, connectors: &Connectors,) -> CustomResult<Vec<(String,masking::Maskable<String>)>,errors::ConnectorError> {
+ fn get_headers(&self, req: &RefundsRouterData<Execute>, connectors: &Connectors,) -> CustomResult<Vec<(String,hyperswitch_masking::Maskable<String>)>,errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -519,7 +519,7 @@ impl
impl
ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for {{project-name | downcase | pascal_case}} {
- fn get_headers(&self, req: &RefundSyncRouterData,connectors: &Connectors,) -> CustomResult<Vec<(String, masking::Maskable<String>)>,errors::ConnectorError> {
+ fn get_headers(&self, req: &RefundSyncRouterData,connectors: &Connectors,) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>,errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -590,7 +590,7 @@ impl webhooks::IncomingWebhook for {{project-name | downcase | pascal_case}} {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError> {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/connector-template/test.rs b/connector-template/test.rs
index 126f6cdd2d..e9d6e6668f 100644
--- a/connector-template/test.rs
+++ b/connector-template/test.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
types::{self, api, storage::enums,
}};
diff --git a/connector-template/transformers.rs b/connector-template/transformers.rs
index a14d7438dc..da5428b022 100644
--- a/connector-template/transformers.rs
+++ b/connector-template/transformers.rs
@@ -1,6 +1,6 @@
use common_enums::enums;
use serde::{Deserialize, Serialize};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use common_utils::types::{StringMinorUnit};
use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData,
diff --git a/crates/analytics/Cargo.toml b/crates/analytics/Cargo.toml
index 6a35cd22af..edd711940d 100644
--- a/crates/analytics/Cargo.toml
+++ b/crates/analytics/Cargo.toml
@@ -17,7 +17,7 @@ common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils" }
diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"], default-features = false }
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces", default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] }
storage_impl = { version = "0.1.0", path = "../storage_impl", default-features = false }
currency_conversion = { version = "0.1.0", path = "../currency_conversion" }
diff --git a/crates/analytics/src/lib.rs b/crates/analytics/src/lib.rs
index 2b98a0b7ca..dc1b0cd8b1 100644
--- a/crates/analytics/src/lib.rs
+++ b/crates/analytics/src/lib.rs
@@ -1047,7 +1047,7 @@ impl SecretsHandler for AnalyticsConfig {
let analytics_config = value.get_inner();
let decrypted_password = match analytics_config {
// Todo: Perform kms decryption of clickhouse password
- Self::Clickhouse { .. } => masking::Secret::new(String::default()),
+ Self::Clickhouse { .. } => hyperswitch_masking::Secret::new(String::default()),
Self::Sqlx { sqlx, .. }
| Self::CombinedCkh { sqlx, .. }
| Self::CombinedSqlx { sqlx, .. } => {
diff --git a/crates/api_models/Cargo.toml b/crates/api_models/Cargo.toml
index 5c1c426309..2e2afbd8f9 100644
--- a/crates/api_models/Cargo.toml
+++ b/crates/api_models/Cargo.toml
@@ -45,7 +45,7 @@ common_enums = { version = "0.1.0", path = "../common_enums" }
common_types = { version = "0.1.0", path = "../common_types" }
common_utils = { version = "0.1.0", path = "../common_utils" }
euclid = { version = "0.1.0", path = "../euclid" }
-masking = { version = "0.1.0", path = "../masking", default-features = false, features = ["alloc", "serde"] }
+hyperswitch_masking = { version = "0.0.1", default-features = false, features = ["alloc", "serde", "time"] }
router_derive = { version = "0.1.0", path = "../router_derive" }
smithy = { version = "0.1.0", path = "../smithy" }
smithy-core = { version = "0.1.0", path = "../smithy-core" }
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 7c00327abb..465e40f7e5 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -11,8 +11,8 @@ use common_utils::{
#[cfg(feature = "v1")]
use common_utils::{crypto::OptionalEncryptableName, ext_traits::ValueExt};
#[cfg(feature = "v2")]
-use masking::ExposeInterface;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use smithy::SmithyModel;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/analytics/search.rs b/crates/api_models/src/analytics/search.rs
index 9ed344bdee..890a7d71a2 100644
--- a/crates/api_models/src/analytics/search.rs
+++ b/crates/api_models/src/analytics/search.rs
@@ -1,5 +1,5 @@
use common_utils::{hashing::HashedString, types::TimeRange};
-use masking::{ExposeInterface, WithType};
+use hyperswitch_masking::{ExposeInterface, WithType};
use serde_json::Value;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
diff --git a/crates/api_models/src/api_keys.rs b/crates/api_models/src/api_keys.rs
index dad6495aec..fcca4e4c78 100644
--- a/crates/api_models/src/api_keys.rs
+++ b/crates/api_models/src/api_keys.rs
@@ -1,5 +1,5 @@
use common_utils::custom_serde;
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/authentication.rs b/crates/api_models/src/authentication.rs
index 0e0f415e5c..a6eb60477d 100644
--- a/crates/api_models/src/authentication.rs
+++ b/crates/api_models/src/authentication.rs
@@ -99,7 +99,7 @@ pub struct AuthenticationResponse {
/// The client secret for this authentication, to be used for client-side operations.
#[schema(value_type = Option<String>, example = "auth_mbabizu24mvu3mela5njyhpit4_secret_el9ksDkiB8hi6j9N78yo")]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// The amount for the transaction.
#[schema(value_type = MinorUnit, example = 1000)]
@@ -225,7 +225,7 @@ pub struct AuthenticationEligibilityRequest {
/// Optional secret value used to identify and authorize the client making the request.
/// This can help ensure that the payment session is secure and valid.
#[schema(value_type = Option<String>)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// Optional identifier for the business profile associated with the payment.
/// This determines which configurations, rules, and branding are applied to the transaction.
@@ -337,7 +337,7 @@ pub struct AuthenticationEligibilityCheckRequest {
/// Optional secret value used to identify and authorize the client making the request.
/// This can help ensure that the payment session is secure and valid.
#[schema(value_type = Option<String>)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// The data for this authentication eligibility check.
pub eligibility_check_data: AuthenticationEligibilityCheckData,
}
@@ -516,7 +516,7 @@ pub struct AuthenticationAuthenticateRequest {
pub authentication_id: id_type::AuthenticationId,
/// Client secret for the authentication
#[schema(value_type = String)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// SDK Information if request is from SDK
pub sdk_information: Option<SdkInformation>,
/// Device Channel indicating whether request is coming from App or Browser
@@ -565,7 +565,7 @@ pub struct AuthenticationAuthenticateResponse {
pub error_code: Option<String>,
/// The authentication value for this authentication, only available in case of server to server request. Unavailable in case of client request due to security concern.
#[schema(value_type = String)]
- pub authentication_value: Option<masking::Secret<String>>,
+ pub authentication_value: Option<hyperswitch_masking::Secret<String>>,
/// The current status of the authentication (e.g., Started).
#[schema(value_type = AuthenticationStatus)]
@@ -614,7 +614,7 @@ pub struct AuthenticationSyncResponse {
/// The client secret for this authentication.
#[schema(value_type = Option<String>)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// The amount for the transaction.
#[schema(value_type = MinorUnit, example = 1000)]
@@ -754,20 +754,20 @@ pub enum AuthenticationPaymentMethodDataResponse {
CardData {
/// card expiry year
#[schema(value_type = Option<String>)]
- card_expiry_year: Option<masking::Secret<String>>,
+ card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
/// card expiry month
#[schema(value_type = Option<String>)]
- card_expiry_month: Option<masking::Secret<String>>,
+ card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
},
NetworkTokenData {
/// network token expiry month
#[schema(value_type = Option<String>)]
- network_token_expiry_month: Option<masking::Secret<String>>,
+ network_token_expiry_month: Option<hyperswitch_masking::Secret<String>>,
/// network token expiry year
#[schema(value_type = Option<String>)]
- network_token_expiry_year: Option<masking::Secret<String>>,
+ network_token_expiry_year: Option<hyperswitch_masking::Secret<String>>,
},
}
@@ -779,43 +779,43 @@ pub enum AuthenticationVaultTokenData {
/// token representing card_number
#[schema(value_type = Option<String>)]
#[serde(rename = "card_number")]
- tokenized_card_number: Option<masking::Secret<String>>,
+ tokenized_card_number: Option<hyperswitch_masking::Secret<String>>,
/// token representing card_expiry_year
#[schema(value_type = Option<String>)]
#[serde(rename = "card_expiry_year")]
- tokenized_card_expiry_year: Option<masking::Secret<String>>,
+ tokenized_card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
/// token representing card_expiry_month
#[schema(value_type = Option<String>)]
#[serde(rename = "card_expiry_month")]
- tokenized_card_expiry_month: Option<masking::Secret<String>>,
+ tokenized_card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
/// token representing card_cvc
#[schema(value_type = Option<String>)]
#[serde(rename = "card_cvc")]
- tokenized_card_cvc: Option<masking::Secret<String>>,
+ tokenized_card_cvc: Option<hyperswitch_masking::Secret<String>>,
},
NetworkTokenData {
/// token representing payment_token
#[schema(value_type = Option<String>)]
#[serde(rename = "network_token")]
- tokenized_network_token: Option<masking::Secret<String>>,
+ tokenized_network_token: Option<hyperswitch_masking::Secret<String>>,
/// token representing token_expiry_year
#[schema(value_type = Option<String>)]
#[serde(rename = "network_token_expiry_year")]
- tokenized_expiry_year: Option<masking::Secret<String>>,
+ tokenized_expiry_year: Option<hyperswitch_masking::Secret<String>>,
/// token representing token_expiry_month
#[schema(value_type = Option<String>)]
#[serde(rename = "network_token_expiry_month")]
- tokenized_expiry_month: Option<masking::Secret<String>>,
+ tokenized_expiry_month: Option<hyperswitch_masking::Secret<String>>,
/// token representing token_cryptogram
#[schema(value_type = Option<String>)]
#[serde(rename = "network_token_cryptogram")]
- tokenized_cryptogram: Option<masking::Secret<String>>,
+ tokenized_cryptogram: Option<hyperswitch_masking::Secret<String>>,
},
}
@@ -832,7 +832,7 @@ impl ApiEventMetric for AuthenticationSyncResponse {
pub struct AuthenticationSyncRequest {
/// The client secret for this authentication.
#[schema(value_type = String)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// Payment method data for Post Authentication sync
pub payment_method_details: Option<PostAuthenticationRequestPaymentMethodData>,
/// Authentication ID for the authentication
@@ -879,7 +879,7 @@ pub struct ClickToPayDetails {
pub provider: Option<super::enums::CtpServiceProvider>,
/// Encrypted payload
#[schema(value_type = Option<String>)]
- pub encrypted_payload: Option<masking::Secret<String>>,
+ pub encrypted_payload: Option<hyperswitch_masking::Secret<String>>,
}
impl ApiEventMetric for AuthenticationSyncRequest {
@@ -912,7 +912,7 @@ pub struct AuthenticationSessionTokenRequest {
pub authentication_id: id_type::AuthenticationId,
/// Client Secret for the authentication
#[schema(value_type = String)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
diff --git a/crates/api_models/src/blocklist.rs b/crates/api_models/src/blocklist.rs
index 8f71bbae86..1f9900704a 100644
--- a/crates/api_models/src/blocklist.rs
+++ b/crates/api_models/src/blocklist.rs
@@ -1,6 +1,6 @@
use common_enums::enums;
use common_utils::events::ApiEventMetric;
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use utoipa::ToSchema;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
diff --git a/crates/api_models/src/chat.rs b/crates/api_models/src/chat.rs
index 975197fd3f..7cdb6e7c0f 100644
--- a/crates/api_models/src/chat.rs
+++ b/crates/api_models/src/chat.rs
@@ -1,5 +1,5 @@
use common_utils::id_type;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::PrimitiveDateTime;
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
diff --git a/crates/api_models/src/customers.rs b/crates/api_models/src/customers.rs
index 186845e0fb..59b65e0538 100644
--- a/crates/api_models/src/customers.rs
+++ b/crates/api_models/src/customers.rs
@@ -6,7 +6,7 @@ use common_utils::{
id_type, pii,
types::Description,
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use smithy::SmithyModel;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/disputes.rs b/crates/api_models/src/disputes.rs
index bf59a4871d..9a5aaa3b99 100644
--- a/crates/api_models/src/disputes.rs
+++ b/crates/api_models/src/disputes.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use common_utils::types::{StringMinorUnit, TimeRange};
-use masking::{Deserialize, Serialize};
+use hyperswitch_masking::{Deserialize, Serialize};
use serde::de::Error;
use smithy::SmithyModel;
use time::PrimitiveDateTime;
diff --git a/crates/api_models/src/ephemeral_key.rs b/crates/api_models/src/ephemeral_key.rs
index 6301ca4190..3a888ece3d 100644
--- a/crates/api_models/src/ephemeral_key.rs
+++ b/crates/api_models/src/ephemeral_key.rs
@@ -1,6 +1,6 @@
use common_utils::id_type;
#[cfg(feature = "v2")]
-use masking::Secret;
+use hyperswitch_masking::Secret;
use smithy::SmithyModel;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/events/recon.rs b/crates/api_models/src/events/recon.rs
index 596b054128..dd2dc44ef5 100644
--- a/crates/api_models/src/events/recon.rs
+++ b/crates/api_models/src/events/recon.rs
@@ -1,5 +1,5 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use crate::recon::{
ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest, VerifyTokenResponse,
diff --git a/crates/api_models/src/external_service_auth.rs b/crates/api_models/src/external_service_auth.rs
index 775529c435..dea43b6169 100644
--- a/crates/api_models/src/external_service_auth.rs
+++ b/crates/api_models/src/external_service_auth.rs
@@ -1,5 +1,5 @@
use common_utils::{id_type, pii};
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[derive(Debug, serde::Serialize)]
pub struct ExternalTokenResponse {
diff --git a/crates/api_models/src/mandates.rs b/crates/api_models/src/mandates.rs
index 189a80e857..3a6f2fc92d 100644
--- a/crates/api_models/src/mandates.rs
+++ b/crates/api_models/src/mandates.rs
@@ -1,5 +1,5 @@
use common_types::payments as common_payments_types;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use smithy::SmithyModel;
use time::PrimitiveDateTime;
diff --git a/crates/api_models/src/oidc.rs b/crates/api_models/src/oidc.rs
index e756f77f57..6f46de21a9 100644
--- a/crates/api_models/src/oidc.rs
+++ b/crates/api_models/src/oidc.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use common_utils::events::ApiEventMetric;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
diff --git a/crates/api_models/src/organization.rs b/crates/api_models/src/organization.rs
index fa6dc01c98..e8db98c6d8 100644
--- a/crates/api_models/src/organization.rs
+++ b/crates/api_models/src/organization.rs
@@ -1,6 +1,6 @@
use common_enums::OrganizationType;
use common_utils::{id_type, pii};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use utoipa::ToSchema;
pub struct OrganizationNew {
pub org_id: id_type::OrganizationId,
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index eb9e436f54..46337ba9a2 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -17,7 +17,7 @@ use common_utils::{
types::{FloatMajorUnit, MinorUnit, Percentage, Surcharge},
};
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use serde::de;
use utoipa::ToSchema;
@@ -555,7 +555,7 @@ pub struct PaymentMethodUpdate {
/// The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)
/// when `setup_future_usage` is set to `off_session`.
#[schema(value_type = Option<String>)]
- pub network_transaction_id: Option<masking::Secret<String>>,
+ pub network_transaction_id: Option<hyperswitch_masking::Secret<String>>,
/// The acknowledgement status of the payment method update, this is used to determine the status of the payment method update
#[schema(value_type = Option<AcknowledgementStatus>)]
@@ -607,12 +607,12 @@ pub enum PaymentMethodCreateData {
pub enum BankDebitDetail {
Ach {
#[schema(value_type = String)]
- account_number: masking::Secret<String>,
+ account_number: hyperswitch_masking::Secret<String>,
#[schema(value_type = String)]
- routing_number: masking::Secret<String>,
+ routing_number: hyperswitch_masking::Secret<String>,
#[schema(value_type = Option<String>)]
#[serde(default)]
- bank_account_holder_name: Option<masking::Secret<String>>,
+ bank_account_holder_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<BankType>)]
#[serde(default)]
bank_type: Option<common_enums::BankType>,
@@ -651,7 +651,7 @@ impl BankDebitDetail {
}
}
- pub fn get_bank_account_holder_name(&self) -> Option<masking::Secret<String>> {
+ pub fn get_bank_account_holder_name(&self) -> Option<hyperswitch_masking::Secret<String>> {
match self {
Self::Ach {
bank_account_holder_name,
@@ -685,23 +685,23 @@ pub struct CardDetail {
/// Card Expiry Month
#[schema(value_type = String,example = "10")]
- pub card_exp_month: masking::Secret<String>,
+ pub card_exp_month: hyperswitch_masking::Secret<String>,
/// Card Expiry Year
#[schema(value_type = String,example = "25")]
- pub card_exp_year: masking::Secret<String>,
+ pub card_exp_year: hyperswitch_masking::Secret<String>,
/// Card CVC for Volatile Storage
#[schema(value_type = Option<String>,example = "123")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Issuing Country
pub card_issuing_country: Option<String>,
@@ -752,19 +752,19 @@ pub struct CardDetail {
/// Card Expiry Month
#[schema(value_type = String,example = "10")]
- pub card_exp_month: masking::Secret<String>,
+ pub card_exp_month: hyperswitch_masking::Secret<String>,
/// Card Expiry Year
#[schema(value_type = String,example = "25")]
- pub card_exp_year: masking::Secret<String>,
+ pub card_exp_year: hyperswitch_masking::Secret<String>,
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Issuing Country
#[schema(value_type = CountryAlpha2)]
@@ -783,7 +783,7 @@ pub struct CardDetail {
/// The CVC number for the card
/// This is optional in case the card needs to be vaulted
#[schema(value_type = String, example = "242")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
// This struct is for collecting Proxy Card Data
@@ -794,15 +794,15 @@ pub struct CardDetail {
pub struct ProxyCardDetails {
/// Tokenized Card Number
#[schema(value_type = String,example = "tok_sjfowhoejsldj")]
- pub card_number: masking::Secret<String>,
+ pub card_number: hyperswitch_masking::Secret<String>,
/// Card Expiry Month
#[schema(value_type = String,example = "10")]
- pub card_exp_month: masking::Secret<String>,
+ pub card_exp_month: hyperswitch_masking::Secret<String>,
/// Card Expiry Year
#[schema(value_type = String,example = "25")]
- pub card_exp_year: masking::Secret<String>,
+ pub card_exp_year: hyperswitch_masking::Secret<String>,
/// First Six Digit of Card Number
pub bin_number: Option<String>,
@@ -825,16 +825,16 @@ pub struct ProxyCardDetails {
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// The CVC number for the card
/// This is optional in case the card needs to be vaulted
#[schema(value_type = String, example = "242")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
@@ -842,23 +842,23 @@ pub struct ProxyCardDetails {
pub struct MigrateCardDetail {
/// Card Number
#[schema(value_type = String,example = "4111111145551142")]
- pub card_number: masking::Secret<String>,
+ pub card_number: hyperswitch_masking::Secret<String>,
/// Card Expiry Month
#[schema(value_type = String,example = "10")]
- pub card_exp_month: masking::Secret<String>,
+ pub card_exp_month: hyperswitch_masking::Secret<String>,
/// Card Expiry Year
#[schema(value_type = String,example = "25")]
- pub card_exp_year: masking::Secret<String>,
+ pub card_exp_year: hyperswitch_masking::Secret<String>,
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Issuing Country
pub card_issuing_country: Option<String>,
@@ -886,19 +886,19 @@ pub struct MigrateNetworkTokenData {
/// Network Token Expiry Month
#[schema(value_type = String,example = "10")]
- pub network_token_exp_month: masking::Secret<String>,
+ pub network_token_exp_month: hyperswitch_masking::Secret<String>,
/// Network Token Expiry Year
#[schema(value_type = String,example = "25")]
- pub network_token_exp_year: masking::Secret<String>,
+ pub network_token_exp_year: hyperswitch_masking::Secret<String>,
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Issuing Country
pub card_issuing_country: Option<String>,
@@ -933,19 +933,19 @@ pub struct MigrateNetworkTokenDetail {
pub struct CardDetailUpdate {
/// Card Expiry Month
#[schema(value_type = String, example = "10")]
- pub card_exp_month: Option<masking::Secret<String>>,
+ pub card_exp_month: Option<hyperswitch_masking::Secret<String>>,
/// Card Expiry Year
#[schema(value_type = String, example = "25")]
- pub card_exp_year: Option<masking::Secret<String>>,
+ pub card_exp_year: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder Name
#[schema(value_type = String, example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>, example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card's Last 4 Digits
#[schema(value_type = Option<String>, example = "1111")]
@@ -985,10 +985,9 @@ impl CardDetailUpdate {
.card_holder_name
.clone()
.or(card_data_from_locker.name_on_card),
- nick_name: self
+ nick_name: self.nick_name.clone().or(card_data_from_locker
.nick_name
- .clone()
- .or(card_data_from_locker.nick_name.map(masking::Secret::new)),
+ .map(hyperswitch_masking::Secret::new)),
card_cvc: None,
card_issuing_country: None,
card_issuing_country_code: None,
@@ -1005,15 +1004,15 @@ impl CardDetailUpdate {
pub struct CardDetailUpdate {
/// Card Holder Name
#[schema(value_type = String,example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>,example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// The CVC number for the card
#[schema(value_type = Option<String>, example = "242")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
#[cfg(feature = "v2")]
@@ -1027,10 +1026,9 @@ impl CardDetailUpdate {
.card_holder_name
.clone()
.or(card_data_from_locker.name_on_card),
- nick_name: self
+ nick_name: self.nick_name.clone().or(card_data_from_locker
.nick_name
- .clone()
- .or(card_data_from_locker.nick_name.map(masking::Secret::new)),
+ .map(hyperswitch_masking::Secret::new)),
card_issuing_country: None,
card_network: None,
card_issuer: None,
@@ -1211,7 +1209,7 @@ pub struct ConnectorTokenDetails {
pub metadata: Option<pii::SecretSerdeValue>,
/// The value of the connector token. This token can be used to make merchant initiated payments ( MIT ), directly with the connector.
- pub token: masking::Secret<String>,
+ pub token: hyperswitch_masking::Secret<String>,
}
#[cfg(feature = "v2")]
@@ -1275,7 +1273,7 @@ pub struct PaymentMethodResponse {
/// The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)
/// when `setup_future_usage` is set to `off_session`.
#[schema(value_type = String)]
- pub network_transaction_id: Option<masking::Secret<String>>,
+ pub network_transaction_id: Option<hyperswitch_masking::Secret<String>>,
/// The raw data associated with the payment method
#[schema(value_type = RawPaymentMethodData)]
@@ -1335,7 +1333,7 @@ impl PaymentMethodsData {
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct ExternalVaultTokenData {
/// Tokenized reference for Card Number
- pub tokenized_card_number: masking::Secret<String>,
+ pub tokenized_card_number: hyperswitch_masking::Secret<String>,
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
@@ -1343,10 +1341,10 @@ pub struct CardDetailsPaymentMethod {
pub last4_digits: Option<String>,
pub issuer_country: Option<String>,
pub issuer_country_code: Option<String>,
- pub expiry_month: Option<masking::Secret<String>>,
- pub expiry_year: Option<masking::Secret<String>>,
- pub nick_name: Option<masking::Secret<String>>,
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ pub expiry_year: Option<hyperswitch_masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
pub card_isin: Option<String>,
pub card_issuer: Option<String>,
pub card_network: Option<api_enums::CardNetwork>,
@@ -1362,8 +1360,8 @@ pub enum BankDebitDetailsPaymentMethod {
AchBankDebit {
masked_account_number: String,
masked_routing_number: String,
- card_holder_name: Option<masking::Secret<String>>,
- bank_account_holder_name: Option<masking::Secret<String>>,
+ card_holder_name: Option<hyperswitch_masking::Secret<String>>,
+ bank_account_holder_name: Option<hyperswitch_masking::Secret<String>>,
bank_name: Option<common_enums::BankNames>,
bank_type: Option<common_enums::BankType>,
bank_holder_type: Option<common_enums::BankHolderType>,
@@ -1425,13 +1423,13 @@ pub struct NetworkTokenDetailsPaymentMethod {
#[schema(value_type = Option<CountryAlpha2>)]
pub issuer_country: Option<common_enums::CountryAlpha2>,
#[schema(value_type = Option<String>, example = "05")]
- pub network_token_expiry_month: Option<masking::Secret<String>>,
+ pub network_token_expiry_month: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<String>, example = "27")]
- pub network_token_expiry_year: Option<masking::Secret<String>>,
+ pub network_token_expiry_year: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<String>, example = "Card")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<String>, example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<String>, example = "16712672")]
pub card_isin: Option<String>,
#[schema(value_type = Option<String>, example = "Bank of America")]
@@ -1443,7 +1441,7 @@ pub struct NetworkTokenDetailsPaymentMethod {
#[serde(default = "saved_in_locker_default")]
pub saved_to_locker: bool,
#[schema(value_type = Option<String>, example = "522134KAVJ1JPZ8L77N0Z2LRYZS7J")]
- pub par: Option<masking::Secret<String>>,
+ pub par: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
@@ -1467,10 +1465,10 @@ pub struct PaymentMethodDataWalletInfo {
pub card_type: Option<String>,
/// The card's expiry month
#[schema(value_type = Option<String>,example = "10")]
- pub card_exp_month: Option<masking::Secret<String>>,
+ pub card_exp_month: Option<hyperswitch_masking::Secret<String>>,
/// The card's expiry year
#[schema(value_type = Option<String>,example = "25")]
- pub card_exp_year: Option<masking::Secret<String>>,
+ pub card_exp_year: Option<hyperswitch_masking::Secret<String>>,
/// Unique authorisation code for the payment
#[schema(value_type = Option<String>,example = "003225")]
pub auth_code: Option<String>,
@@ -1547,14 +1545,14 @@ pub struct BankAccountTokenData {
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BankAccountConnectorDetails {
pub connector: String,
- pub account_id: masking::Secret<String>,
+ pub account_id: hyperswitch_masking::Secret<String>,
pub mca_id: id_type::MerchantConnectorAccountId,
pub access_token: BankAccountAccessCreds,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum BankAccountAccessCreds {
- AccessToken(masking::Secret<String>),
+ AccessToken(hyperswitch_masking::Secret<String>),
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
@@ -1580,9 +1578,9 @@ impl LockerCardResponse {
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct Card {
pub card_number: CardNumber,
- pub name_on_card: Option<masking::Secret<String>>,
- pub card_exp_month: masking::Secret<String>,
- pub card_exp_year: masking::Secret<String>,
+ pub name_on_card: Option<hyperswitch_masking::Secret<String>>,
+ pub card_exp_month: hyperswitch_masking::Secret<String>,
+ pub card_exp_year: hyperswitch_masking::Secret<String>,
pub card_brand: Option<String>,
pub card_isin: Option<String>,
pub nick_name: Option<String>,
@@ -1596,7 +1594,7 @@ impl From<(Card, Option<common_enums::CardNetwork>)> for CardDetail {
card_exp_month: card.card_exp_month.clone(),
card_exp_year: card.card_exp_year.clone(),
card_holder_name: card.name_on_card.clone(),
- nick_name: card.nick_name.map(masking::Secret::new),
+ nick_name: card.nick_name.map(hyperswitch_masking::Secret::new),
card_cvc: None,
card_issuing_country: None,
card_issuing_country_code: None,
@@ -1619,22 +1617,22 @@ pub struct CardDetailFromLocker {
pub card_number: Option<CardNumber>,
#[schema(value_type=Option<String>)]
- pub expiry_month: Option<masking::Secret<String>>,
+ pub expiry_month: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>)]
- pub expiry_year: Option<masking::Secret<String>>,
+ pub expiry_year: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>)]
- pub card_token: Option<masking::Secret<String>>,
+ pub card_token: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>)]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>)]
- pub card_fingerprint: Option<masking::Secret<String>>,
+ pub card_fingerprint: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>)]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<CardNetwork>)]
pub card_network: Option<api_enums::CardNetwork>,
@@ -1657,19 +1655,19 @@ pub struct CardDetailFromLocker {
pub card_number: Option<CardNumber>,
#[schema(value_type=Option<String>, example = "10")]
- pub expiry_month: Option<masking::Secret<String>>,
+ pub expiry_month: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>, example = "25")]
- pub expiry_year: Option<masking::Secret<String>>,
+ pub expiry_year: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>, example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>, example = "fingerprint_12345")]
- pub card_fingerprint: Option<masking::Secret<String>>,
+ pub card_fingerprint: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type=Option<String>, example = "Card")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
#[schema(value_type = Option<CardNetwork>, example = "VISA")]
pub card_network: Option<api_enums::CardNetwork>,
@@ -2080,7 +2078,7 @@ pub struct RequiredFieldInfo {
pub field_type: api_enums::FieldType,
#[schema(value_type = Option<String>)]
- pub value: Option<masking::Secret<String>>,
+ pub value: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Clone, serde::Serialize, ToSchema)]
@@ -2503,7 +2501,7 @@ pub struct PaymentMethodListIntentData {
/// Client secret for client-side payment confirmation
#[schema(value_type = Option<String>)]
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
/// A description for the payment
pub description: Option<String>,
@@ -2533,7 +2531,7 @@ pub struct PaymentMethodListIntentData {
/// Order details for the payment
#[schema(value_type = Option<Vec<Object>>)]
- pub order_details: Option<Vec<masking::Secret<serde_json::Value>>>,
+ pub order_details: Option<Vec<hyperswitch_masking::Secret<serde_json::Value>>>,
/// Timestamp when the payment was created
pub created: Option<time::PrimitiveDateTime>,
@@ -2723,15 +2721,15 @@ pub struct NetworkTokenDetailsResponse {
/// Expiry month of the network token
#[schema(value_type = String)]
- pub network_token_exp_month: masking::Secret<String>,
+ pub network_token_exp_month: hyperswitch_masking::Secret<String>,
/// Expiry year of the network token
#[schema(value_type = String)]
- pub network_token_exp_year: masking::Secret<String>,
+ pub network_token_exp_year: hyperswitch_masking::Secret<String>,
/// Cryptogram generated by the Network
#[schema(value_type = Option<String>)]
- pub cryptogram: Option<masking::Secret<String>>,
+ pub cryptogram: Option<hyperswitch_masking::Secret<String>>,
/// Issuer of the card
pub card_issuer: Option<String>,
@@ -2752,11 +2750,11 @@ pub struct NetworkTokenDetailsResponse {
/// Name of the card holder
#[schema(value_type = Option<String>)]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Nick name of the card holder
#[schema(value_type = Option<String>)]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// ECI indicator of the card
pub eci: Option<String>,
@@ -3083,7 +3081,7 @@ pub struct PaymentMethodCollectLinkResponse {
/// URL to the form's link generated for collecting payment method details.
#[schema(value_type = String, example = "https://sandbox.hyperswitch.io/payment_method/collect/pm_collect_link_2bdacf398vwzq5n422S1")]
- pub link: masking::Secret<url::Url>,
+ pub link: hyperswitch_masking::Secret<url::Url>,
/// Redirect to this URL post completion
#[schema(value_type = Option<String>, example = "https://sandbox.hyperswitch.io/payment_method/collect/pm_collect_link_2bdacf398vwzq5n422S1/status")]
@@ -3112,8 +3110,8 @@ pub struct PaymentMethodCollectLinkRenderRequest {
#[derive(Clone, Debug, serde::Serialize)]
pub struct PaymentMethodCollectLinkDetails {
- pub publishable_key: masking::Secret<String>,
- pub client_secret: masking::Secret<String>,
+ pub publishable_key: hyperswitch_masking::Secret<String>,
+ pub client_secret: hyperswitch_masking::Secret<String>,
pub pm_collect_link_id: String,
pub customer_id: id_type::CustomerId,
#[serde(with = "common_utils::custom_serde::iso8601")]
@@ -3271,53 +3269,53 @@ pub struct TokenizedBankRedirectValue2 {
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
pub struct PaymentMethodRecord {
pub customer_id: id_type::CustomerId,
- pub name: Option<masking::Secret<String>>,
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
pub email: Option<pii::Email>,
- pub phone: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
pub phone_country_code: Option<String>,
pub merchant_id: Option<id_type::MerchantId>,
pub payment_method: Option<api_enums::PaymentMethod>,
pub payment_method_type: Option<api_enums::PaymentMethodType>,
- pub nick_name: Option<masking::Secret<String>>,
- pub payment_instrument_id: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
+ pub payment_instrument_id: Option<hyperswitch_masking::Secret<String>>,
pub connector_customer_id: Option<String>,
pub connector_mandate_request_reference_id: Option<String>,
// Card fields are optional to support non-card CSV rows (e.g., ACH bank debit).
// For card rows these will still be populated normally from the CSV columns.
#[serde(default)]
- pub card_number_masked: Option<masking::Secret<String>>,
+ pub card_number_masked: Option<hyperswitch_masking::Secret<String>>,
#[serde(default)]
- pub card_expiry_month: Option<masking::Secret<String>>,
+ pub card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
#[serde(default)]
- pub card_expiry_year: Option<masking::Secret<String>>,
+ pub card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
pub card_scheme: Option<String>,
pub original_transaction_id: Option<String>,
- pub billing_address_zip: Option<masking::Secret<String>>,
- pub billing_address_state: Option<masking::Secret<String>>,
- pub billing_address_first_name: Option<masking::Secret<String>>,
- pub billing_address_last_name: Option<masking::Secret<String>>,
+ pub billing_address_zip: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_state: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_first_name: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_last_name: Option<hyperswitch_masking::Secret<String>>,
pub billing_address_city: Option<String>,
pub billing_address_country: Option<api_enums::CountryAlpha2>,
- pub billing_address_line1: Option<masking::Secret<String>>,
- pub billing_address_line2: Option<masking::Secret<String>>,
- pub billing_address_line3: Option<masking::Secret<String>>,
- pub raw_card_number: Option<masking::Secret<String>>,
+ pub billing_address_line1: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_line2: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_line3: Option<hyperswitch_masking::Secret<String>>,
+ pub raw_card_number: Option<hyperswitch_masking::Secret<String>>,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub merchant_connector_ids: Option<String>,
pub original_transaction_amount: Option<i64>,
pub original_transaction_currency: Option<common_enums::Currency>,
pub line_number: Option<i64>,
pub network_token_number: Option<CardNumber>,
- pub network_token_expiry_month: Option<masking::Secret<String>>,
- pub network_token_expiry_year: Option<masking::Secret<String>>,
+ pub network_token_expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ pub network_token_expiry_year: Option<hyperswitch_masking::Secret<String>>,
pub network_token_requestor_ref_id: Option<String>,
#[serde(default)]
- pub account_number: Option<masking::Secret<String>>,
+ pub account_number: Option<hyperswitch_masking::Secret<String>>,
#[serde(default)]
- pub routing_number: Option<masking::Secret<String>>,
+ pub routing_number: Option<hyperswitch_masking::Secret<String>>,
#[serde(default)]
- pub bank_account_holder_name: Option<masking::Secret<String>>,
+ pub bank_account_holder_name: Option<hyperswitch_masking::Secret<String>>,
#[serde(default)]
pub bank_type: Option<common_enums::BankType>,
#[serde(default)]
@@ -3354,11 +3352,11 @@ pub struct UpdatePaymentMethodRecord {
pub status: Option<common_enums::PaymentMethodStatus>,
pub network_transaction_id: Option<String>,
pub line_number: Option<i64>,
- pub payment_instrument_id: Option<masking::Secret<String>>,
+ pub payment_instrument_id: Option<hyperswitch_masking::Secret<String>>,
pub connector_customer_id: Option<String>,
pub merchant_connector_ids: Option<String>,
- pub card_expiry_month: Option<masking::Secret<String>>,
- pub card_expiry_year: Option<masking::Secret<String>>,
+ pub card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ pub card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
@@ -3412,7 +3410,7 @@ pub struct PaymentMethodMigrationResponse {
pub migration_status: MigrationStatus,
#[serde(skip_serializing_if = "Option::is_none")]
pub migration_error: Option<String>,
- pub card_number_masked: Option<masking::Secret<String>>,
+ pub card_number_masked: Option<hyperswitch_masking::Secret<String>>,
pub card_migrated: Option<bool>,
pub payment_method_migrated: Option<bool>,
pub network_token_migrated: Option<bool>,
@@ -3727,23 +3725,23 @@ pub struct TokenizeCardRequest {
/// Card Expiry Month
#[schema(value_type = String, example = "10")]
- pub card_expiry_month: masking::Secret<String>,
+ pub card_expiry_month: hyperswitch_masking::Secret<String>,
/// Card Expiry Year
#[schema(value_type = String, example = "25")]
- pub card_expiry_year: masking::Secret<String>,
+ pub card_expiry_year: hyperswitch_masking::Secret<String>,
/// The CVC number for the card
#[schema(value_type = Option<String>, example = "242")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder Name
#[schema(value_type = Option<String>, example = "John Doe")]
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Holder's Nick Name
#[schema(value_type = Option<String>, example = "John Doe")]
- pub nick_name: Option<masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
/// Card Issuing Country
pub card_issuing_country: Option<String>,
@@ -3770,7 +3768,7 @@ pub struct TokenizePaymentMethodRequest {
/// The CVC number for the card
#[schema(value_type = Option<String>, example = "242")]
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Default, serde::Deserialize, serde::Serialize, ToSchema)]
@@ -3803,14 +3801,14 @@ impl common_utils::events::ApiEventMetric for CardNetworkTokenizeResponse {}
impl From<&Card> for MigrateCardDetail {
fn from(card: &Card) -> Self {
Self {
- card_number: masking::Secret::new(card.card_number.get_card_no()),
+ card_number: hyperswitch_masking::Secret::new(card.card_number.get_card_no()),
card_exp_month: card.card_exp_month.clone(),
card_exp_year: card.card_exp_year.clone(),
card_holder_name: card.name_on_card.clone(),
nick_name: card
.nick_name
.as_ref()
- .map(|name| masking::Secret::new(name.clone())),
+ .map(|name| hyperswitch_masking::Secret::new(name.clone())),
card_issuing_country: None,
card_issuing_country_code: None,
card_network: None,
@@ -3893,7 +3891,7 @@ pub struct PaymentMethodSessionUpdateSavedPaymentMethod {
#[cfg(feature = "v2")]
impl PaymentMethodSessionUpdateSavedPaymentMethod {
- pub fn fetch_card_cvc_update(&self) -> Option<masking::Secret<String>> {
+ pub fn fetch_card_cvc_update(&self) -> Option<hyperswitch_masking::Secret<String>> {
match &self.payment_method_update_request.payment_method_data {
Some(PaymentMethodUpdateData::Card(card_update)) => card_update.card_cvc.clone(),
_ => None,
@@ -3972,7 +3970,7 @@ pub struct PaymentMethodSessionResponse {
/// Client Secret
#[schema(value_type = String, example = "cs_9wcXDRVkfEtLEsSnYKgQ")]
- pub client_secret: masking::Secret<String>,
+ pub client_secret: hyperswitch_masking::Secret<String>,
/// The return url to which the user should be redirected to
#[schema(value_type = Option<String>, example = "https://merchant-website.com/return")]
@@ -4042,11 +4040,11 @@ pub struct NetworkTokenStatusCheckSuccessResponse {
/// The expiry month of the network token if active
#[schema(value_type = Option<String>)]
- pub token_expiry_month: Option<masking::Secret<String>>,
+ pub token_expiry_month: Option<hyperswitch_masking::Secret<String>>,
/// The expiry year of the network token if active
#[schema(value_type = Option<String>)]
- pub token_expiry_year: Option<masking::Secret<String>>,
+ pub token_expiry_year: Option<hyperswitch_masking::Secret<String>>,
/// The last four digits of the card if active
pub card_last_four: Option<String>,
@@ -4056,11 +4054,11 @@ pub struct NetworkTokenStatusCheckSuccessResponse {
/// The expiry month of the card if active
#[schema(value_type = Option<String>)]
- pub card_expiry_month: Option<masking::Secret<String>>,
+ pub card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
/// The expiry year of the card if active
#[schema(value_type = Option<String>)]
- pub card_expiry_year: Option<masking::Secret<String>>,
+ pub card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
/// The payment method ID that was checked
#[schema(value_type = String, example = "12345_pm_019959146f92737389eb6927ce1eb7dc")]
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 880beac2c9..ee24ef8681 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -62,7 +62,7 @@ where
None => Ok(None),
}
}
-use masking::{PeekInterface, Secret, WithType};
+use hyperswitch_masking::{PeekInterface, Secret, WithType};
use router_derive::Setter;
#[cfg(feature = "v1")]
use serde::{de, Deserializer};
@@ -6314,7 +6314,7 @@ pub struct Address {
pub email: Option<Email>,
}
-impl masking::SerializableSecret for Address {}
+impl hyperswitch_masking::SerializableSecret for Address {}
impl Address {
/// Unify the address, giving priority to `self` when details are present in both
@@ -9495,7 +9495,7 @@ pub struct OrderDetailsWithAmount {
pub unit_discount_amount: Option<MinorUnit>,
}
-impl masking::SerializableSecret for OrderDetailsWithAmount {}
+impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
#[derive(
Default,
@@ -12402,7 +12402,7 @@ mod payments_response_api_contract {
#[cfg(test)]
mod billing_from_payment_method_data {
use common_enums::CountryAlpha2;
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
use super::*;
diff --git a/crates/api_models/src/payments/additional_info.rs b/crates/api_models/src/payments/additional_info.rs
index 35f26bcb18..fa97d5b37c 100644
--- a/crates/api_models/src/payments/additional_info.rs
+++ b/crates/api_models/src/payments/additional_info.rs
@@ -1,7 +1,7 @@
use common_utils::new_type::{
MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use smithy::SmithyModel;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/payouts.rs b/crates/api_models/src/payouts.rs
index 67988a3c1e..69f13e46a6 100644
--- a/crates/api_models/src/payouts.rs
+++ b/crates/api_models/src/payouts.rs
@@ -11,7 +11,7 @@ use common_utils::{
transformers::ForeignFrom,
types::{UnifiedCode, UnifiedMessage},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[cfg(feature = "v1")]
use payments::BrowserInformation;
use router_derive::FlatStruct;
diff --git a/crates/api_models/src/recon.rs b/crates/api_models/src/recon.rs
index f73bcc5ae1..08c6ccccbd 100644
--- a/crates/api_models/src/recon.rs
+++ b/crates/api_models/src/recon.rs
@@ -1,5 +1,5 @@
use common_utils::{id_type, pii};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use crate::enums;
diff --git a/crates/api_models/src/refunds.rs b/crates/api_models/src/refunds.rs
index f9119d0c09..210efb8c95 100644
--- a/crates/api_models/src/refunds.rs
+++ b/crates/api_models/src/refunds.rs
@@ -350,7 +350,7 @@ pub struct RefundResponse {
pub issuer_error_message: Option<String>,
/// Contains whole connector response
#[schema(value_type = Option<String>)]
- pub raw_connector_response: Option<masking::Secret<String>>,
+ pub raw_connector_response: Option<hyperswitch_masking::Secret<String>>,
/// A unique identifier for a payment provided by the connector
#[smithy(value_type = "Option<String>")]
pub connector_refund_id: Option<String>,
@@ -414,7 +414,7 @@ pub struct RefundResponse {
pub connector_refund_reference_id: Option<String>,
/// Contains raw connector response
#[schema(value_type = Option<String>)]
- pub raw_connector_response: Option<masking::Secret<String>>,
+ pub raw_connector_response: Option<hyperswitch_masking::Secret<String>>,
}
#[cfg(feature = "v2")]
diff --git a/crates/api_models/src/revenue_recovery_data_backfill.rs b/crates/api_models/src/revenue_recovery_data_backfill.rs
index 0148280da9..37b0891426 100644
--- a/crates/api_models/src/revenue_recovery_data_backfill.rs
+++ b/crates/api_models/src/revenue_recovery_data_backfill.rs
@@ -5,7 +5,7 @@ use actix_web::{HttpResponse, ResponseError};
use common_enums::{CardNetwork, PaymentMethodType};
use common_utils::{events::ApiEventMetric, id_type, pii::PhoneNumberStrategy};
use csv::Reader;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::{Date, PrimitiveDateTime};
diff --git a/crates/api_models/src/subscription.rs b/crates/api_models/src/subscription.rs
index 78439bcc66..081de00ab7 100644
--- a/crates/api_models/src/subscription.rs
+++ b/crates/api_models/src/subscription.rs
@@ -10,7 +10,7 @@ use common_utils::{
},
types::{MinorUnit, Url},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use utoipa::ToSchema;
use crate::{
diff --git a/crates/api_models/src/tokenization.rs b/crates/api_models/src/tokenization.rs
index 7bd0e91c3e..6b619a3432 100644
--- a/crates/api_models/src/tokenization.rs
+++ b/crates/api_models/src/tokenization.rs
@@ -24,7 +24,7 @@ pub struct GenericTokenizationRequest {
pub customer_id: id_type::GlobalCustomerId,
/// Request for tokenization which contains the data to be tokenized
#[schema(value_type = Object,example = json!({ "city": "NY", "unit": "245" }))]
- pub token_request: masking::Secret<serde_json::Value>,
+ pub token_request: hyperswitch_masking::Secret<serde_json::Value>,
}
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
diff --git a/crates/api_models/src/user.rs b/crates/api_models/src/user.rs
index 41d51362b1..607dfa62b3 100644
--- a/crates/api_models/src/user.rs
+++ b/crates/api_models/src/user.rs
@@ -2,7 +2,7 @@ use std::fmt::Debug;
use common_enums::{EntityType, TokenPurpose};
use common_utils::{crypto::OptionalEncryptableName, id_type, pii};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use utoipa::ToSchema;
use crate::user_role::UserStatus;
diff --git a/crates/api_models/src/user/dashboard_metadata.rs b/crates/api_models/src/user/dashboard_metadata.rs
index e8dc3a82b9..0f728fcaf3 100644
--- a/crates/api_models/src/user/dashboard_metadata.rs
+++ b/crates/api_models/src/user/dashboard_metadata.rs
@@ -1,7 +1,7 @@
use common_enums::{CountryAlpha2, MerchantProductType};
use common_types::primitive_wrappers::SafeString;
use common_utils::{id_type, pii};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use strum::EnumString;
#[derive(Debug, serde::Deserialize, serde::Serialize)]
diff --git a/crates/api_models/src/user/theme.rs b/crates/api_models/src/user/theme.rs
index 718d340ce0..16f6a8d6f9 100644
--- a/crates/api_models/src/user/theme.rs
+++ b/crates/api_models/src/user/theme.rs
@@ -4,7 +4,7 @@ use common_utils::{
id_type,
types::user::{EmailThemeConfig, ThemeLineage},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
diff --git a/crates/api_models/src/user_role.rs b/crates/api_models/src/user_role.rs
index 2c8df401e5..b76237e369 100644
--- a/crates/api_models/src/user_role.rs
+++ b/crates/api_models/src/user_role.rs
@@ -1,6 +1,6 @@
use common_enums::{ParentGroup, PermissionGroup};
use common_utils::pii;
-use masking::Secret;
+use hyperswitch_masking::Secret;
pub mod role;
diff --git a/crates/api_models/src/webhook_events.rs b/crates/api_models/src/webhook_events.rs
index 972ed159c5..0537dec0ca 100644
--- a/crates/api_models/src/webhook_events.rs
+++ b/crates/api_models/src/webhook_events.rs
@@ -1,7 +1,7 @@
use std::collections::HashSet;
use common_enums::{EventClass, EventType, WebhookDeliveryAttempt};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use utoipa::ToSchema;
diff --git a/crates/api_models/src/webhooks.rs b/crates/api_models/src/webhooks.rs
index 8f8e500184..384aa62269 100644
--- a/crates/api_models/src/webhooks.rs
+++ b/crates/api_models/src/webhooks.rs
@@ -492,7 +492,7 @@ pub enum OutgoingWebhookContent {
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorWebhookSecrets {
pub secret: Vec<u8>,
- pub additional_secret: Option<masking::Secret<String>>,
+ pub additional_secret: Option<hyperswitch_masking::Secret<String>>,
}
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
diff --git a/crates/cards/Cargo.toml b/crates/cards/Cargo.toml
index 62f42014c0..2ee52860b8 100644
--- a/crates/cards/Cargo.toml
+++ b/crates/cards/Cargo.toml
@@ -18,7 +18,7 @@ regex = "1.11.1"
# First party crates
common_utils = { version = "0.1.0", path = "../common_utils" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"], default-features = false }
diff --git a/crates/cards/src/lib.rs b/crates/cards/src/lib.rs
index 592b87d4de..77d1d25a5c 100644
--- a/crates/cards/src/lib.rs
+++ b/crates/cards/src/lib.rs
@@ -3,7 +3,7 @@ use std::ops::Deref;
use common_utils::{date_time, errors};
use error_stack::report;
-use masking::{PeekInterface, StrongSecret};
+use hyperswitch_masking::{PeekInterface, StrongSecret};
use serde::{de, Deserialize, Serialize};
use time::{Date, Duration, PrimitiveDateTime, Time};
diff --git a/crates/cards/src/validate.rs b/crates/cards/src/validate.rs
index cf037f536d..970024391f 100644
--- a/crates/cards/src/validate.rs
+++ b/crates/cards/src/validate.rs
@@ -2,7 +2,7 @@ use std::{collections::HashMap, fmt, ops::Deref, str::FromStr, sync::LazyLock};
use common_utils::errors::ValidationError;
use error_stack::report;
-use masking::{PeekInterface, Strategy, StrongSecret, WithType};
+use hyperswitch_masking::{PeekInterface, Strategy, StrongSecret, WithType};
use regex::Regex;
#[cfg(not(target_arch = "wasm32"))]
use router_env::{logger, which as router_env_which, Env};
@@ -329,7 +329,7 @@ where
#[cfg(test)]
mod tests {
- use masking::Secret;
+ use hyperswitch_masking::Secret;
use super::*;
@@ -373,7 +373,7 @@ mod tests {
fn card_number_no_whitespace() {
let s = "3714 4963 5398 431";
assert_eq!(
- CardNumber::from_str(s).unwrap().to_string(),
+ format!("{:?}", CardNumber::from_str(s).unwrap().0),
"371449*********"
);
}
@@ -401,8 +401,10 @@ mod tests {
#[test]
fn test_valid_card_number_deserialization() {
let card_number = serde_json::from_str::<CardNumber>(r#""3714 4963 5398 431""#).unwrap();
- let secret = card_number.to_string();
- assert_eq!(r#""371449*********""#, format!("{secret:?}"));
+ assert_eq!(
+ r#""371449*********""#,
+ format!("{:?}", card_number.get_card_no())
+ );
}
#[test]
diff --git a/crates/cards/tests/basic.rs b/crates/cards/tests/basic.rs
index 0f27c9e028..f3d977fdda 100644
--- a/crates/cards/tests/basic.rs
+++ b/crates/cards/tests/basic.rs
@@ -2,7 +2,7 @@
use cards::{CardExpiration, CardExpirationMonth, CardExpirationYear, CardSecurityCode};
use common_utils::date_time;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
#[test]
fn test_card_security_code() {
diff --git a/crates/common_enums/Cargo.toml b/crates/common_enums/Cargo.toml
index 38316e2db9..f4758c96ac 100644
--- a/crates/common_enums/Cargo.toml
+++ b/crates/common_enums/Cargo.toml
@@ -23,7 +23,7 @@ utoipa = { version = "4.2.3", features = ["preserve_order", "preserve_path_order
# First party crates
router_derive = { version = "0.1.0", path = "../router_derive" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = { version = "0.0.1", features = ["serde"] }
smithy = { version = "0.1.0", path = "../smithy" }
smithy-core = { version = "0.1.0", path = "../smithy-core" }
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 4865fa1313..af04ea7341 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -18,7 +18,7 @@ use diesel::{
serialize::{Output, ToSql},
sql_types::Text,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
pub use payments::ProductType;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use smithy::SmithyModel;
@@ -2528,7 +2528,7 @@ impl PaymentMethodType {
}
}
-impl masking::SerializableSecret for PaymentMethodType {}
+impl hyperswitch_masking::SerializableSecret for PaymentMethodType {}
/// Indicates the type of payment method. Eg: 'card', 'wallet', etc.
#[derive(
diff --git a/crates/common_types/Cargo.toml b/crates/common_types/Cargo.toml
index 2183518ae4..3b4b28e901 100644
--- a/crates/common_types/Cargo.toml
+++ b/crates/common_types/Cargo.toml
@@ -25,7 +25,7 @@ common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils"}
cards = { version = "0.1.0", path = "../cards"}
euclid = { version = "0.1.0", path = "../euclid" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
smithy = { version = "0.1.0", path = "../smithy" }
smithy-core = { version = "0.1.0", path = "../smithy-core" }
diff --git a/crates/common_types/src/domain.rs b/crates/common_types/src/domain.rs
index 734f182a03..bb0c20fb6a 100644
--- a/crates/common_types/src/domain.rs
+++ b/crates/common_types/src/domain.rs
@@ -6,7 +6,7 @@ use common_enums::enums;
use common_utils::{impl_to_sql_from_sql_json, types::MinorUnit};
use diesel::{sql_types::Jsonb, AsExpression, FromSqlRow};
#[cfg(feature = "v2")]
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use smithy::SmithyModel;
use utoipa::ToSchema;
diff --git a/crates/common_types/src/payments.rs b/crates/common_types/src/payments.rs
index 1fd46ae110..df35c59106 100644
--- a/crates/common_types/src/payments.rs
+++ b/crates/common_types/src/payments.rs
@@ -18,7 +18,7 @@ use euclid::frontend::{
ast::Program,
dir::{DirKeyKind, EuclidDirFilter},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use smithy::SmithyModel;
use time::PrimitiveDateTime;
@@ -255,7 +255,7 @@ impl CustomerAcceptance {
}
}
-impl masking::SerializableSecret for CustomerAcceptance {}
+impl hyperswitch_masking::SerializableSecret for CustomerAcceptance {}
#[derive(
Default,
diff --git a/crates/common_types/src/primitive_wrappers.rs b/crates/common_types/src/primitive_wrappers.rs
index e017e3f510..2acc5a4dd4 100644
--- a/crates/common_types/src/primitive_wrappers.rs
+++ b/crates/common_types/src/primitive_wrappers.rs
@@ -499,7 +499,7 @@ mod safe_string {
use std::ops::Deref;
use common_utils::validation::contains_potential_xss_or_sqli;
- use masking::SerializableSecret;
+ use hyperswitch_masking::SerializableSecret;
use serde::{de::Error, Deserialize, Serialize};
/// String wrapper that prevents XSS and SQLi attacks
diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml
index e92b3470c8..51a51dc47b 100644
--- a/crates/common_utils/Cargo.toml
+++ b/crates/common_utils/Cargo.toml
@@ -67,7 +67,7 @@ ammonia = "3.3"
# First party crates
common_enums = { version = "0.1.0", path = "../common_enums" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = { version = "0.0.1", features = ["diesel", "time"] }
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"], optional = true, default-features = false }
[target.'cfg(target_arch = "wasm32")'.dependencies.uuid]
diff --git a/crates/common_utils/src/crypto.rs b/crates/common_utils/src/crypto.rs
index 35efa6b907..cc4b8ef815 100644
--- a/crates/common_utils/src/crypto.rs
+++ b/crates/common_utils/src/crypto.rs
@@ -3,7 +3,7 @@ use std::ops::Deref;
use base64::Engine;
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use ring::{
aead::{self, BoundKey, OpeningKey, SealingKey, UnboundKey},
hmac, rand as ring_rand,
@@ -631,7 +631,7 @@ pub struct Encryptable<T: Clone> {
encrypted: Secret<Vec<u8>, EncryptionStrategy>,
}
-impl<T: Clone, S: masking::Strategy<T>> Encryptable<Secret<T, S>> {
+impl<T: Clone, S: hyperswitch_masking::Strategy<T>> Encryptable<Secret<T, S>> {
/// constructor function to be used by the encryptor and decryptor to generate the data type
pub fn new(
masked_data: Secret<T, S>,
@@ -696,9 +696,9 @@ impl<T: Clone> Deref for Encryptable<Secret<T>> {
}
}
-impl<T: Clone> masking::Serialize for Encryptable<T>
+impl<T: Clone> hyperswitch_masking::Serialize for Encryptable<T>
where
- T: masking::Serialize,
+ T: hyperswitch_masking::Serialize,
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
diff --git a/crates/common_utils/src/encryption.rs b/crates/common_utils/src/encryption.rs
index 9c56643278..eb6df269c3 100644
--- a/crates/common_utils/src/encryption.rs
+++ b/crates/common_utils/src/encryption.rs
@@ -5,7 +5,7 @@ use diesel::{
serialize::ToSql,
sql_types,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use crate::{crypto::Encryptable, pii::EncryptionStrategy};
diff --git a/crates/common_utils/src/ext_traits.rs b/crates/common_utils/src/ext_traits.rs
index 3205c05168..a5fcdfecaa 100644
--- a/crates/common_utils/src/ext_traits.rs
+++ b/crates/common_utils/src/ext_traits.rs
@@ -2,7 +2,7 @@
//! & inbuilt datatypes.
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret, Strategy};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret, Strategy};
use quick_xml::de;
#[cfg(all(feature = "logs", feature = "async_ext"))]
use router_env::logger;
@@ -180,7 +180,7 @@ impl BytesExt for bytes::Bytes {
format!(
"Unable to parse {variable_type} from bytes {:?}",
- Secret::<_, masking::JsonMaskStrategy>::new(value)
+ Secret::<_, hyperswitch_masking::JsonMaskStrategy>::new(value)
)
})
}
@@ -214,7 +214,7 @@ impl ByteSliceExt for [u8] {
format!(
"Unable to parse {type_name} from &[u8] {:?}",
- Secret::<_, masking::JsonMaskStrategy>::new(value)
+ Secret::<_, hyperswitch_masking::JsonMaskStrategy>::new(value)
)
})
}
@@ -239,7 +239,7 @@ impl ValueExt for serde_json::Value {
format!(
"Unable to parse {type_name} from serde_json::Value: {:?}",
// Required to prevent logging sensitive data in case of deserialization failure
- Secret::<_, masking::JsonMaskStrategy>::new(self)
+ Secret::<_, hyperswitch_masking::JsonMaskStrategy>::new(self)
)
})
}
@@ -307,9 +307,9 @@ impl<T> StringExt<T> for String {
.attach_printable_lazy(|| {
format!(
"Unable to parse {type_name} from string {:?}",
- Secret::<_, masking::JsonMaskStrategy>::new(serde_json::Value::String(
- self.clone()
- ))
+ Secret::<_, hyperswitch_masking::JsonMaskStrategy>::new(
+ serde_json::Value::String(self.clone())
+ )
)
})
}
diff --git a/crates/common_utils/src/hashing.rs b/crates/common_utils/src/hashing.rs
index 0982ca5378..b81087018b 100644
--- a/crates/common_utils/src/hashing.rs
+++ b/crates/common_utils/src/hashing.rs
@@ -1,4 +1,4 @@
-use masking::{PeekInterface, Secret, Strategy};
+use hyperswitch_masking::{PeekInterface, Secret, Strategy};
use serde::{Deserialize, Serialize, Serializer};
#[derive(Clone, PartialEq, Debug, Deserialize)]
diff --git a/crates/common_utils/src/keymanager.rs b/crates/common_utils/src/keymanager.rs
index 94495d3cf2..8ebb260f61 100644
--- a/crates/common_utils/src/keymanager.rs
+++ b/crates/common_utils/src/keymanager.rs
@@ -6,7 +6,7 @@ use std::str::FromStr;
use base64::Engine;
use error_stack::ResultExt;
use http::{HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
-use masking::{PeekInterface, StrongSecret};
+use hyperswitch_masking::{PeekInterface, StrongSecret};
use once_cell::sync::OnceCell;
use router_env::{instrument, logger, tracing};
diff --git a/crates/common_utils/src/lib.rs b/crates/common_utils/src/lib.rs
index 1c69429dfa..f8cc44c4b3 100644
--- a/crates/common_utils/src/lib.rs
+++ b/crates/common_utils/src/lib.rs
@@ -1,7 +1,7 @@
#![warn(missing_docs, missing_debug_implementations)]
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR" ), "/", "README.md"))]
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
pub mod access_token;
pub mod consts;
@@ -48,7 +48,7 @@ pub mod date_time {
use std::time::Instant;
use std::{marker::PhantomData, num::NonZeroU8};
- use masking::{Deserialize, Serialize};
+ use hyperswitch_masking::{Deserialize, Serialize};
use time::{
format_description::{
well_known::iso8601::{Config, EncodedConfig, Iso8601, TimePrecision},
diff --git a/crates/common_utils/src/link_utils.rs b/crates/common_utils/src/link_utils.rs
index f91a26cdae..a2c2237b83 100644
--- a/crates/common_utils/src/link_utils.rs
+++ b/crates/common_utils/src/link_utils.rs
@@ -12,7 +12,7 @@ use diesel::{
AsExpression, FromSqlRow,
};
use error_stack::{report, ResultExt};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use regex::Regex;
#[cfg(feature = "logs")]
use router_env::logger;
diff --git a/crates/common_utils/src/macros.rs b/crates/common_utils/src/macros.rs
index 12d8c186ac..51243d0a56 100644
--- a/crates/common_utils/src/macros.rs
+++ b/crates/common_utils/src/macros.rs
@@ -278,7 +278,7 @@ mod id_type {
#[macro_export]
macro_rules! impl_serializable_secret_id_type {
($type:ty) => {
- impl masking::SerializableSecret for $type {}
+ impl hyperswitch_masking::SerializableSecret for $type {}
};
}
diff --git a/crates/common_utils/src/new_type.rs b/crates/common_utils/src/new_type.rs
index bae7f96704..b7d293e994 100644
--- a/crates/common_utils/src/new_type.rs
+++ b/crates/common_utils/src/new_type.rs
@@ -1,5 +1,5 @@
//! Contains new types with restrictions
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
consts::MAX_ALLOWED_MERCHANT_NAME_LENGTH,
@@ -13,7 +13,7 @@ use crate::{
)]
pub struct MerchantName(String);
-impl masking::SerializableSecret for MerchantName {}
+impl hyperswitch_masking::SerializableSecret for MerchantName {}
/// Function for masking alphanumeric characters in a string.
///
@@ -260,7 +260,7 @@ impl From<Secret<String>> for MaskedPspToken {
#[cfg(test)]
mod apply_mask_fn_test {
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
use crate::new_type::{
apply_mask, MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode,
diff --git a/crates/common_utils/src/payout_method_utils.rs b/crates/common_utils/src/payout_method_utils.rs
index bd5c687663..388e46f1af 100644
--- a/crates/common_utils/src/payout_method_utils.rs
+++ b/crates/common_utils/src/payout_method_utils.rs
@@ -1,7 +1,7 @@
//! This module has common utilities for payout method data in HyperSwitch
use diesel::{sql_types::Jsonb, AsExpression, FromSqlRow};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
diff --git a/crates/common_utils/src/pii.rs b/crates/common_utils/src/pii.rs
index b1805b3b17..29175777e8 100644
--- a/crates/common_utils/src/pii.rs
+++ b/crates/common_utils/src/pii.rs
@@ -11,7 +11,7 @@ use diesel::{
sql_types, AsExpression,
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, Secret, Strategy, WithType};
+use hyperswitch_masking::{ExposeInterface, Secret, Strategy, WithType};
#[cfg(feature = "logs")]
use router_env::logger;
use serde::Deserialize;
@@ -370,7 +370,7 @@ where
mod pii_masking_strategy_tests {
use std::str::FromStr;
- use masking::{ExposeInterface, Secret};
+ use hyperswitch_masking::{ExposeInterface, Secret};
use super::{ClientSecret, Email, IpAddress, UpiVpaMaskingStrategy};
use crate::pii::{EmailStrategy, REDACTED};
diff --git a/crates/common_utils/src/request.rs b/crates/common_utils/src/request.rs
index 42a4a32d0f..58f53a1e0d 100644
--- a/crates/common_utils/src/request.rs
+++ b/crates/common_utils/src/request.rs
@@ -1,4 +1,4 @@
-use masking::{Maskable, Secret};
+use hyperswitch_masking::{Maskable, Secret};
use reqwest::multipart::Form;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
@@ -65,10 +65,15 @@ impl std::fmt::Debug for RequestContent {
}
pub enum RequestContent {
- Json(Box<dyn masking::ErasedMaskSerialize + Send>),
- FormUrlEncoded(Box<dyn masking::ErasedMaskSerialize + Send>),
- FormData((Form, Box<dyn masking::ErasedMaskSerialize + Send>)),
- Xml(Box<dyn masking::ErasedMaskSerialize + Send>),
+ Json(Box<dyn hyperswitch_masking::ErasedMaskSerialize + Send>),
+ FormUrlEncoded(Box<dyn hyperswitch_masking::ErasedMaskSerialize + Send>),
+ FormData(
+ (
+ Form,
+ Box<dyn hyperswitch_masking::ErasedMaskSerialize + Send>,
+ ),
+ ),
+ Xml(Box<dyn hyperswitch_masking::ErasedMaskSerialize + Send>),
RawBytes(Vec<u8>),
}
diff --git a/crates/common_utils/src/types/keymanager.rs b/crates/common_utils/src/types/keymanager.rs
index cb4ebdf47d..bef29fdd78 100644
--- a/crates/common_utils/src/types/keymanager.rs
+++ b/crates/common_utils/src/types/keymanager.rs
@@ -3,7 +3,7 @@
use core::fmt;
use base64::Engine;
-use masking::{ExposeInterface, PeekInterface, Secret, Strategy, StrongSecret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret, Strategy, StrongSecret};
#[cfg(feature = "encryption_service")]
use router_env::logger;
#[cfg(feature = "km_forward_x_request_id")]
diff --git a/crates/diesel_models/Cargo.toml b/crates/diesel_models/Cargo.toml
index 8c77c17792..04135b0390 100644
--- a/crates/diesel_models/Cargo.toml
+++ b/crates/diesel_models/Cargo.toml
@@ -28,7 +28,7 @@ time = { version = "0.3.41", features = ["serde", "serde-well-known", "std"] }
common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils" }
common_types = { version = "0.1.0", path = "../common_types" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_derive = { version = "0.1.0", path = "../router_derive" }
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] }
diff --git a/crates/diesel_models/src/business_profile.rs b/crates/diesel_models/src/business_profile.rs
index 59102aaef7..b02314bce7 100644
--- a/crates/diesel_models/src/business_profile.rs
+++ b/crates/diesel_models/src/business_profile.rs
@@ -4,7 +4,7 @@ use common_enums::{AuthenticationConnectors, UIWidgetFormLayout, VaultSdk};
use common_types::primitive_wrappers;
use common_utils::{encryption::Encryption, pii};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::Duration;
#[cfg(feature = "v1")]
diff --git a/crates/diesel_models/src/dispute.rs b/crates/diesel_models/src/dispute.rs
index fa4824170f..1b2061d648 100644
--- a/crates/diesel_models/src/dispute.rs
+++ b/crates/diesel_models/src/dispute.rs
@@ -3,7 +3,7 @@ use common_utils::{
types::{MinorUnit, StringMinorUnit},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::Serialize;
use time::PrimitiveDateTime;
diff --git a/crates/diesel_models/src/ephemeral_key.rs b/crates/diesel_models/src/ephemeral_key.rs
index ede9f61b03..7ac9452d17 100644
--- a/crates/diesel_models/src/ephemeral_key.rs
+++ b/crates/diesel_models/src/ephemeral_key.rs
@@ -1,5 +1,5 @@
#[cfg(feature = "v2")]
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
#[cfg(feature = "v2")]
pub struct ClientSecretTypeNew {
diff --git a/crates/diesel_models/src/file.rs b/crates/diesel_models/src/file.rs
index 99265bfa80..086e4841b8 100644
--- a/crates/diesel_models/src/file.rs
+++ b/crates/diesel_models/src/file.rs
@@ -1,6 +1,6 @@
use common_utils::custom_serde;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::{Deserialize, Serialize};
+use hyperswitch_masking::{Deserialize, Serialize};
use crate::schema::file_metadata;
diff --git a/crates/diesel_models/src/fraud_check.rs b/crates/diesel_models/src/fraud_check.rs
index 6b709cc07c..7f409b964e 100644
--- a/crates/diesel_models/src/fraud_check.rs
+++ b/crates/diesel_models/src/fraud_check.rs
@@ -1,6 +1,6 @@
use common_enums as storage_enums;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::{Deserialize, Serialize};
+use hyperswitch_masking::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{
diff --git a/crates/diesel_models/src/generic_link.rs b/crates/diesel_models/src/generic_link.rs
index 5f55e30434..10399a51d9 100644
--- a/crates/diesel_models/src/generic_link.rs
+++ b/crates/diesel_models/src/generic_link.rs
@@ -6,7 +6,7 @@ use common_utils::{
},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::{Duration, PrimitiveDateTime};
diff --git a/crates/diesel_models/src/mandate.rs b/crates/diesel_models/src/mandate.rs
index f4c507e471..d36d6a5b5b 100644
--- a/crates/diesel_models/src/mandate.rs
+++ b/crates/diesel_models/src/mandate.rs
@@ -1,7 +1,7 @@
use common_enums::MerchantStorageScheme;
use common_utils::pii;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::mandate};
diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rs
index d400c7d245..9f6aec80bb 100644
--- a/crates/diesel_models/src/payment_attempt.rs
+++ b/crates/diesel_models/src/payment_attempt.rs
@@ -126,7 +126,7 @@ pub struct PaymentAttempt {
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
- pub encoded_data: Option<masking::Secret<String>>,
+ pub encoded_data: Option<hyperswitch_masking::Secret<String>>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
#[diesel(deserialize_as = RequiredFromNullable<MinorUnit>)]
@@ -137,7 +137,8 @@ pub struct PaymentAttempt {
pub fingerprint_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
- pub customer_acceptance: Option<masking::Secret<common_payments_types::CustomerAcceptance>>,
+ pub customer_acceptance:
+ Option<hyperswitch_masking::Secret<common_payments_types::CustomerAcceptance>>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
@@ -404,7 +405,7 @@ pub struct PaymentAttemptNew {
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub redirection_data: Option<RedirectForm>,
- pub encoded_data: Option<masking::Secret<String>>,
+ pub encoded_data: Option<hyperswitch_masking::Secret<String>>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: MinorUnit,
@@ -415,7 +416,8 @@ pub struct PaymentAttemptNew {
pub payment_method_billing_address: Option<common_utils::encryption::Encryption>,
pub client_source: Option<String>,
pub client_version: Option<String>,
- pub customer_acceptance: Option<masking::Secret<common_payments_types::CustomerAcceptance>>,
+ pub customer_acceptance:
+ Option<hyperswitch_masking::Secret<common_payments_types::CustomerAcceptance>>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
@@ -4593,7 +4595,7 @@ pub enum RedirectForm {
Nmi {
amount: String,
currency: common_enums::Currency,
- public_key: masking::Secret<String>,
+ public_key: hyperswitch_masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
diff --git a/crates/diesel_models/src/payment_intent.rs b/crates/diesel_models/src/payment_intent.rs
index 0bebbe1a30..8da0c5b625 100644
--- a/crates/diesel_models/src/payment_intent.rs
+++ b/crates/diesel_models/src/payment_intent.rs
@@ -5,7 +5,7 @@ use common_types::{
};
use common_utils::{encryption::Encryption, pii, types::MinorUnit};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
@@ -41,8 +41,8 @@ pub struct PaymentIntent {
pub last_synced: Option<PrimitiveDateTime>,
pub setup_future_usage: Option<storage_enums::FutureUsage>,
pub active_attempt_id: Option<common_utils::id_type::GlobalAttemptId>,
- #[diesel(deserialize_as = super::OptionalDieselArray<masking::Secret<OrderDetailsWithAmount>>)]
- pub order_details: Option<Vec<masking::Secret<OrderDetailsWithAmount>>>,
+ #[diesel(deserialize_as = super::OptionalDieselArray<hyperswitch_masking::Secret<OrderDetailsWithAmount>>)]
+ pub order_details: Option<Vec<hyperswitch_masking::Secret<OrderDetailsWithAmount>>>,
pub allowed_payment_method_types: Option<pii::SecretSerdeValue>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
pub feature_metadata: Option<FeatureMetadata>,
@@ -358,8 +358,8 @@ pub struct PaymentIntentNew {
pub last_synced: Option<PrimitiveDateTime>,
pub setup_future_usage: Option<storage_enums::FutureUsage>,
pub active_attempt_id: Option<common_utils::id_type::GlobalAttemptId>,
- #[diesel(deserialize_as = super::OptionalDieselArray<masking::Secret<OrderDetailsWithAmount>>)]
- pub order_details: Option<Vec<masking::Secret<OrderDetailsWithAmount>>>,
+ #[diesel(deserialize_as = super::OptionalDieselArray<hyperswitch_masking::Secret<OrderDetailsWithAmount>>)]
+ pub order_details: Option<Vec<hyperswitch_masking::Secret<OrderDetailsWithAmount>>>,
pub allowed_payment_method_types: Option<pii::SecretSerdeValue>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
pub feature_metadata: Option<FeatureMetadata>,
@@ -533,12 +533,12 @@ pub enum PaymentIntentUpdate {
fingerprint_id: Option<String>,
updated_by: String,
incremental_authorization_allowed: Option<bool>,
- feature_metadata: Option<masking::Secret<serde_json::Value>>,
+ feature_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
},
MetadataUpdate {
metadata: Option<serde_json::Value>,
updated_by: String,
- feature_metadata: Option<masking::Secret<serde_json::Value>>,
+ feature_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
},
Update(Box<PaymentIntentUpdateFields>),
StateMetadataUpdate {
@@ -564,7 +564,7 @@ pub enum PaymentIntentUpdate {
status: storage_enums::IntentStatus,
updated_by: String,
incremental_authorization_allowed: Option<bool>,
- feature_metadata: Option<masking::Secret<serde_json::Value>>,
+ feature_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
},
PaymentAttemptAndAttemptCountUpdate {
active_attempt_id: String,
@@ -673,7 +673,7 @@ pub struct PaymentIntentUpdateFields {
pub force_3ds_challenge: Option<bool>,
pub is_iframe_redirection_enabled: Option<bool>,
pub payment_channel: Option<common_enums::PaymentChannel>,
- pub feature_metadata: Option<masking::Secret<serde_json::Value>>,
+ pub feature_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
pub tax_status: Option<common_enums::TaxStatus>,
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
@@ -716,7 +716,7 @@ pub struct PaymentIntentUpdateInternal {
pub setup_future_usage: Option<storage_enums::FutureUsage>,
pub apply_mit_exemption: Option<bool>,
pub statement_descriptor: Option<common_utils::types::StatementDescriptor>,
- pub order_details: Option<Vec<masking::Secret<OrderDetailsWithAmount>>>,
+ pub order_details: Option<Vec<hyperswitch_masking::Secret<OrderDetailsWithAmount>>>,
pub allowed_payment_method_types: Option<pii::SecretSerdeValue>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
@@ -915,7 +915,7 @@ pub struct PaymentIntentUpdateInternal {
pub is_iframe_redirection_enabled: Option<bool>,
pub extended_return_url: Option<String>,
pub payment_channel: Option<common_enums::PaymentChannel>,
- pub feature_metadata: Option<masking::Secret<serde_json::Value>>,
+ pub feature_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
pub tax_status: Option<common_enums::TaxStatus>,
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
diff --git a/crates/diesel_models/src/payment_method.rs b/crates/diesel_models/src/payment_method.rs
index 2cc67bacec..2ecd45373c 100644
--- a/crates/diesel_models/src/payment_method.rs
+++ b/crates/diesel_models/src/payment_method.rs
@@ -9,8 +9,8 @@ use common_utils::{
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use error_stack::ResultExt;
#[cfg(feature = "v1")]
-use masking::ExposeInterface;
-use masking::Secret;
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/diesel_models/src/payment_methods_session.rs b/crates/diesel_models/src/payment_methods_session.rs
index 03997c381a..0685413ef5 100644
--- a/crates/diesel_models/src/payment_methods_session.rs
+++ b/crates/diesel_models/src/payment_methods_session.rs
@@ -62,5 +62,5 @@ pub struct PaymentMethodsSessionUpdateInternal {
pub billing: Option<common_utils::encryption::Encryption>,
pub psp_tokenization: Option<common_types::payment_methods::PspTokenization>,
pub network_tokenization: Option<common_types::payment_methods::NetworkTokenization>,
- pub tokenization_data: Option<masking::Secret<serde_json::Value>>,
+ pub tokenization_data: Option<hyperswitch_masking::Secret<serde_json::Value>>,
}
diff --git a/crates/diesel_models/src/subscription.rs b/crates/diesel_models/src/subscription.rs
index 720f77593a..c2f42f9ca0 100644
--- a/crates/diesel_models/src/subscription.rs
+++ b/crates/diesel_models/src/subscription.rs
@@ -1,6 +1,6 @@
use common_utils::{generate_id_with_default_len, pii::SecretSerdeValue};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::schema::subscription;
diff --git a/crates/diesel_models/src/types.rs b/crates/diesel_models/src/types.rs
index 1243e8b464..8a72deb9b1 100644
--- a/crates/diesel_models/src/types.rs
+++ b/crates/diesel_models/src/types.rs
@@ -7,7 +7,7 @@ use diesel::{
sql_types::{Json, Jsonb},
AsExpression, FromSqlRow,
};
-use masking::{Secret, WithType};
+use hyperswitch_masking::{Secret, WithType};
use serde::{self, Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, FromSqlRow, AsExpression)]
@@ -55,7 +55,7 @@ pub struct OrderDetailsWithAmount {
pub unit_discount_amount: Option<MinorUnit>,
}
-impl masking::SerializableSecret for OrderDetailsWithAmount {}
+impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
common_utils::impl_to_sql_from_sql_json!(OrderDetailsWithAmount);
@@ -220,7 +220,7 @@ pub struct RedirectResponse {
pub param: Option<Secret<String>>,
pub json_payload: Option<pii::SecretSerdeValue>,
}
-impl masking::SerializableSecret for RedirectResponse {}
+impl hyperswitch_masking::SerializableSecret for RedirectResponse {}
common_utils::impl_to_sql_from_sql_json!(RedirectResponse);
#[cfg(feature = "v2")]
diff --git a/crates/diesel_models/src/user.rs b/crates/diesel_models/src/user.rs
index f348d69554..30c9e68758 100644
--- a/crates/diesel_models/src/user.rs
+++ b/crates/diesel_models/src/user.rs
@@ -1,6 +1,6 @@
use common_utils::{encryption::Encryption, pii, types::user::LineageContext};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::PrimitiveDateTime;
use crate::{diesel_impl::OptionalDieselArray, enums::TotpStatus, schema::users};
diff --git a/crates/diesel_models/src/user/dashboard_metadata.rs b/crates/diesel_models/src/user/dashboard_metadata.rs
index 004fc86693..4bd01dab0e 100644
--- a/crates/diesel_models/src/user/dashboard_metadata.rs
+++ b/crates/diesel_models/src/user/dashboard_metadata.rs
@@ -1,6 +1,6 @@
use common_utils::id_type;
use diesel::{query_builder::AsChangeset, Identifiable, Insertable, Queryable, Selectable};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::PrimitiveDateTime;
use crate::{enums, schema::dashboard_metadata};
diff --git a/crates/drainer/Cargo.toml b/crates/drainer/Cargo.toml
index 217726d101..f4cef04bb4 100644
--- a/crates/drainer/Cargo.toml
+++ b/crates/drainer/Cargo.toml
@@ -35,7 +35,7 @@ common_utils = { version = "0.1.0", path = "../common_utils", features = ["signa
diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"], default-features = false }
external_services = { version = "0.1.0", path = "../external_services" }
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
redis_interface = { version = "0.1.0", path = "../redis_interface" }
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] }
diff --git a/crates/drainer/src/settings.rs b/crates/drainer/src/settings.rs
index ea926f32af..a65202325c 100644
--- a/crates/drainer/src/settings.rs
+++ b/crates/drainer/src/settings.rs
@@ -11,7 +11,7 @@ use hyperswitch_interfaces::{
RawSecret, SecretState, SecretStateContainer, SecuredSecret,
},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use redis_interface as redis;
pub use router_env::config::{Log, LogConsole, LogFile, LogTelemetry};
use router_env::{env, logger};
diff --git a/crates/events/Cargo.toml b/crates/events/Cargo.toml
index 3dad2dec50..d401ac21fb 100644
--- a/crates/events/Cargo.toml
+++ b/crates/events/Cargo.toml
@@ -8,7 +8,7 @@ license.workspace = true
[dependencies]
# First Party crates
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] }
# Third Party crates
diff --git a/crates/events/src/lib.rs b/crates/events/src/lib.rs
index 38a597e030..54109656fd 100644
--- a/crates/events/src/lib.rs
+++ b/crates/events/src/lib.rs
@@ -14,7 +14,7 @@ mod actix;
use std::{collections::HashMap, sync::Arc};
use error_stack::{Result, ResultExt};
-use masking::{ErasedMaskSerialize, Serialize};
+use hyperswitch_masking::{ErasedMaskSerialize, Serialize};
use router_env::logger;
use serde::Serializer;
use serde_json::Value;
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index d67567ed36..7b19ff05f0 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -18,6 +18,7 @@ v2 = ["hyperswitch_interfaces/v2", "common_utils/v2"]
revenue_recovery = [
"dep:prost",
"dep:router_env",
+ "dep:tonic-prost",
"tokio/macros",
"tokio/rt-multi-thread",
"dep:hyper-util",
@@ -27,6 +28,7 @@ revenue_recovery = [
dynamic_routing = [
"dep:prost",
"dep:api_models",
+ "dep:tonic-prost",
"tokio/macros",
"tokio/rt-multi-thread",
"dep:router_env",
@@ -55,12 +57,13 @@ thiserror = "1.0.69"
serde_json = "1.0.140"
serde_urlencoded = "0.7.1"
vaultrs = { version = "0.7.4", optional = true }
-prost = { version = "0.13", optional = true }
-prost-types = { version = "0.13", optional = true }
+prost = { version = "0.14", optional = true }
+prost-types = { version = "0.14", optional = true }
time = { version = "0.3.41", features = ["serde", "serde-well-known", "std"] }
tokio = "1.48.0"
-tonic = "0.13.1"
-tonic-reflection = "0.13.1"
+tonic = "0.14"
+tonic-prost = { version = "0.14", optional = true }
+tonic-reflection = "0.14.0"
tonic-types = "0.13.1"
typed-builder = "0.21.2"
hyper-util = { version = "0.1.12", optional = true }
@@ -69,7 +72,7 @@ reqwest = { version = "0.11.27", features = ["rustls-tls"] }
http = "0.2.12"
url = { version = "2.5.4", features = ["serde"] }
quick-xml = { version = "0.31.0", features = ["serialize"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "95144b0829b8b3d8c4b0914921b43540abb6ac50", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.03.04.0-hotfix1" , package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
superposition_provider = { version = "0.97.0", optional = true }
@@ -78,7 +81,7 @@ superposition_provider = { version = "0.97.0", optional = true }
common_utils = { version = "0.1.0", path = "../common_utils" }
common_enums = { version = "0.1.0", path = "../common_enums" }
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces", default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_env = { version = "0.1.0", path = "../router_env", features = [
"log_extra_implicit_fields",
"log_custom_entries_to_extra",
@@ -87,8 +90,8 @@ api_models = { version = "0.1.0", path = "../api_models", optional = true }
[build-dependencies]
-tonic-build = "0.13.1"
router_env = { version = "0.1.0", path = "../router_env", default-features = false, optional = true }
+tonic-prost-build = "0.14"
[lints]
workspace = true
diff --git a/crates/external_services/build.rs b/crates/external_services/build.rs
index 2e0ac1ef1b..e5ab9e34ce 100644
--- a/crates/external_services/build.rs
+++ b/crates/external_services/build.rs
@@ -7,11 +7,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let recovery_proto_files = [proto_base_path.join("recovery_decider.proto")];
#[allow(clippy::expect_used, clippy::unwrap_in_result)]
- tonic_build::configure()
+ tonic_prost_build::configure()
.out_dir(&out_dir)
.compile_well_known_types(true)
.extern_path(".google.protobuf.Timestamp", "::prost_types::Timestamp")
- .compile_protos(&recovery_proto_files, &[&proto_base_path])
+ .compile_protos(&recovery_proto_files, &[proto_base_path])
.expect("Failed to compile revenue-recovery proto files");
}
@@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Compile the .proto file
#[allow(clippy::expect_used, clippy::unwrap_in_result)]
- tonic_build::configure()
+ tonic_prost_build::configure()
.out_dir(out_dir)
.compile_protos(
&[
diff --git a/crates/external_services/src/aws_kms/implementers.rs b/crates/external_services/src/aws_kms/implementers.rs
index cc00dbf346..69a120de4f 100644
--- a/crates/external_services/src/aws_kms/implementers.rs
+++ b/crates/external_services/src/aws_kms/implementers.rs
@@ -6,7 +6,7 @@ use hyperswitch_interfaces::{
encryption_interface::{EncryptionError, EncryptionManagementInterface},
secrets_interface::{SecretManagementInterface, SecretsManagementError},
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use crate::aws_kms::core::AwsKmsClient;
diff --git a/crates/external_services/src/email/ses.rs b/crates/external_services/src/email/ses.rs
index a4c81e291e..85306f50a1 100644
--- a/crates/external_services/src/email/ses.rs
+++ b/crates/external_services/src/email/ses.rs
@@ -11,7 +11,7 @@ use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
use common_utils::{errors::CustomResult, pii};
use error_stack::{report, ResultExt};
use hyper::Uri;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::logger;
use crate::email::{EmailClient, EmailError, EmailResult, EmailSettings, IntermediateString};
diff --git a/crates/external_services/src/email/smtp.rs b/crates/external_services/src/email/smtp.rs
index 1ec6c7d832..4eea8d5d9e 100644
--- a/crates/external_services/src/email/smtp.rs
+++ b/crates/external_services/src/email/smtp.rs
@@ -2,6 +2,7 @@ use std::time::Duration;
use common_utils::{errors::CustomResult, pii};
use error_stack::ResultExt;
+use hyperswitch_masking::{PeekInterface, Secret};
use lettre::{
address::AddressError,
error,
@@ -9,7 +10,6 @@ use lettre::{
transport::smtp::{self, authentication::Credentials},
Message, SmtpTransport, Transport,
};
-use masking::{PeekInterface, Secret};
use crate::email::{EmailClient, EmailError, EmailResult, EmailSettings, IntermediateString};
diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rs
index bc92d171f2..536eabd93c 100644
--- a/crates/external_services/src/grpc_client/unified_connector_service.rs
+++ b/crates/external_services/src/grpc_client/unified_connector_service.rs
@@ -4,7 +4,7 @@ use common_enums::connector_enums::Connector;
use common_utils::{consts as common_utils_consts, errors::CustomResult, types::Url};
use error_stack::ResultExt;
pub use hyperswitch_interfaces::unified_connector_service::transformers::UnifiedConnectorServiceError;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::logger;
use tokio::time::{timeout, Duration};
use tonic::{
diff --git a/crates/external_services/src/hashicorp_vault/core.rs b/crates/external_services/src/hashicorp_vault/core.rs
index 3cc03b4330..324d0746ee 100644
--- a/crates/external_services/src/hashicorp_vault/core.rs
+++ b/crates/external_services/src/hashicorp_vault/core.rs
@@ -4,7 +4,7 @@ use std::{collections::HashMap, future::Future, pin::Pin};
use common_utils::{ext_traits::ConfigExt, fp_utils::when};
use error_stack::{Report, ResultExt};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use vaultrs::client::{VaultClient, VaultClientSettingsBuilder};
static HC_CLIENT: tokio::sync::OnceCell<HashiCorpVault> = tokio::sync::OnceCell::const_new();
@@ -162,7 +162,7 @@ pub trait FromEncoded: Sized {
///
/// ```rust
/// use external_services::hashicorp_vault::core::FromEncoded;
- /// use masking::Secret;
+ /// use hyperswitch_masking::Secret;
/// let secret_instance = Secret::<String>::from_encoded("encoded_secret_string".to_string());
/// let vec_instance = Vec::<u8>::from_encoded("68656c6c6f".to_string());
/// ```
diff --git a/crates/external_services/src/hashicorp_vault/implementers.rs b/crates/external_services/src/hashicorp_vault/implementers.rs
index 52fec2bd8d..c9ebea09a3 100644
--- a/crates/external_services/src/hashicorp_vault/implementers.rs
+++ b/crates/external_services/src/hashicorp_vault/implementers.rs
@@ -5,7 +5,7 @@ use error_stack::ResultExt;
use hyperswitch_interfaces::secrets_interface::{
SecretManagementInterface, SecretsManagementError,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use crate::hashicorp_vault::core::{HashiCorpVault, Kv2};
diff --git a/crates/external_services/src/http_client/client.rs b/crates/external_services/src/http_client/client.rs
index 34bf22c9a9..613775f1fd 100644
--- a/crates/external_services/src/http_client/client.rs
+++ b/crates/external_services/src/http_client/client.rs
@@ -5,7 +5,7 @@ use common_utils::consts::BASE64_ENGINE;
pub use common_utils::errors::CustomResult;
use error_stack::ResultExt;
use hyperswitch_interfaces::{errors::HttpClientError, types::Proxy};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use once_cell::sync::OnceCell;
static DEFAULT_CLIENT: OnceCell<reqwest::Client> = OnceCell::new();
@@ -25,9 +25,9 @@ trait ProxyClientCacheKey {
#[allow(missing_docs)]
pub fn create_client(
proxy_config: &Proxy,
- client_certificate: Option<masking::Secret<String>>,
- client_certificate_key: Option<masking::Secret<String>>,
- ca_certificate: Option<masking::Secret<String>>,
+ client_certificate: Option<hyperswitch_masking::Secret<String>>,
+ client_certificate_key: Option<hyperswitch_masking::Secret<String>>,
+ ca_certificate: Option<hyperswitch_masking::Secret<String>>,
) -> CustomResult<reqwest::Client, HttpClientError> {
// Case 1: Mutual TLS with client certificate and key
if let (Some(encoded_certificate), Some(encoded_certificate_key)) =
@@ -127,8 +127,8 @@ pub fn get_client_builder(
#[allow(missing_docs)]
pub fn create_identity_from_certificate_and_key(
- encoded_certificate: masking::Secret<String>,
- encoded_certificate_key: masking::Secret<String>,
+ encoded_certificate: hyperswitch_masking::Secret<String>,
+ encoded_certificate_key: hyperswitch_masking::Secret<String>,
) -> Result<reqwest::Identity, error_stack::Report<HttpClientError>> {
let decoded_certificate = BASE64_ENGINE
.decode(encoded_certificate.expose())
@@ -151,7 +151,7 @@ pub fn create_identity_from_certificate_and_key(
#[allow(missing_docs)]
pub fn create_certificate(
- encoded_certificate: masking::Secret<String>,
+ encoded_certificate: hyperswitch_masking::Secret<String>,
) -> Result<Vec<reqwest::Certificate>, error_stack::Report<HttpClientError>> {
let decoded_certificate = BASE64_ENGINE
.decode(encoded_certificate.expose())
diff --git a/crates/external_services/src/http_client/request.rs b/crates/external_services/src/http_client/request.rs
index cf2727f066..d7404e44f4 100644
--- a/crates/external_services/src/http_client/request.rs
+++ b/crates/external_services/src/http_client/request.rs
@@ -4,7 +4,7 @@ use common_utils::request::Headers;
pub use common_utils::{errors::CustomResult, request::ContentType};
use error_stack::ResultExt;
use hyperswitch_interfaces::errors::HttpClientError;
-pub use masking::{Mask, Maskable};
+pub use hyperswitch_masking::{Mask, Maskable};
use router_env::{instrument, tracing};
#[allow(missing_docs)]
diff --git a/crates/external_services/src/hubspot_proxy.rs b/crates/external_services/src/hubspot_proxy.rs
index 1781767641..1491a892d4 100644
--- a/crates/external_services/src/hubspot_proxy.rs
+++ b/crates/external_services/src/hubspot_proxy.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
/// Lead source constant for Hubspot
pub const HUBSPOT_LEAD_SOURCE: &str = "Hyperswitch Dashboard";
diff --git a/crates/external_services/src/no_encryption/implementers.rs b/crates/external_services/src/no_encryption/implementers.rs
index b880c3c130..ef36244f72 100644
--- a/crates/external_services/src/no_encryption/implementers.rs
+++ b/crates/external_services/src/no_encryption/implementers.rs
@@ -6,7 +6,7 @@ use hyperswitch_interfaces::{
encryption_interface::{EncryptionError, EncryptionManagementInterface},
secrets_interface::{SecretManagementInterface, SecretsManagementError},
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use crate::no_encryption::core::NoEncryption;
diff --git a/crates/external_services/src/superposition.rs b/crates/external_services/src/superposition.rs
index 6748aaf3ce..b8e187c85a 100644
--- a/crates/external_services/src/superposition.rs
+++ b/crates/external_services/src/superposition.rs
@@ -7,7 +7,7 @@ use std::collections::HashMap;
use common_utils::{errors::CustomResult, id_type::TargetingKey};
use error_stack::report;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
pub use self::types::{ConfigContext, SuperpositionClientConfig, SuperpositionError};
use crate::config_metrics;
diff --git a/crates/external_services/src/superposition/types.rs b/crates/external_services/src/superposition/types.rs
index 59f8a3a04c..dda719bfbe 100644
--- a/crates/external_services/src/superposition/types.rs
+++ b/crates/external_services/src/superposition/types.rs
@@ -3,7 +3,7 @@
use std::collections::HashMap;
use common_utils::{errors::CustomResult, fp_utils::when};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
/// Wrapper type for JSON values from Superposition
#[derive(Debug, Clone)]
diff --git a/crates/hyperswitch_connectors/Cargo.toml b/crates/hyperswitch_connectors/Cargo.toml
index 2f3a818fd9..412f835ef7 100644
--- a/crates/hyperswitch_connectors/Cargo.toml
+++ b/crates/hyperswitch_connectors/Cargo.toml
@@ -72,7 +72,7 @@ common_types = { version = "0.1.0", path = "../common_types" }
common_utils = { version = "0.1.0", path = "../common_utils", features = ["async_ext", "logs", "metrics", "crypto_openssl"] }
hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_models", default-features = false }
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces", default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] }
[lints]
diff --git a/crates/hyperswitch_connectors/src/connectors/aci.rs b/crates/hyperswitch_connectors/src/connectors/aci.rs
index 7fc4cecc86..966a0b21a7 100644
--- a/crates/hyperswitch_connectors/src/connectors/aci.rs
+++ b/crates/hyperswitch_connectors/src/connectors/aci.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use ring::aead::{self, UnboundKey};
use transformers as aci;
@@ -91,7 +91,8 @@ impl ConnectorCommon for Aci {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = aci::AciAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -210,7 +211,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -294,7 +296,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsCaptureType::get_content_type(self)
@@ -390,7 +393,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Aci
&self,
req: &PaymentsSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsSyncType::get_content_type(self).to_string().into(),
@@ -476,7 +480,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsAuthorizeType::get_content_type(self)
@@ -576,7 +581,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ac
&self,
req: &PaymentsCancelRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsAuthorizeType::get_content_type(self)
@@ -663,7 +669,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Aci {
&self,
req: &RefundsRouterData<Execute>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
RefundExecuteType::get_content_type(self).to_string().into(),
@@ -976,7 +983,8 @@ impl IncomingWebhook for Aci {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let aci_notification: aci::AciWebhookNotification =
serde_json::from_slice(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)
diff --git a/crates/hyperswitch_connectors/src/connectors/aci/transformers.rs b/crates/hyperswitch_connectors/src/connectors/aci/transformers.rs
index 64e41039cb..bd8e67af86 100644
--- a/crates/hyperswitch_connectors/src/connectors/aci/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/aci/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/adyen.rs b/crates/hyperswitch_connectors/src/connectors/adyen.rs
index 888af7e7bc..23b8ec69d6 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyen.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyen.rs
@@ -83,7 +83,7 @@ use hyperswitch_interfaces::{
IncomingWebhook, IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext,
},
};
-use masking::{ExposeInterface, Mask, Maskable, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, Secret};
use ring::hmac;
use router_env::{instrument, tracing};
use transformers as adyen;
@@ -2122,7 +2122,8 @@ impl IncomingWebhook for Adyen {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif = get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
index df96c2390d..beb44973fc 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
@@ -54,7 +54,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use time::{Duration, OffsetDateTime, PrimitiveDateTime};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/adyenplatform.rs b/crates/hyperswitch_connectors/src/connectors/adyenplatform.rs
index 8e161afe6a..67b092271c 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyenplatform.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyenplatform.rs
@@ -54,7 +54,7 @@ use hyperswitch_interfaces::{
IncomingWebhook, IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext,
},
};
-use masking::{Mask as _, Maskable, Secret};
+use hyperswitch_masking::{Mask as _, Maskable, Secret};
#[cfg(feature = "payouts")]
use ring::hmac;
#[cfg(feature = "payouts")]
@@ -454,7 +454,7 @@ impl IncomingWebhook for Adyenplatform {
&self,
#[cfg(feature = "payouts")] request: &IncomingWebhookRequestDetails<'_>,
#[cfg(not(feature = "payouts"))] _request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
#[cfg(feature = "payouts")]
{
let webhook_body: adyenplatform::AdyenplatformIncomingWebhook = request
diff --git a/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs b/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs
index 31d3e77a7f..ee4eb3cddb 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs
@@ -2,7 +2,7 @@ use common_utils::types::MinorUnit;
use error_stack::Report;
use hyperswitch_domain_models::router_data::ConnectorAuthType;
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::Serialize;
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs b/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs
index 8cf49ac94c..0da321a19d 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs
@@ -4,7 +4,7 @@ use common_utils::pii;
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::types::{self, PayoutsRouterData};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use super::{AdyenPlatformRouterData, Error};
diff --git a/crates/hyperswitch_connectors/src/connectors/affirm.rs b/crates/hyperswitch_connectors/src/connectors/affirm.rs
index 69a957eb02..8c71c5cf3b 100644
--- a/crates/hyperswitch_connectors/src/connectors/affirm.rs
+++ b/crates/hyperswitch_connectors/src/connectors/affirm.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as affirm;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -95,7 +95,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -126,7 +127,8 @@ impl ConnectorCommon for Affirm {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = affirm::AffirmAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = BASE64_ENGINE.encode(format!(
@@ -209,7 +211,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -300,7 +303,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -382,7 +386,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Aff
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -453,7 +458,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -543,7 +549,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Af
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -624,7 +631,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Affirm
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -713,7 +721,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Affirm {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -795,7 +804,8 @@ impl webhooks::IncomingWebhook for Affirm {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs b/crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs
index b6ef09e337..3558b47d5d 100644
--- a/crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use serde_json::Value;
diff --git a/crates/hyperswitch_connectors/src/connectors/airwallex.rs b/crates/hyperswitch_connectors/src/connectors/airwallex.rs
index 961cd7fb5d..c932d78338 100644
--- a/crates/hyperswitch_connectors/src/connectors/airwallex.rs
+++ b/crates/hyperswitch_connectors/src/connectors/airwallex.rs
@@ -54,7 +54,7 @@ use hyperswitch_interfaces::{
types::{self, ConnectorCustomerType, CreateOrderType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use router_env::logger;
use transformers as airwallex;
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -210,7 +211,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -318,7 +320,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let headers = vec![
(
headers::X_API_KEY.to_string(),
@@ -386,7 +389,8 @@ impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseD
&self,
req: &CreateOrderRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -476,7 +480,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -571,7 +576,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Air
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -651,7 +657,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -737,7 +744,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -831,7 +839,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ai
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -917,7 +926,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Airwall
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1007,7 +1017,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Airwallex
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1179,7 +1190,8 @@ impl IncomingWebhook for Airwallex {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: airwallex::AirwallexWebhookObjectResource = request
.body
.parse_struct("AirwallexWebhookObjectResource")
diff --git a/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs b/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs
index cbbd31d875..6bf5ca48f4 100644
--- a/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs
@@ -25,7 +25,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/amazonpay.rs b/crates/hyperswitch_connectors/src/connectors/amazonpay.rs
index cdba4d24fc..8b565ede31 100644
--- a/crates/hyperswitch_connectors/src/connectors/amazonpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/amazonpay.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
use sha2::{Digest, Sha256};
use transformers as amazonpay;
@@ -740,7 +740,8 @@ impl webhooks::IncomingWebhook for Amazonpay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs
index ed60fb8e6b..877fda3a72 100644
--- a/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/archipel.rs b/crates/hyperswitch_connectors/src/connectors/archipel.rs
index 4a68fddcd6..ff4cecdca3 100644
--- a/crates/hyperswitch_connectors/src/connectors/archipel.rs
+++ b/crates/hyperswitch_connectors/src/connectors/archipel.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use router_env::{error, info};
use transformers::{
self as archipel, ArchipelCardAuthorizationRequest, ArchipelIncrementalAuthorizationRequest,
@@ -1060,7 +1060,8 @@ impl IncomingWebhook for Archipel {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs b/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs
index 6e9124a999..211c270cd1 100644
--- a/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs
@@ -22,7 +22,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/authipay.rs b/crates/hyperswitch_connectors/src/connectors/authipay.rs
index b77ac11d3e..a42e48c5d4 100644
--- a/crates/hyperswitch_connectors/src/connectors/authipay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/authipay.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use transformers as authipay;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -107,7 +107,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let timestamp = time::OffsetDateTime::now_utc().unix_timestamp_nanos() / 1_000_000;
let auth: authipay::AuthipayAuthType =
authipay::AuthipayAuthType::try_from(&req.connector_auth_type)?;
@@ -161,7 +162,8 @@ impl ConnectorCommon for Authipay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = authipay::AuthipayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -234,7 +236,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -321,7 +324,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Aut
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -402,7 +406,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -492,7 +497,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Au
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -581,7 +587,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Authipa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -670,7 +677,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Authipay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -766,7 +774,8 @@ impl webhooks::IncomingWebhook for Authipay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
index aee34d659a..5c1c06af49 100644
--- a/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs b/crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs
index 9e97702d95..9d4354dfc0 100644
--- a/crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs
+++ b/crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs
@@ -50,7 +50,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use transformers as authorizedotnet;
use crate::{
@@ -1089,7 +1089,8 @@ impl webhooks::IncomingWebhook for Authorizedotnet {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let payload: authorizedotnet::AuthorizedotnetWebhookObjectId = request
.body
.parse_struct("AuthorizedotnetWebhookObjectId")
diff --git a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs
index 95c459b62b..d7160e7b52 100644
--- a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs
@@ -30,7 +30,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret, StrongSecret};
use rand::distributions::{Alphanumeric, DistString};
use regex::Regex;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/bambora.rs b/crates/hyperswitch_connectors/src/connectors/bambora.rs
index ce07d929c7..853a22b346 100644
--- a/crates/hyperswitch_connectors/src/connectors/bambora.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bambora.rs
@@ -45,8 +45,8 @@ use hyperswitch_interfaces::{
},
webhooks,
};
+use hyperswitch_masking::Mask;
use lazy_static::lazy_static;
-use masking::Mask;
use transformers as bambora;
use crate::{
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsAuthorizeType::get_content_type(self)
@@ -124,7 +125,8 @@ impl ConnectorCommon for Bambora {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = bambora::BamboraAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -195,7 +197,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -281,7 +284,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -370,7 +374,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bam
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -445,7 +450,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -534,7 +540,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ba
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -649,7 +656,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Bambora
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -741,7 +749,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Bambora {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -829,7 +838,8 @@ impl webhooks::IncomingWebhook for Bambora {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs
index 53cbda6683..32fbb7f752 100644
--- a/crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs
@@ -15,7 +15,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Deserializer, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/bamboraapac.rs b/crates/hyperswitch_connectors/src/connectors/bamboraapac.rs
index 909c190c00..7042b086d2 100644
--- a/crates/hyperswitch_connectors/src/connectors/bamboraapac.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bamboraapac.rs
@@ -92,7 +92,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -192,7 +193,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -274,7 +276,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -367,7 +370,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bam
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -449,7 +453,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -543,7 +548,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Bambora
&self,
req: &RefundExecuteRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -634,7 +640,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Bamboraap
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -731,7 +738,8 @@ impl IncomingWebhook for Bamboraapac {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs
index 17a2605533..f03615a3f6 100644
--- a/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs b/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
index e773ec78bf..7178bf7d6d 100644
--- a/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::{digest, hmac};
use time::OffsetDateTime;
use transformers as bankofamerica;
@@ -1085,7 +1085,8 @@ impl webhooks::IncomingWebhook for Bankofamerica {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
index 1ad4560382..65bedbcc95 100644
--- a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
@@ -20,7 +20,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{api, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
diff --git a/crates/hyperswitch_connectors/src/connectors/barclaycard.rs b/crates/hyperswitch_connectors/src/connectors/barclaycard.rs
index 4856c0eb88..f468f51d37 100644
--- a/crates/hyperswitch_connectors/src/connectors/barclaycard.rs
+++ b/crates/hyperswitch_connectors/src/connectors/barclaycard.rs
@@ -54,7 +54,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::{digest, hmac};
use time::OffsetDateTime;
use transformers as barclaycard;
@@ -1535,7 +1535,8 @@ impl webhooks::IncomingWebhook for Barclaycard {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs b/crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs
index a79a5f0536..e7b504ccc4 100644
--- a/crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs
@@ -28,7 +28,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
diff --git a/crates/hyperswitch_connectors/src/connectors/billwerk.rs b/crates/hyperswitch_connectors/src/connectors/billwerk.rs
index e8a86e62c1..6e3a853e72 100644
--- a/crates/hyperswitch_connectors/src/connectors/billwerk.rs
+++ b/crates/hyperswitch_connectors/src/connectors/billwerk.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers::{
self as billwerk, BillwerkAuthType, BillwerkCaptureRequest, BillwerkErrorResponse,
BillwerkPaymentsRequest, BillwerkPaymentsResponse, BillwerkRefundRequest, BillwerkRouterData,
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -123,7 +124,8 @@ impl ConnectorCommon for Billwerk {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = BillwerkAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = BASE64_ENGINE.encode(format!("{}:", auth.api_key.peek()));
@@ -184,7 +186,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -277,7 +280,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -372,7 +376,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bil
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -448,7 +453,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -545,7 +551,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Bi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -621,7 +628,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Billwer
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -713,7 +721,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Billwerk
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -807,7 +816,8 @@ impl IncomingWebhook for Billwerk {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs b/crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs
index 8f4b4f9f65..64777e8833 100644
--- a/crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/bitpay.rs b/crates/hyperswitch_connectors/src/connectors/bitpay.rs
index 9625a00f20..6859a254a5 100644
--- a/crates/hyperswitch_connectors/src/connectors/bitpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bitpay.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsSyncType, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as bitpay;
use self::bitpay::BitpayWebhookDetails;
@@ -88,7 +88,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -125,7 +126,8 @@ impl ConnectorCommon for Bitpay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = bitpay::BitpayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -189,7 +191,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -273,7 +276,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bit
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -418,7 +422,8 @@ impl webhooks::IncomingWebhook for Bitpay {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif: BitpayWebhookDetails = request
.body
.parse_struct("BitpayWebhookDetails")
diff --git a/crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs
index aca73b9f2a..b7beae5297 100644
--- a/crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs
@@ -8,7 +8,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs b/crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs
index 87b1c6cc50..ba1c197ef9 100644
--- a/crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs
+++ b/crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use transformers as blackhawknetwork;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -631,7 +631,8 @@ impl webhooks::IncomingWebhook for Blackhawknetwork {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs b/crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs
index 148e897762..1c8f7d9777 100644
--- a/crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts::NO_ERROR_MESSAGE, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{
diff --git a/crates/hyperswitch_connectors/src/connectors/bluesnap.rs b/crates/hyperswitch_connectors/src/connectors/bluesnap.rs
index 28d5db8033..87efcd81d5 100644
--- a/crates/hyperswitch_connectors/src/connectors/bluesnap.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bluesnap.rs
@@ -53,7 +53,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use router_env::logger;
use transformers as bluesnap;
@@ -100,7 +100,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = self.get_auth_header(&req.connector_auth_type)?;
header.push((
headers::CONTENT_TYPE.to_string(),
@@ -129,7 +130,8 @@ impl ConnectorCommon for Bluesnap {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = bluesnap::BluesnapAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key =
@@ -324,7 +326,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Bl
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -409,7 +412,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Blu
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -495,7 +499,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -587,7 +592,8 @@ impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> fo
&self,
req: &PaymentsSessionRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -679,7 +685,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -828,7 +835,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -918,7 +926,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Bluesna
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1007,7 +1016,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Bluesnap
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1204,7 +1214,8 @@ impl IncomingWebhook for Bluesnap {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let resource: bluesnap::BluesnapWebhookObjectResource =
serde_urlencoded::from_bytes(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs
index 9da387a4cb..7d085b7fec 100644
--- a/crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs
@@ -29,7 +29,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
diff --git a/crates/hyperswitch_connectors/src/connectors/boku.rs b/crates/hyperswitch_connectors/src/connectors/boku.rs
index 1a26c92966..2b0a97ab6d 100644
--- a/crates/hyperswitch_connectors/src/connectors/boku.rs
+++ b/crates/hyperswitch_connectors/src/connectors/boku.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask, PeekInterface, Secret, WithType};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret, WithType};
use ring::hmac;
use router_env::logger;
use time::OffsetDateTime;
@@ -96,7 +96,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let connector_auth = boku::BokuAuthType::try_from(&req.connector_auth_type)?;
let boku_url = Self::get_url(self, req, connectors)?;
@@ -205,7 +206,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -303,7 +305,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bok
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -386,7 +389,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -467,7 +471,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Boku {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -558,7 +563,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Boku {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -654,7 +660,8 @@ impl IncomingWebhook for Boku {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/boku/transformers.rs b/crates/hyperswitch_connectors/src/connectors/boku/transformers.rs
index 088d1cc62c..cf7c404639 100644
--- a/crates/hyperswitch_connectors/src/connectors/boku/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/boku/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types::{self, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
use uuid::Uuid;
diff --git a/crates/hyperswitch_connectors/src/connectors/braintree.rs b/crates/hyperswitch_connectors/src/connectors/braintree.rs
index 170ae5b025..94868dcc72 100644
--- a/crates/hyperswitch_connectors/src/connectors/braintree.rs
+++ b/crates/hyperswitch_connectors/src/connectors/braintree.rs
@@ -62,7 +62,7 @@ use hyperswitch_interfaces::{
IncomingWebhook, IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext,
},
};
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret};
use ring::hmac;
use router_env::logger;
use sha1::{Digest, Sha1};
@@ -103,7 +103,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -136,7 +137,8 @@ impl ConnectorCommon for Braintree {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = braintree::BraintreeAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!("{}:{}", auth.public_key.peek(), auth.private_key.peek());
@@ -250,7 +252,8 @@ impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> fo
&self,
req: &PaymentsSessionRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -338,7 +341,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -434,7 +438,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -518,7 +523,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Bra
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -593,7 +599,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -691,7 +698,8 @@ impl ConnectorIntegration<MandateRevoke, MandateRevokeRequestData, MandateRevoke
&self,
req: &MandateRevokeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_url(
@@ -759,7 +767,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Br
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -836,7 +845,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Braintr
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -914,7 +924,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Braintree
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1107,7 +1118,8 @@ impl IncomingWebhook for Braintree {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif = get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
@@ -1242,7 +1254,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
diff --git a/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs b/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
index c12c87edfa..57c458b980 100644
--- a/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
@@ -25,7 +25,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use strum::Display;
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/breadpay.rs b/crates/hyperswitch_connectors/src/connectors/breadpay.rs
index 3a5e05a7ab..860d596ad9 100644
--- a/crates/hyperswitch_connectors/src/connectors/breadpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/breadpay.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use transformers::{
self as breadpay, BreadpayTransactionRequest, BreadpayTransactionResponse,
BreadpayTransactionType,
@@ -797,7 +797,8 @@ impl webhooks::IncomingWebhook for Breadpay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs
index 5a84507e44..4e6e542f7c 100644
--- a/crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/calida.rs b/crates/hyperswitch_connectors/src/connectors/calida.rs
index b1479f6af4..7640a2a241 100644
--- a/crates/hyperswitch_connectors/src/connectors/calida.rs
+++ b/crates/hyperswitch_connectors/src/connectors/calida.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use ring::hmac;
use serde_json::Value;
use transformers as calida;
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -123,7 +124,8 @@ impl ConnectorCommon for Calida {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = calida::CalidaAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -198,7 +200,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -304,7 +307,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Cal
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -394,7 +398,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -481,7 +486,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Calida
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -565,7 +571,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Calida {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -715,7 +722,8 @@ impl webhooks::IncomingWebhook for Calida {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body = transformers::get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/calida/transformers.rs b/crates/hyperswitch_connectors/src/connectors/calida/transformers.rs
index c17117dfbb..dc5b4613c6 100644
--- a/crates/hyperswitch_connectors/src/connectors/calida/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/calida/transformers.rs
@@ -18,7 +18,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
diff --git a/crates/hyperswitch_connectors/src/connectors/cashtocode.rs b/crates/hyperswitch_connectors/src/connectors/cashtocode.rs
index bd8b3132db..4c4db95246 100644
--- a/crates/hyperswitch_connectors/src/connectors/cashtocode.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cashtocode.rs
@@ -41,7 +41,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, Response},
webhooks::{self, IncomingWebhookFlowError},
};
-use masking::{Mask, PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
use transformers as cashtocode;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -75,11 +75,11 @@ impl api::RefundSync for Cashtocode {}
fn get_b64_auth_cashtocode(
payment_method_type: Option<enums::PaymentMethodType>,
auth_type: &transformers::CashtocodeAuth,
-) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
fn construct_basic_auth(
username: Option<Secret<String>>,
password: Option<Secret<String>>,
- ) -> Result<masking::Maskable<String>, errors::ConnectorError> {
+ ) -> Result<hyperswitch_masking::Maskable<String>, errors::ConnectorError> {
let username = username.ok_or(errors::ConnectorError::FailedToObtainAuthType)?;
let password = password.ok_or(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(format!(
@@ -189,7 +189,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsAuthorizeType::get_content_type(self)
@@ -409,7 +410,8 @@ impl webhooks::IncomingWebhook for Cashtocode {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook: transformers::CashtocodeIncomingWebhook = request
.body
.parse_struct("CashtocodeIncomingWebhook")
diff --git a/crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs
index 299ed5ef85..b99dbb944d 100644
--- a/crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
types::PaymentsAuthorizeRouterData,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::env::{self, Env};
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/celero.rs b/crates/hyperswitch_connectors/src/connectors/celero.rs
index d656d3d1cc..55e9ff2d21 100644
--- a/crates/hyperswitch_connectors/src/connectors/celero.rs
+++ b/crates/hyperswitch_connectors/src/connectors/celero.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as celero;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -118,7 +119,8 @@ impl ConnectorCommon for Celero {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = celero::CeleroAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -203,7 +205,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -290,7 +293,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Cel
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -370,7 +374,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -460,7 +465,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ce
&self,
req: &RouterData<Void, PaymentsCancelData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -532,7 +538,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Celero
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -621,7 +628,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Celero {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -716,7 +724,8 @@ impl webhooks::IncomingWebhook for Celero {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs b/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
index 6872cdf87d..26db306a6a 100644
--- a/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
@@ -22,7 +22,7 @@ use hyperswitch_interfaces::{
consts,
errors::{self},
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/chargebee.rs b/crates/hyperswitch_connectors/src/connectors/chargebee.rs
index 38fcc25287..5622a58ea8 100644
--- a/crates/hyperswitch_connectors/src/connectors/chargebee.rs
+++ b/crates/hyperswitch_connectors/src/connectors/chargebee.rs
@@ -74,7 +74,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
use transformers as chargebee;
use crate::{
@@ -163,7 +163,7 @@ macro_rules! impl_chargebee_integration {
&self,
req: &$router_data,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
@@ -295,7 +295,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -326,7 +327,8 @@ impl ConnectorCommon for Chargebee {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = chargebee::ChargebeeAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = BASE64_ENGINE.encode(auth.full_access_key_v1.peek());
@@ -820,7 +822,8 @@ impl webhooks::IncomingWebhook for Chargebee {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook =
chargebee::ChargebeeInvoiceBody::get_invoice_webhook_data_from_body(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs b/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs
index bfbf47c23f..2ba77313d4 100644
--- a/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs
@@ -35,7 +35,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/checkbook.rs b/crates/hyperswitch_connectors/src/connectors/checkbook.rs
index 18f3edfe2e..6c4d774293 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkbook.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkbook.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as checkbook;
use crate::{constants::headers, types::ResponseRouterData};
@@ -88,7 +88,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -119,7 +120,8 @@ impl ConnectorCommon for Checkbook {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = checkbook::CheckbookAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!(
@@ -180,7 +182,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -264,7 +267,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Che
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -339,7 +343,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ch
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -403,7 +408,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Checkbo
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -477,7 +483,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Checkbook
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -561,7 +568,8 @@ impl webhooks::IncomingWebhook for Checkbook {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: checkbook::CheckbookPaymentsResponse = request
.body
.parse_struct("CheckbookWebhookResponse")
diff --git a/crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs b/crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs
index e1545ad132..bddc83cf59 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs
@@ -8,7 +8,7 @@ use hyperswitch_domain_models::{
types::PaymentsAuthorizeRouterData,
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/checkout.rs b/crates/hyperswitch_connectors/src/connectors/checkout.rs
index 7806ea1112..5423c3a0a6 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkout.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkout.rs
@@ -59,7 +59,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{Mask, Maskable, PeekInterface};
use transformers::CheckoutErrorResponse;
use self::transformers as checkout;
@@ -1360,7 +1360,8 @@ impl webhooks::IncomingWebhook for Checkout {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let event_type_data: checkout::CheckoutWebhookEventTypeBody = request
.body
.parse_struct("CheckoutWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
index 32ad69d4e8..0fbc75dac4 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
@@ -27,7 +27,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors, webhooks};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::json;
use serde_with::skip_serializing_none;
diff --git a/crates/hyperswitch_connectors/src/connectors/coinbase.rs b/crates/hyperswitch_connectors/src/connectors/coinbase.rs
index e528f835f1..d0957e7824 100644
--- a/crates/hyperswitch_connectors/src/connectors/coinbase.rs
+++ b/crates/hyperswitch_connectors/src/connectors/coinbase.rs
@@ -41,8 +41,8 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsSyncType, Response},
webhooks,
};
+use hyperswitch_masking::Mask;
use lazy_static::lazy_static;
-use masking::Mask;
use transformers as coinbase;
use self::coinbase::CoinbaseWebhookDetails;
@@ -86,7 +86,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -119,7 +120,8 @@ impl ConnectorCommon for Coinbase {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth: coinbase::CoinbaseAuthType = coinbase::CoinbaseAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -191,7 +193,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -274,7 +277,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Coi
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -448,7 +452,8 @@ impl webhooks::IncomingWebhook for Coinbase {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif: CoinbaseWebhookDetails = request
.body
.parse_struct("CoinbaseWebhookDetails")
diff --git a/crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs b/crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs
index ed77e4cc21..9c081c727b 100644
--- a/crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types::{self, PaymentsAuthorizeRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/coingate.rs b/crates/hyperswitch_connectors/src/connectors/coingate.rs
index feb5252a63..c98fd22816 100644
--- a/crates/hyperswitch_connectors/src/connectors/coingate.rs
+++ b/crates/hyperswitch_connectors/src/connectors/coingate.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use transformers::{self as coingate, CoingateWebhookBody};
use crate::{
@@ -90,7 +90,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -121,7 +122,8 @@ impl ConnectorCommon for Coingate {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = coingate::CoingateAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -179,7 +181,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -266,7 +269,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Coi
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -368,7 +372,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Coingat
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -457,7 +462,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Coingate
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -590,7 +596,9 @@ impl webhooks::IncomingWebhook for Coingate {
request: &webhooks::IncomingWebhookRequestDetails<'_>,
_merchant_id: &common_utils::id_type::MerchantId,
_connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
_connector_label: &str,
) -> CustomResult<bool, errors::ConnectorError> {
let connector_account_details: ConnectorAuthType = connector_account_details
@@ -609,7 +617,8 @@ impl webhooks::IncomingWebhook for Coingate {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif: CoingateWebhookBody = request
.body
.parse_struct("CoingateWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs b/crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
index a00da50946..732a1eee2a 100644
--- a/crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsSyncRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/cryptopay.rs b/crates/hyperswitch_connectors/src/connectors/cryptopay.rs
index 99ae2f93d1..f1ee39201f 100644
--- a/crates/hyperswitch_connectors/src/connectors/cryptopay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cryptopay.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsSyncType, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as cryptopay;
use self::cryptopay::CryptopayWebhookDetails;
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let method = self.get_http_method();
let payload = match method {
Method::Get => String::default(),
@@ -166,7 +167,8 @@ impl ConnectorCommon for Cryptopay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = cryptopay::CryptopayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -228,7 +230,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -334,7 +337,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Cry
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -497,7 +501,8 @@ impl webhooks::IncomingWebhook for Cryptopay {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif: CryptopayWebhookDetails =
request
.body
diff --git a/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
index b762876677..8656533014 100644
--- a/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{consts, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use reqwest::Url;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs b/crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs
index cba1e12005..ef678b7688 100644
--- a/crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs
+++ b/crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs
@@ -55,7 +55,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -122,7 +123,8 @@ impl webhooks::IncomingWebhook for CtpMastercard {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/custombilling.rs b/crates/hyperswitch_connectors/src/connectors/custombilling.rs
index df2d0dea56..a73f27ed28 100644
--- a/crates/hyperswitch_connectors/src/connectors/custombilling.rs
+++ b/crates/hyperswitch_connectors/src/connectors/custombilling.rs
@@ -80,7 +80,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -114,7 +115,8 @@ impl ConnectorCommon for Custombilling {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -169,7 +171,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -257,7 +260,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Cus
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -321,7 +325,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -400,7 +405,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Customb
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -486,7 +492,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Custombil
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -568,7 +575,8 @@ impl webhooks::IncomingWebhook for Custombilling {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs b/crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs
index fb985448c9..b1ca6c200a 100644
--- a/crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource.rs b/crates/hyperswitch_connectors/src/connectors/cybersource.rs
index b20db6436f..1d97b4c54b 100644
--- a/crates/hyperswitch_connectors/src/connectors/cybersource.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cybersource.rs
@@ -71,7 +71,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::{digest, hmac};
use time::OffsetDateTime;
use transformers as cybersource;
@@ -2146,7 +2146,8 @@ impl webhooks::IncomingWebhook for Cybersource {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
index d7557d0ed8..707e7c1792 100644
--- a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
@@ -50,7 +50,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{api, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use utils::ForeignTryFrom;
diff --git a/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs b/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs
index f0c511b9e2..ab73bf7e11 100644
--- a/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::{digest, hmac};
use time::OffsetDateTime;
use transformers as cybersourcedecisionmanager;
@@ -649,7 +649,7 @@ impl webhooks::IncomingWebhook for Cybersourcedecisionmanager {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs
index e35003b161..17ca790264 100644
--- a/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
router_response_types::fraud_check::FraudCheckResponseData,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/datatrans.rs b/crates/hyperswitch_connectors/src/connectors/datatrans.rs
index 8d308ba554..f21fb4f1df 100644
--- a/crates/hyperswitch_connectors/src/connectors/datatrans.rs
+++ b/crates/hyperswitch_connectors/src/connectors/datatrans.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as datatrans;
use crate::{
@@ -98,7 +98,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -129,7 +130,8 @@ impl ConnectorCommon for Datatrans {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = datatrans::DatatransAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!("{}:{}", auth.merchant_id.peek(), auth.passcode.peek());
@@ -218,7 +220,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -290,7 +293,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -390,7 +394,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Dat
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -460,7 +465,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -551,7 +557,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Da
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -622,7 +629,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Datatra
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -708,7 +716,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Datatrans
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -792,7 +801,8 @@ impl IncomingWebhook for Datatrans {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs b/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
index 45c3362713..572850879c 100644
--- a/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
@@ -17,7 +17,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/deutschebank.rs b/crates/hyperswitch_connectors/src/connectors/deutschebank.rs
index a88ec39fd5..a4d37c99d2 100644
--- a/crates/hyperswitch_connectors/src/connectors/deutschebank.rs
+++ b/crates/hyperswitch_connectors/src/connectors/deutschebank.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use rand::distributions::{Alphanumeric, DistString};
use ring::hmac;
use transformers as deutschebank;
@@ -103,7 +103,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -144,7 +145,8 @@ impl ConnectorCommon for Deutschebank {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = deutschebank::DeutschebankAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -338,7 +340,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -482,7 +485,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -586,7 +590,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Deu
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -658,7 +663,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -749,7 +755,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for De
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -830,7 +837,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Deutsch
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -921,7 +929,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Deutscheb
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1004,7 +1013,8 @@ impl webhooks::IncomingWebhook for Deutschebank {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
index 5763927275..f0c46b4bf8 100644
--- a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs b/crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs
index 7e0afd287a..e6e29cd9f4 100644
--- a/crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs
+++ b/crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as digitalvirgo;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -123,7 +124,8 @@ impl ConnectorCommon for Digitalvirgo {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = digitalvirgo::DigitalvirgoAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = consts::BASE64_ENGINE.encode(format!(
@@ -215,7 +217,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -313,7 +316,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Dig
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -388,7 +392,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -527,7 +532,8 @@ impl webhooks::IncomingWebhook for Digitalvirgo {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs b/crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs
index a0c3bfccf1..ce7c95c7ea 100644
--- a/crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsCompleteAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/dlocal.rs b/crates/hyperswitch_connectors/src/connectors/dlocal.rs
index 3aca0f4548..80c2b62f86 100644
--- a/crates/hyperswitch_connectors/src/connectors/dlocal.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dlocal.rs
@@ -44,8 +44,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use hyperswitch_masking::{Mask, Maskable, PeekInterface};
use lazy_static::lazy_static;
-use masking::{Mask, Maskable, PeekInterface};
use transformers as dlocal;
use crate::{
@@ -709,7 +709,8 @@ impl webhooks::IncomingWebhook for Dlocal {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs b/crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs
index 6976c7da93..889704d526 100644
--- a/crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/dummyconnector.rs b/crates/hyperswitch_connectors/src/connectors/dummyconnector.rs
index fce89678e1..23a30be93a 100644
--- a/crates/hyperswitch_connectors/src/connectors/dummyconnector.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dummyconnector.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask as _, Maskable};
+use hyperswitch_masking::{Mask as _, Maskable};
use transformers as dummyconnector;
use crate::{
@@ -648,7 +648,7 @@ impl<const T: u8> IncomingWebhook for DummyConnector<T> {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs b/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs
index 3350e9ef9e..a42e4a9b58 100644
--- a/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/dwolla.rs b/crates/hyperswitch_connectors/src/connectors/dwolla.rs
index 2c5eaaddd3..a9087c5820 100644
--- a/crates/hyperswitch_connectors/src/connectors/dwolla.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dwolla.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, RefreshTokenType, Response, TokenizationType},
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use ring::hmac;
use transformers as dwolla;
use transformers::extract_token_from_body;
@@ -92,7 +92,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -190,7 +191,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = dwolla::DwollaAuthType::try_from(&req.connector_auth_type)?;
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
@@ -285,7 +287,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -369,7 +372,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -491,7 +495,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -608,7 +613,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Dwo
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -689,7 +695,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Dwolla
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -789,7 +796,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Dwolla {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -951,7 +959,8 @@ impl webhooks::IncomingWebhook for Dwolla {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: dwolla::DwollaWebhookDetails = request
.body
.parse_struct("DwollaWebhookDetails")
diff --git a/crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs b/crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs
index 4de317fa11..3ad1730eb5 100644
--- a/crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/ebanx.rs b/crates/hyperswitch_connectors/src/connectors/ebanx.rs
index c556d4f16f..3bff06312d 100644
--- a/crates/hyperswitch_connectors/src/connectors/ebanx.rs
+++ b/crates/hyperswitch_connectors/src/connectors/ebanx.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
#[cfg(feature = "payouts")]
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
use transformers as ebanx;
@@ -448,7 +448,7 @@ impl IncomingWebhook for Ebanx {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs b/crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs
index 2d00ee7e48..efe39f4f28 100644
--- a/crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs
@@ -14,8 +14,8 @@ use hyperswitch_domain_models::router_flow_types::PoCreate;
use hyperswitch_domain_models::types::{PayoutsResponseData, PayoutsRouterData};
use hyperswitch_interfaces::errors::ConnectorError;
#[cfg(feature = "payouts")]
-use masking::ExposeInterface;
-use masking::Secret;
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/elavon.rs b/crates/hyperswitch_connectors/src/connectors/elavon.rs
index e543d5d95c..9726dde6d4 100644
--- a/crates/hyperswitch_connectors/src/connectors/elavon.rs
+++ b/crates/hyperswitch_connectors/src/connectors/elavon.rs
@@ -41,7 +41,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Secret, WithoutType};
+use hyperswitch_masking::{Secret, WithoutType};
use serde::Serialize;
use transformers as elavon;
@@ -107,7 +107,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -147,7 +148,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -235,7 +237,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Ela
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -311,7 +314,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -406,7 +410,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Elavon
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -491,7 +496,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Elavon {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -581,7 +587,8 @@ impl webhooks::IncomingWebhook for Elavon {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs b/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
index c4da917ee0..d05993acf9 100644
--- a/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
@@ -14,7 +14,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts::NO_ERROR_CODE, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Deserializer, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/envoy.rs b/crates/hyperswitch_connectors/src/connectors/envoy.rs
index b3550ec47f..e78ddab843 100644
--- a/crates/hyperswitch_connectors/src/connectors/envoy.rs
+++ b/crates/hyperswitch_connectors/src/connectors/envoy.rs
@@ -103,7 +103,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Envoy
&self,
_req: &PayoutsRouterData<PoFulfill>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -199,7 +200,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -230,7 +232,8 @@ impl ConnectorCommon for Envoy {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -302,7 +305,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -389,7 +393,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Env
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -453,7 +458,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -532,7 +538,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Envoy {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -616,7 +623,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Envoy {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -698,7 +706,8 @@ impl webhooks::IncomingWebhook for Envoy {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs b/crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs
index 9fc3e497e4..0d94328929 100644
--- a/crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs
@@ -22,7 +22,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/facilitapay.rs b/crates/hyperswitch_connectors/src/connectors/facilitapay.rs
index a7cf0fa050..a40816f5bc 100644
--- a/crates/hyperswitch_connectors/src/connectors/facilitapay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/facilitapay.rs
@@ -46,8 +46,8 @@ use hyperswitch_interfaces::{
types::{self, RefreshTokenType, Response},
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask, PeekInterface};
use requests::{
FacilitapayAuthRequest, FacilitapayCustomerRequest, FacilitapayPaymentsRequest,
FacilitapayRouterData,
@@ -106,7 +106,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -160,7 +161,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -251,7 +253,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -346,7 +349,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -436,7 +440,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fac
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -511,7 +516,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -588,7 +594,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Fa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -655,7 +662,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Facilit
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -733,7 +741,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Facilitap
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -805,7 +814,9 @@ impl webhooks::IncomingWebhook for Facilitapay {
request: &webhooks::IncomingWebhookRequestDetails<'_>,
_merchant_id: &common_utils::id_type::MerchantId,
connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- _connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ _connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
_connector_name: &str,
) -> CustomResult<bool, errors::ConnectorError> {
let webhook_body: responses::FacilitapayWebhookNotification = request
@@ -905,7 +916,8 @@ impl webhooks::IncomingWebhook for Facilitapay {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: responses::FacilitapayWebhookNotification = request
.body
.parse_struct("FacilitapayWebhookNotification")
diff --git a/crates/hyperswitch_connectors/src/connectors/facilitapay/requests.rs b/crates/hyperswitch_connectors/src/connectors/facilitapay/requests.rs
index a14da2dd57..7514b64e2e 100644
--- a/crates/hyperswitch_connectors/src/connectors/facilitapay/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/facilitapay/requests.rs
@@ -1,6 +1,6 @@
use common_enums::CountryAlpha2;
use common_utils::{new_type::MaskedBankAccount, pii, types::StringMajorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs b/crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs
index ead8569154..8101646b6d 100644
--- a/crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs
+++ b/crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs
@@ -1,5 +1,5 @@
use common_utils::{pii, types::StringMajorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use super::requests::DocumentType;
diff --git a/crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs
index 45a05aa467..0584851298 100644
--- a/crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
use hyperswitch_interfaces::{
consts, errors, events::connector_api_logs::ConnectorEvent, types::Response,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/finix.rs b/crates/hyperswitch_connectors/src/connectors/finix.rs
index c909e38d36..6c9513bf30 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix.rs
@@ -51,7 +51,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as finix;
use crate::{
@@ -97,7 +97,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &RouterData<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -183,7 +184,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &RouterData<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -267,7 +269,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -298,7 +301,8 @@ impl ConnectorCommon for Finix {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = finix::FinixAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let credentials = format!(
@@ -382,7 +386,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -464,7 +469,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -560,7 +566,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fin
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -647,7 +654,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -739,7 +747,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Fi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -823,7 +832,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Finix {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -912,7 +922,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Finix {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1210,7 +1221,8 @@ impl webhooks::IncomingWebhook for Finix {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: finix::FinixWebhookBody =
request
.body
diff --git a/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs b/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
index ba31d4cd04..f9ceb9b19d 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
@@ -28,7 +28,7 @@ use hyperswitch_domain_models::{
types::RefundsRouterData,
};
use hyperswitch_interfaces::{consts, disputes::DisputePayload, errors::ConnectorError};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
pub use request::*;
pub use response::*;
diff --git a/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs b/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
index 65ff276de6..f0d55d70b2 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use common_enums::Currency;
use common_utils::{pii::Email, types::MinorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use super::*;
diff --git a/crates/hyperswitch_connectors/src/connectors/fiserv.rs b/crates/hyperswitch_connectors/src/connectors/fiserv.rs
index 19a074106d..9d37201335 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiserv.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiserv.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
events::connector_api_logs::ConnectorEvent,
types, webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use ring::hmac;
use time::OffsetDateTime;
use transformers as fiserv;
@@ -93,7 +93,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let timestamp = OffsetDateTime::now_utc().unix_timestamp_nanos() / 1_000_000;
let auth: fiserv::FiservAuthType =
fiserv::FiservAuthType::try_from(&req.connector_auth_type)?;
@@ -146,7 +147,8 @@ impl ConnectorCommon for Fiserv {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = fiserv::FiservAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -249,7 +251,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Fi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -335,7 +338,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fis
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -447,7 +451,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -566,7 +571,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -691,7 +697,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Fiserv
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -792,7 +799,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Fiserv {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -919,7 +927,8 @@ impl webhooks::IncomingWebhook for Fiserv {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs
index cffdcb104b..914a1e43ef 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs
@@ -17,7 +17,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{ser::Serializer, Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs b/crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs
index e5a9d797e7..0df3bc37b0 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs
@@ -41,8 +41,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask};
use transformers as fiservcommercehub;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -118,7 +119,8 @@ impl ConnectorCommon for Fiservcommercehub {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = fiservcommercehub::FiservcommercehubAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -205,7 +207,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -294,7 +297,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fis
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -360,7 +364,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData>
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -439,7 +444,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Fiservc
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -525,7 +531,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Fiservcom
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -607,7 +614,8 @@ impl webhooks::IncomingWebhook for Fiservcommercehub {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs
index 9b4e136787..fd3ab0de4f 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/fiservemea.rs b/crates/hyperswitch_connectors/src/connectors/fiservemea.rs
index 76d4cddabf..29af8b199e 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiservemea.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiservemea.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use ring::hmac;
use time::OffsetDateTime;
use transformers as fiservemea;
@@ -132,7 +132,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let timestamp = OffsetDateTime::now_utc().unix_timestamp_nanos() / 1_000_000;
let auth: fiservemea::FiservemeaAuthType =
fiservemea::FiservemeaAuthType::try_from(&req.connector_auth_type)?;
@@ -271,7 +272,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -362,7 +364,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fis
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -438,7 +441,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -527,7 +531,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Fi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -607,7 +612,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Fiserve
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -695,7 +701,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Fiserveme
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -785,7 +792,8 @@ impl webhooks::IncomingWebhook for Fiservemea {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs
index d8567897ff..a2b5faff96 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu.rs b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
index db5873f5b3..8a44b949ea 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use reqwest::multipart::Form;
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -197,7 +197,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -299,7 +300,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -414,7 +416,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fiu
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_url(
@@ -941,7 +944,8 @@ impl webhooks::IncomingWebhook for Fiuu {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let header = utils::get_header_key_value("content-type", request.headers)?;
let payload: FiuuWebhooksResponse = if header == "application/x-www-form-urlencoded" {
parse_and_log_keys_in_url_encoded_response::<FiuuWebhooksResponse>(request.body);
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
index d7ab1f7e84..865764f29e 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
@@ -30,7 +30,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use strum::Display;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/flexiti.rs b/crates/hyperswitch_connectors/src/connectors/flexiti.rs
index de210b44c3..d3b381cb7c 100644
--- a/crates/hyperswitch_connectors/src/connectors/flexiti.rs
+++ b/crates/hyperswitch_connectors/src/connectors/flexiti.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use transformers as flexiti;
use uuid::Uuid;
@@ -87,7 +87,7 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
}
impl Flexiti {
- fn get_default_header() -> (String, masking::Maskable<String>) {
+ fn get_default_header() -> (String, hyperswitch_masking::Maskable<String>) {
(
"x-reference-id".to_string(),
Uuid::new_v4().to_string().into(),
@@ -103,7 +103,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -137,7 +138,8 @@ impl ConnectorCommon for Flexiti {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -240,7 +242,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(Self::get_default_header())])
}
fn get_request_body(
@@ -313,7 +316,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -405,7 +409,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Fle
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -480,7 +485,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -559,7 +565,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Flexiti
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -643,7 +650,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Flexiti {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -725,7 +733,8 @@ impl webhooks::IncomingWebhook for Flexiti {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs b/crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs
index b41ac5eb9e..79d33faf48 100644
--- a/crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/forte.rs b/crates/hyperswitch_connectors/src/connectors/forte.rs
index 79f832c88e..a8814e2024 100644
--- a/crates/hyperswitch_connectors/src/connectors/forte.rs
+++ b/crates/hyperswitch_connectors/src/connectors/forte.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as forte;
use crate::{
@@ -95,7 +95,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let content_type = ConnectorCommon::common_get_content_type(self);
let mut common_headers = self.get_auth_header(&req.connector_auth_type)?;
common_headers.push((
@@ -122,7 +123,8 @@ impl ConnectorCommon for Forte {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = forte::ForteAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let raw_basic_token = format!(
@@ -200,7 +202,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -295,7 +298,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for For
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -369,7 +373,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -454,7 +459,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Fo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -538,7 +544,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Forte {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -630,7 +637,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Forte {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -718,7 +726,8 @@ impl IncomingWebhook for Forte {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/forte/transformers.rs b/crates/hyperswitch_connectors/src/connectors/forte/transformers.rs
index 4dbd365b54..d615142d14 100644
--- a/crates/hyperswitch_connectors/src/connectors/forte/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/forte/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/getnet.rs b/crates/hyperswitch_connectors/src/connectors/getnet.rs
index 632d790840..7b5359591b 100644
--- a/crates/hyperswitch_connectors/src/connectors/getnet.rs
+++ b/crates/hyperswitch_connectors/src/connectors/getnet.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{self},
};
-use masking::{Mask, PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
use ring::hmac;
use transformers as getnet;
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -128,7 +129,8 @@ impl ConnectorCommon for Getnet {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = getnet::GetnetAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key =
@@ -213,7 +215,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -302,7 +305,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Get
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -379,7 +383,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -466,7 +471,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ge
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -545,7 +551,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Getnet
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -630,7 +637,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Getnet {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -773,7 +781,8 @@ impl webhooks::IncomingWebhook for Getnet {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif = getnet::get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(notif))
diff --git a/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
index dce42ef2d7..34caab596e 100644
--- a/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/gigadat.rs b/crates/hyperswitch_connectors/src/connectors/gigadat.rs
index 94b77b0003..cb5ff10b26 100644
--- a/crates/hyperswitch_connectors/src/connectors/gigadat.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gigadat.rs
@@ -53,10 +53,10 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use lazy_static::lazy_static;
#[cfg(feature = "payouts")]
-use masking::ExposeInterface;
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{Mask, PeekInterface};
+use lazy_static::lazy_static;
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
use transformers as gigadat;
@@ -115,7 +115,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -146,7 +147,8 @@ impl ConnectorCommon for Gigadat {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = gigadat::GigadatAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!(
@@ -229,7 +231,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -324,7 +327,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Gig
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -396,7 +400,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -475,7 +480,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Gigadat
&self,
req: &RefundsRouterData<Execute>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = gigadat::GigadatAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!(
@@ -611,7 +617,8 @@ impl ConnectorIntegration<PoQuote, PayoutsData, PayoutsResponseData> for Gigadat
&self,
req: &PayoutsRouterData<PoQuote>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -699,7 +706,8 @@ impl ConnectorIntegration<PoCreate, PayoutsData, PayoutsResponseData> for Gigada
&self,
req: &PayoutsRouterData<PoCreate>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -774,7 +782,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Gigad
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -872,7 +881,8 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Gigadat
&self,
req: &PayoutsRouterData<PoSync>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1001,7 +1011,8 @@ impl webhooks::IncomingWebhook for Gigadat {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let body_str = std::str::from_utf8(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
@@ -1013,7 +1024,7 @@ impl webhooks::IncomingWebhook for Gigadat {
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
_merchant_id: &common_utils::id_type::MerchantId,
_connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- _connector_account_details: Encryptable<masking::Secret<serde_json::Value>>,
+ _connector_account_details: Encryptable<hyperswitch_masking::Secret<serde_json::Value>>,
_connector_label: &str,
) -> CustomResult<bool, errors::ConnectorError> {
Ok(false)
diff --git a/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs b/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs
index a1d17da958..6d11d545e5 100644
--- a/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs
@@ -29,7 +29,7 @@ use hyperswitch_domain_models::{
types::PayoutsRouterData,
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay.rs b/crates/hyperswitch_connectors/src/connectors/globalpay.rs
index 94146a115d..0f02426393 100644
--- a/crates/hyperswitch_connectors/src/connectors/globalpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globalpay.rs
@@ -53,7 +53,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use requests::{GlobalpayPaymentsRequest, GlobalpayRefreshTokenRequest};
use response::{
GlobalpayPaymentsResponse, GlobalpayRefreshTokenErrorResponse, GlobalpayRefreshTokenResponse,
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -129,7 +130,8 @@ impl ConnectorCommon for Globalpay {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -190,7 +192,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -281,7 +284,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -390,7 +394,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -484,7 +489,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Gl
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -576,7 +582,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Glo
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -664,7 +671,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -760,7 +768,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -850,7 +859,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Globalp
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -937,7 +947,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Globalpay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1073,7 +1084,8 @@ impl IncomingWebhook for Globalpay {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Ok(Box::new(
request
.body
diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs
index dcda455e2b..395629707b 100644
--- a/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs
@@ -1,5 +1,5 @@
use common_utils::types::StringMinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs b/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs
index 89f5da8ba1..db70c83b57 100644
--- a/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs
@@ -1,6 +1,6 @@
use common_enums::Currency;
use common_utils::types::StringMinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::utils::deserialize_optional_currency;
diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs
index 9e10bd017f..33419b7196 100644
--- a/crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_interfaces::{
consts::{self, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use rand::distributions::DistString;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/globepay.rs b/crates/hyperswitch_connectors/src/connectors/globepay.rs
index 97130a87ab..a6a4e0802c 100644
--- a/crates/hyperswitch_connectors/src/connectors/globepay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globepay.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsSyncType, RefundExecuteType, RefundSyncType, Response},
webhooks,
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use rand::distributions::DistString;
use time::OffsetDateTime;
use transformers as globepay;
@@ -90,7 +90,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -194,7 +195,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -296,7 +298,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Glo
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -384,7 +387,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Globepa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -474,7 +478,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Globepay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -562,7 +567,8 @@ impl webhooks::IncomingWebhook for Globepay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs
index 4056b63df0..d4254a63c5 100644
--- a/crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{self, RefundsRouterData},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/gocardless.rs b/crates/hyperswitch_connectors/src/connectors/gocardless.rs
index af20514b33..fe765a4640 100644
--- a/crates/hyperswitch_connectors/src/connectors/gocardless.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gocardless.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, PaymentsSyncType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as gocardless;
use crate::{
@@ -94,7 +94,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -131,7 +132,8 @@ impl ConnectorCommon for Gocardless {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = gocardless::GocardlessAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -184,7 +186,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -272,7 +275,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -383,7 +387,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -462,7 +467,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -552,7 +558,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Goc
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -629,7 +636,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Gocardl
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -859,7 +867,8 @@ impl IncomingWebhook for Gocardless {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: gocardless::GocardlessWebhookEvent = request
.body
.parse_struct("GocardlessWebhookEvent")
diff --git a/crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs b/crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs
index e8037445f9..6a032da53d 100644
--- a/crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs
@@ -18,7 +18,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/gpayments.rs b/crates/hyperswitch_connectors/src/connectors/gpayments.rs
index ca5e424cec..2f3b637a5f 100644
--- a/crates/hyperswitch_connectors/src/connectors/gpayments.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gpayments.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use transformers as gpayments;
use crate::{
@@ -213,7 +213,7 @@ impl IncomingWebhook for Gpayments {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs b/crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs
index c1f7d50ac6..f0638704e8 100644
--- a/crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs
@@ -1,7 +1,7 @@
use api_models::payments::ThreeDsCompletionIndicator;
use cards::CardNumber;
use common_utils::types;
-use masking::{Deserialize, Secret, Serialize};
+use hyperswitch_masking::{Deserialize, Secret, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct GpaymentsConnectorMetaData {
diff --git a/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs b/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs
index 369aa67360..d94fcdfc82 100644
--- a/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs
@@ -17,7 +17,7 @@ use hyperswitch_domain_models::{
router_response_types::AuthenticationResponseData,
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::Deserialize;
use serde_json::to_string;
diff --git a/crates/hyperswitch_connectors/src/connectors/helcim.rs b/crates/hyperswitch_connectors/src/connectors/helcim.rs
index 5dd9b1b541..c1fb40f8e5 100644
--- a/crates/hyperswitch_connectors/src/connectors/helcim.rs
+++ b/crates/hyperswitch_connectors/src/connectors/helcim.rs
@@ -46,8 +46,8 @@ use hyperswitch_interfaces::{
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
#[cfg(feature = "v2")]
-use masking::PeekInterface;
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::PeekInterface;
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as helcim;
use crate::{
@@ -106,7 +106,7 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
@@ -147,7 +147,7 @@ impl ConnectorCommon for Helcim {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
let auth = helcim::HelcimAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -224,7 +224,7 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
self.build_headers(req, connectors)
}
@@ -299,7 +299,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
self.build_headers(req, connectors)
}
@@ -391,7 +391,7 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Hel
&self,
req: &PaymentsSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
@@ -481,7 +481,7 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
self.build_headers(req, connectors)
}
@@ -568,7 +568,7 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for He
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
self.build_headers(req, connectors)
}
@@ -648,7 +648,7 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Helcim
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
self.build_headers(req, connectors)
}
@@ -734,7 +734,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Helcim {
&self,
req: &RefundSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError>
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
{
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
@@ -833,7 +833,8 @@ impl IncomingWebhook for Helcim {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs b/crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs
index 9b23a2b8df..f7a5133ed7 100644
--- a/crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/hipay.rs b/crates/hyperswitch_connectors/src/connectors/hipay.rs
index d39611901b..c93cc5685d 100644
--- a/crates/hyperswitch_connectors/src/connectors/hipay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hipay.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response, TokenizationType},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use reqwest::multipart::Form;
use serde::Serialize;
use serde_json::Value;
@@ -111,7 +111,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -191,7 +192,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::ACCEPT.to_string(),
"application/json".to_string().into(),
@@ -218,7 +220,8 @@ impl ConnectorCommon for Hipay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = hipay::HipayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!("{}:{}", auth.api_key.peek(), auth.key1.peek());
@@ -271,7 +274,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -354,7 +358,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Hip
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -423,7 +428,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -509,7 +515,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Hi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_url(
@@ -574,7 +581,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Hipay {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -659,7 +667,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Hipay {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -742,7 +751,8 @@ impl webhooks::IncomingWebhook for Hipay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
index 7552c4b280..bbfe8628e3 100644
--- a/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperpg.rs b/crates/hyperswitch_connectors/src/connectors/hyperpg.rs
index 2405b02e5b..94cb47fd78 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperpg.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperpg.rs
@@ -86,7 +86,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -117,7 +118,8 @@ impl ConnectorCommon for Hyperpg {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
// This method is not implemented for Phonepe, as it will always call the UCS service which has the logic to create headers.
Err(errors::ConnectorError::NotImplemented("get_auth_header method".to_string()).into())
}
@@ -190,7 +192,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -277,7 +280,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Hyp
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -341,7 +345,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -420,7 +425,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Hyperpg
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -504,7 +510,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Hyperpg {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -586,7 +593,8 @@ impl webhooks::IncomingWebhook for Hyperpg {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs b/crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs
index 677bafade5..dcdb56c0e2 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs b/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs
index 1098c3fc0d..286ff4c32c 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs
@@ -41,7 +41,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as hyperswitch_vault;
use crate::{constants::headers, types::ResponseRouterData};
@@ -71,7 +71,8 @@ impl ConnectorIntegration<ExternalVaultCreateFlow, VaultRequestData, VaultRespon
&self,
req: &VaultRouterData<ExternalVaultCreateFlow>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -173,7 +174,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = hyperswitch_vault::HyperswitchVaultAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let api_key = auth.api_key.expose();
@@ -216,7 +218,8 @@ impl ConnectorCommon for HyperswitchVault {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -256,7 +259,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -486,7 +490,8 @@ impl webhooks::IncomingWebhook for HyperswitchVault {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs b/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs
index cb2ddd6772..e5e586d54c 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs
@@ -8,7 +8,7 @@ use hyperswitch_domain_models::{
types::{ConnectorCustomerRouterData, VaultRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{types::ResponseRouterData, utils};
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperwallet.rs b/crates/hyperswitch_connectors/src/connectors/hyperwallet.rs
index 5307780d70..dd5a7636dd 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperwallet.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperwallet.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as hyperwallet;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -118,7 +119,8 @@ impl ConnectorCommon for Hyperwallet {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = hyperwallet::HyperwalletAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -198,7 +200,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -286,7 +289,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Hyp
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -350,7 +354,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -429,7 +434,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Hyperwa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -514,7 +520,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Hyperwall
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -596,7 +603,8 @@ impl webhooks::IncomingWebhook for Hyperwallet {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs
index 63ec276a57..d0422d8439 100644
--- a/crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/iatapay.rs b/crates/hyperswitch_connectors/src/connectors/iatapay.rs
index f0c00f7cd8..9a2a46d007 100644
--- a/crates/hyperswitch_connectors/src/connectors/iatapay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/iatapay.rs
@@ -44,8 +44,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
+use hyperswitch_masking::{Mask, PeekInterface};
use lazy_static::lazy_static;
-use masking::{Mask, PeekInterface};
use transformers::{self as iatapay, IatapayPaymentsResponse};
use crate::{
@@ -94,7 +94,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -133,7 +134,8 @@ impl ConnectorCommon for Iatapay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = iatapay::IatapayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -210,7 +212,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth: iatapay::IatapayAuthType =
iatapay::IatapayAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -325,7 +328,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -413,7 +417,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Iat
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -501,7 +506,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Iatapay
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -592,7 +598,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Iatapay {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -747,7 +754,8 @@ impl IncomingWebhook for Iatapay {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif: iatapay::IatapayWebhookResponse = request
.body
.parse_struct("IatapayWebhookResponse")
diff --git a/crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs
index 7de7307013..21aa15b977 100644
--- a/crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs
@@ -21,7 +21,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{Secret, SwitchStrategy};
+use hyperswitch_masking::{Secret, SwitchStrategy};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/inespay.rs b/crates/hyperswitch_connectors/src/connectors/inespay.rs
index 1f44240fe5..9119c39bcc 100644
--- a/crates/hyperswitch_connectors/src/connectors/inespay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/inespay.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use ring::hmac;
use transformers as inespay;
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -122,7 +123,8 @@ impl ConnectorCommon for Inespay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = inespay::InespayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -183,7 +185,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -280,7 +283,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Ine
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -354,7 +358,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -433,7 +438,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Inespay
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -517,7 +523,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Inespay {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -706,7 +713,8 @@ impl webhooks::IncomingWebhook for Inespay {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let data_return = get_webhook_body(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(match data_return {
diff --git a/crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs
index 2464a7216f..ac1ce054a0 100644
--- a/crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/itaubank.rs b/crates/hyperswitch_connectors/src/connectors/itaubank.rs
index 6f8dd242d9..773de320f1 100644
--- a/crates/hyperswitch_connectors/src/connectors/itaubank.rs
+++ b/crates/hyperswitch_connectors/src/connectors/itaubank.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use transformers as itaubank;
use crate::{
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token =
req.access_token
.clone()
@@ -207,7 +208,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let flow_header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -334,7 +336,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -427,7 +430,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Ita
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -501,7 +505,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -595,7 +600,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Itauban
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -696,7 +702,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Itaubank
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -795,7 +802,8 @@ impl IncomingWebhook for Itaubank {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs b/crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs
index 4b90f498de..9cafa423f8 100644
--- a/crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/jpmorgan.rs b/crates/hyperswitch_connectors/src/connectors/jpmorgan.rs
index f3cb77bf78..96ea1e86fd 100644
--- a/crates/hyperswitch_connectors/src/connectors/jpmorgan.rs
+++ b/crates/hyperswitch_connectors/src/connectors/jpmorgan.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, RefreshTokenType, Response},
webhooks,
};
-use masking::{Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{Mask, Maskable, PeekInterface};
use transformers::{self as jpmorgan, JpmorganErrorResponse};
use crate::{
@@ -822,7 +822,8 @@ impl webhooks::IncomingWebhook for Jpmorgan {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs b/crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
index 98a718fe29..9f850fd70e 100644
--- a/crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
@@ -109,7 +109,7 @@ pub struct JpmorganPaymentsRequest {
#[derive(Default, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct JpmorganCard {
- account_number: Secret<String>,
+ account_number: cards::CardNumber,
expiry: Expiry,
}
@@ -194,7 +194,7 @@ impl TryFrom<&JpmorganRouterData<&PaymentsAuthorizeRouterData>> for JpmorganPaym
year: req_card.get_expiry_year_as_4_digit_i32()?,
};
- let account_number = Secret::new(req_card.card_number.to_string());
+ let account_number = req_card.card_number;
let card = JpmorganCard {
account_number,
diff --git a/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs b/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs
index 4d0bd10cf4..0ef93f7b3f 100644
--- a/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs
+++ b/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as juspaythreedsserver;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -137,7 +137,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -171,7 +172,8 @@ impl ConnectorCommon for Juspaythreedsserver {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = juspaythreedsserver::JuspaythreedsserverAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -236,7 +238,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -326,7 +329,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Jus
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -392,7 +396,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData>
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -471,7 +476,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Juspayt
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -558,7 +564,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Juspaythr
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -640,7 +647,8 @@ impl webhooks::IncomingWebhook for Juspaythreedsserver {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs b/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs
index 3dd1849295..ed819382c3 100644
--- a/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/katapult.rs b/crates/hyperswitch_connectors/src/connectors/katapult.rs
index 0a3a967d31..ddffab3163 100644
--- a/crates/hyperswitch_connectors/src/connectors/katapult.rs
+++ b/crates/hyperswitch_connectors/src/connectors/katapult.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as katapult;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -121,7 +122,8 @@ impl ConnectorCommon for Katapult {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = katapult::KatapultAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -201,7 +203,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -288,7 +291,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Kat
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -352,7 +356,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -431,7 +436,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Katapul
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -515,7 +521,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Katapult
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -597,7 +604,8 @@ impl webhooks::IncomingWebhook for Katapult {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs b/crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs
index 42ac77ae42..b712eb1a8b 100644
--- a/crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/klarna.rs b/crates/hyperswitch_connectors/src/connectors/klarna.rs
index dea03fe0c5..465742054d 100644
--- a/crates/hyperswitch_connectors/src/connectors/klarna.rs
+++ b/crates/hyperswitch_connectors/src/connectors/klarna.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use router_env::logger;
use transformers as klarna;
@@ -93,7 +93,8 @@ impl ConnectorCommon for Klarna {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = klarna::KlarnaAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key =
@@ -170,7 +171,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsAuthorizeType::get_content_type(self)
@@ -204,7 +206,8 @@ impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> fo
&self,
req: &PaymentsSessionRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -312,7 +315,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -411,7 +415,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Kla
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -498,7 +503,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1168,7 +1174,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Kl
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1241,7 +1248,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Klarna
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1339,7 +1347,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Klarna {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1424,7 +1433,8 @@ impl IncomingWebhook for Klarna {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs b/crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs
index 50c7ac4937..571cddc1be 100644
--- a/crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs
@@ -14,7 +14,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/loonio.rs b/crates/hyperswitch_connectors/src/connectors/loonio.rs
index ff273c3429..b990fd5f6c 100644
--- a/crates/hyperswitch_connectors/src/connectors/loonio.rs
+++ b/crates/hyperswitch_connectors/src/connectors/loonio.rs
@@ -49,8 +49,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask, Secret};
use transformers as loonio;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -100,7 +100,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -131,7 +132,8 @@ impl ConnectorCommon for Loonio {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = loonio::LoonioAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -217,7 +219,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -307,7 +310,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Loo
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -375,7 +379,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -454,7 +459,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Loonio
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -538,7 +544,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Loonio {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -606,7 +613,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Looni
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -709,7 +717,8 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Loonio {
&self,
req: &PayoutsRouterData<PoSync>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -814,7 +823,8 @@ impl webhooks::IncomingWebhook for Loonio {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: loonio::LoonioWebhookBody = request
.body
.parse_struct("LoonioWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs b/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
index 264e342933..1d5995b6b7 100644
--- a/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
@@ -22,7 +22,7 @@ use hyperswitch_domain_models::{
types::PayoutsRouterData,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/mifinity.rs b/crates/hyperswitch_connectors/src/connectors/mifinity.rs
index 35c9afdc27..4419e3e91c 100644
--- a/crates/hyperswitch_connectors/src/connectors/mifinity.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mifinity.rs
@@ -42,8 +42,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
+use hyperswitch_masking::{ExposeInterface, Mask};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask};
use router_env::logger;
use transformers::{self as mifinity, auth_headers};
@@ -95,7 +95,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -132,7 +133,8 @@ impl ConnectorCommon for Mifinity {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = mifinity::MifinityAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -232,7 +234,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -329,7 +332,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mif
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -401,7 +405,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -511,7 +516,8 @@ impl IncomingWebhook for Mifinity {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs b/crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
index 4efc30e845..2913893172 100644
--- a/crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::Date;
diff --git a/crates/hyperswitch_connectors/src/connectors/mollie.rs b/crates/hyperswitch_connectors/src/connectors/mollie.rs
index 5fc153c909..ccb4544719 100644
--- a/crates/hyperswitch_connectors/src/connectors/mollie.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mollie.rs
@@ -45,8 +45,8 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use hyperswitch_masking::{Mask, PeekInterface};
use lazy_static::lazy_static;
-use masking::{Mask, PeekInterface};
use transformers as mollie;
use crate::{
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.get_auth_header(&req.connector_auth_type)
}
}
@@ -112,7 +113,8 @@ impl ConnectorCommon for Mollie {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = mollie::MollieAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -174,7 +176,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -261,7 +264,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -340,7 +344,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -416,7 +421,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -506,7 +512,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mol
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -575,7 +582,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -677,7 +685,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Mollie
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -767,7 +776,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Mollie {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -845,7 +855,7 @@ impl webhooks::IncomingWebhook for Mollie {
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
_merchant_id: &common_utils::id_type::MerchantId,
_connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- _connector_account_details: Encryptable<masking::Secret<serde_json::Value>>,
+ _connector_account_details: Encryptable<hyperswitch_masking::Secret<serde_json::Value>>,
_connector_name: &str,
) -> CustomResult<bool, errors::ConnectorError> {
// Mollie next gen webhooks are not ready for transaction events yet, need to update here once they support
@@ -873,7 +883,8 @@ impl webhooks::IncomingWebhook for Mollie {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: mollie::MollieWebhookBody = serde_qs::from_bytes(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(Box::new(details))
diff --git a/crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs b/crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs
index 0b5710afea..1990211304 100644
--- a/crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/moneris.rs b/crates/hyperswitch_connectors/src/connectors/moneris.rs
index a8ad7e709a..07f9a9fbc4 100644
--- a/crates/hyperswitch_connectors/src/connectors/moneris.rs
+++ b/crates/hyperswitch_connectors/src/connectors/moneris.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, RefreshTokenType, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use transformers as moneris;
use crate::{
@@ -91,7 +91,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = moneris::MonerisAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let mut header = vec![
@@ -141,7 +142,8 @@ impl ConnectorCommon for Moneris {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = moneris::MonerisAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -218,7 +220,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
RefreshTokenType::get_content_type(self).to_string().into(),
@@ -319,7 +322,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -406,7 +410,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mon
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -478,7 +483,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -568,7 +574,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Mo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -640,7 +647,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Moneris
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -724,7 +732,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Moneris {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -807,7 +816,8 @@ impl webhooks::IncomingWebhook for Moneris {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs b/crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs
index f2f20ac4f6..c3c8579d66 100644
--- a/crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/mpgs.rs b/crates/hyperswitch_connectors/src/connectors/mpgs.rs
index 647233ed0a..f1eaa4a6cc 100644
--- a/crates/hyperswitch_connectors/src/connectors/mpgs.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mpgs.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as mpgs;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -121,7 +122,8 @@ impl ConnectorCommon for Mpgs {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = mpgs::MpgsAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -198,7 +200,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -285,7 +288,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mpg
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -349,7 +353,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -428,7 +433,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Mpgs {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -512,7 +518,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Mpgs {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -594,7 +601,8 @@ impl webhooks::IncomingWebhook for Mpgs {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs b/crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs
index 97d8744cef..130c428245 100644
--- a/crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/multisafepay.rs b/crates/hyperswitch_connectors/src/connectors/multisafepay.rs
index 024e5d65f7..91336ba9e1 100644
--- a/crates/hyperswitch_connectors/src/connectors/multisafepay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/multisafepay.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as multisafepay;
use crate::{
@@ -74,7 +74,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
}
@@ -99,7 +100,8 @@ impl ConnectorCommon for Multisafepay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = multisafepay::MultisafepayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -188,7 +190,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mul
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -272,7 +275,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -371,7 +375,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Multisa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -465,7 +470,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Multisafe
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -553,7 +559,8 @@ impl IncomingWebhook for Multisafepay {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs
index 20da5c2e83..184738a661 100644
--- a/crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs
@@ -20,7 +20,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera.rs b/crates/hyperswitch_connectors/src/connectors/netcetera.rs
index 029c01e8d2..8673bf0d16 100644
--- a/crates/hyperswitch_connectors/src/connectors/netcetera.rs
+++ b/crates/hyperswitch_connectors/src/connectors/netcetera.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use transformers as netcetera;
use crate::{
@@ -202,7 +202,7 @@ impl IncomingWebhook for Netcetera {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let webhook_body_value: netcetera::ResultsResponseData = request
.body
.parse_struct("netcetera ResultsResponseDatae")
diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs b/crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs
index b9c627f8fe..78395d7281 100644
--- a/crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs
+++ b/crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs
@@ -5,7 +5,7 @@ use hyperswitch_domain_models::router_request_types::{
authentication::MessageCategory, BrowserInformation,
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use serde::{Deserialize, Serialize};
use unidecode::unidecode;
@@ -398,7 +398,7 @@ pub struct CardholderAccount {
/// The field has 4 characters in a format YYMM.
///
/// The requirements of the presence of this field are DS specific.
- pub card_expiry_date: Option<masking::Secret<String>>,
+ pub card_expiry_date: Option<hyperswitch_masking::Secret<String>>,
/// This field contains additional information about the Cardholder’s account provided by the 3DS Requestor.
///
/// The field is optional but recommended to include.
@@ -443,7 +443,7 @@ pub struct CardholderAccount {
///
/// This field is required depending on the rules provided by the Directory Server.
/// Available for supporting EMV 3DS 2.3.1 and later versions.
- pub card_security_code: Option<masking::Secret<String>>,
+ pub card_security_code: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -625,7 +625,7 @@ pub struct Cardholder {
/// This field is limited to a maximum of 50 characters.
///
/// This field is required unless market or regional mandate restricts sending this information.
- bill_addr_line1: Option<masking::Secret<String>>,
+ bill_addr_line1: Option<hyperswitch_masking::Secret<String>>,
/// Second line of the street address or equivalent local portion of the Cardholder billing address associated with
/// the card use for this purchase.
@@ -633,7 +633,7 @@ pub struct Cardholder {
/// This field is limited to a maximum of 50 characters.
///
/// This field is required unless market or regional mandate restricts sending this information.
- bill_addr_line2: Option<masking::Secret<String>>,
+ bill_addr_line2: Option<hyperswitch_masking::Secret<String>>,
/// Third line of the street address or equivalent local portion of the Cardholder billing address associated with
/// the card use for this purchase.
@@ -641,14 +641,14 @@ pub struct Cardholder {
/// This field is limited to a maximum of 50 characters.
///
/// This field is required unless market or regional mandate restricts sending this information.
- bill_addr_line3: Option<masking::Secret<String>>,
+ bill_addr_line3: Option<hyperswitch_masking::Secret<String>>,
/// ZIP or other postal code of the Cardholder billing address associated with the card used for this purchase.
///
/// This field is limited to a maximum of 16 characters.
///
/// This field is required unless market or regional mandate restricts sending this information.
- bill_addr_post_code: Option<masking::Secret<String>>,
+ bill_addr_post_code: Option<hyperswitch_masking::Secret<String>>,
/// The state or province of the Cardholder billing address associated with the card used for this purchase.
///
@@ -656,7 +656,7 @@ pub struct Cardholder {
///
/// This field is required unless State is not applicable for this country and unless market or regional mandate
/// restricts sending this information.
- bill_addr_state: Option<masking::Secret<String>>,
+ bill_addr_state: Option<hyperswitch_masking::Secret<String>>,
/// The email address associated with the account that is either entered by the Cardholder, or is on file with
/// the 3DS Requestor.
@@ -696,7 +696,7 @@ pub struct Cardholder {
///
/// Starting from EMV 3DS 2.3.1:
/// This field is limited to 1-45 characters.
- cardholder_name: Option<masking::Secret<String>>,
+ cardholder_name: Option<hyperswitch_masking::Secret<String>>,
/// City portion of the shipping address requested by the Cardholder.
///
@@ -720,7 +720,7 @@ pub struct Cardholder {
///
/// This field is required unless shipping information is the same as billing information, or market or regional
/// mandate restricts sending this information.
- ship_addr_line1: Option<masking::Secret<String>>,
+ ship_addr_line1: Option<hyperswitch_masking::Secret<String>>,
/// Second line of the street address or equivalent local portion of the shipping address associated with
/// the card use for this purchase.
@@ -729,7 +729,7 @@ pub struct Cardholder {
///
/// This field is required unless shipping information is the same as billing information, or market or regional
/// mandate restricts sending this information.
- ship_addr_line2: Option<masking::Secret<String>>,
+ ship_addr_line2: Option<hyperswitch_masking::Secret<String>>,
/// Third line of the street address or equivalent local portion of the shipping address associated with
/// the card use for this purchase.
@@ -738,7 +738,7 @@ pub struct Cardholder {
///
/// This field is required unless shipping information is the same as billing information, or market or regional
/// mandate restricts sending this information.
- ship_addr_line3: Option<masking::Secret<String>>,
+ ship_addr_line3: Option<hyperswitch_masking::Secret<String>>,
/// ZIP or other postal code of the shipping address associated with the card used for this purchase.
///
@@ -746,7 +746,7 @@ pub struct Cardholder {
///
/// This field is required unless shipping information is the same as billing information, or market or regional
/// mandate restricts sending this information.
- ship_addr_post_code: Option<masking::Secret<String>>,
+ ship_addr_post_code: Option<hyperswitch_masking::Secret<String>>,
/// The state or province of the shipping address associated with the card used for this purchase.
///
@@ -754,7 +754,7 @@ pub struct Cardholder {
///
/// This field is required unless shipping information is the same as billing information, or State is not applicable
/// for this country, or market or regional mandate restricts sending this information.
- ship_addr_state: Option<masking::Secret<String>>,
+ ship_addr_state: Option<hyperswitch_masking::Secret<String>>,
/// Tax ID is the Cardholder's tax identification.
///
@@ -831,7 +831,7 @@ impl
cardholder_name: billing_address.address.and_then(|address| {
address
.get_optional_full_name()
- .map(|name| masking::Secret::new(unidecode(&name.expose())))
+ .map(|name| hyperswitch_masking::Secret::new(unidecode(&name.expose())))
}),
ship_addr_city: shipping_address
.as_ref()
@@ -879,7 +879,7 @@ pub struct PhoneNumber {
/// Country Code of the phone, limited to 1-3 characters
#[serde(rename = "cc")]
country_code: Option<String>,
- subscriber: Option<masking::Secret<String>>,
+ subscriber: Option<hyperswitch_masking::Secret<String>>,
}
impl TryFrom<hyperswitch_domain_models::address::PhoneDetails> for PhoneNumber {
@@ -1353,7 +1353,7 @@ pub struct Browser {
///
/// This field is required for requests when deviceChannel = 02 (BRW) where regionally acceptable.
#[serde(rename = "browserIP")]
- browser_ip: Option<masking::Secret<String, common_utils::pii::IpAddress>>,
+ browser_ip: Option<hyperswitch_masking::Secret<String, common_utils::pii::IpAddress>>,
/// Boolean that represents the ability of the cardholder browser to execute Java. Value is returned from the
/// navigator.javaEnabled property.
@@ -1478,7 +1478,7 @@ impl From<BrowserInformation> for Browser {
browser_accept_header: value.accept_header,
browser_ip: value
.ip_address
- .map(|ip| masking::Secret::new(ip.to_string())),
+ .map(|ip| hyperswitch_masking::Secret::new(ip.to_string())),
browser_java_enabled: value.java_enabled,
browser_language: value.language,
browser_color_depth: value.color_depth.map(|cd| cd.to_string()),
diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
index 541c297400..245b7f8a6b 100644
--- a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
router_response_types::AuthenticationResponseData,
};
use hyperswitch_interfaces::{api::CurrencyUnit, errors::ConnectorError};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use super::netcetera_types;
diff --git a/crates/hyperswitch_connectors/src/connectors/nexinets.rs b/crates/hyperswitch_connectors/src/connectors/nexinets.rs
index 106c05f71d..0f0c5a4fe0 100644
--- a/crates/hyperswitch_connectors/src/connectors/nexinets.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nexinets.rs
@@ -49,9 +49,9 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Mask;
+use hyperswitch_masking::Mask;
#[cfg(feature = "v2")]
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use transformers as nexinets;
use crate::{
@@ -95,7 +95,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -122,7 +123,8 @@ impl ConnectorCommon for Nexinets {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = nexinets::NexinetsAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -222,7 +224,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -308,7 +311,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nex
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -387,7 +391,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -472,7 +477,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ne
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -554,7 +560,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Nexinet
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -636,7 +643,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nexinets
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -728,7 +736,8 @@ impl IncomingWebhook for Nexinets {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs
index 799d7bfaf0..bdc298f905 100644
--- a/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs b/crates/hyperswitch_connectors/src/connectors/nexixpay.rs
index 3b4742da88..5d6b32f7e3 100644
--- a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nexixpay.rs
@@ -50,8 +50,8 @@ use hyperswitch_interfaces::{
types::{self, PaymentsPreAuthenticateType, Response},
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask};
use serde_json::Value;
use transformers as nexixpay;
use uuid::Uuid;
@@ -118,7 +118,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -149,7 +150,8 @@ impl ConnectorCommon for Nexixpay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = nexixpay::NexixpayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -253,7 +255,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -343,7 +346,8 @@ impl ConnectorIntegration<PostAuthenticate, PaymentsPostAuthenticateData, Paymen
&self,
req: &PaymentsPostAuthenticateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -428,7 +432,8 @@ impl ConnectorIntegration<PreAuthenticate, PaymentsPreAuthenticateData, Payments
&self,
req: &PaymentsPreAuthenticateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -519,7 +524,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -604,7 +610,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -694,7 +701,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -785,7 +793,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nex
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -877,7 +886,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::IDEMPOTENCY_KEY.to_string(),
Uuid::new_v4().to_string().into_masked(),
@@ -976,7 +986,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ne
&self,
req: &PaymentsCancelRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::IDEMPOTENCY_KEY.to_string(),
Uuid::new_v4().to_string().into_masked(),
@@ -1082,7 +1093,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Nexixpa
&self,
req: &RefundsRouterData<Execute>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::IDEMPOTENCY_KEY.to_string(),
Uuid::new_v4().to_string().into_masked(),
@@ -1180,7 +1192,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nexixpay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1267,7 +1280,8 @@ impl webhooks::IncomingWebhook for Nexixpay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs
index 987d238f89..ce25da723b 100644
--- a/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs
@@ -33,7 +33,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts::NO_ERROR_CODE, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
use strum::Display;
diff --git a/crates/hyperswitch_connectors/src/connectors/nmi.rs b/crates/hyperswitch_connectors/src/connectors/nmi.rs
index 26ef4452ba..634aa45849 100644
--- a/crates/hyperswitch_connectors/src/connectors/nmi.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nmi.rs
@@ -50,7 +50,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use regex::Regex;
use transformers as nmi;
@@ -1041,7 +1041,7 @@ impl IncomingWebhook for Nmi {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let webhook_body: nmi::NmiWebhookBody = request
.body
.parse_struct("nmi NmiWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
index 73952cc2a0..bbe157fcec 100644
--- a/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
diff --git a/crates/hyperswitch_connectors/src/connectors/nomupay.rs b/crates/hyperswitch_connectors/src/connectors/nomupay.rs
index af449895fa..312fa2f0e8 100644
--- a/crates/hyperswitch_connectors/src/connectors/nomupay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nomupay.rs
@@ -54,12 +54,12 @@ use hyperswitch_interfaces::{
types::Response,
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask};
use josekit::{
jws::{self, JwsHeader, ES256},
jwt::{self, JwtPayload},
Map, Value,
};
-use masking::{ExposeInterface, Mask};
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
use serde_json::json;
@@ -94,7 +94,7 @@ fn get_private_key(
}
fn box_to_jwt_payload(
- body: Box<dyn masking::ErasedMaskSerialize + Send>,
+ body: Box<dyn hyperswitch_masking::ErasedMaskSerialize + Send>,
) -> CustomResult<JwtPayload, errors::ConnectorError> {
let str_result = serde_json::to_string(&body)
.change_context(errors::ConnectorError::ProcessingStepFailed(None))?;
@@ -193,7 +193,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let is_post_req = matches!(self.get_http_method(), Method::Post);
let body = self.get_request_body(req, connectors)?;
let auth = nomupay::NomupayAuthType::try_from(&req.connector_auth_type)
@@ -214,7 +215,7 @@ where
)];
header.push((
headers::X_SIGNATURE.to_string(),
- masking::Maskable::Normal(sign),
+ hyperswitch_masking::Maskable::Normal(sign),
));
let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
@@ -255,7 +256,8 @@ impl ConnectorCommon for Nomupay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = nomupay::NomupayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -429,7 +431,8 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Nomupay
&self,
req: &PayoutsRouterData<PoSync>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -519,7 +522,8 @@ impl ConnectorIntegration<PoRecipient, PayoutsData, PayoutsResponseData> for Nom
&self,
req: &PayoutsRouterData<PoRecipient>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -601,7 +605,8 @@ impl ConnectorIntegration<PoRecipientAccount, PayoutsData, PayoutsResponseData>
&self,
req: &PayoutsRouterData<PoRecipientAccount>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -680,7 +685,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Nomup
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -769,7 +775,8 @@ impl webhooks::IncomingWebhook for Nomupay {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs
index d71acd35ae..2a1777ca14 100644
--- a/crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs
@@ -8,7 +8,7 @@ use hyperswitch_domain_models::{
router_response_types::PayoutsResponseData, types::PayoutsRouterData,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/noon.rs b/crates/hyperswitch_connectors/src/connectors/noon.rs
index 784db8faad..16f8fc182e 100644
--- a/crates/hyperswitch_connectors/src/connectors/noon.rs
+++ b/crates/hyperswitch_connectors/src/connectors/noon.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use router_env::logger;
use transformers as noon;
@@ -100,7 +100,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsAuthorizeType::get_content_type(self)
@@ -115,7 +116,7 @@ where
fn get_auth_header(
auth_type: &ConnectorAuthType,
-) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
let auth = noon::NoonAuthType::try_from(auth_type)?;
let encoded_api_key = auth
@@ -255,7 +256,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -352,7 +354,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Noo
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -422,7 +425,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -506,7 +510,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for No
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -583,7 +588,8 @@ impl ConnectorIntegration<MandateRevoke, MandateRevokeRequestData, MandateRevoke
&self,
req: &MandateRevokeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -654,7 +660,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Noon {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -735,7 +742,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Noon {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -906,7 +914,8 @@ impl webhooks::IncomingWebhook for Noon {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let resource: noon::NoonWebhookObject = request
.body
.parse_struct("NoonWebhookObject")
diff --git a/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs b/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
index 97f5e11b30..10525b432e 100644
--- a/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/nordea.rs b/crates/hyperswitch_connectors/src/connectors/nordea.rs
index fa7bb746b2..a6e6f1a907 100644
--- a/crates/hyperswitch_connectors/src/connectors/nordea.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nordea.rs
@@ -49,8 +49,8 @@ use hyperswitch_interfaces::{
types::{self, AuthenticationTokenType, RefreshTokenType, Response},
webhooks,
};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
use ring::{
digest,
signature::{RsaKeyPair, RSA_PKCS1_SHA256},
@@ -269,7 +269,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -748,7 +749,8 @@ impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseD
&self,
req: &CreateOrderRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -861,7 +863,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -986,7 +989,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1083,7 +1087,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nor
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1222,7 +1227,8 @@ impl webhooks::IncomingWebhook for Nordea {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/nordea/requests.rs b/crates/hyperswitch_connectors/src/connectors/nordea/requests.rs
index a30a12ce40..11fd8209ee 100644
--- a/crates/hyperswitch_connectors/src/connectors/nordea/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nordea/requests.rs
@@ -1,5 +1,5 @@
use common_utils::types::StringMajorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
pub struct NordeaRouterData<T> {
diff --git a/crates/hyperswitch_connectors/src/connectors/nordea/responses.rs b/crates/hyperswitch_connectors/src/connectors/nordea/responses.rs
index 10693c9b43..409c2903a9 100644
--- a/crates/hyperswitch_connectors/src/connectors/nordea/responses.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nordea/responses.rs
@@ -1,6 +1,6 @@
use common_enums::CountryAlpha2;
use common_utils::types::StringMajorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use super::requests::{
diff --git a/crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs
index 0531ded75e..0996e28c87 100644
--- a/crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs
@@ -14,7 +14,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use rand::distributions::DistString;
use serde::{Deserialize, Deserializer, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet.rs b/crates/hyperswitch_connectors/src/connectors/novalnet.rs
index 46525c963f..d30178735c 100644
--- a/crates/hyperswitch_connectors/src/connectors/novalnet.rs
+++ b/crates/hyperswitch_connectors/src/connectors/novalnet.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as novalnet;
use crate::{
@@ -94,7 +94,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -125,7 +126,8 @@ impl ConnectorCommon for Novalnet {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = novalnet::NovalnetAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let api_key: String = auth.payment_access_key.expose();
@@ -243,7 +245,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -319,7 +322,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -410,7 +414,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nov
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -487,7 +492,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -573,7 +579,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Novalne
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -658,7 +665,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Novalnet
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -735,7 +743,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for No
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -971,7 +980,8 @@ impl webhooks::IncomingWebhook for Novalnet {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif = get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(notif))
diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
index d36e8ea9c0..0d656e5956 100644
--- a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
@@ -27,7 +27,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use strum::Display;
diff --git a/crates/hyperswitch_connectors/src/connectors/nuvei.rs b/crates/hyperswitch_connectors/src/connectors/nuvei.rs
index ff3387b19a..94c85ec69f 100644
--- a/crates/hyperswitch_connectors/src/connectors/nuvei.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nuvei.rs
@@ -64,7 +64,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use transformers as nuvei;
use crate::{
@@ -103,7 +103,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -128,7 +129,8 @@ impl ConnectorCommon for Nuvei {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
}
@@ -199,7 +201,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Nuvei
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -263,7 +266,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -346,7 +350,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Nu
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -427,7 +432,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -509,7 +515,8 @@ impl ConnectorIntegration<PostCaptureVoid, PaymentsCancelPostCaptureData, Paymen
&self,
req: &PaymentsCancelPostCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -593,7 +600,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nuv
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -675,7 +683,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -760,7 +769,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -848,7 +858,8 @@ impl ConnectorIntegration<AuthorizeSessionToken, AuthorizeSessionTokenData, Paym
&self,
req: &PaymentsAuthorizeSessionTokenRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -933,7 +944,8 @@ impl ConnectorIntegration<PreAuthenticate, PaymentsPreAuthenticateData, Payments
&self,
req: &PaymentsPreAuthenticateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1020,7 +1032,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1105,7 +1118,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Nuvei {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1398,7 +1412,8 @@ impl IncomingWebhook for Nuvei {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notification = get_webhook_object_from_body(request.body)?;
Ok(Box::new(notification))
}
diff --git a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
index 9c45ecd544..29e6892713 100644
--- a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors::{self},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::env::{self, Env};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/opayo.rs b/crates/hyperswitch_connectors/src/connectors/opayo.rs
index 118ca09732..812fb91c0f 100644
--- a/crates/hyperswitch_connectors/src/connectors/opayo.rs
+++ b/crates/hyperswitch_connectors/src/connectors/opayo.rs
@@ -40,7 +40,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as opayo;
use crate::{constants::headers, types::ResponseRouterData, utils::convert_amount};
@@ -84,7 +84,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let content_type = ConnectorCommon::common_get_content_type(self);
let mut common_headers = self.get_auth_header(&req.connector_auth_type)?;
common_headers.push((
@@ -110,7 +111,8 @@ impl ConnectorCommon for Opayo {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = opayo::OpayoAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -191,7 +193,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -275,7 +278,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Opa
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -341,7 +345,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -420,7 +425,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Opayo {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -502,7 +508,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Opayo {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -583,7 +590,8 @@ impl webhooks::IncomingWebhook for Opayo {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs b/crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs
index c5051939f5..c82edc0fd5 100644
--- a/crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/opennode.rs b/crates/hyperswitch_connectors/src/connectors/opennode.rs
index e69b5671c3..33fc7ea9a7 100644
--- a/crates/hyperswitch_connectors/src/connectors/opennode.rs
+++ b/crates/hyperswitch_connectors/src/connectors/opennode.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsSyncType, Response},
webhooks::{self, IncomingWebhook},
};
-use masking::{Mask, Maskable};
+use hyperswitch_masking::{Mask, Maskable};
use transformers as opennode;
use self::opennode::OpennodeWebhookDetails;
@@ -453,7 +453,8 @@ impl IncomingWebhook for Opennode {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let notif = serde_urlencoded::from_bytes::<OpennodeWebhookDetails>(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs b/crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs
index a5fcc466e8..78c8031564 100644
--- a/crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/paybox.rs b/crates/hyperswitch_connectors/src/connectors/paybox.rs
index 2f15cb18c6..1a51566e51 100644
--- a/crates/hyperswitch_connectors/src/connectors/paybox.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paybox.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as paybox;
use crate::{
@@ -103,7 +103,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -128,7 +129,8 @@ impl ConnectorCommon for Paybox {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = paybox::PayboxAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -187,7 +189,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -276,7 +279,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -347,7 +351,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -428,7 +433,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paybox
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -507,7 +513,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paybox {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -595,7 +602,8 @@ impl IncomingWebhook for Paybox {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
@@ -607,7 +615,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
diff --git a/crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs
index 854e95672d..e500f696c5 100644
--- a/crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs
@@ -18,7 +18,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/payeezy.rs b/crates/hyperswitch_connectors/src/connectors/payeezy.rs
index 64c3e25ef2..7cedf71ee6 100644
--- a/crates/hyperswitch_connectors/src/connectors/payeezy.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payeezy.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use rand::distributions::DistString;
use ring::hmac;
use transformers as payeezy;
@@ -62,7 +62,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = payeezy::PayeezyAuthType::try_from(&req.connector_auth_type)?;
let request_payload = self
.get_request_body(req, connectors)?
@@ -190,7 +191,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -281,7 +283,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -379,7 +382,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -468,7 +472,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payeezy
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -578,7 +583,8 @@ impl IncomingWebhook for Payeezy {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs
index 1487514423..7f2f90c818 100644
--- a/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs
@@ -14,7 +14,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{api::CurrencyUnit, errors::ConnectorError};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/payjustnow.rs b/crates/hyperswitch_connectors/src/connectors/payjustnow.rs
index 2c11f43a5c..0486686b6d 100644
--- a/crates/hyperswitch_connectors/src/connectors/payjustnow.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payjustnow.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret};
use transformers as payjustnow;
use crate::{
@@ -94,7 +94,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let request_body = Self::get_request_body(self, req, connectors)?;
let request_body_string =
@@ -155,7 +156,8 @@ impl ConnectorCommon for Payjustnow {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = payjustnow::PayjustnowAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -249,7 +251,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -334,7 +337,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -408,7 +412,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -485,7 +490,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -559,7 +565,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payjust
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -632,7 +639,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Payjustno
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -736,7 +744,8 @@ impl webhooks::IncomingWebhook for Payjustnow {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: payjustnow::PayjustnowWebhookDetails = request
.body
.parse_struct("PayjustnowWebhookDetails")
diff --git a/crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs
index bf15bf3615..c69c918647 100644
--- a/crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs b/crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs
index 754d2c805f..11cf9e79eb 100644
--- a/crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use ring::hmac;
use transformers as payjustnowinstore;
@@ -94,7 +94,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let request_body = Self::get_request_body(self, req, connectors)?;
let request_body_string =
@@ -150,7 +151,8 @@ impl ConnectorCommon for Payjustnowinstore {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = payjustnowinstore::PayjustnowinstoreAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -220,7 +222,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -312,7 +315,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -403,7 +407,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payjust
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -533,7 +538,8 @@ impl webhooks::IncomingWebhook for Payjustnowinstore {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: payjustnowinstore::PayjustnowinstoreWebhookDetails = request
.body
.parse_struct("PayjustnowinstoreWebhookDetails")
@@ -585,7 +591,9 @@ impl webhooks::IncomingWebhook for Payjustnowinstore {
request: &webhooks::IncomingWebhookRequestDetails<'_>,
merchant_id: &common_utils::id_type::MerchantId,
_connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
_connector_name: &str,
) -> CustomResult<bool, errors::ConnectorError> {
let connector_auth_type: ConnectorAuthType = connector_account_details
diff --git a/crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs
index 3e16d67741..e271a38851 100644
--- a/crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/payload.rs b/crates/hyperswitch_connectors/src/connectors/payload.rs
index 726a9f8743..370cf28d95 100644
--- a/crates/hyperswitch_connectors/src/connectors/payload.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payload.rs
@@ -55,7 +55,7 @@ use hyperswitch_interfaces::{
types::{self, ConnectorCustomerType, PaymentsVoidType, Response, SetupMandateType},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as payload;
use crate::{
@@ -98,7 +98,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
"application/json".to_string().into(),
@@ -186,7 +187,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
Self::common_get_content_type(self).to_string().into(),
@@ -217,7 +219,8 @@ impl ConnectorCommon for Payload {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = payload::PayloadAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
// The API key is the same for all currencies, so we can take any.
@@ -288,7 +291,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -407,7 +411,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -497,7 +502,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = Vec::new();
let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
header.append(&mut api_key);
@@ -569,7 +575,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -660,7 +667,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -745,7 +753,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payload
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -831,7 +840,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Payload {
&self,
req: &RefundSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.get_auth_header(&req.connector_auth_type)
}
@@ -1048,7 +1058,8 @@ impl webhooks::IncomingWebhook for Payload {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: responses::PayloadWebhookEvent = request
.body
.parse_struct("PayloadWebhookEvent")
diff --git a/crates/hyperswitch_connectors/src/connectors/payload/requests.rs b/crates/hyperswitch_connectors/src/connectors/payload/requests.rs
index 5ad630526a..faf743c367 100644
--- a/crates/hyperswitch_connectors/src/connectors/payload/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payload/requests.rs
@@ -1,5 +1,5 @@
use common_utils::{pii::Email, types::StringMajorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::connectors::payload::responses;
diff --git a/crates/hyperswitch_connectors/src/connectors/payload/responses.rs b/crates/hyperswitch_connectors/src/connectors/payload/responses.rs
index 319f9717e9..ef7187fec6 100644
--- a/crates/hyperswitch_connectors/src/connectors/payload/responses.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payload/responses.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
// PaymentsResponse
#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
diff --git a/crates/hyperswitch_connectors/src/connectors/payload/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payload/transformers.rs
index ba04e9ca7a..5819084da7 100644
--- a/crates/hyperswitch_connectors/src/connectors/payload/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payload/transformers.rs
@@ -25,7 +25,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeOptionInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeOptionInterface, PeekInterface, Secret};
use serde::Deserialize;
use super::{requests, responses};
diff --git a/crates/hyperswitch_connectors/src/connectors/payme.rs b/crates/hyperswitch_connectors/src/connectors/payme.rs
index 8280677d2d..556e8da21d 100644
--- a/crates/hyperswitch_connectors/src/connectors/payme.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payme.rs
@@ -55,7 +55,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use transformers as payme;
use crate::{
@@ -103,7 +103,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
crate::constants::headers::CONTENT_TYPE.to_string(),
Self::get_content_type(self).to_string().into(),
@@ -211,7 +212,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -310,7 +312,8 @@ impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseD
&self,
req: &CreateOrderRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -414,7 +417,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -554,7 +558,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -641,7 +646,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -752,7 +758,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &RouterData<PSync, PaymentsSyncData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -825,7 +832,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -918,7 +926,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1017,7 +1026,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payme {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1115,7 +1125,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Payme {
&self,
req: &RouterData<RSync, RefundsData, RefundsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1327,7 +1338,8 @@ impl webhooks::IncomingWebhook for Payme {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let resource =
serde_urlencoded::from_bytes::<payme::WebhookEventDataResource>(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/payme/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payme/transformers.rs
index 6adde6633a..72e9d593e6 100644
--- a/crates/hyperswitch_connectors/src/connectors/payme/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payme/transformers.rs
@@ -27,7 +27,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/payone.rs b/crates/hyperswitch_connectors/src/connectors/payone.rs
index e61a3d2840..2121cb86e5 100644
--- a/crates/hyperswitch_connectors/src/connectors/payone.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payone.rs
@@ -51,7 +51,7 @@ use hyperswitch_interfaces::{
api::{PayoutFulfill, Payouts},
types::PayoutFulfillType,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::hmac;
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
@@ -388,7 +388,7 @@ impl IncomingWebhook for Payone {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
index e2a6c1677d..e952e7eba1 100644
--- a/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
types::{PayoutsResponseData, PayoutsRouterData},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/paypal.rs b/crates/hyperswitch_connectors/src/connectors/paypal.rs
index e8fb13911d..378134dfd0 100644
--- a/crates/hyperswitch_connectors/src/connectors/paypal.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paypal.rs
@@ -75,7 +75,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
use transformers::{
@@ -2230,7 +2230,8 @@ impl IncomingWebhook for Paypal {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: paypal::PaypalWebhooksBody =
request
.body
diff --git a/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
index ea1633286e..575620ad41 100644
--- a/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/paysafe.rs b/crates/hyperswitch_connectors/src/connectors/paysafe.rs
index db8e03af3d..a7bfda2e86 100644
--- a/crates/hyperswitch_connectors/src/connectors/paysafe.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paysafe.rs
@@ -52,7 +52,7 @@ use hyperswitch_interfaces::{
types::{self, Response, TokenizationType},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as paysafe;
use crate::{
@@ -100,7 +100,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -202,7 +203,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -299,7 +301,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -330,7 +333,8 @@ impl ConnectorCommon for Paysafe {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = paysafe::PaysafeAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!("{}:{}", auth.username.peek(), auth.password.peek());
@@ -435,7 +439,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -521,7 +526,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -673,7 +679,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -757,7 +764,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -832,7 +840,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -922,7 +931,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1014,7 +1024,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paysafe
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1103,7 +1114,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paysafe {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1190,7 +1202,8 @@ impl webhooks::IncomingWebhook for Paysafe {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs
index c4174e92be..f91a82e88f 100644
--- a/crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs
@@ -32,7 +32,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/paystack.rs b/crates/hyperswitch_connectors/src/connectors/paystack.rs
index 10d126157d..e2065bd9a6 100644
--- a/crates/hyperswitch_connectors/src/connectors/paystack.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paystack.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as paystack;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -118,7 +119,8 @@ impl ConnectorCommon for Paystack {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = paystack::PaystackAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -177,7 +179,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -264,7 +267,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -338,7 +342,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -417,7 +422,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paystac
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -501,7 +507,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paystack
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -644,7 +651,8 @@ impl webhooks::IncomingWebhook for Paystack {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body = request
.body
.parse_struct::<paystack::PaystackWebhookData>("PaystackWebhookData")
diff --git a/crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs
index 2fbcf37dd8..6091a13b72 100644
--- a/crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/paytm.rs b/crates/hyperswitch_connectors/src/connectors/paytm.rs
index 4e9bcde2f5..00f2fcb75a 100644
--- a/crates/hyperswitch_connectors/src/connectors/paytm.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paytm.rs
@@ -86,7 +86,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -117,7 +118,8 @@ impl ConnectorCommon for Paytm {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
// This method is not implemented for Paytm, as it will always call the UCS service which has the logic to create headers.
Err(errors::ConnectorError::NotImplemented("get_auth_header method".to_string()).into())
}
@@ -190,7 +192,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -277,7 +280,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -341,7 +345,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -420,7 +425,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paytm {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -504,7 +510,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paytm {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -586,7 +593,8 @@ impl webhooks::IncomingWebhook for Paytm {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs
index 638fc291f9..8dff020744 100644
--- a/crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/payu.rs b/crates/hyperswitch_connectors/src/connectors/payu.rs
index 0638a58e14..66b5de89bd 100644
--- a/crates/hyperswitch_connectors/src/connectors/payu.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payu.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as payu;
use crate::{
@@ -75,7 +75,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -111,7 +112,8 @@ impl ConnectorCommon for Payu {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = payu::PayuAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -182,7 +184,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pa
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -269,7 +272,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
RefreshTokenType::get_content_type(self).to_string().into(),
@@ -360,7 +364,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pay
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -436,7 +441,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -527,7 +533,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -620,7 +627,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payu {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -707,7 +715,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Payu {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -793,7 +802,8 @@ impl IncomingWebhook for Payu {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/payu/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payu/transformers.rs
index 76e9e2b680..091ce7c1fe 100644
--- a/crates/hyperswitch_connectors/src/connectors/payu/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payu/transformers.rs
@@ -15,7 +15,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/peachpayments.rs b/crates/hyperswitch_connectors/src/connectors/peachpayments.rs
index deb5b2d6cb..14ccd6ca32 100644
--- a/crates/hyperswitch_connectors/src/connectors/peachpayments.rs
+++ b/crates/hyperswitch_connectors/src/connectors/peachpayments.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use transformers as peachpayments;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -89,7 +89,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -121,7 +122,8 @@ impl ConnectorCommon for Peachpayments {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = peachpayments::PeachpaymentsAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -203,7 +205,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -305,7 +308,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pea
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -374,7 +378,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -465,7 +470,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pe
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -563,7 +569,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Peachpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -644,7 +651,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Peachpaym
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -801,7 +809,8 @@ impl webhooks::IncomingWebhook for Peachpayments {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: peachpayments::PeachpaymentsIncomingWebhook = request
.body
.parse_struct("PeachpaymentsIncomingWebhook")
diff --git a/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs b/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
index c97f6bb9ff..fab652d4a8 100644
--- a/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/phonepe.rs b/crates/hyperswitch_connectors/src/connectors/phonepe.rs
index 4dcca143f8..f381a9aab5 100644
--- a/crates/hyperswitch_connectors/src/connectors/phonepe.rs
+++ b/crates/hyperswitch_connectors/src/connectors/phonepe.rs
@@ -86,7 +86,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -117,7 +118,8 @@ impl ConnectorCommon for Phonepe {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
// This method is not implemented for Phonepe, as it will always call the UCS service which has the logic to create headers.
Err(errors::ConnectorError::NotImplemented("get_auth_header method".to_string()).into())
}
@@ -190,7 +192,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -277,7 +280,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pho
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -341,7 +345,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -420,7 +425,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Phonepe
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -504,7 +510,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Phonepe {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -586,7 +593,8 @@ impl webhooks::IncomingWebhook for Phonepe {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs
index 62fcffa93d..d4b63529da 100644
--- a/crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/placetopay.rs b/crates/hyperswitch_connectors/src/connectors/placetopay.rs
index ce5c2d531e..e2879b2b05 100644
--- a/crates/hyperswitch_connectors/src/connectors/placetopay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/placetopay.rs
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -170,7 +171,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -258,7 +260,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pla
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -336,7 +339,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -416,7 +420,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Pl
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -494,7 +499,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Placeto
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -573,7 +579,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Placetopa
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -666,7 +673,8 @@ impl IncomingWebhook for Placetopay {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs
index 43e6275079..fb56d2f234 100644
--- a/crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use ring::digest;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/plaid.rs b/crates/hyperswitch_connectors/src/connectors/plaid.rs
index 6424698063..ca00ebe83f 100644
--- a/crates/hyperswitch_connectors/src/connectors/plaid.rs
+++ b/crates/hyperswitch_connectors/src/connectors/plaid.rs
@@ -41,7 +41,7 @@ use hyperswitch_interfaces::{
types::{PaymentsAuthorizeType, PaymentsPostProcessingType, PaymentsSyncType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask as _, Maskable};
+use hyperswitch_masking::{Mask as _, Maskable};
use transformers as plaid;
use crate::{
@@ -445,7 +445,7 @@ impl IncomingWebhook for Plaid {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err((ConnectorError::WebhooksNotImplemented).into())
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs b/crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs
index 364997326c..ac645e7cd7 100644
--- a/crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsSyncRouterData},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/powertranz.rs b/crates/hyperswitch_connectors/src/connectors/powertranz.rs
index 12f1178431..d9ea2fc85a 100644
--- a/crates/hyperswitch_connectors/src/connectors/powertranz.rs
+++ b/crates/hyperswitch_connectors/src/connectors/powertranz.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as powertranz;
use crate::{
@@ -102,7 +102,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -129,7 +130,8 @@ impl ConnectorCommon for Powertranz {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = powertranz::PowertranzAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -195,7 +197,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -292,7 +295,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -383,7 +387,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -468,7 +473,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Po
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -540,7 +546,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Powertr
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -641,7 +648,8 @@ impl webhooks::IncomingWebhook for Powertranz {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs b/crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs
index 8b8273538d..898bde506f 100644
--- a/crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
diff --git a/crates/hyperswitch_connectors/src/connectors/prophetpay.rs b/crates/hyperswitch_connectors/src/connectors/prophetpay.rs
index 6666ba62b5..364523a87b 100644
--- a/crates/hyperswitch_connectors/src/connectors/prophetpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/prophetpay.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as prophetpay;
use crate::{constants::headers, types::ResponseRouterData};
@@ -80,7 +80,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -111,7 +112,8 @@ impl ConnectorCommon for Prophetpay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = prophetpay::ProphetpayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -183,7 +185,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -280,7 +283,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -376,7 +380,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Pro
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -533,7 +538,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Prophet
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -621,7 +627,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Prophetpa
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -718,7 +725,8 @@ impl IncomingWebhook for Prophetpay {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
index ea9795e19b..032e180797 100644
--- a/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{api, consts::NO_ERROR_CODE, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/rapyd.rs b/crates/hyperswitch_connectors/src/connectors/rapyd.rs
index 2f98a3c788..df06688269 100644
--- a/crates/hyperswitch_connectors/src/connectors/rapyd.rs
+++ b/crates/hyperswitch_connectors/src/connectors/rapyd.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret};
use rand::distributions::{Alphanumeric, DistString};
use ring::hmac;
use router_env::logger;
@@ -120,7 +120,8 @@ impl ConnectorCommon for Rapyd {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -182,7 +183,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
_req: &PaymentsAuthorizeRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsAuthorizeType::get_content_type(self)
@@ -306,7 +308,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ra
&self,
_req: &PaymentsCancelRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsVoidType::get_content_type(self)
@@ -395,7 +398,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Rap
&self,
_req: &PaymentsSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsSyncType::get_content_type(self)
@@ -491,7 +495,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
_req: &PaymentsCaptureRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsCaptureType::get_content_type(self)
@@ -615,7 +620,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Rapyd {
&self,
_req: &RefundsRouterData<Execute>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::RefundExecuteType::get_content_type(self)
@@ -898,7 +904,8 @@ impl IncomingWebhook for Rapyd {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook: transformers::RapydIncomingWebhook = request
.body
.parse_struct("RapydIncomingWebhook")
diff --git a/crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs b/crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs
index bf1b992852..564f740ec3 100644
--- a/crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs
@@ -14,7 +14,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{consts::NO_ERROR_CODE, errors};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/razorpay.rs b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
index c4df76af04..e2b3e45a7a 100644
--- a/crates/hyperswitch_connectors/src/connectors/razorpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
@@ -45,8 +45,8 @@ use hyperswitch_interfaces::{
types::{self, CreateOrderType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
+use hyperswitch_masking::{Mask, Maskable, PeekInterface};
use lazy_static::lazy_static;
-use masking::{Mask, Maskable, PeekInterface};
use router_env::logger;
use transformers as razorpay;
@@ -738,7 +738,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Razorpay
// _merchant_id: &common_utils::id_type::MerchantId,
// _connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
// _connector_account_details: common_utils::crypto::Encryptable<
-// masking::Secret<serde_json::Value>,
+// hyperswitch_masking::Secret<serde_json::Value>,
// >,
// _connector_label: &str,
// ) -> CustomResult<bool, errors::ConnectorError> {
@@ -759,7 +759,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Razorpay
// fn get_webhook_resource_object(
// &self,
// request: &IncomingWebhookRequestDetails<'_>,
-// ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+// ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError> {
// let details: razorpay::RazorpayWebhookPayload = request
// .body
// .parse_struct("RazorpayWebhookPayload")
@@ -788,7 +788,8 @@ impl IncomingWebhook for Razorpay {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
index d7dfdade73..9c73c2c109 100644
--- a/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::{Duration, OffsetDateTime};
diff --git a/crates/hyperswitch_connectors/src/connectors/recurly.rs b/crates/hyperswitch_connectors/src/connectors/recurly.rs
index 4c9c9b3c66..3eb4692869 100644
--- a/crates/hyperswitch_connectors/src/connectors/recurly.rs
+++ b/crates/hyperswitch_connectors/src/connectors/recurly.rs
@@ -71,7 +71,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as recurly;
use crate::{connectors::recurly::transformers::RecurlyWebhookBody, constants::headers};
@@ -308,7 +308,8 @@ impl ConnectorCommon for Recurly {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = recurly::RecurlyAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -372,7 +373,8 @@ impl
fn get_headers(
&self,
req: &recovery_router_data_types::BillingConnectorPaymentsSyncRouterDataV2,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -457,7 +459,8 @@ impl
fn get_headers(
&self,
req: &recovery_router_data_types::InvoiceRecordBackRouterDataV2,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -548,7 +551,8 @@ impl
fn get_headers(
&self,
req: &recovery_router_data_types::BillingConnectorInvoiceSyncRouterDataV2,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -713,7 +717,8 @@ impl webhooks::IncomingWebhook for Recurly {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook = RecurlyWebhookBody::get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(webhook))
diff --git a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
index 33fd71090c..fef42141bf 100644
--- a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
types as recovery_router_data_types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/redsys.rs b/crates/hyperswitch_connectors/src/connectors/redsys.rs
index 46458e039f..34586d31fc 100644
--- a/crates/hyperswitch_connectors/src/connectors/redsys.rs
+++ b/crates/hyperswitch_connectors/src/connectors/redsys.rs
@@ -50,7 +50,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use transformers as redsys;
use crate::{
@@ -162,7 +162,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -338,7 +339,8 @@ impl ConnectorIntegration<Authenticate, PaymentsAuthenticateData, PaymentsRespon
&self,
req: &PaymentsAuthenticateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -429,7 +431,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -822,7 +825,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Red
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -900,7 +904,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Redsys {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
@@ -996,7 +1001,8 @@ impl webhooks::IncomingWebhook for Redsys {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs b/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
index a7ad0b54f8..87408d7e28 100644
--- a/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
@@ -27,7 +27,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/revolv3.rs b/crates/hyperswitch_connectors/src/connectors/revolv3.rs
index e1076dcff9..ec0bd9c8b1 100644
--- a/crates/hyperswitch_connectors/src/connectors/revolv3.rs
+++ b/crates/hyperswitch_connectors/src/connectors/revolv3.rs
@@ -66,7 +66,8 @@ impl api::ConnectorCommon for Revolv3 {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(Vec::new())
}
@@ -121,7 +122,8 @@ impl webhooks::IncomingWebhook for Revolv3 {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err((errors::ConnectorError::WebhooksNotImplemented).into())
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/revolv3/transformers.rs b/crates/hyperswitch_connectors/src/connectors/revolv3/transformers.rs
index c049b1bc67..d2c8d97d55 100644
--- a/crates/hyperswitch_connectors/src/connectors/revolv3/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/revolv3/transformers.rs
@@ -2,7 +2,7 @@ use hyperswitch_domain_models::router_data::ConnectorAuthType;
use hyperswitch_interfaces::errors;
pub struct Revolv3AuthType {
- pub api_key: masking::Secret<String>,
+ pub api_key: hyperswitch_masking::Secret<String>,
}
impl TryFrom<&ConnectorAuthType> for Revolv3AuthType {
diff --git a/crates/hyperswitch_connectors/src/connectors/riskified.rs b/crates/hyperswitch_connectors/src/connectors/riskified.rs
index 8a4ddaf390..071a521d27 100644
--- a/crates/hyperswitch_connectors/src/connectors/riskified.rs
+++ b/crates/hyperswitch_connectors/src/connectors/riskified.rs
@@ -62,9 +62,7 @@ use hyperswitch_interfaces::{
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
#[cfg(feature = "frm")]
-use masking::Maskable;
-#[cfg(feature = "frm")]
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
#[cfg(feature = "frm")]
use ring::hmac;
#[cfg(feature = "frm")]
@@ -644,7 +642,7 @@ impl IncomingWebhook for Riskified {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let resource: riskified::RiskifiedWebhookBody = request
.body
.parse_struct("RiskifiedWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
index 61a4d8e157..ac0f5227b5 100644
--- a/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
+++ b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
@@ -17,7 +17,7 @@ use hyperswitch_domain_models::{
router_response_types::fraud_check::FraudCheckResponseData,
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs
index 85beeedaed..65656520ec 100644
--- a/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs
+++ b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs
@@ -1,6 +1,6 @@
use hyperswitch_domain_models::router_data::ConnectorAuthType;
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
pub struct RiskifiedAuthType {
pub secret_token: Secret<String>,
diff --git a/crates/hyperswitch_connectors/src/connectors/santander.rs b/crates/hyperswitch_connectors/src/connectors/santander.rs
index 2055222f8c..e92779455e 100644
--- a/crates/hyperswitch_connectors/src/connectors/santander.rs
+++ b/crates/hyperswitch_connectors/src/connectors/santander.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
types::{self, RefreshTokenType, Response},
webhooks,
};
-use masking::{Maskable, PeekInterface};
+use hyperswitch_masking::{Maskable, PeekInterface};
use crate::{
connectors::santander::{
@@ -1478,7 +1478,8 @@ impl webhooks::IncomingWebhook for Santander {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/santander/requests.rs b/crates/hyperswitch_connectors/src/connectors/santander/requests.rs
index de91f98e2f..18d0913b45 100644
--- a/crates/hyperswitch_connectors/src/connectors/santander/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/santander/requests.rs
@@ -1,5 +1,5 @@
use common_utils::types::{FloatMajorUnit, StringMajorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::connectors::santander::responses;
diff --git a/crates/hyperswitch_connectors/src/connectors/santander/responses.rs b/crates/hyperswitch_connectors/src/connectors/santander/responses.rs
index 4f1163fd6b..57a978abfe 100644
--- a/crates/hyperswitch_connectors/src/connectors/santander/responses.rs
+++ b/crates/hyperswitch_connectors/src/connectors/santander/responses.rs
@@ -1,5 +1,5 @@
use common_utils::types::StringMajorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
index b5c27e1dbf..a9993f10aa 100644
--- a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
@@ -25,7 +25,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors::{self},
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/shift4.rs b/crates/hyperswitch_connectors/src/connectors/shift4.rs
index 92d4574bb2..f1e2af6455 100644
--- a/crates/hyperswitch_connectors/src/connectors/shift4.rs
+++ b/crates/hyperswitch_connectors/src/connectors/shift4.rs
@@ -49,7 +49,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers::{self as shift4, Shift4PaymentsRequest, Shift4RefundRequest};
use crate::{
@@ -79,7 +79,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -111,7 +112,8 @@ impl ConnectorCommon for Shift4 {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = shift4::Shift4AuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let api_key = format!(
@@ -204,7 +206,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -305,7 +308,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Shi
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -381,7 +385,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -467,7 +472,8 @@ impl ConnectorIntegration<PreAuthenticate, PaymentsPreAuthenticateData, Payments
&self,
req: &PaymentsPreAuthenticateRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -574,7 +580,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -681,7 +688,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -769,7 +777,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Shift4
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -855,7 +864,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Shift4 {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -967,7 +977,8 @@ impl IncomingWebhook for Shift4 {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: shift4::Shift4WebhookObjectResource = request
.body
.parse_struct("Shift4WebhookObjectResource")
diff --git a/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs b/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs
index eea825a4dc..d65665b1f6 100644
--- a/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/sift.rs b/crates/hyperswitch_connectors/src/connectors/sift.rs
index 1769a2a52f..e242b31ba4 100644
--- a/crates/hyperswitch_connectors/src/connectors/sift.rs
+++ b/crates/hyperswitch_connectors/src/connectors/sift.rs
@@ -42,7 +42,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as sift;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -87,7 +87,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -121,7 +122,8 @@ impl ConnectorCommon for Sift {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = sift::SiftAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -198,7 +200,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -285,7 +288,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Sif
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -349,7 +353,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -428,7 +433,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Sift {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -512,7 +518,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Sift {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -594,7 +601,8 @@ impl webhooks::IncomingWebhook for Sift {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/sift/transformers.rs b/crates/hyperswitch_connectors/src/connectors/sift/transformers.rs
index a2dbf4e406..9e95bf4983 100644
--- a/crates/hyperswitch_connectors/src/connectors/sift/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/sift/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::{RefundsResponseRouterData, ResponseRouterData};
diff --git a/crates/hyperswitch_connectors/src/connectors/signifyd.rs b/crates/hyperswitch_connectors/src/connectors/signifyd.rs
index 6ce6f56e2d..8fb0ae0c17 100644
--- a/crates/hyperswitch_connectors/src/connectors/signifyd.rs
+++ b/crates/hyperswitch_connectors/src/connectors/signifyd.rs
@@ -61,11 +61,9 @@ use hyperswitch_interfaces::{
types::Response,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
+use hyperswitch_masking::Maskable;
#[cfg(feature = "frm")]
-use masking::Mask;
-use masking::Maskable;
-#[cfg(feature = "frm")]
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
#[cfg(feature = "frm")]
use ring::hmac;
#[cfg(feature = "frm")]
@@ -717,7 +715,7 @@ impl IncomingWebhook for Signifyd {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let resource: signifyd::SignifydWebhookBody = request
.body
.parse_struct("SignifydWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs
index c23bc40a97..52cc789a72 100644
--- a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs
+++ b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
router_response_types::fraud_check::FraudCheckResponseData,
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use num_traits::ToPrimitive;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs
index c4783c4d3a..943e591d49 100644
--- a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs
+++ b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs
@@ -1,6 +1,6 @@
use hyperswitch_domain_models::router_data::ConnectorAuthType;
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
pub struct SignifydAuthType {
pub api_key: Secret<String>,
diff --git a/crates/hyperswitch_connectors/src/connectors/silverflow.rs b/crates/hyperswitch_connectors/src/connectors/silverflow.rs
index e85cb3064c..4fe5067731 100644
--- a/crates/hyperswitch_connectors/src/connectors/silverflow.rs
+++ b/crates/hyperswitch_connectors/src/connectors/silverflow.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as silverflow;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -77,7 +77,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &RouterData<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -160,7 +161,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -213,7 +215,8 @@ impl ConnectorCommon for Silverflow {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = silverflow::SilverflowAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_string = format!("{}:{}", auth.api_key.expose(), auth.api_secret.expose());
@@ -292,7 +295,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -375,7 +379,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Sil
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -450,7 +455,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -533,7 +539,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Si
&self,
req: &RouterData<Void, PaymentsCancelData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -617,7 +624,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Silverf
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -701,7 +709,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Silverflo
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -858,7 +867,8 @@ impl webhooks::IncomingWebhook for Silverflow {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body = String::from_utf8(request.body.to_vec())
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs b/crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs
index 69b8afa9ed..4af6784cb1 100644
--- a/crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/square.rs b/crates/hyperswitch_connectors/src/connectors/square.rs
index 687b0f633e..babf50b0f0 100644
--- a/crates/hyperswitch_connectors/src/connectors/square.rs
+++ b/crates/hyperswitch_connectors/src/connectors/square.rs
@@ -47,8 +47,8 @@ use hyperswitch_interfaces::{
types::{self, PaymentsAuthorizeType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
+use hyperswitch_masking::{Mask, Maskable, PeekInterface};
use lazy_static::lazy_static;
-use masking::{Mask, Maskable, PeekInterface};
use transformers::{
self as square, SquareAuthType, SquarePaymentsRequest, SquareRefundRequest, SquareTokenRequest,
};
@@ -903,7 +903,8 @@ impl IncomingWebhook for Square {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: square::SquareWebhookBody =
request
.body
diff --git a/crates/hyperswitch_connectors/src/connectors/square/transformers.rs b/crates/hyperswitch_connectors/src/connectors/square/transformers.rs
index dd0a70b00d..bcecf492de 100644
--- a/crates/hyperswitch_connectors/src/connectors/square/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/square/transformers.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/stax.rs b/crates/hyperswitch_connectors/src/connectors/stax.rs
index 049e04877c..c973fe8bf3 100644
--- a/crates/hyperswitch_connectors/src/connectors/stax.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stax.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
use transformers as stax;
use self::stax::StaxWebhookEventType;
@@ -79,7 +79,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsAuthorizeType::get_content_type(self)
@@ -112,7 +113,8 @@ impl ConnectorCommon for Stax {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = stax::StaxAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -175,7 +177,8 @@ impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, Paymen
&self,
req: &ConnectorCustomerRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -263,7 +266,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &TokenizationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -364,7 +368,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -453,7 +458,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Sta
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -528,7 +534,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -618,7 +625,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for St
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -688,7 +696,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Stax {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -785,7 +794,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Stax {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -925,7 +935,8 @@ impl webhooks::IncomingWebhook for Stax {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let reference_object: serde_json::Value = serde_json::from_slice(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(reference_object))
diff --git a/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
index 436413a9b7..c354b825cf 100644
--- a/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{api, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe.rs b/crates/hyperswitch_connectors/src/connectors/stripe.rs
index 71c9429d76..e863200733 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe.rs
@@ -76,7 +76,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask as _, Maskable, PeekInterface};
+use hyperswitch_masking::{Mask as _, Maskable, PeekInterface};
use router_env::{instrument, tracing};
use stripe::auth_headers;
@@ -2490,7 +2490,7 @@ impl IncomingWebhook for Stripe {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let details: stripe::WebhookEvent = request
.body
.parse_struct("WebhookEvent")
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
index e67fff13df..0459f94c96 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
@@ -41,7 +41,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors::ConnectorError};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use time::PrimitiveDateTime;
@@ -4973,7 +4973,7 @@ where
mod test_validate_shipping_address_against_payment_method {
use common_enums::CountryAlpha2;
use hyperswitch_interfaces::errors::ConnectorError;
- use masking::Secret;
+ use hyperswitch_masking::Secret;
use crate::connectors::stripe::transformers::{
validate_shipping_address_against_payment_method, StripePaymentMethodType,
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs b/crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs
index 7afcd744ae..f8ba9cfa67 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs
@@ -3,7 +3,7 @@ use common_utils::{ext_traits::OptionExt as _, pii::Email};
use error_stack::ResultExt;
use hyperswitch_domain_models::types::{PayoutsResponseData, PayoutsRouterData};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use super::ErrorDetails;
diff --git a/crates/hyperswitch_connectors/src/connectors/stripebilling.rs b/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
index 34db1d1f6a..4b34ee6c67 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
@@ -48,7 +48,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use stripebilling::auth_headers;
use transformers as stripebilling;
@@ -165,7 +165,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -196,7 +197,8 @@ impl ConnectorCommon for Stripebilling {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = stripebilling::StripebillingAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![
@@ -262,7 +264,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -350,7 +353,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Str
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -414,7 +418,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -493,7 +498,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Stripeb
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -579,7 +585,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Stripebil
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -653,7 +660,8 @@ impl
&self,
req: &recovery_router_data_types::BillingConnectorPaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -750,7 +758,8 @@ impl
&self,
req: &recovery_router_data_types::InvoiceRecordBackRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -930,7 +939,8 @@ impl webhooks::IncomingWebhook for Stripebilling {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
@@ -938,7 +948,8 @@ impl webhooks::IncomingWebhook for Stripebilling {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook = stripebilling::StripebillingInvoiceBody::get_invoice_webhook_data_from_body(
request.body,
)
diff --git a/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs
index 7944a3418d..1a5e0822ae 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_domain_models::{
types as recovery_router_data_types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/taxjar.rs b/crates/hyperswitch_connectors/src/connectors/taxjar.rs
index 8014b0aa17..72e4bf064e 100644
--- a/crates/hyperswitch_connectors/src/connectors/taxjar.rs
+++ b/crates/hyperswitch_connectors/src/connectors/taxjar.rs
@@ -39,7 +39,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as taxjar;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -85,7 +85,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -116,7 +117,8 @@ impl ConnectorCommon for Taxjar {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = taxjar::TaxjarAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -171,7 +173,8 @@ impl ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculati
&self,
req: &PaymentsTaxCalculationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -298,7 +301,8 @@ impl webhooks::IncomingWebhook for Taxjar {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs b/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
index 617f6d4748..75a9dd806c 100644
--- a/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
@@ -8,7 +8,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/tesouro.rs b/crates/hyperswitch_connectors/src/connectors/tesouro.rs
index 51ff1447fd..101a18b1aa 100644
--- a/crates/hyperswitch_connectors/src/connectors/tesouro.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tesouro.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as tesouro;
use crate::{
@@ -93,7 +93,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -208,7 +209,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
types::RefreshTokenType::get_content_type(self)
@@ -323,7 +325,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -403,7 +406,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -494,7 +498,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tes
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -570,7 +575,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -655,7 +661,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Te
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -731,7 +738,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Tesouro
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -815,7 +823,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Tesouro {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -906,7 +915,8 @@ impl webhooks::IncomingWebhook for Tesouro {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs b/crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
index 23dd49de75..d699836c80 100644
--- a/crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
@@ -22,7 +22,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/threedsecureio.rs b/crates/hyperswitch_connectors/src/connectors/threedsecureio.rs
index ed7b25c5d0..aa10e6577d 100644
--- a/crates/hyperswitch_connectors/src/connectors/threedsecureio.rs
+++ b/crates/hyperswitch_connectors/src/connectors/threedsecureio.rs
@@ -50,7 +50,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask as _, Maskable};
+use hyperswitch_masking::{ExposeInterface, Mask as _, Maskable};
use transformers as threedsecureio;
use crate::{
@@ -216,7 +216,7 @@ impl IncomingWebhook for Threedsecureio {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs b/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
index 9f0635e93f..ec9ea7c3ab 100644
--- a/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
@@ -18,8 +18,8 @@ use hyperswitch_domain_models::{
router_response_types::AuthenticationResponseData,
};
use hyperswitch_interfaces::{api::CurrencyUnit, consts::NO_ERROR_MESSAGE, errors};
+use hyperswitch_masking::{ExposeInterface, Secret};
use iso_currency::Currency;
-use masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::{json, to_string};
diff --git a/crates/hyperswitch_connectors/src/connectors/thunes.rs b/crates/hyperswitch_connectors/src/connectors/thunes.rs
index e197bed1a8..b6bf5badfd 100644
--- a/crates/hyperswitch_connectors/src/connectors/thunes.rs
+++ b/crates/hyperswitch_connectors/src/connectors/thunes.rs
@@ -38,7 +38,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as thunes;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -83,7 +83,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -117,7 +118,8 @@ impl ConnectorCommon for Thunes {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = thunes::ThunesAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -172,7 +174,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -259,7 +262,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Thu
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -323,7 +327,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -402,7 +407,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Thunes
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -486,7 +492,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Thunes {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -568,7 +575,8 @@ impl webhooks::IncomingWebhook for Thunes {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs b/crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs
index 6aa6d7f00d..f7f3c25e3c 100644
--- a/crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/tokenex.rs b/crates/hyperswitch_connectors/src/connectors/tokenex.rs
index 85c6d04e33..865e49482c 100644
--- a/crates/hyperswitch_connectors/src/connectors/tokenex.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tokenex.rs
@@ -39,7 +39,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as tokenex;
use crate::{constants::headers, types::ResponseRouterData};
@@ -84,7 +84,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = tokenex::TokenexAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let header = vec![
@@ -129,7 +130,8 @@ impl ConnectorCommon for Tokenex {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = tokenex::TokenexAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -206,7 +208,8 @@ impl ConnectorIntegration<ExternalVaultInsertFlow, VaultRequestData, VaultRespon
&self,
req: &VaultRouterData<ExternalVaultInsertFlow>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -287,7 +290,8 @@ impl ConnectorIntegration<ExternalVaultRetrieveFlow, VaultRequestData, VaultResp
&self,
req: &VaultRouterData<ExternalVaultRetrieveFlow>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -370,7 +374,8 @@ impl webhooks::IncomingWebhook for Tokenex {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs b/crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs
index 2c3b48ec19..f02686b209 100644
--- a/crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
vault::{PaymentMethodCustomVaultingData, PaymentMethodVaultingData},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::types::ResponseRouterData;
diff --git a/crates/hyperswitch_connectors/src/connectors/tokenio.rs b/crates/hyperswitch_connectors/src/connectors/tokenio.rs
index 4ac8e50992..bbc3d58648 100644
--- a/crates/hyperswitch_connectors/src/connectors/tokenio.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tokenio.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
types::Response,
webhooks,
};
-use masking::{ExposeInterface, Mask, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use openssl::{ec::EcKey, hash::MessageDigest, pkey::PKey, rsa::Rsa, sign::Signer};
use transformers::{self as tokenio, TokenioPaymentStatus};
@@ -259,7 +259,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
// Basic headers - JWT will be added in individual build_request methods
let header = vec![(
headers::CONTENT_TYPE.to_string(),
@@ -290,7 +291,8 @@ impl ConnectorCommon for Tokenio {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -340,7 +342,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -443,7 +446,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tok
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
// For GET requests, we need JWT with detached format (no body)
let auth = tokenio::TokenioAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -678,7 +682,8 @@ impl webhooks::IncomingWebhook for Tokenio {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_payload: tokenio::TokenioWebhookPayload = request
.body
.parse_struct("TokenioWebhookPayload")
diff --git a/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs b/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
index a4e8616fab..3088167a7c 100644
--- a/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
@@ -15,7 +15,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/truelayer.rs b/crates/hyperswitch_connectors/src/connectors/truelayer.rs
index f4e1fef123..d73553201b 100644
--- a/crates/hyperswitch_connectors/src/connectors/truelayer.rs
+++ b/crates/hyperswitch_connectors/src/connectors/truelayer.rs
@@ -53,7 +53,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as truelayer;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -100,7 +100,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let idempotency_key = uuid::Uuid::new_v4().to_string();
let truelayer_req = self
.get_request_body(req, connectors)
@@ -170,7 +171,8 @@ impl ConnectorCommon for Truelayer {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = truelayer::TruelayerAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -344,7 +346,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -431,7 +434,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tru
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -495,7 +499,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -574,7 +579,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Truelay
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -658,7 +664,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Truelayer
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -745,7 +752,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Truel
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -843,7 +851,8 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Truelaye
&self,
req: &PayoutsRouterData<PoSync>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -1041,7 +1050,8 @@ impl webhooks::IncomingWebhook for Truelayer {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body: truelayer::TruelayerPayoutsWebhookBody = request
.body
.parse_struct("TruelayerPayoutsWebhookBody")
diff --git a/crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs b/crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs
index 606fe936f2..dbf53ce9e2 100644
--- a/crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs
@@ -32,8 +32,8 @@ use hyperswitch_domain_models::{
types::PayoutsRouterData,
};
use hyperswitch_interfaces::errors;
+use hyperswitch_masking::Secret;
use josekit::jws::{JwsHeader, ES512};
-use masking::Secret;
use openssl::{
bn::{BigNum, BigNumContext},
ec::{EcGroup, EcKey, EcPoint},
diff --git a/crates/hyperswitch_connectors/src/connectors/trustly.rs b/crates/hyperswitch_connectors/src/connectors/trustly.rs
index 75dfcbe593..f44fab3f68 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustly.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustly.rs
@@ -97,7 +97,7 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -131,7 +131,7 @@ impl ConnectorCommon for Trustly {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
Ok(Vec::new())
}
@@ -203,7 +203,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -290,7 +290,7 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tru
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -354,7 +354,7 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -433,7 +433,7 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Trustly
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -517,7 +517,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Trustly {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -601,7 +601,7 @@ impl ConnectorIntegration<PoRecipient, PayoutsData, PayoutsResponseData> for Tru
&self,
req: &PayoutsRouterData<PoRecipient>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -685,7 +685,7 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Trust
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -765,7 +765,7 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Trustly
&self,
req: &PayoutsRouterData<PoSync>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, ConnectorError> {
self.build_headers(req, connectors)
}
@@ -844,7 +844,7 @@ impl webhooks::IncomingWebhook for Trustly {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs b/crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs
index e1299e57a7..b5bc3f5762 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use openssl::{hash::MessageDigest, pkey::PKey, rsa::Rsa, sign::Signer};
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpay.rs b/crates/hyperswitch_connectors/src/connectors/trustpay.rs
index ceb2c37527..f0691bf906 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpay.rs
@@ -53,7 +53,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as trustpay;
use crate::{
@@ -89,7 +89,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
match req.payment_method {
enums::PaymentMethod::BankRedirect | enums::PaymentMethod::BankTransfer => {
let token = req
@@ -140,7 +141,8 @@ impl ConnectorCommon for Trustpay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = trustpay::TrustpayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -260,7 +262,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = trustpay::TrustpayAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_value = auth
@@ -366,7 +369,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tru
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -507,7 +511,8 @@ impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseD
&self,
req: &CreateOrderRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsPreProcessingType::get_content_type(self)
@@ -604,7 +609,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PaymentsPreProcessingType::get_content_type(self)
@@ -707,7 +713,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -811,7 +818,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Trustpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -908,7 +916,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Trustpay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1093,7 +1102,8 @@ impl webhooks::IncomingWebhook for Trustpay {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: trustpay::TrustpayWebhookResponse = request
.body
.parse_struct("TrustpayWebhookResponse")
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
index d2133e956f..879f8b9b1f 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
@@ -27,7 +27,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use reqwest::Url;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpayments.rs b/crates/hyperswitch_connectors/src/connectors/trustpayments.rs
index 8923be5b3a..c46580122f 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpayments.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpayments.rs
@@ -43,7 +43,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::Mask;
+use hyperswitch_masking::Mask;
use transformers as trustpayments;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -81,7 +81,8 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
&self,
req: &RouterData<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -163,7 +164,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -194,7 +196,8 @@ impl ConnectorCommon for Trustpayments {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = trustpayments::TrustpaymentsAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -274,7 +277,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -362,7 +366,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tru
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -438,7 +443,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -524,7 +530,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Tr
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -600,7 +607,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Trustpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -686,7 +694,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Trustpaym
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -777,7 +786,8 @@ impl webhooks::IncomingWebhook for Trustpayments {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs b/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
index 389a84a919..ee96bd54a9 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/tsys.rs b/crates/hyperswitch_connectors/src/connectors/tsys.rs
index 073f5f6f4c..b036c82936 100644
--- a/crates/hyperswitch_connectors/src/connectors/tsys.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tsys.rs
@@ -86,7 +86,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
Self::get_content_type(self).to_string().into(),
@@ -133,7 +134,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -221,7 +223,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tsy
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -300,7 +303,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -387,7 +391,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Ts
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -463,7 +468,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Tsys {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -548,7 +554,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Tsys {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -642,7 +649,8 @@ impl webhooks::IncomingWebhook for Tsys {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs b/crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs
index 8944d1e9d4..ffab01f4b7 100644
--- a/crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
pub struct TsysRouterData<T> {
pub amount: StringMinorUnit,
diff --git a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs
index 1cd58a75dc..9d572e8441 100644
--- a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs
+++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs
@@ -44,7 +44,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use transformers as unified_authentication_service;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -100,7 +100,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -192,7 +193,8 @@ impl
&self,
req: &UasAuthenticationConfirmationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -291,7 +293,8 @@ impl
&self,
req: &UasPreAuthenticationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -411,7 +414,8 @@ impl
&self,
req: &UasPostAuthenticationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -499,7 +503,8 @@ impl ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthent
&self,
req: &UasAuthenticationRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -634,7 +639,8 @@ impl
&self,
req: &UasProcessWebhookRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -739,7 +745,8 @@ impl webhooks::IncomingWebhook for UnifiedAuthenticationService {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let webhook_body_value: unified_authentication_service::WebhookResponse = request
.body
.parse_struct("unified_authentication_service WebhookResponse")
diff --git a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
index cbcb5fb9e1..8302d84642 100644
--- a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
@@ -17,7 +17,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_connectors/src/connectors/vgs.rs b/crates/hyperswitch_connectors/src/connectors/vgs.rs
index 9195742059..55c650204a 100644
--- a/crates/hyperswitch_connectors/src/connectors/vgs.rs
+++ b/crates/hyperswitch_connectors/src/connectors/vgs.rs
@@ -33,7 +33,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as vgs;
use crate::{constants::headers, types::ResponseRouterData};
@@ -71,7 +71,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -104,7 +105,8 @@ impl ConnectorCommon for Vgs {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -183,7 +185,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
types::RefreshTokenType::get_content_type(self)
@@ -288,7 +291,8 @@ impl ConnectorIntegration<ExternalVaultInsertFlow, VaultRequestData, VaultRespon
&self,
req: &VaultRouterData<ExternalVaultInsertFlow>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -375,7 +379,8 @@ impl ConnectorIntegration<ExternalVaultRetrieveFlow, VaultRequestData, VaultResp
&self,
req: &VaultRouterData<ExternalVaultRetrieveFlow>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -450,7 +455,8 @@ impl webhooks::IncomingWebhook for Vgs {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs b/crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs
index 345eca99cc..561d69a205 100644
--- a/crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
vault::{PaymentMethodCustomVaultingData, PaymentMethodVaultingData},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::types::ResponseRouterData;
diff --git a/crates/hyperswitch_connectors/src/connectors/volt.rs b/crates/hyperswitch_connectors/src/connectors/volt.rs
index 9702b47827..7c5ec8edfc 100644
--- a/crates/hyperswitch_connectors/src/connectors/volt.rs
+++ b/crates/hyperswitch_connectors/src/connectors/volt.rs
@@ -45,7 +45,7 @@ use hyperswitch_interfaces::{
types::{self, PaymentsAuthorizeType, PaymentsVoidType, RefreshTokenType, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use transformers as volt;
use self::volt::{webhook_headers, VoltWebhookBodyEventType};
@@ -100,7 +100,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let access_token = req
.access_token
.clone()
@@ -152,7 +153,8 @@ impl ConnectorCommon for Volt {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = volt::VoltAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -223,7 +225,8 @@ impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken>
&self,
_req: &RefreshTokenRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
RefreshTokenType::get_content_type(self).to_string().into(),
@@ -326,7 +329,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -410,7 +414,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Vol
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -498,7 +503,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Vo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -568,7 +574,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Volt {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -760,7 +767,8 @@ impl webhooks::IncomingWebhook for Volt {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details: volt::VoltWebhookObjectResource = request
.body
.parse_struct("VoltWebhookObjectResource")
diff --git a/crates/hyperswitch_connectors/src/connectors/volt/transformers.rs b/crates/hyperswitch_connectors/src/connectors/volt/transformers.rs
index c59ee01b41..ec068efaf3 100644
--- a/crates/hyperswitch_connectors/src/connectors/volt/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/volt/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs
index 74e55a359e..85646310f3 100644
--- a/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs
@@ -58,7 +58,7 @@ use hyperswitch_interfaces::{
},
webhooks,
};
-use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, Maskable, PeekInterface};
use ring::{digest, hmac};
use time::OffsetDateTime;
use transformers as wellsfargo;
@@ -1329,7 +1329,8 @@ impl webhooks::IncomingWebhook for Wellsfargo {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
index 2494aa3fa8..f28db17fdd 100644
--- a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
@@ -29,7 +29,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{api, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs
index e250c5e974..8d9f2a415a 100644
--- a/crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs
@@ -41,7 +41,7 @@ use hyperswitch_interfaces::{
},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{ExposeInterface, Mask as _, Maskable};
+use hyperswitch_masking::{ExposeInterface, Mask as _, Maskable};
use self::transformers as wellsfargopayout;
use crate::{constants::headers, types::ResponseRouterData, utils::convert_amount};
@@ -572,7 +572,7 @@ impl IncomingWebhook for Wellsfargopayout {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
Err(report!(ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs
index 6ec6511ab4..6aa8aa940a 100644
--- a/crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/wise.rs b/crates/hyperswitch_connectors/src/connectors/wise.rs
index eb96c440e8..0c71c3572e 100644
--- a/crates/hyperswitch_connectors/src/connectors/wise.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wise.rs
@@ -49,8 +49,8 @@ use hyperswitch_interfaces::{
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
#[cfg(feature = "payouts")]
-use masking::PeekInterface;
-use masking::{Mask as _, Maskable};
+use hyperswitch_masking::PeekInterface;
+use hyperswitch_masking::{Mask as _, Maskable};
#[cfg(feature = "payouts")]
use router_env::{instrument, tracing};
@@ -84,8 +84,6 @@ where
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
- use masking::Mask as _;
-
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
PayoutQuoteType::get_content_type(self).to_string().into(),
@@ -871,7 +869,7 @@ impl IncomingWebhook for Wise {
&self,
#[cfg(feature = "payouts")] request: &IncomingWebhookRequestDetails<'_>,
#[cfg(not(feature = "payouts"))] _request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
#[cfg(feature = "payouts")]
{
let payload: wise::WisePayoutsWebhookBody = request
diff --git a/crates/hyperswitch_connectors/src/connectors/wise/transformers.rs b/crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
index 927f920591..81fbbbd7d9 100644
--- a/crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::router_data::ConnectorAuthType;
#[cfg(feature = "payouts")]
use hyperswitch_domain_models::types::{PayoutsResponseData, PayoutsRouterData};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldline.rs b/crates/hyperswitch_connectors/src/connectors/worldline.rs
index e0c60e6a90..2d1b6e88d2 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldline.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldline.rs
@@ -46,7 +46,7 @@ use hyperswitch_interfaces::{
},
webhooks::{self, IncomingWebhookFlowError},
};
-use masking::{ExposeInterface, Mask, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface};
use ring::hmac;
use router_env::logger;
use time::{format_description, OffsetDateTime};
@@ -107,7 +107,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let base_url = self.base_url(connectors);
let url = Self::get_url(self, req, connectors)?;
let endpoint = url.replace(base_url, "");
@@ -211,7 +212,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Wo
&self,
req: &RouterData<Void, PaymentsCancelData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -290,7 +292,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Wor
&self,
req: &RouterData<PSync, PaymentsSyncData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -366,7 +369,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &RouterData<Capture, PaymentsCaptureData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -466,7 +470,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &RouterData<Authorize, PaymentsAuthorizeData, PaymentsResponseData>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -553,7 +558,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldli
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -638,7 +644,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldline
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -789,7 +796,8 @@ impl webhooks::IncomingWebhook for Worldline {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let details = request
.body
.parse_struct::<worldline::WebhookBody>("WorldlineWebhookObjectId")
diff --git a/crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
index a063c8525f..245e1ed244 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types::{PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, RefundsRouterData},
};
use hyperswitch_interfaces::{api::CurrencyUnit, errors};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay.rs b/crates/hyperswitch_connectors/src/connectors/worldpay.rs
index ab8d11f061..2334609697 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay.rs
@@ -60,7 +60,7 @@ use hyperswitch_interfaces::{
types::{self, PaymentsVoidType, Response},
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::Mask;
+use hyperswitch_masking::Mask;
#[cfg(feature = "payouts")]
use payout_requests::WorldpayPayoutRequest;
#[cfg(feature = "payouts")]
@@ -111,7 +111,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::ACCEPT.to_string(),
@@ -149,7 +150,8 @@ impl ConnectorCommon for Worldpay {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = worldpay::WorldpayAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
@@ -227,7 +229,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -344,7 +347,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Wo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -447,7 +451,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Wor
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -589,7 +594,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -715,7 +721,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -829,7 +836,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -951,7 +959,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1063,7 +1072,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpay
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1158,7 +1168,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for World
&self,
req: &PayoutsRouterData<PoFulfill>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = worldpay_payout::WorldpayPayoutAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let headers = vec![
@@ -1294,7 +1305,9 @@ impl IncomingWebhook for Worldpay {
request: &IncomingWebhookRequestDetails<'_>,
merchant_id: &common_utils::id_type::MerchantId,
connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- _connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ _connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
connector_label: &str,
) -> CustomResult<bool, errors::ConnectorError> {
let connector_webhook_secrets = self
@@ -1368,7 +1381,8 @@ impl IncomingWebhook for Worldpay {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let body: WorldpayWebhookEventType = request
.body
.parse_struct("WorldpayWebhookEventType")
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs
index c9247ffd6c..424f1629d7 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs
index 3f209553df..4dd22305d8 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
router_response_types::PayoutsResponseData, types,
};
use hyperswitch_interfaces::{api, errors};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use super::{payout_requests::*, payout_response::*};
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
index d8aeea2b3b..b20aa2afa3 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize)]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
index 3f684a694d..f9556f5928 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
@@ -1,6 +1,6 @@
use error_stack::ResultExt;
use hyperswitch_interfaces::errors;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use url::Url;
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
index 7f58a37f23..d7034f43d2 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{api, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use super::{requests::*, response::*};
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs b/crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs
index d87a6074eb..9c55e8f4c1 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs
@@ -29,7 +29,7 @@ use hyperswitch_interfaces::{
types::*,
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails, WebhookContext},
};
-use masking::{Mask, Maskable};
+use hyperswitch_masking::{Mask, Maskable};
use transformers::*;
use crate::{
@@ -768,7 +768,7 @@ impl IncomingWebhook for Worldpaymodular {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, ConnectorError> {
let body: WorldpaymodularWebhookEventType = request
.body
.parse_struct("WorldpayWebhookEventType")
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs
index bebfdb2733..4ff9a108a2 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs
@@ -17,7 +17,7 @@ use hyperswitch_domain_models::{
types::*,
};
use hyperswitch_interfaces::{api::*, errors::ConnectorError};
-use masking::{ExposeInterface as _, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface as _, PeekInterface, Secret};
pub use request::*;
pub use response::*;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/request.rs b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/request.rs
index 521bb2c4cc..dd8c416509 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/request.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/request.rs
@@ -1,5 +1,5 @@
use common_utils::types::MinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/response.rs b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/response.rs
index 890d831c7b..aef5b5a30a 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/response.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers/response.rs
@@ -1,6 +1,6 @@
use hyperswitch_domain_models::{router_request_types::*, router_response_types::*};
use hyperswitch_interfaces::errors::ConnectorError;
-use masking::{ExposeInterface as _, Secret};
+use hyperswitch_masking::{ExposeInterface as _, Secret};
use serde::{Deserialize, Serialize};
use crate::utils::ForeignTryFrom;
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs b/crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs
index 9318b55620..d3f07072e5 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs
@@ -57,7 +57,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use transformers as worldpayvantiv;
use crate::{
@@ -110,7 +110,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -139,7 +140,8 @@ impl ConnectorCommon for Worldpayvantiv {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = worldpayvantiv::WorldpayvantivAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let auth_key = format!("{}:{}", auth.user.peek(), auth.password.peek());
@@ -213,7 +215,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -298,7 +301,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -393,7 +397,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Wor
&self,
req: &PaymentsSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.get_auth_header(&req.connector_auth_type)
}
@@ -464,7 +469,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -557,7 +563,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Wo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -643,7 +650,8 @@ impl ConnectorIntegration<PostCaptureVoid, PaymentsCancelPostCaptureData, Paymen
&self,
req: &PaymentsCancelPostCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -731,7 +739,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -824,7 +833,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpayv
&self,
req: &RefundSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.get_auth_header(&req.connector_auth_type)
}
@@ -901,7 +911,8 @@ impl ConnectorIntegration<Fetch, FetchDisputesRequestData, FetchDisputesResponse
&self,
req: &FetchDisputeRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -989,7 +1000,8 @@ impl ConnectorIntegration<Dsync, DisputeSyncData, DisputeSyncResponse> for World
&self,
req: &DisputeSyncRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -1069,7 +1081,8 @@ impl ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceRes
&self,
req: &SubmitEvidenceRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -1171,7 +1184,8 @@ impl ConnectorIntegration<Accept, AcceptDisputeRequestData, AcceptDisputeRespons
&self,
req: &AcceptDisputeRouterData,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
@@ -1273,7 +1287,8 @@ impl ConnectorIntegration<Upload, UploadFileRequestData, UploadFileResponse> for
&self,
req: &RouterData<Upload, UploadFileRequestData, UploadFileResponse>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
req.request.file_type.to_string().into(),
@@ -1378,7 +1393,8 @@ impl ConnectorIntegration<Retrieve, RetrieveFileRequestData, RetrieveFileRespons
&self,
req: &RouterData<Retrieve, RetrieveFileRequestData, RetrieveFileResponse>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.get_auth_header(&req.connector_auth_type)
}
@@ -1475,7 +1491,8 @@ impl webhooks::IncomingWebhook for Worldpayvantiv {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
index 2edcc8fd50..b1042e56e7 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
@@ -29,7 +29,7 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::logger;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs b/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs
index f3849f02ba..0dbecae1df 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs
@@ -57,7 +57,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use hyperswitch_masking::{ExposeInterface, Mask};
use transformers as worldpayxml;
use crate::{
@@ -107,7 +107,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.common_get_content_type().to_string().into(),
@@ -138,7 +139,8 @@ impl ConnectorCommon for Worldpayxml {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = worldpayxml::WorldpayxmlAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
@@ -232,7 +234,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -329,7 +332,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -427,7 +431,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Wor
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -518,7 +523,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -609,7 +615,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Wo
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -690,7 +697,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldpa
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -780,7 +788,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpayx
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -874,7 +883,8 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
&self,
req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = self.build_headers(req, connectors)?;
let cookie = worldpayxml::get_cookie_from_metadata(req.request.connector_meta.clone())?;
@@ -988,7 +998,8 @@ impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for World
&self,
req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1090,7 +1101,8 @@ impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Worldpay
&self,
req: &PayoutsRouterData<PoSync>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1185,7 +1197,8 @@ impl ConnectorIntegration<PoCancel, PayoutsData, PayoutsResponseData> for Worldp
&self,
req: &PayoutsRouterData<PoCancel>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -1267,7 +1280,7 @@ impl webhooks::IncomingWebhook for Worldpayxml {
_merchant_id: &common_utils::id_type::MerchantId,
_connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
_connector_account_details: common_utils::crypto::Encryptable<
- masking::Secret<serde_json::Value>,
+ hyperswitch_masking::Secret<serde_json::Value>,
>,
_connector_label: &str,
) -> CustomResult<bool, errors::ConnectorError> {
@@ -1333,7 +1346,8 @@ impl webhooks::IncomingWebhook for Worldpayxml {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let body_str = std::str::from_utf8(request.body)
.map_err(|_| errors::ConnectorError::WebhookBodyDecodingFailed)?;
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
index ea74e319c9..a716fb025f 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
@@ -34,8 +34,8 @@ use hyperswitch_domain_models::{
},
};
use hyperswitch_interfaces::{consts, errors};
+use hyperswitch_masking::{ExposeInterface, Secret};
use josekit;
-use masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
diff --git a/crates/hyperswitch_connectors/src/connectors/xendit.rs b/crates/hyperswitch_connectors/src/connectors/xendit.rs
index e7fc1fc441..83d7d78c40 100644
--- a/crates/hyperswitch_connectors/src/connectors/xendit.rs
+++ b/crates/hyperswitch_connectors/src/connectors/xendit.rs
@@ -51,8 +51,8 @@ use hyperswitch_interfaces::{
types::{self, PaymentsAuthorizeType, PaymentsCaptureType, PaymentsSyncType, Response},
webhooks,
};
+use hyperswitch_masking::{Mask, PeekInterface};
use image::EncodableLayout;
-use masking::{Mask, PeekInterface};
use transformers::{self as xendit, XenditEventType, XenditWebhookEvent};
use crate::{
@@ -102,7 +102,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -133,7 +134,8 @@ impl ConnectorCommon for Xendit {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = xendit::XenditAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let encoded_api_key = BASE64_ENGINE.encode(format!("{}:", auth.api_key.peek()));
@@ -208,7 +210,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
match &req.request.split_payments {
@@ -354,7 +357,8 @@ impl ConnectorIntegration<SettlementSplitCreate, SettlementSplitRequestData, Pay
&self,
req: &PaymentsSettlementSplitCreateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -438,7 +442,8 @@ impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResp
&self,
req: &PaymentsPreProcessingRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -520,7 +525,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Xen
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
match &req.request.split_payments {
@@ -643,7 +649,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
match &req.request.split_payments {
@@ -765,7 +772,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Xendit
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
if let Some(SplitRefundsRequest::XenditSplitRefund(sub_merchant_data)) =
&req.request.split_refunds
@@ -873,7 +881,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Xendit {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
if let Some(SplitRefundsRequest::XenditSplitRefund(sub_merchant_data)) =
&req.request.split_refunds
@@ -977,7 +986,9 @@ impl webhooks::IncomingWebhook for Xendit {
request: &webhooks::IncomingWebhookRequestDetails<'_>,
merchant_id: &common_utils::id_type::MerchantId,
connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- _connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ _connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
connector_label: &str,
) -> CustomResult<bool, errors::ConnectorError> {
let connector_webhook_secrets = self
@@ -1073,7 +1084,8 @@ impl webhooks::IncomingWebhook for Xendit {
fn get_webhook_resource_object(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let body: XenditWebhookEvent = request
.body
.parse_struct("XenditWebhookEvent")
diff --git a/crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs b/crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs
index 29a047929a..4ef9a790c8 100644
--- a/crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs
@@ -24,7 +24,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/zen.rs b/crates/hyperswitch_connectors/src/connectors/zen.rs
index 6d6c3c4e69..31f14a3809 100644
--- a/crates/hyperswitch_connectors/src/connectors/zen.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zen.rs
@@ -47,7 +47,7 @@ use hyperswitch_interfaces::{
IncomingWebhook, IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext,
},
};
-use masking::{Mask, PeekInterface, Secret};
+use hyperswitch_masking::{Mask, PeekInterface, Secret};
use transformers::{self as zen, ZenPaymentStatus, ZenWebhookTxnType};
use uuid::Uuid;
@@ -70,7 +70,7 @@ impl api::RefundExecute for Zen {}
impl api::RefundSync for Zen {}
impl Zen {
- fn get_default_header() -> (String, masking::Maskable<String>) {
+ fn get_default_header() -> (String, hyperswitch_masking::Maskable<String>) {
("request-id".to_string(), Uuid::new_v4().to_string().into())
}
}
@@ -83,7 +83,8 @@ where
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -116,7 +117,8 @@ impl ConnectorCommon for Zen {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let auth = zen::ZenAuthType::try_from(auth_type)?;
Ok(vec![(
headers::AUTHORIZATION.to_string(),
@@ -199,7 +201,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
let api_headers = match req.request.payment_method_data {
PaymentMethodData::Wallet(_) => None,
@@ -300,7 +303,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Zen
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
headers.push(Self::get_default_header());
Ok(headers)
@@ -398,7 +402,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Zen {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
headers.push(Self::get_default_header());
Ok(headers)
@@ -483,7 +488,8 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Zen {
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let mut headers = self.build_headers(req, connectors)?;
headers.push(Self::get_default_header());
Ok(headers)
@@ -673,7 +679,8 @@ impl IncomingWebhook for Zen {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let reference_object: serde_json::Value = serde_json::from_slice(request.body)
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(reference_object))
diff --git a/crates/hyperswitch_connectors/src/connectors/zen/transformers.rs b/crates/hyperswitch_connectors/src/connectors/zen/transformers.rs
index 803e46687d..f8e4b3f278 100644
--- a/crates/hyperswitch_connectors/src/connectors/zen/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zen/transformers.rs
@@ -23,7 +23,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use ring::digest;
use serde::{Deserialize, Serialize};
use strum::Display;
diff --git a/crates/hyperswitch_connectors/src/connectors/zift.rs b/crates/hyperswitch_connectors/src/connectors/zift.rs
index 18c26536ed..d84f8dc9d0 100644
--- a/crates/hyperswitch_connectors/src/connectors/zift.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zift.rs
@@ -77,7 +77,8 @@ impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsRespons
&self,
req: &SetupMandateRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -161,7 +162,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -189,7 +191,8 @@ impl ConnectorCommon for Zift {
fn get_auth_header(
&self,
_auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
Ok(vec![])
}
@@ -259,7 +262,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -345,7 +349,8 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Zif
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -419,7 +424,8 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -501,7 +507,8 @@ impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Zi
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -575,7 +582,8 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Zift {
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -657,7 +665,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Zift {
// &self,
// req: &RefundSyncRouterData,
// connectors: &Connectors,
- // ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ // ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError> {
// self.build_headers(req, connectors)
// }
@@ -737,7 +745,8 @@ impl webhooks::IncomingWebhook for Zift {
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
index 34f95eccb3..1924d06c05 100644
--- a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
@@ -19,7 +19,7 @@ use hyperswitch_interfaces::{
consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
errors,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_connectors/src/connectors/zsl.rs b/crates/hyperswitch_connectors/src/connectors/zsl.rs
index a6a1b65c53..85dbbf19aa 100644
--- a/crates/hyperswitch_connectors/src/connectors/zsl.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zsl.rs
@@ -46,8 +46,8 @@ use hyperswitch_interfaces::{
IncomingWebhook, IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext,
},
};
+use hyperswitch_masking::{ExposeInterface, Secret};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Secret};
use transformers::{self as zsl, get_status};
use crate::{
@@ -79,7 +79,8 @@ where
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
@@ -145,7 +146,8 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
self.build_headers(req, connectors)
}
@@ -398,7 +400,8 @@ impl IncomingWebhook for Zsl {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
let response = get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
Ok(Box::new(response))
diff --git a/crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs b/crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs
index 800fdbb690..24f7826c45 100644
--- a/crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs
@@ -12,7 +12,7 @@ use hyperswitch_domain_models::{
types,
};
use hyperswitch_interfaces::{api, consts::NO_ERROR_CODE, errors};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use ring::digest;
use serde::{Deserialize, Serialize};
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index c836bc1194..0f997a0353 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -78,8 +78,8 @@ use hyperswitch_domain_models::{
types::{OrderDetailsWithAmount, SetupMandateRouterData},
};
use hyperswitch_interfaces::{api, consts, errors, types::Response};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use image::{DynamicImage, ImageBuffer, ImageFormat, Luma, Rgba};
-use masking::{ExposeInterface, PeekInterface, Secret};
use quick_xml::{
events::{BytesDecl, BytesText, Event},
Writer,
@@ -7783,11 +7783,11 @@ pub trait CustomerDetails {
fn get_customer_id(&self) -> Result<id_type::CustomerId, errors::ConnectorError>;
fn get_customer_name(
&self,
- ) -> Result<Secret<String, masking::WithType>, errors::ConnectorError>;
+ ) -> Result<Secret<String, hyperswitch_masking::WithType>, errors::ConnectorError>;
fn get_customer_email(&self) -> Result<Email, errors::ConnectorError>;
fn get_customer_phone(
&self,
- ) -> Result<Secret<String, masking::WithType>, errors::ConnectorError>;
+ ) -> Result<Secret<String, hyperswitch_masking::WithType>, errors::ConnectorError>;
fn get_customer_phone_country_code(&self) -> Result<String, errors::ConnectorError>;
}
@@ -7803,7 +7803,7 @@ impl CustomerDetails for hyperswitch_domain_models::router_request_types::Custom
fn get_customer_name(
&self,
- ) -> Result<Secret<String, masking::WithType>, errors::ConnectorError> {
+ ) -> Result<Secret<String, hyperswitch_masking::WithType>, errors::ConnectorError> {
self.name
.clone()
.ok_or(errors::ConnectorError::MissingRequiredField {
@@ -7821,7 +7821,7 @@ impl CustomerDetails for hyperswitch_domain_models::router_request_types::Custom
fn get_customer_phone(
&self,
- ) -> Result<Secret<String, masking::WithType>, errors::ConnectorError> {
+ ) -> Result<Secret<String, hyperswitch_masking::WithType>, errors::ConnectorError> {
self.phone
.clone()
.ok_or(errors::ConnectorError::MissingRequiredField {
diff --git a/crates/hyperswitch_domain_models/Cargo.toml b/crates/hyperswitch_domain_models/Cargo.toml
index 6d3ef7efee..5a117b3e09 100644
--- a/crates/hyperswitch_domain_models/Cargo.toml
+++ b/crates/hyperswitch_domain_models/Cargo.toml
@@ -27,7 +27,7 @@ common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils", features = ["async_ext", "metrics", "keymanager"] }
common_types = { version = "0.1.0", path = "../common_types" }
diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"], default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
payment_link = { version = "0.1.0", path = "../payment_link", default-features = false }
router_derive = { version = "0.1.0", path = "../router_derive" }
router_env = { version = "0.1.0", path = "../router_env" }
diff --git a/crates/hyperswitch_domain_models/src/address.rs b/crates/hyperswitch_domain_models/src/address.rs
index a816deab7c..f7d5f05359 100644
--- a/crates/hyperswitch_domain_models/src/address.rs
+++ b/crates/hyperswitch_domain_models/src/address.rs
@@ -1,4 +1,4 @@
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
#[derive(Default, Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct Address {
@@ -7,7 +7,7 @@ pub struct Address {
pub email: Option<common_utils::pii::Email>,
}
-impl masking::SerializableSecret for Address {}
+impl hyperswitch_masking::SerializableSecret for Address {}
impl Address {
/// Unify the address, giving priority to `self` when details are present in both
diff --git a/crates/hyperswitch_domain_models/src/api.rs b/crates/hyperswitch_domain_models/src/api.rs
index b0280d9e42..6ed5265fb0 100644
--- a/crates/hyperswitch_domain_models/src/api.rs
+++ b/crates/hyperswitch_domain_models/src/api.rs
@@ -16,7 +16,7 @@ pub enum ApplicationResponse<R> {
Form(Box<RedirectionFormData>),
PaymentLinkForm(Box<PaymentLinkAction>),
FileData((Vec<u8>, mime::Mime)),
- JsonWithHeaders((R, Vec<(String, masking::Maskable<String>)>)),
+ JsonWithHeaders((R, Vec<(String, hyperswitch_masking::Maskable<String>)>)),
GenericLinkForm(Box<GenericLinks>),
}
diff --git a/crates/hyperswitch_domain_models/src/authentication.rs b/crates/hyperswitch_domain_models/src/authentication.rs
index 4e2ed695ef..eea880dad0 100644
--- a/crates/hyperswitch_domain_models/src/authentication.rs
+++ b/crates/hyperswitch_domain_models/src/authentication.rs
@@ -10,7 +10,7 @@ use common_utils::{
types::keymanager::{Identifier, KeyManagerState, ToEncryptable},
};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use rustc_hash::FxHashMap;
use serde_json::Value;
diff --git a/crates/hyperswitch_domain_models/src/behaviour.rs b/crates/hyperswitch_domain_models/src/behaviour.rs
index 29f9d6bab7..03ad6750cd 100644
--- a/crates/hyperswitch_domain_models/src/behaviour.rs
+++ b/crates/hyperswitch_domain_models/src/behaviour.rs
@@ -2,7 +2,7 @@ use common_utils::{
errors::{CustomResult, ValidationError},
types::keymanager::{Identifier, KeyManagerState},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
/// Trait for converting domain types to storage models
#[async_trait::async_trait]
diff --git a/crates/hyperswitch_domain_models/src/bulk_tokenization.rs b/crates/hyperswitch_domain_models/src/bulk_tokenization.rs
index 5b3b6d655b..0c72a4636c 100644
--- a/crates/hyperswitch_domain_models/src/bulk_tokenization.rs
+++ b/crates/hyperswitch_domain_models/src/bulk_tokenization.rs
@@ -32,11 +32,11 @@ pub enum TokenizeDataRequest {
#[derive(Clone, Debug)]
pub struct TokenizeCardRequest {
pub raw_card_number: CardNumber,
- pub card_expiry_month: masking::Secret<String>,
- pub card_expiry_year: masking::Secret<String>,
- pub card_cvc: Option<masking::Secret<String>>,
- pub card_holder_name: Option<masking::Secret<String>>,
- pub nick_name: Option<masking::Secret<String>>,
+ pub card_expiry_month: hyperswitch_masking::Secret<String>,
+ pub card_expiry_year: hyperswitch_masking::Secret<String>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
pub card_issuing_country: Option<String>,
pub card_issuing_country_code: Option<String>,
pub card_network: Option<enums::CardNetwork>,
@@ -47,18 +47,18 @@ pub struct TokenizeCardRequest {
#[derive(Clone, Debug)]
pub struct TokenizePaymentMethodRequest {
pub payment_method_id: String,
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Default, Debug, serde::Deserialize, serde::Serialize)]
pub struct CardNetworkTokenizeRecord {
// Card details
pub raw_card_number: Option<CardNumber>,
- pub card_expiry_month: Option<masking::Secret<String>>,
- pub card_expiry_year: Option<masking::Secret<String>>,
- pub card_cvc: Option<masking::Secret<String>>,
- pub card_holder_name: Option<masking::Secret<String>>,
- pub nick_name: Option<masking::Secret<String>>,
+ pub card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ pub card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
+ pub nick_name: Option<hyperswitch_masking::Secret<String>>,
pub card_issuing_country: Option<String>,
pub card_issuing_country_code: Option<String>,
pub card_network: Option<enums::CardNetwork>,
@@ -73,28 +73,28 @@ pub struct CardNetworkTokenizeRecord {
// Customer details
pub customer_id: id_type::CustomerId,
#[serde(rename = "name")]
- pub customer_name: Option<masking::Secret<String>>,
+ pub customer_name: Option<hyperswitch_masking::Secret<String>>,
#[serde(rename = "email")]
pub customer_email: Option<pii::Email>,
#[serde(rename = "phone")]
- pub customer_phone: Option<masking::Secret<String>>,
+ pub customer_phone: Option<hyperswitch_masking::Secret<String>>,
#[serde(rename = "phone_country_code")]
pub customer_phone_country_code: Option<String>,
#[serde(rename = "tax_registration_id")]
- pub customer_tax_registration_id: Option<masking::Secret<String>>,
+ pub customer_tax_registration_id: Option<hyperswitch_masking::Secret<String>>,
#[serde(rename = "document_details")]
pub customer_document_details: Option<api_models::customers::CustomerDocumentDetails>,
// Billing details
pub billing_address_city: Option<String>,
pub billing_address_country: Option<enums::CountryAlpha2>,
- pub billing_address_line1: Option<masking::Secret<String>>,
- pub billing_address_line2: Option<masking::Secret<String>>,
- pub billing_address_line3: Option<masking::Secret<String>>,
- pub billing_address_zip: Option<masking::Secret<String>>,
- pub billing_address_state: Option<masking::Secret<String>>,
- pub billing_address_first_name: Option<masking::Secret<String>>,
- pub billing_address_last_name: Option<masking::Secret<String>>,
- pub billing_phone_number: Option<masking::Secret<String>>,
+ pub billing_address_line1: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_line2: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_line3: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_zip: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_state: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_first_name: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_address_last_name: Option<hyperswitch_masking::Secret<String>>,
+ pub billing_phone_number: Option<hyperswitch_masking::Secret<String>>,
pub billing_phone_country_code: Option<String>,
pub billing_email: Option<pii::Email>,
@@ -201,7 +201,7 @@ impl ForeignTryFrom<CardNetworkTokenizeRecord> for payment_methods_api::CardNetw
impl ForeignFrom<&TokenizeCardRequest> for payment_methods_api::MigrateCardDetail {
fn foreign_from(card: &TokenizeCardRequest) -> Self {
Self {
- card_number: masking::Secret::new(card.raw_card_number.get_card_no()),
+ card_number: hyperswitch_masking::Secret::new(card.raw_card_number.get_card_no()),
card_exp_month: card.card_expiry_month.clone(),
card_exp_year: card.card_expiry_year.clone(),
card_holder_name: card.card_holder_name.clone(),
diff --git a/crates/hyperswitch_domain_models/src/business_profile.rs b/crates/hyperswitch_domain_models/src/business_profile.rs
index 00efb24a13..79e8fc5103 100644
--- a/crates/hyperswitch_domain_models/src/business_profile.rs
+++ b/crates/hyperswitch_domain_models/src/business_profile.rs
@@ -19,7 +19,7 @@ use diesel_models::business_profile::{
ProfileUpdateInternal, WebhookDetails,
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::logger;
use crate::{
diff --git a/crates/hyperswitch_domain_models/src/chat.rs b/crates/hyperswitch_domain_models/src/chat.rs
index 9243f535c0..fcde505ac1 100644
--- a/crates/hyperswitch_domain_models/src/chat.rs
+++ b/crates/hyperswitch_domain_models/src/chat.rs
@@ -1,5 +1,5 @@
use common_utils::id_type;
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct GetDataMessage {
diff --git a/crates/hyperswitch_domain_models/src/connector_endpoints.rs b/crates/hyperswitch_domain_models/src/connector_endpoints.rs
index eed43cbd2d..87e5eefe4c 100644
--- a/crates/hyperswitch_domain_models/src/connector_endpoints.rs
+++ b/crates/hyperswitch_domain_models/src/connector_endpoints.rs
@@ -1,7 +1,7 @@
//! Configs interface
use common_enums::{connector_enums, ApplicationError};
use common_utils::errors::CustomResult;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::Deserialize;
use crate::errors::api_error_response;
diff --git a/crates/hyperswitch_domain_models/src/customer.rs b/crates/hyperswitch_domain_models/src/customer.rs
index 4b092c1db6..c9007d0cf5 100644
--- a/crates/hyperswitch_domain_models/src/customer.rs
+++ b/crates/hyperswitch_domain_models/src/customer.rs
@@ -17,7 +17,7 @@ use diesel_models::{
customers as storage_types, customers::CustomerUpdateInternal, query::customers as query,
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret, SwitchStrategy};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret, SwitchStrategy};
use router_env::{instrument, tracing};
use rustc_hash::FxHashMap;
use serde_json::Value;
@@ -109,7 +109,7 @@ impl Customer {
pub fn get_connector_customer_map(
&self,
) -> FxHashMap<id_type::MerchantConnectorAccountId, String> {
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
if let Some(connector_customer_value) = &self.connector_customer {
connector_customer_value
.peek()
@@ -124,7 +124,7 @@ impl Customer {
/// Get the connector customer ID for the specified connector label, if present
#[cfg(feature = "v1")]
pub fn get_connector_customer_id(&self, connector_label: &str) -> Option<&str> {
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
self.connector_customer
.as_ref()
diff --git a/crates/hyperswitch_domain_models/src/invoice.rs b/crates/hyperswitch_domain_models/src/invoice.rs
index f4609443ec..65d4cd007c 100644
--- a/crates/hyperswitch_domain_models/src/invoice.rs
+++ b/crates/hyperswitch_domain_models/src/invoice.rs
@@ -7,7 +7,7 @@ use common_utils::{
MinorUnit,
},
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use utoipa::ToSchema;
use crate::merchant_key_store::MerchantKeyStore;
diff --git a/crates/hyperswitch_domain_models/src/merchant_account.rs b/crates/hyperswitch_domain_models/src/merchant_account.rs
index a4c76bfac8..8ad8fe3aab 100644
--- a/crates/hyperswitch_domain_models/src/merchant_account.rs
+++ b/crates/hyperswitch_domain_models/src/merchant_account.rs
@@ -11,7 +11,7 @@ use diesel_models::{
enums::MerchantStorageScheme, merchant_account::MerchantAccountUpdateInternal,
};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::logger;
use crate::{
diff --git a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
index db11e4dc33..d7bf5d0488 100644
--- a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
+++ b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
@@ -21,7 +21,7 @@ use diesel_models::{
merchant_connector_account::{self as storage, MerchantConnectorAccountUpdateInternal},
};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use rustc_hash::FxHashMap;
use serde_json::Value;
diff --git a/crates/hyperswitch_domain_models/src/merchant_key_store.rs b/crates/hyperswitch_domain_models/src/merchant_key_store.rs
index c1c4afeb93..df8d0ef056 100644
--- a/crates/hyperswitch_domain_models/src/merchant_key_store.rs
+++ b/crates/hyperswitch_domain_models/src/merchant_key_store.rs
@@ -6,7 +6,7 @@ use common_utils::{
types::keymanager::{self, KeyManagerState},
};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use time::PrimitiveDateTime;
use crate::type_encryption::{crypto_operation, CryptoOperation};
diff --git a/crates/hyperswitch_domain_models/src/payment_method_data.rs b/crates/hyperswitch_domain_models/src/payment_method_data.rs
index b490881533..82569722bc 100644
--- a/crates/hyperswitch_domain_models/src/payment_method_data.rs
+++ b/crates/hyperswitch_domain_models/src/payment_method_data.rs
@@ -18,7 +18,7 @@ use common_utils::{
payout_method_utils,
pii::{self, Email},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use time::Date;
diff --git a/crates/hyperswitch_domain_models/src/payment_methods.rs b/crates/hyperswitch_domain_models/src/payment_methods.rs
index 6b66c5fddc..9a9af38119 100644
--- a/crates/hyperswitch_domain_models/src/payment_methods.rs
+++ b/crates/hyperswitch_domain_models/src/payment_methods.rs
@@ -22,7 +22,7 @@ pub use diesel_models::{
enums as storage_enums, PaymentMethodUpdate as StoragePaymentMethodUpdate,
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
#[cfg(feature = "v1")]
use router_env::logger;
#[cfg(feature = "v2")]
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index ffab0824e1..cd12ae6ed1 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -27,7 +27,7 @@ use diesel_models::payment_intent::TaxDetails;
use error_stack::Report;
#[cfg(feature = "v2")]
use error_stack::ResultExt;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_derive::ToEncryption;
use rustc_hash::FxHashMap;
use serde_json::Value;
@@ -48,7 +48,7 @@ use common_enums as storage_enums;
use diesel_models::types::{FeatureMetadata, OrderDetailsWithAmount};
#[cfg(feature = "v1")]
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use self::{payment_attempt::PaymentAttempt, payment_intent::CustomerData};
#[cfg(feature = "v2")]
@@ -276,7 +276,7 @@ impl PaymentIntent {
type_name: &'static str,
) -> CustomResult<Option<T>, common_utils::errors::ParsingError>
where
- T: for<'de> masking::Deserialize<'de>,
+ T: for<'de> hyperswitch_masking::Deserialize<'de>,
{
self.metadata
.clone()
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 3e2f5c94f3..f07dcb283f 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -39,8 +39,8 @@ use diesel_models::{
};
use error_stack::ResultExt;
#[cfg(feature = "v2")]
-use masking::ExposeInterface;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{PeekInterface, Secret};
#[cfg(feature = "v1")]
use router_env::logger;
use rustc_hash::FxHashMap;
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
index 9157f2dd6d..570c26da98 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
@@ -24,8 +24,8 @@ use diesel_models::{
};
use error_stack::ResultExt;
#[cfg(feature = "v2")]
-use masking::ExposeInterface;
-use masking::{Deserialize, PeekInterface, Secret};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{Deserialize, PeekInterface, Secret};
use serde::Serialize;
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_domain_models/src/relay.rs b/crates/hyperswitch_domain_models/src/relay.rs
index c0a3ed75a1..7b3bf40e4b 100644
--- a/crates/hyperswitch_domain_models/src/relay.rs
+++ b/crates/hyperswitch_domain_models/src/relay.rs
@@ -9,7 +9,7 @@ use common_utils::{
};
use diesel_models::relay::RelayUpdateInternal;
use error_stack::ResultExt;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{self, Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index b41ee89084..3df34f4d77 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -10,7 +10,7 @@ use common_utils::{
types::MinorUnit,
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
diff --git a/crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs b/crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs
index c7f155fa16..bca67675f3 100644
--- a/crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs
+++ b/crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs
@@ -5,17 +5,17 @@ pub struct VerifyWebhookSource;
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorMandateDetails {
- pub connector_mandate_id: masking::Secret<String>,
+ pub connector_mandate_id: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, Clone, Serialize)]
-pub struct ConnectorNetworkTxnId(masking::Secret<String>);
+pub struct ConnectorNetworkTxnId(hyperswitch_masking::Secret<String>);
impl ConnectorNetworkTxnId {
- pub fn new(txn_id: masking::Secret<String>) -> Self {
+ pub fn new(txn_id: hyperswitch_masking::Secret<String>) -> Self {
Self(txn_id)
}
- pub fn get_id(&self) -> &masking::Secret<String> {
+ pub fn get_id(&self) -> &hyperswitch_masking::Secret<String> {
&self.0
}
}
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index 7b6f64755e..32d2a9139b 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -16,7 +16,7 @@ use common_utils::{
};
use diesel_models::{enums as storage_enums, types::OrderDetailsWithAmount};
use error_stack::ResultExt;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
@@ -1562,11 +1562,11 @@ pub struct PayoutsData {
#[derive(Debug, Default, Clone)]
pub struct CustomerDetails {
pub customer_id: Option<id_type::CustomerId>,
- pub name: Option<Secret<String, masking::WithType>>,
+ pub name: Option<Secret<String, hyperswitch_masking::WithType>>,
pub email: Option<pii::Email>,
- pub phone: Option<Secret<String, masking::WithType>>,
+ pub phone: Option<Secret<String, hyperswitch_masking::WithType>>,
pub phone_country_code: Option<String>,
- pub tax_registration_id: Option<Secret<String, masking::WithType>>,
+ pub tax_registration_id: Option<Secret<String, hyperswitch_masking::WithType>>,
pub document_details: Option<api_models::customers::CustomerDocumentDetails>,
}
diff --git a/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs b/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs
index c98bcb7d84..7f108b20a7 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs
@@ -181,7 +181,7 @@ pub struct ExternalThreeDSConnectorMetadata {
#[derive(Clone, Debug)]
pub struct AuthenticationStore {
- pub cavv: Option<masking::Secret<String>>,
+ pub cavv: Option<hyperswitch_masking::Secret<String>>,
pub authentication: authentication::Authentication,
}
diff --git a/crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs b/crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs
index 469c974186..f6cd17768b 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs
@@ -3,7 +3,7 @@ use common_utils::{
pii::Email,
};
use diesel_models::types::OrderDetailsWithAmount;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
diff --git a/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs b/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs
index e1ba076af0..b1854f846d 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs
@@ -2,7 +2,7 @@ use api_models::payments::DeviceChannel;
use common_enums::{MerchantCategoryCode, RoutingRegion};
use common_types::payments::MerchantCountryCode;
use common_utils::types::MinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use crate::address::Address;
diff --git a/crates/hyperswitch_domain_models/src/router_response_types.rs b/crates/hyperswitch_domain_models/src/router_response_types.rs
index b57f10bc99..9112863740 100644
--- a/crates/hyperswitch_domain_models/src/router_response_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_response_types.rs
@@ -175,14 +175,16 @@ impl CaptureSyncResponse {
}
}
impl PaymentsResponseData {
- pub fn get_connector_metadata(&self) -> Option<masking::Secret<serde_json::Value>> {
+ pub fn get_connector_metadata(&self) -> Option<hyperswitch_masking::Secret<serde_json::Value>> {
match self {
Self::TransactionResponse {
connector_metadata, ..
}
| Self::PreProcessingResponse {
connector_metadata, ..
- } => connector_metadata.clone().map(masking::Secret::new),
+ } => connector_metadata
+ .clone()
+ .map(hyperswitch_masking::Secret::new),
_ => None,
}
}
@@ -368,7 +370,7 @@ pub enum RedirectForm {
Nmi {
amount: String,
currency: common_enums::Currency,
- public_key: masking::Secret<String>,
+ public_key: hyperswitch_masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
@@ -668,7 +670,7 @@ pub enum AuthenticationResponseData {
},
AuthNResponse {
authn_flow_type: AuthNFlowType,
- authentication_value: Option<masking::Secret<String>>,
+ authentication_value: Option<hyperswitch_masking::Secret<String>>,
trans_status: common_enums::TransactionStatus,
connector_metadata: Option<serde_json::Value>,
ds_trans_id: Option<String>,
@@ -680,7 +682,7 @@ pub enum AuthenticationResponseData {
},
PostAuthNResponse {
trans_status: common_enums::TransactionStatus,
- authentication_value: Option<masking::Secret<String>>,
+ authentication_value: Option<hyperswitch_masking::Secret<String>>,
eci: Option<String>,
challenge_cancel: Option<String>,
challenge_code_reason: Option<String>,
@@ -771,8 +773,8 @@ impl PaymentMethodDetails {
#[derive(Debug, Clone)]
pub enum VaultResponseData {
ExternalVaultCreateResponse {
- session_id: masking::Secret<String>,
- client_secret: masking::Secret<String>,
+ session_id: hyperswitch_masking::Secret<String>,
+ client_secret: hyperswitch_masking::Secret<String>,
},
ExternalVaultInsertResponse {
connector_vault_id: VaultIdType,
@@ -795,16 +797,16 @@ pub enum VaultIdType {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum MultiVaultIdType {
Card {
- tokenized_card_number: Option<masking::Secret<String>>,
- tokenized_card_expiry_year: Option<masking::Secret<String>>,
- tokenized_card_expiry_month: Option<masking::Secret<String>>,
- tokenized_card_cvc: Option<masking::Secret<String>>,
+ tokenized_card_number: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_card_expiry_year: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_card_expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_card_cvc: Option<hyperswitch_masking::Secret<String>>,
},
NetworkToken {
- tokenized_network_token: Option<masking::Secret<String>>,
- tokenized_network_token_exp_year: Option<masking::Secret<String>>,
- tokenized_network_token_exp_month: Option<masking::Secret<String>>,
- tokenized_cryptogram: Option<masking::Secret<String>>,
+ tokenized_network_token: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_network_token_exp_year: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_network_token_exp_month: Option<hyperswitch_masking::Secret<String>>,
+ tokenized_cryptogram: Option<hyperswitch_masking::Secret<String>>,
},
}
diff --git a/crates/hyperswitch_domain_models/src/subscription.rs b/crates/hyperswitch_domain_models/src/subscription.rs
index 36110a1f19..55122927a9 100644
--- a/crates/hyperswitch_domain_models/src/subscription.rs
+++ b/crates/hyperswitch_domain_models/src/subscription.rs
@@ -6,7 +6,7 @@ use common_utils::{
types::keymanager::{self, KeyManagerState},
};
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use time::PrimitiveDateTime;
use crate::{errors::api_error_response::ApiErrorResponse, merchant_key_store::MerchantKeyStore};
diff --git a/crates/hyperswitch_domain_models/src/tokenization.rs b/crates/hyperswitch_domain_models/src/tokenization.rs
index d157445a79..ebb9654503 100644
--- a/crates/hyperswitch_domain_models/src/tokenization.rs
+++ b/crates/hyperswitch_domain_models/src/tokenization.rs
@@ -3,7 +3,7 @@ use common_utils::{
errors::{CustomResult, ValidationError},
types::keymanager,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/hyperswitch_domain_models/src/type_encryption.rs b/crates/hyperswitch_domain_models/src/type_encryption.rs
index da8c1f331f..d309b7f5f5 100644
--- a/crates/hyperswitch_domain_models/src/type_encryption.rs
+++ b/crates/hyperswitch_domain_models/src/type_encryption.rs
@@ -8,7 +8,7 @@ use common_utils::{
types::keymanager::{Identifier, KeyManagerState},
};
use encrypt::TypeEncryption;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::{instrument, tracing};
use rustc_hash::FxHashMap;
@@ -29,7 +29,7 @@ mod encrypt {
};
use error_stack::ResultExt;
use http::Method;
- use masking::{PeekInterface, Secret};
+ use hyperswitch_masking::{PeekInterface, Secret};
use router_env::{instrument, logger, tracing};
use rustc_hash::FxHashMap;
@@ -39,7 +39,7 @@ mod encrypt {
pub trait TypeEncryption<
T,
V: crypto::EncodeMessage + crypto::DecodeMessage,
- S: masking::Strategy<T>,
+ S: hyperswitch_masking::Strategy<T>,
>: Sized
{
async fn encrypt_via_api(
@@ -102,7 +102,7 @@ mod encrypt {
#[async_trait]
impl<
V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static,
- S: masking::Strategy<String> + Send + Sync,
+ S: hyperswitch_masking::Strategy<String> + Send + Sync,
> TypeEncryption<String, V, S> for crypto::Encryptable<Secret<String, S>>
{
// Do not remove the `skip_all` as the key would be logged otherwise
@@ -339,7 +339,7 @@ mod encrypt {
#[async_trait]
impl<
V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static,
- S: masking::Strategy<serde_json::Value> + Send + Sync,
+ S: hyperswitch_masking::Strategy<serde_json::Value> + Send + Sync,
> TypeEncryption<serde_json::Value, V, S>
for crypto::Encryptable<Secret<serde_json::Value, S>>
{
@@ -587,7 +587,7 @@ mod encrypt {
bytes: Secret<Vec<u8>>,
) -> CustomResult<Secret<Self, S>, errors::ParsingError>
where
- S: masking::Strategy<Self>,
+ S: hyperswitch_masking::Strategy<Self>,
{
bytes
.peek()
@@ -602,7 +602,7 @@ mod encrypt {
impl<
T: std::fmt::Debug + Clone + serde::Serialize + serde::de::DeserializeOwned + Send,
V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static,
- S: masking::Strategy<EncryptedJsonType<T>> + Send + Sync,
+ S: hyperswitch_masking::Strategy<EncryptedJsonType<T>> + Send + Sync,
> TypeEncryption<EncryptedJsonType<T>, V, S>
for crypto::Encryptable<Secret<EncryptedJsonType<T>, S>>
{
@@ -812,7 +812,7 @@ mod encrypt {
#[async_trait]
impl<
V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static,
- S: masking::Strategy<Vec<u8>> + Send + Sync,
+ S: hyperswitch_masking::Strategy<Vec<u8>> + Send + Sync,
> TypeEncryption<Vec<u8>, V, S> for crypto::Encryptable<Secret<Vec<u8>, S>>
{
// Do not remove the `skip_all` as the key would be logged otherwise
@@ -1128,7 +1128,7 @@ async fn encrypt<E: Clone, S>(
key: &[u8],
) -> CustomResult<crypto::Encryptable<Secret<E, S>>, CryptoError>
where
- S: masking::Strategy<E>,
+ S: hyperswitch_masking::Strategy<E>,
crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>,
{
record_operation_time(
@@ -1145,7 +1145,7 @@ async fn encrypt_locally<E: Clone, S>(
key: &[u8],
) -> CustomResult<crypto::Encryptable<Secret<E, S>>, CryptoError>
where
- S: masking::Strategy<E>,
+ S: hyperswitch_masking::Strategy<E>,
crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>,
{
record_operation_time(
@@ -1164,7 +1164,7 @@ async fn batch_encrypt<E: Clone, S>(
key: &[u8],
) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError>
where
- S: masking::Strategy<E>,
+ S: hyperswitch_masking::Strategy<E>,
crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>,
{
if !inner.is_empty() {
@@ -1194,7 +1194,7 @@ async fn encrypt_optional<E: Clone, S>(
) -> CustomResult<Option<crypto::Encryptable<Secret<E, S>>>, CryptoError>
where
Secret<E, S>: Send,
- S: masking::Strategy<E>,
+ S: hyperswitch_masking::Strategy<E>,
crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>,
{
inner
@@ -1204,7 +1204,7 @@ where
}
#[inline]
-async fn decrypt_optional<T: Clone, S: masking::Strategy<T>>(
+async fn decrypt_optional<T: Clone, S: hyperswitch_masking::Strategy<T>>(
state: &KeyManagerState,
inner: Option<Encryption>,
identifier: Identifier,
@@ -1220,7 +1220,7 @@ where
}
#[inline]
-async fn decrypt<T: Clone, S: masking::Strategy<T>>(
+async fn decrypt<T: Clone, S: hyperswitch_masking::Strategy<T>>(
state: &KeyManagerState,
inner: Encryption,
identifier: Identifier,
@@ -1238,7 +1238,7 @@ where
}
#[inline]
-async fn decrypt_locally<T: Clone, S: masking::Strategy<T>>(
+async fn decrypt_locally<T: Clone, S: hyperswitch_masking::Strategy<T>>(
inner: Encryption,
key: &[u8],
) -> CustomResult<crypto::Encryptable<Secret<T, S>>, CryptoError>
@@ -1261,7 +1261,7 @@ async fn batch_decrypt<E: Clone, S>(
key: &[u8],
) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError>
where
- S: masking::Strategy<E>,
+ S: hyperswitch_masking::Strategy<E>,
crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>,
{
if !inner.is_empty() {
@@ -1282,7 +1282,7 @@ where
}
}
-pub enum CryptoOperation<T: Clone, S: masking::Strategy<T>> {
+pub enum CryptoOperation<T: Clone, S: hyperswitch_masking::Strategy<T>> {
Encrypt(Secret<T, S>),
EncryptOptional(Option<Secret<T, S>>),
EncryptLocally(Secret<T, S>),
@@ -1295,7 +1295,7 @@ pub enum CryptoOperation<T: Clone, S: masking::Strategy<T>> {
#[derive(router_derive::TryGetEnumVariant)]
#[error(CryptoError::EncodingFailed)]
-pub enum CryptoOutput<T: Clone, S: masking::Strategy<T>> {
+pub enum CryptoOutput<T: Clone, S: hyperswitch_masking::Strategy<T>> {
Operation(crypto::Encryptable<Secret<T, S>>),
OptionalOperation(Option<crypto::Encryptable<Secret<T, S>>>),
BatchOperation(FxHashMap<String, crypto::Encryptable<Secret<T, S>>>),
@@ -1303,7 +1303,7 @@ pub enum CryptoOutput<T: Clone, S: masking::Strategy<T>> {
// Do not remove the `skip_all` as the key would be logged otherwise
#[instrument(skip_all, fields(table = table_name))]
-pub async fn crypto_operation<T: Clone + Send, S: masking::Strategy<T>>(
+pub async fn crypto_operation<T: Clone + Send, S: hyperswitch_masking::Strategy<T>>(
state: &KeyManagerState,
table_name: &str,
operation: CryptoOperation<T, S>,
@@ -1355,12 +1355,12 @@ fn obtain_data_to_decrypt_locally<S>(
encrypted_data: Secret<Vec<u8>, S>,
) -> CustomResult<Secret<Vec<u8>, S>, CryptoError>
where
- S: masking::Strategy<Vec<u8>>,
+ S: hyperswitch_masking::Strategy<Vec<u8>>,
{
use base64::Engine;
use common_utils::consts::BASE64_ENGINE;
use error_stack::ResultExt;
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
if let Some((_version, base64_encoded_data)) = split_version_prefix(encrypted_data.peek()) {
// Data encrypted by encryption service.
diff --git a/crates/hyperswitch_domain_models/src/vault.rs b/crates/hyperswitch_domain_models/src/vault.rs
index bca75f1087..c16265e5a1 100644
--- a/crates/hyperswitch_domain_models/src/vault.rs
+++ b/crates/hyperswitch_domain_models/src/vault.rs
@@ -25,15 +25,15 @@ pub enum FingerprintData {
#[derive(Debug, Default, Deserialize, Serialize, Clone)]
pub struct FingerprintCardData {
card_number: cards::CardNumber,
- card_exp_month: masking::Secret<String>,
- card_exp_year: masking::Secret<String>,
+ card_exp_month: hyperswitch_masking::Secret<String>,
+ card_exp_year: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, Default, Deserialize, Serialize, Clone)]
pub struct FingerprintNetworkTokenData {
network_token: cards::NetworkToken,
- network_token_exp_month: masking::Secret<String>,
- network_token_exp_year: masking::Secret<String>,
+ network_token_exp_month: hyperswitch_masking::Secret<String>,
+ network_token_exp_year: hyperswitch_masking::Secret<String>,
}
impl PaymentMethodVaultingData {
@@ -47,7 +47,7 @@ impl PaymentMethodVaultingData {
}
#[cfg(feature = "v2")]
- pub fn set_card_cvc(&mut self, card_cvc: masking::Secret<String>) {
+ pub fn set_card_cvc(&mut self, card_cvc: hyperswitch_masking::Secret<String>) {
match self {
Self::Card(card_details) => {
card_details.card_cvc = Some(card_cvc);
@@ -123,7 +123,7 @@ impl PaymentMethodVaultingData {
#[cfg(feature = "v2")]
pub fn populated_payment_methods_data_for_payment_method_vaulting_data_card_number(
card_number: &cards::CardNumber,
- card_cvc: Option<masking::Secret<String>>,
+ card_cvc: Option<hyperswitch_masking::Secret<String>>,
payment_methods_data: &Encryptable<payment_methods::PaymentMethodsData>,
) -> CustomResult<payment_methods::CardDetail, errors::api_error_response::ApiErrorResponse>
{
@@ -216,17 +216,17 @@ impl Default for PaymentMethodCustomVaultingData {
#[derive(Debug, Default, Deserialize, Serialize, Clone)]
pub struct CardCustomData {
pub card_number: Option<cards::CardNumber>,
- pub card_exp_month: Option<masking::Secret<String>>,
- pub card_exp_year: Option<masking::Secret<String>>,
- pub card_cvc: Option<masking::Secret<String>>,
+ pub card_exp_month: Option<hyperswitch_masking::Secret<String>>,
+ pub card_exp_year: Option<hyperswitch_masking::Secret<String>>,
+ pub card_cvc: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Default, Deserialize, Serialize, Clone)]
pub struct NetworkTokenCustomData {
pub network_token: Option<cards::NetworkToken>,
- pub network_token_exp_month: Option<masking::Secret<String>>,
- pub network_token_exp_year: Option<masking::Secret<String>>,
- pub cryptogram: Option<masking::Secret<String>>,
+ pub network_token_exp_month: Option<hyperswitch_masking::Secret<String>>,
+ pub network_token_exp_year: Option<hyperswitch_masking::Secret<String>>,
+ pub cryptogram: Option<hyperswitch_masking::Secret<String>>,
}
#[cfg(feature = "v1")]
@@ -306,9 +306,9 @@ pub trait VaultingDataInterface {
impl VaultingDataInterface for PaymentMethodVaultingData {
fn get_vaulting_data_key(&self) -> String {
match &self {
- Self::Card(card) => card.card_number.to_string(),
- Self::NetworkToken(network_token) => network_token.network_token.to_string(),
- Self::CardNumber(card_number) => card_number.to_string(),
+ Self::Card(card) => card.card_number.get_card_no(),
+ Self::NetworkToken(network_token) => network_token.network_token.get_card_no(),
+ Self::CardNumber(card_number) => card_number.get_card_no(),
}
}
}
@@ -316,9 +316,9 @@ impl VaultingDataInterface for PaymentMethodVaultingData {
impl VaultingDataInterface for FingerprintData {
fn get_vaulting_data_key(&self) -> String {
match self {
- Self::Card(card) => card.card_number.to_string(),
- Self::NetworkToken(network_token) => network_token.network_token.to_string(),
- Self::CardNumber(card_number) => card_number.to_string(),
+ Self::Card(card) => card.card_number.get_card_no(),
+ Self::NetworkToken(network_token) => network_token.network_token.get_card_no(),
+ Self::CardNumber(card_number) => card_number.get_card_no(),
}
}
}
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index 549b23e406..5f35fee7a0 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -30,13 +30,12 @@ strum = { version = "0.26", features = ["derive"] }
thiserror = "1.0.69"
time = "0.3.41"
url = { version = "2.5.4", features = ["serde"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "95144b0829b8b3d8c4b0914921b43540abb6ac50", package = "rust-grpc-client" }
-unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.11.24.0", package = "masking" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.03.04.0-hotfix1", package = "rust-grpc-client" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
# First party crates
hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_models", default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
api_models = { version = "0.1.0", path = "../api_models" }
common_enums = { version = "0.1.0", path = "../common_enums" }
common_types = { version = "0.1.0", path = "../common_types" }
diff --git a/crates/hyperswitch_interfaces/src/api.rs b/crates/hyperswitch_interfaces/src/api.rs
index c207c1b41f..dc8b98c400 100644
--- a/crates/hyperswitch_interfaces/src/api.rs
+++ b/crates/hyperswitch_interfaces/src/api.rs
@@ -81,7 +81,7 @@ use hyperswitch_domain_models::{
VerifyWebhookSourceResponseData,
},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use serde_json::json;
#[cfg(feature = "frm")]
diff --git a/crates/hyperswitch_interfaces/src/api_client.rs b/crates/hyperswitch_interfaces/src/api_client.rs
index 272323ae10..500ce7f3ad 100644
--- a/crates/hyperswitch_interfaces/src/api_client.rs
+++ b/crates/hyperswitch_interfaces/src/api_client.rs
@@ -15,7 +15,7 @@ use hyperswitch_domain_models::{
errors::api_error_response,
router_data::{ErrorResponse, RouterData},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use reqwest::multipart::Form;
use router_env::{instrument, logger, tracing, RequestId};
use serde_json::json;
@@ -80,8 +80,8 @@ where
&self,
method: Method,
url: String,
- certificate: Option<masking::Secret<String>>,
- certificate_key: Option<masking::Secret<String>>,
+ certificate: Option<hyperswitch_masking::Secret<String>>,
+ certificate_key: Option<hyperswitch_masking::Secret<String>>,
) -> CustomResult<Box<dyn RequestBuilder>, ApiClientError>;
/// Send a request and return the response
@@ -253,12 +253,12 @@ where
get_flow_name::<T>().unwrap_or_else(|_| "UnknownFlow".to_string());
request.headers.insert((
X_FLOW_NAME.to_string(),
- Maskable::Masked(masking::Secret::new(flow_name.to_string())),
+ Maskable::Masked(hyperswitch_masking::Secret::new(flow_name.to_string())),
));
let connector_name = req.connector.clone();
request.headers.insert((
X_CONNECTOR_NAME.to_string(),
- Maskable::Masked(masking::Secret::new(connector_name.clone().to_string())),
+ Maskable::Masked(hyperswitch_masking::Secret::new(connector_name.clone().to_string())),
));
state.get_request_id().as_ref().map(|id| {
let request_id = id.to_string();
@@ -585,7 +585,7 @@ where
if decoded.starts_with('\u{feff}') {
decoded = decoded.trim_start_matches('\u{feff}').to_string();
}
- router_data.raw_connector_response = Some(masking::Secret::new(decoded));
+ router_data.raw_connector_response = Some(hyperswitch_masking::Secret::new(decoded));
}
Ok(())
}
diff --git a/crates/hyperswitch_interfaces/src/authentication.rs b/crates/hyperswitch_interfaces/src/authentication.rs
index cdde955e5e..6218c95433 100644
--- a/crates/hyperswitch_interfaces/src/authentication.rs
+++ b/crates/hyperswitch_interfaces/src/authentication.rs
@@ -6,7 +6,7 @@ pub struct ExternalAuthenticationPayload {
/// trans_status
pub trans_status: common_enums::TransactionStatus,
/// authentication_value
- pub authentication_value: Option<masking::Secret<String>>,
+ pub authentication_value: Option<hyperswitch_masking::Secret<String>>,
/// eci
pub eci: Option<String>,
/// Indicates whether the challenge was canceled by the user or system.
diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs
index 4e28441016..05b1343b88 100644
--- a/crates/hyperswitch_interfaces/src/configs.rs
+++ b/crates/hyperswitch_interfaces/src/configs.rs
@@ -2,7 +2,7 @@ use common_utils::{crypto::Encryptable, errors::CustomResult, id_type};
pub use hyperswitch_domain_models::{
connector_endpoints::Connectors, errors::api_error_response, merchant_connector_account,
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::Deserialize;
#[allow(missing_docs)]
diff --git a/crates/hyperswitch_interfaces/src/connector_integration_interface.rs b/crates/hyperswitch_interfaces/src/connector_integration_interface.rs
index 166e7da9b4..354b542c53 100644
--- a/crates/hyperswitch_interfaces/src/connector_integration_interface.rs
+++ b/crates/hyperswitch_interfaces/src/connector_integration_interface.rs
@@ -299,7 +299,9 @@ impl IncomingWebhook for ConnectorEnum {
request: &IncomingWebhookRequestDetails<'_>,
merchant_id: &common_utils::id_type::MerchantId,
connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
- connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>,
+ connector_account_details: crypto::Encryptable<
+ hyperswitch_masking::Secret<serde_json::Value>,
+ >,
connector_name: &str,
) -> CustomResult<bool, errors::ConnectorError> {
match self {
@@ -363,7 +365,8 @@ impl IncomingWebhook for ConnectorEnum {
fn get_webhook_resource_object(
&self,
request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>
+ {
match self {
Self::Old(connector) => connector.get_webhook_resource_object(request),
Self::New(connector) => connector.get_webhook_resource_object(request),
@@ -797,7 +800,8 @@ impl ConnectorCommon for ConnectorEnum {
fn get_auth_header(
&self,
auth_type: &ConnectorAuthType,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>
+ {
match self {
Self::Old(connector) => connector.get_auth_header(auth_type),
Self::New(connector) => connector.get_auth_header(auth_type),
diff --git a/crates/hyperswitch_interfaces/src/connector_integration_v2.rs b/crates/hyperswitch_interfaces/src/connector_integration_v2.rs
index 7ff6a89d65..2a1fcba8b5 100644
--- a/crates/hyperswitch_interfaces/src/connector_integration_v2.rs
+++ b/crates/hyperswitch_interfaces/src/connector_integration_v2.rs
@@ -5,7 +5,7 @@ use common_utils::{
request::{Method, Request, RequestBuilder, RequestContent},
};
use hyperswitch_domain_models::{router_data::ErrorResponse, router_data_v2::RouterDataV2};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use serde_json::json;
use crate::{
@@ -236,7 +236,7 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_certificate(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- ) -> CustomResult<Option<masking::Secret<String>>, errors::ConnectorError> {
+ ) -> CustomResult<Option<hyperswitch_masking::Secret<String>>, errors::ConnectorError> {
Ok(None)
}
@@ -244,7 +244,7 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_certificate_key(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- ) -> CustomResult<Option<masking::Secret<String>>, errors::ConnectorError> {
+ ) -> CustomResult<Option<hyperswitch_masking::Secret<String>>, errors::ConnectorError> {
Ok(None)
}
}
diff --git a/crates/hyperswitch_interfaces/src/crm.rs b/crates/hyperswitch_interfaces/src/crm.rs
index 40eb56e9e6..d05ad03d5f 100644
--- a/crates/hyperswitch_interfaces/src/crm.rs
+++ b/crates/hyperswitch_interfaces/src/crm.rs
@@ -3,7 +3,7 @@ use common_utils::{
errors::CustomResult,
request::{Request, RequestContent},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use super::types::Proxy;
use crate::errors::HttpClientError;
diff --git a/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs b/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
index 21e8050688..d0335c1b9c 100644
--- a/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
+++ b/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
@@ -75,7 +75,7 @@ impl ConnectorEvent {
/// fn set_response_body
pub fn set_response_body<T: Serialize>(&mut self, response: &T) {
- match masking::masked_serialize(response) {
+ match hyperswitch_masking::masked_serialize(response) {
Ok(masked) => {
self.masked_response = Some(masked.to_string());
}
@@ -85,7 +85,7 @@ impl ConnectorEvent {
/// fn set_error_response_body
pub fn set_error_response_body<T: Serialize>(&mut self, response: &T) {
- match masking::masked_serialize(response) {
+ match hyperswitch_masking::masked_serialize(response) {
Ok(masked) => {
self.error = Some(masked.to_string());
}
diff --git a/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs b/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
index 4ec8aed79c..d8ed519f03 100644
--- a/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
+++ b/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
@@ -101,7 +101,7 @@ impl RoutingEvent {
/// fn set_response_body
pub fn set_response_body<T: Serialize>(&mut self, response: &T) {
- match masking::masked_serialize(response) {
+ match hyperswitch_masking::masked_serialize(response) {
Ok(masked) => {
self.response = Some(masked.to_string());
}
@@ -111,7 +111,7 @@ impl RoutingEvent {
/// fn set_error_response_body
pub fn set_error_response_body<T: Serialize>(&mut self, response: &T) {
- match masking::masked_serialize(response) {
+ match hyperswitch_masking::masked_serialize(response) {
Ok(masked) => {
self.error = Some(masked.to_string());
}
diff --git a/crates/hyperswitch_interfaces/src/helpers.rs b/crates/hyperswitch_interfaces/src/helpers.rs
index 4f80e2ab4e..822fe11a4e 100644
--- a/crates/hyperswitch_interfaces/src/helpers.rs
+++ b/crates/hyperswitch_interfaces/src/helpers.rs
@@ -4,7 +4,7 @@ use common_utils::{
};
use error_stack::ResultExt;
use hyperswitch_domain_models::router_data;
-use masking;
+use hyperswitch_masking;
use router_env::{logger, tracing};
use crate::{api_client, consts, errors, types};
@@ -26,9 +26,9 @@ pub trait ForeignFrom<F>: Sized {
#[derive(serde::Serialize, Debug)]
pub struct ComparisonData {
/// Hyperswitch router data
- pub hyperswitch_data: masking::Secret<serde_json::Value>,
+ pub hyperswitch_data: hyperswitch_masking::Secret<serde_json::Value>,
/// Unified Connector Service router data
- pub unified_connector_service_data: masking::Secret<serde_json::Value>,
+ pub unified_connector_service_data: hyperswitch_masking::Secret<serde_json::Value>,
}
/// Trait to get comparison service configuration
@@ -62,9 +62,9 @@ where
]
.map(|(data, source)| {
serde_json::to_value(data)
- .map(masking::Secret::new)
+ .map(hyperswitch_masking::Secret::new)
.unwrap_or_else(|e| {
- masking::Secret::new(serde_json::json!({
+ hyperswitch_masking::Secret::new(serde_json::json!({
"error": e.to_string(),
"source": source
}))
@@ -107,14 +107,23 @@ pub async fn send_comparison_data(
.set_body(request::RequestContent::Json(Box::new(comparison_data)))
.build();
- request.add_header(X_CONNECTOR_NAME, masking::Maskable::Normal(connector_name));
+ request.add_header(
+ X_CONNECTOR_NAME,
+ hyperswitch_masking::Maskable::Normal(connector_name),
+ );
if let Some(sub_flow_name) = sub_flow_name.filter(|name| !name.is_empty()) {
- request.add_header(X_SUB_FLOW_NAME, masking::Maskable::Normal(sub_flow_name));
+ request.add_header(
+ X_SUB_FLOW_NAME,
+ hyperswitch_masking::Maskable::Normal(sub_flow_name),
+ );
}
if let Some(req_id) = request_id {
- request.add_header(consts::X_REQUEST_ID, masking::Maskable::Normal(req_id));
+ request.add_header(
+ consts::X_REQUEST_ID,
+ hyperswitch_masking::Maskable::Normal(req_id),
+ );
}
let _ = state
diff --git a/crates/hyperswitch_interfaces/src/micro_service/executor.rs b/crates/hyperswitch_interfaces/src/micro_service/executor.rs
index ee2e4bb5b2..48c89c55ff 100644
--- a/crates/hyperswitch_interfaces/src/micro_service/executor.rs
+++ b/crates/hyperswitch_interfaces/src/micro_service/executor.rs
@@ -2,7 +2,7 @@ use common_utils::{
consts::TENANT_HEADER,
request::{Headers, Request},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use router_env::{logger, RequestIdentifier};
use url::Url;
diff --git a/crates/hyperswitch_interfaces/src/secrets_interface.rs b/crates/hyperswitch_interfaces/src/secrets_interface.rs
index 6944729191..a93221b0eb 100644
--- a/crates/hyperswitch_interfaces/src/secrets_interface.rs
+++ b/crates/hyperswitch_interfaces/src/secrets_interface.rs
@@ -5,7 +5,7 @@ pub mod secret_handler;
pub mod secret_state;
use common_utils::errors::CustomResult;
-use masking::Secret;
+use hyperswitch_masking::Secret;
/// Trait defining the interface for managing application secrets
#[async_trait::async_trait]
diff --git a/crates/hyperswitch_interfaces/src/types.rs b/crates/hyperswitch_interfaces/src/types.rs
index 39b0b71f74..9599312073 100644
--- a/crates/hyperswitch_interfaces/src/types.rs
+++ b/crates/hyperswitch_interfaces/src/types.rs
@@ -466,7 +466,7 @@ pub struct Proxy {
pub bypass_proxy_hosts: Option<String>,
/// The CA certificate used for man-in-the-middle (MITM) proxying, if enabled.
- pub mitm_ca_certificate: Option<masking::Secret<String>>,
+ pub mitm_ca_certificate: Option<hyperswitch_masking::Secret<String>>,
/// Whether man-in-the-middle (MITM) proxying is enabled.
pub mitm_enabled: Option<bool>,
diff --git a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
index 076f3595bd..75401e4941 100644
--- a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
+++ b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
},
router_response_types::{PaymentsResponseData, RedirectForm},
};
-use unified_connector_service_masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use crate::{
helpers::{ForeignFrom, ForeignTryFrom},
@@ -438,7 +438,7 @@ impl ForeignTryFrom<payments_grpc::AdditionalPaymentMethodConnectorResponse>
hyperswitch_domain_models::router_data::InteracCustomerInfo {
customer_info: proto_interac.customer_info.map(|info| {
common_types::payments::InteracCustomerInfoDetails {
- customer_name: info.customer_name.map(|secret| masking::Secret::new(secret.expose())),
+ customer_name: info.customer_name.map(|secret| hyperswitch_masking::Secret::new(secret.expose())),
customer_email: info.customer_email
.and_then(|secret| {
common_utils::pii::Email::from_str(&secret.expose())
@@ -451,9 +451,9 @@ impl ForeignTryFrom<payments_grpc::AdditionalPaymentMethodConnectorResponse>
})
.ok()
}),
- customer_phone_number: info.customer_phone_number.map(|secret| masking::Secret::new(secret.expose())),
- customer_bank_id: info.customer_bank_id.map(|secret| masking::Secret::new(secret.expose())),
- customer_bank_name: info.customer_bank_name.map(|secret| masking::Secret::new(secret.expose())),
+ customer_phone_number: info.customer_phone_number.map(|secret| hyperswitch_masking::Secret::new(secret.expose())),
+ customer_bank_id: info.customer_bank_id.map(|secret| hyperswitch_masking::Secret::new(secret.expose())),
+ customer_bank_name: info.customer_bank_name.map(|secret| hyperswitch_masking::Secret::new(secret.expose())),
}
}),
}
@@ -502,14 +502,14 @@ impl ForeignTryFrom<payments_grpc::Ach>
.and_then(|bht| common_enums::BankHolderType::foreign_try_from(bht).ok());
Ok(Self::AchBankDebit {
- account_number: masking::Secret::new(
+ account_number: hyperswitch_masking::Secret::new(
ach.account_number
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "account_number",
})?
.expose(),
),
- routing_number: masking::Secret::new(
+ routing_number: hyperswitch_masking::Secret::new(
ach.routing_number
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "routing_number",
@@ -518,10 +518,10 @@ impl ForeignTryFrom<payments_grpc::Ach>
),
card_holder_name: ach
.card_holder_name
- .map(|s| masking::Secret::new(s.expose())),
+ .map(|s| hyperswitch_masking::Secret::new(s.expose())),
bank_account_holder_name: ach
.bank_account_holder_name
- .map(|s| masking::Secret::new(s.expose())),
+ .map(|s| hyperswitch_masking::Secret::new(s.expose())),
bank_name,
bank_type,
bank_holder_type,
@@ -536,7 +536,7 @@ impl ForeignTryFrom<payments_grpc::Sepa>
fn foreign_try_from(sepa: payments_grpc::Sepa) -> Result<Self, Self::Error> {
Ok(Self::SepaBankDebit {
- iban: masking::Secret::new(
+ iban: hyperswitch_masking::Secret::new(
sepa.iban
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "iban",
@@ -545,7 +545,7 @@ impl ForeignTryFrom<payments_grpc::Sepa>
),
bank_account_holder_name: sepa
.bank_account_holder_name
- .map(|name| masking::Secret::new(name.expose())),
+ .map(|name| hyperswitch_masking::Secret::new(name.expose())),
})
}
}
@@ -557,14 +557,14 @@ impl ForeignTryFrom<payments_grpc::Bacs>
fn foreign_try_from(bacs: payments_grpc::Bacs) -> Result<Self, Self::Error> {
Ok(Self::BacsBankDebit {
- account_number: masking::Secret::new(
+ account_number: hyperswitch_masking::Secret::new(
bacs.account_number
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "account_number",
})?
.expose(),
),
- sort_code: masking::Secret::new(
+ sort_code: hyperswitch_masking::Secret::new(
bacs.sort_code
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "sort_code",
@@ -573,7 +573,7 @@ impl ForeignTryFrom<payments_grpc::Bacs>
),
bank_account_holder_name: bacs
.bank_account_holder_name
- .map(|name| masking::Secret::new(name.expose())),
+ .map(|name| hyperswitch_masking::Secret::new(name.expose())),
})
}
}
@@ -585,14 +585,14 @@ impl ForeignTryFrom<payments_grpc::Becs>
fn foreign_try_from(becs: payments_grpc::Becs) -> Result<Self, Self::Error> {
Ok(Self::BecsBankDebit {
- account_number: masking::Secret::new(
+ account_number: hyperswitch_masking::Secret::new(
becs.account_number
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "account_number",
})?
.expose(),
),
- bsb_number: masking::Secret::new(
+ bsb_number: hyperswitch_masking::Secret::new(
becs.bsb_number
.ok_or(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "bsb_number",
@@ -601,7 +601,7 @@ impl ForeignTryFrom<payments_grpc::Becs>
),
bank_account_holder_name: becs
.bank_account_holder_name
- .map(|name| masking::Secret::new(name.expose())),
+ .map(|name| hyperswitch_masking::Secret::new(name.expose())),
})
}
}
diff --git a/crates/hyperswitch_interfaces/src/webhooks.rs b/crates/hyperswitch_interfaces/src/webhooks.rs
index 6068901c1b..27f508532c 100644
--- a/crates/hyperswitch_interfaces/src/webhooks.rs
+++ b/crates/hyperswitch_interfaces/src/webhooks.rs
@@ -5,7 +5,7 @@ use error_stack::ResultExt;
use hyperswitch_domain_models::{
api::ApplicationResponse, errors::api_error_response::ApiErrorResponse,
};
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use crate::{api::ConnectorCommon, errors};
@@ -322,7 +322,7 @@ pub trait IncomingWebhook: ConnectorCommon + Sync {
fn get_webhook_resource_object(
&self,
_request: &IncomingWebhookRequestDetails<'_>,
- ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError>;
+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>;
/// fn get_webhook_api_response
fn get_webhook_api_response(
diff --git a/crates/injector/Cargo.toml b/crates/injector/Cargo.toml
index 3cffd170ac..93250ac82a 100644
--- a/crates/injector/Cargo.toml
+++ b/crates/injector/Cargo.toml
@@ -14,7 +14,7 @@ tracing-actix-web = []
[dependencies]
common_utils = { version = "0.1.0", path = "../common_utils" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
router_env = { version = "0.1.0", path = "../router_env" }
async-trait = { version = "0.1.88" }
diff --git a/crates/injector/src/injector.rs b/crates/injector/src/injector.rs
index b2c4dd2a4c..5990232ccb 100644
--- a/crates/injector/src/injector.rs
+++ b/crates/injector/src/injector.rs
@@ -4,7 +4,7 @@ pub mod core {
use async_trait::async_trait;
use common_utils::request::{Method, RequestBuilder, RequestContent};
use error_stack::{self, ResultExt};
- use masking::{self, ExposeInterface};
+ use hyperswitch_masking::{self, ExposeInterface};
use nom::{
bytes::complete::{tag, take_while1},
character::complete::{char, multispace0},
@@ -62,9 +62,9 @@ pub mod core {
/// Create HTTP client using the proven external_services create_client logic
fn create_client(
proxy_config: &Proxy,
- client_certificate: Option<masking::Secret<String>>,
- client_certificate_key: Option<masking::Secret<String>>,
- ca_certificate: Option<masking::Secret<String>>,
+ client_certificate: Option<hyperswitch_masking::Secret<String>>,
+ client_certificate_key: Option<hyperswitch_masking::Secret<String>>,
+ ca_certificate: Option<hyperswitch_masking::Secret<String>>,
) -> error_stack::Result<reqwest::Client, InjectorError> {
logger::debug!(
has_client_cert = client_certificate.is_some(),
@@ -170,8 +170,8 @@ pub mod core {
}
fn create_identity_from_certificate_and_key(
- encoded_certificate: masking::Secret<String>,
- encoded_certificate_key: masking::Secret<String>,
+ encoded_certificate: hyperswitch_masking::Secret<String>,
+ encoded_certificate_key: hyperswitch_masking::Secret<String>,
) -> error_stack::Result<reqwest::Identity, InjectorError> {
let cert_str = encoded_certificate.expose();
let key_str = encoded_certificate_key.expose();
@@ -188,7 +188,7 @@ pub mod core {
}
fn create_certificate(
- encoded_certificate: masking::Secret<String>,
+ encoded_certificate: hyperswitch_masking::Secret<String>,
) -> error_stack::Result<Vec<reqwest::Certificate>, InjectorError> {
let cert_str = encoded_certificate.expose();
@@ -279,8 +279,8 @@ pub mod core {
// Add headers
for (key, value) in &request.headers {
let header_value = match value {
- masking::Maskable::Masked(secret) => secret.clone().expose(),
- masking::Maskable::Normal(normal) => normal.clone(),
+ hyperswitch_masking::Maskable::Masked(secret) => secret.clone().expose(),
+ hyperswitch_masking::Maskable::Normal(normal) => normal.clone(),
};
req_builder = req_builder.header(key, header_value);
}
@@ -629,11 +629,16 @@ pub mod core {
logger::debug!("Constructed URL: {}", url);
// Convert headers to common_utils Headers format safely
- let headers: Vec<(String, masking::Maskable<String>)> = config
+ let headers: Vec<(String, hyperswitch_masking::Maskable<String>)> = config
.headers
.clone()
.into_iter()
- .map(|(k, v)| (k, masking::Maskable::new_normal(v.expose().clone())))
+ .map(|(k, v)| {
+ (
+ k,
+ hyperswitch_masking::Maskable::new_normal(v.expose().clone()),
+ )
+ })
.collect();
// Determine method and request content
@@ -882,11 +887,11 @@ mod tests {
let mut headers = HashMap::new();
headers.insert(
"Content-Type".to_string(),
- masking::Secret::new("application/x-www-form-urlencoded".to_string()),
+ hyperswitch_masking::Secret::new("application/x-www-form-urlencoded".to_string()),
);
headers.insert(
"Authorization".to_string(),
- masking::Secret::new("Bearer Test".to_string()),
+ hyperswitch_masking::Secret::new("Bearer Test".to_string()),
);
let specific_token_data = common_utils::pii::SecretSerdeValue::new(serde_json::json!({
@@ -961,11 +966,11 @@ mod tests {
let mut headers = HashMap::new();
headers.insert(
"Content-Type".to_string(),
- masking::Secret::new("application/x-www-form-urlencoded".to_string()),
+ hyperswitch_masking::Secret::new("application/x-www-form-urlencoded".to_string()),
);
headers.insert(
"Authorization".to_string(),
- masking::Secret::new("Bearer TEST".to_string()),
+ hyperswitch_masking::Secret::new("Bearer TEST".to_string()),
);
let specific_token_data = common_utils::pii::SecretSerdeValue::new(serde_json::json!({
diff --git a/crates/injector/src/types.rs b/crates/injector/src/types.rs
index 5e5a05f950..8e2194b1ee 100644
--- a/crates/injector/src/types.rs
+++ b/crates/injector/src/types.rs
@@ -3,7 +3,7 @@ pub mod models {
use async_trait::async_trait;
use common_utils::pii::SecretSerdeValue;
- use masking::Secret;
+ use hyperswitch_masking::Secret;
use router_env::logger;
use serde::{Deserialize, Serialize};
diff --git a/crates/injector/src/vault_metadata.rs b/crates/injector/src/vault_metadata.rs
index 71b86b2709..6404d73c4d 100644
--- a/crates/injector/src/vault_metadata.rs
+++ b/crates/injector/src/vault_metadata.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use base64::Engine;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use router_env::logger;
use url::Url;
diff --git a/crates/kgraph_utils/Cargo.toml b/crates/kgraph_utils/Cargo.toml
index 3793a95860..768b041fb8 100644
--- a/crates/kgraph_utils/Cargo.toml
+++ b/crates/kgraph_utils/Cargo.toml
@@ -18,7 +18,7 @@ common_utils = { version = "0.1.0", path = "../common_utils" }
common_types = {version = "0.1.0", path = "../common_types" }
euclid = { version = "0.1.0", path = "../euclid" }
hyperswitch_constraint_graph = { version = "0.1.0", path = "../hyperswitch_constraint_graph", features = ["viz"] }
-masking = { version = "0.1.0", path = "../masking/" }
+hyperswitch_masking = { version = "0.0.1" }
# Third party crates
serde = "1.0.219"
diff --git a/crates/kgraph_utils/benches/evaluation.rs b/crates/kgraph_utils/benches/evaluation.rs
index 9acb9c7f3d..3b4a3fc044 100644
--- a/crates/kgraph_utils/benches/evaluation.rs
+++ b/crates/kgraph_utils/benches/evaluation.rs
@@ -60,7 +60,7 @@ fn build_test_data(
// connector_type: api_enums::ConnectorType::FizOperations,
// connector_name: "stripe".to_string(),
// id: common_utils::generate_merchant_connector_account_id_of_default_length(),
- // connector_account_details: masking::Secret::new(serde_json::json!({})),
+ // connector_account_details: hyperswitch_masking::Secret::new(serde_json::json!({})),
// disabled: None,
// metadata: None,
// payment_methods_enabled: Some(pms_enabled),
@@ -81,7 +81,7 @@ fn build_test_data(
connector_name: "stripe".to_string(),
merchant_connector_id:
common_utils::generate_merchant_connector_account_id_of_default_length(),
- connector_account_details: masking::Secret::new(serde_json::json!({})),
+ connector_account_details: hyperswitch_masking::Secret::new(serde_json::json!({})),
test_mode: None,
disabled: None,
metadata: None,
diff --git a/crates/kgraph_utils/src/mca.rs b/crates/kgraph_utils/src/mca.rs
index 7d6d30520a..5b3284003e 100644
--- a/crates/kgraph_utils/src/mca.rs
+++ b/crates/kgraph_utils/src/mca.rs
@@ -1088,7 +1088,7 @@ mod tests {
// connector_name: "stripe".to_string(),
// id: common_utils::generate_merchant_connector_account_id_of_default_length(),
// connector_label: Some("something".to_string()),
- // connector_account_details: masking::Secret::new(serde_json::json!({})),
+ // connector_account_details: hyperswitch_masking::Secret::new(serde_json::json!({})),
// disabled: None,
// metadata: None,
// payment_methods_enabled: Some(vec![PaymentMethodsEnabled {
@@ -1147,7 +1147,7 @@ mod tests {
connector_label: Some("something".to_string()),
business_label: Some("food".to_string()),
business_sub_label: None,
- connector_account_details: masking::Secret::new(serde_json::json!({})),
+ connector_account_details: hyperswitch_masking::Secret::new(serde_json::json!({})),
test_mode: None,
disabled: None,
metadata: None,
diff --git a/crates/masking/Cargo.toml b/crates/masking/Cargo.toml
deleted file mode 100644
index bf5c7a3ca9..0000000000
--- a/crates/masking/Cargo.toml
+++ /dev/null
@@ -1,40 +0,0 @@
-[package]
-name = "masking"
-description = "Personal Identifiable Information protection. Wrapper types and traits for secret management which help ensure they aren't accidentally copied, logged, or otherwise exposed (as much as possible), and also ensure secrets are securely wiped from memory when dropped."
-version = "0.1.0"
-edition.workspace = true
-rust-version.workspace = true
-readme = "README.md"
-license.workspace = true
-
-[features]
-default = ["alloc", "serde", "diesel", "time"]
-alloc = ["zeroize/alloc"]
-serde = ["dep:serde", "dep:serde_json"]
-time = ["dep:time"]
-cassandra = ["dep:scylla"]
-proto_tonic = ["dep:bytes", "dep:prost"]
-bytes = ["dep:bytes"]
-
-[package.metadata.docs.rs]
-all-features = true
-rustdoc-args = ["--cfg", "docsrs"]
-
-[dependencies]
-bytes = { version = "1", optional = true }
-diesel = { version = "2.2.10", features = ["postgres", "serde_json", "time"], optional = true }
-erased-serde = "0.4.6"
-serde = { version = "1", features = ["derive"], optional = true }
-serde_json = { version = "1.0.140", optional = true }
-subtle = "2.6.1"
-time = { version = "0.3.41", optional = true, features = ["serde-human-readable"] }
-url = { version = "2.5.4", features = ["serde"] }
-zeroize = { version = "1.8", default-features = false }
-scylla = { git = "https://github.com/juspay/scylla-rust-driver.git",rev = "5700aa2847b25437cdd4fcf34d707aa90dca8b89", optional = true}
-prost = { version = "0.13", optional = true }
-
-[dev-dependencies]
-serde_json = "1.0.140"
-
-[lints]
-workspace = true
diff --git a/crates/masking/README.md b/crates/masking/README.md
deleted file mode 100644
index b6aa86b046..0000000000
--- a/crates/masking/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Masking
-
-Personal Identifiable Information protection.
-Wrapper types and traits for secret management which help ensure they aren't
-accidentally copied, logged, or otherwise exposed (as much as possible), and
-also ensure secrets are securely wiped from memory when dropped.
-Secret-keeping library inspired by `secrecy`.
-
-This solution has such advantages over alternatives:
-
-- alternatives have not implemented several traits from the box which are needed
-- alternatives do not have WeakSecret and Secret differentiation
-- alternatives do not support masking strategies
-- alternatives had several minor problems
-
-## How to use
-
-To convert a non-secret variable into a secret, use `Secret::new()`:
-
-```rust
-use masking::Secret;
-
-let card_number: Secret<String> = Secret::new(String::from("1234 5678 9012 3456"));
-assert_eq!(format!("{:?}", card_number), "*** alloc::string::String ***");
-```
-
-To get a reference to the inner value from the secret, use `peek()`:
-
-```rust
-use masking::{PeekInterface, Secret};
-
-let card_number: Secret<String> = Secret::new(String::from("1234 5678 9012 3456"));
-let last4_digits: &str = card_number.peek();
-```
-
-To get the owned inner value from the secret, use `expose()`:
-
-```rust
-use masking::{ExposeInterface, Secret};
-
-let card_number: Secret<String> = Secret::new(String::from("1234 5678 9012 3456"));
-let last4_digits: String = card_number.expose();
-```
-
-For fields that are `Option<T>`, you can use `expose_option()`:
-
-```rust
-use masking::{ExposeOptionInterface, Secret};
-
-let card_number: Option<Secret<String>> = Some(Secret::new(String::from("1234 5678 9012 3456")));
-let card_number_str: String = card_number.expose_option().unwrap_or_default();
-assert_eq!(format!("{}", card_number_str), "1234 5678 9012 3456");
-
-let card_number: Option<Secret<String>> = None;
-let card_number_str: String = card_number.expose_option().unwrap_or_default();
-assert_eq!(format!("{}", card_number_str), "");
-```
diff --git a/crates/masking/src/abs.rs b/crates/masking/src/abs.rs
deleted file mode 100644
index 8996db65f2..0000000000
--- a/crates/masking/src/abs.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-//! Abstract data types.
-
-use crate::Secret;
-
-/// Interface to expose a reference to an inner secret
-pub trait PeekInterface<S> {
- /// Only method providing access to the secret value.
- fn peek(&self) -> &S;
-
- /// Provide a mutable reference to the inner value.
- fn peek_mut(&mut self) -> &mut S;
-}
-
-/// Interface that consumes a option secret and returns the value.
-pub trait ExposeOptionInterface<S> {
- /// Expose option.
- fn expose_option(self) -> S;
-}
-
-/// Interface that consumes a secret and returns the inner value.
-pub trait ExposeInterface<S> {
- /// Consume the secret and return the inner value
- fn expose(self) -> S;
-}
-
-impl<S, I> ExposeOptionInterface<Option<S>> for Option<Secret<S, I>>
-where
- S: Clone,
- I: crate::Strategy<S>,
-{
- fn expose_option(self) -> Option<S> {
- self.map(ExposeInterface::expose)
- }
-}
-
-impl<S, I> ExposeInterface<S> for Secret<S, I>
-where
- I: crate::Strategy<S>,
-{
- fn expose(self) -> S {
- self.inner_secret
- }
-}
-
-/// Interface that consumes a secret and converts it to a secret with a different masking strategy.
-pub trait SwitchStrategy<FromStrategy, ToStrategy> {
- /// The type returned by `switch_strategy()`.
- type Output;
-
- /// Consumes the secret and converts it to a secret with a different masking strategy.
- fn switch_strategy(self) -> Self::Output;
-}
-
-impl<S, FromStrategy, ToStrategy> SwitchStrategy<FromStrategy, ToStrategy>
- for Secret<S, FromStrategy>
-where
- FromStrategy: crate::Strategy<S>,
- ToStrategy: crate::Strategy<S>,
-{
- type Output = Secret<S, ToStrategy>;
-
- fn switch_strategy(self) -> Self::Output {
- Secret::new(self.inner_secret)
- }
-}
diff --git a/crates/masking/src/boxed.rs b/crates/masking/src/boxed.rs
deleted file mode 100644
index 42dda0873a..0000000000
--- a/crates/masking/src/boxed.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-//! `Box` types containing secrets
-//!
-//! There is not alias type by design.
-
-#[cfg(feature = "serde")]
-use super::{SerializableSecret, Serialize};
-
-#[cfg(feature = "serde")]
-impl<S: Serialize> SerializableSecret for Box<S> {}
diff --git a/crates/masking/src/bytes.rs b/crates/masking/src/bytes.rs
deleted file mode 100644
index 07b8c289ad..0000000000
--- a/crates/masking/src/bytes.rs
+++ /dev/null
@@ -1,100 +0,0 @@
-//! Optional `Secret` wrapper type for the `bytes::BytesMut` crate.
-
-use core::fmt;
-
-use bytes::BytesMut;
-#[cfg(all(feature = "bytes", feature = "serde"))]
-use serde::de::{self, Deserialize};
-
-use super::{PeekInterface, ZeroizableSecret};
-
-/// Instance of [`BytesMut`] protected by a type that impls the [`ExposeInterface`]
-/// trait like `Secret<T>`.
-///
-/// Because of the nature of how the `BytesMut` type works, it needs some special
-/// care in order to have a proper zeroizing drop handler.
-#[derive(Clone)]
-#[cfg_attr(docsrs, cfg(feature = "bytes"))]
-pub struct SecretBytesMut(BytesMut);
-
-impl SecretBytesMut {
- /// Wrap bytes in `SecretBytesMut`
- pub fn new(bytes: impl Into<BytesMut>) -> Self {
- Self(bytes.into())
- }
-}
-
-impl PeekInterface<BytesMut> for SecretBytesMut {
- fn peek(&self) -> &BytesMut {
- &self.0
- }
-
- fn peek_mut(&mut self) -> &mut BytesMut {
- &mut self.0
- }
-}
-
-impl fmt::Debug for SecretBytesMut {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "SecretBytesMut([REDACTED])")
- }
-}
-
-impl From<BytesMut> for SecretBytesMut {
- fn from(bytes: BytesMut) -> Self {
- Self::new(bytes)
- }
-}
-
-impl Drop for SecretBytesMut {
- fn drop(&mut self) {
- self.0.resize(self.0.capacity(), 0);
- self.0.as_mut().zeroize();
- debug_assert!(self.0.as_ref().iter().all(|b| *b == 0));
- }
-}
-
-#[cfg(all(feature = "bytes", feature = "serde"))]
-impl<'de> Deserialize<'de> for SecretBytesMut {
- fn deserialize<D: de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
- struct SecretBytesVisitor;
-
- impl<'de> de::Visitor<'de> for SecretBytesVisitor {
- type Value = SecretBytesMut;
-
- fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
- formatter.write_str("byte array")
- }
-
- #[inline]
- fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
- where
- E: de::Error,
- {
- let mut bytes = BytesMut::with_capacity(v.len());
- bytes.extend_from_slice(v);
- Ok(SecretBytesMut(bytes))
- }
-
- #[inline]
- fn visit_seq<V>(self, mut seq: V) -> Result<Self::Value, V::Error>
- where
- V: de::SeqAccess<'de>,
- {
- // 4096 is cargo culted from upstream
- let len = core::cmp::min(seq.size_hint().unwrap_or(0), 4096);
- let mut bytes = BytesMut::with_capacity(len);
-
- use bytes::BufMut;
-
- while let Some(value) = seq.next_element()? {
- bytes.put_u8(value);
- }
-
- Ok(SecretBytesMut(bytes))
- }
- }
-
- deserializer.deserialize_bytes(SecretBytesVisitor)
- }
-}
diff --git a/crates/masking/src/cassandra.rs b/crates/masking/src/cassandra.rs
deleted file mode 100644
index ec44f1fb52..0000000000
--- a/crates/masking/src/cassandra.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-use scylla::{
- deserialize::DeserializeValue,
- frame::response::result::ColumnType,
- serialize::{
- value::SerializeValue,
- writers::{CellWriter, WrittenCellProof},
- SerializationError,
- },
-};
-
-use crate::{abs::PeekInterface, StrongSecret};
-
-impl<T> SerializeValue for StrongSecret<T>
-where
- T: SerializeValue + zeroize::Zeroize + Clone,
-{
- fn serialize<'b>(
- &self,
- column_type: &ColumnType<'_>,
- writer: CellWriter<'b>,
- ) -> Result<WrittenCellProof<'b>, SerializationError> {
- self.peek().serialize(column_type, writer)
- }
-}
-
-impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for StrongSecret<T>
-where
- T: DeserializeValue<'frame, 'metadata> + zeroize::Zeroize + Clone,
-{
- fn type_check(column_type: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {
- T::type_check(column_type)
- }
-
- fn deserialize(
- column_type: &'metadata ColumnType<'metadata>,
- v: Option<scylla::deserialize::FrameSlice<'frame>>,
- ) -> Result<Self, scylla::deserialize::DeserializationError> {
- Ok(Self::new(T::deserialize(column_type, v)?))
- }
-}
diff --git a/crates/masking/src/diesel.rs b/crates/masking/src/diesel.rs
deleted file mode 100644
index 148e50ed82..0000000000
--- a/crates/masking/src/diesel.rs
+++ /dev/null
@@ -1,152 +0,0 @@
-//! Diesel-related.
-
-use diesel::{
- backend::Backend,
- deserialize::{self, FromSql, Queryable},
- expression::AsExpression,
- internal::derives::as_expression::Bound,
- serialize::{self, Output, ToSql},
- sql_types,
-};
-
-use crate::{Secret, Strategy, StrongSecret, ZeroizableSecret};
-
-impl<S, I, T> AsExpression<T> for &Secret<S, I>
-where
- T: sql_types::SingleValue,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<S, I, T> AsExpression<T> for &&Secret<S, I>
-where
- T: sql_types::SingleValue,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<S, I, T, DB> ToSql<T, DB> for Secret<S, I>
-where
- DB: Backend,
- S: ToSql<T, DB>,
- I: Strategy<S>,
-{
- fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> serialize::Result {
- ToSql::<T, DB>::to_sql(&self.inner_secret, out)
- }
-}
-
-impl<DB, S, T, I> FromSql<T, DB> for Secret<S, I>
-where
- DB: Backend,
- S: FromSql<T, DB>,
- I: Strategy<S>,
-{
- fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> {
- S::from_sql(bytes).map(|raw| raw.into())
- }
-}
-
-impl<S, I, T> AsExpression<T> for Secret<S, I>
-where
- T: sql_types::SingleValue,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<ST, DB, S, I> Queryable<ST, DB> for Secret<S, I>
-where
- DB: Backend,
- I: Strategy<S>,
- ST: sql_types::SingleValue,
- Self: FromSql<ST, DB>,
-{
- type Row = Self;
- fn build(row: Self::Row) -> deserialize::Result<Self> {
- Ok(row)
- }
-}
-
-impl<S, I, T> AsExpression<T> for &StrongSecret<S, I>
-where
- T: sql_types::SingleValue,
- S: ZeroizableSecret,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<S, I, T> AsExpression<T> for &&StrongSecret<S, I>
-where
- T: sql_types::SingleValue,
- S: ZeroizableSecret,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<S, I, DB, T> ToSql<T, DB> for StrongSecret<S, I>
-where
- DB: Backend,
- S: ToSql<T, DB> + ZeroizableSecret,
- I: Strategy<S>,
-{
- fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> serialize::Result {
- ToSql::<T, DB>::to_sql(&self.inner_secret, out)
- }
-}
-
-impl<DB, S, I, T> FromSql<T, DB> for StrongSecret<S, I>
-where
- DB: Backend,
- S: FromSql<T, DB> + ZeroizableSecret,
- I: Strategy<S>,
-{
- fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> {
- S::from_sql(bytes).map(|raw| raw.into())
- }
-}
-
-impl<S, I, T> AsExpression<T> for StrongSecret<S, I>
-where
- T: sql_types::SingleValue,
- S: ZeroizableSecret,
- I: Strategy<S>,
-{
- type Expression = Bound<T, Self>;
- fn as_expression(self) -> Self::Expression {
- Bound::new(self)
- }
-}
-
-impl<ST, DB, S, I> Queryable<ST, DB> for StrongSecret<S, I>
-where
- I: Strategy<S>,
- DB: Backend,
- S: ZeroizableSecret,
- ST: sql_types::SingleValue,
- Self: FromSql<ST, DB>,
-{
- type Row = Self;
- fn build(row: Self::Row) -> deserialize::Result<Self> {
- Ok(row)
- }
-}
diff --git a/crates/masking/src/lib.rs b/crates/masking/src/lib.rs
deleted file mode 100644
index 35e55c8cb3..0000000000
--- a/crates/masking/src/lib.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide))]
-#![cfg_attr(docsrs, doc(cfg_hide(doc)))]
-#![warn(missing_docs)]
-
-//! Personal Identifiable Information protection. Wrapper types and traits for secret management which help ensure they aren't accidentally copied, logged, or otherwise exposed (as much as possible), and also ensure secrets are securely wiped from memory when dropped.
-//! Secret-keeping library inspired by secrecy.
-
-#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR" ), "/", "README.md"))]
-
-pub use zeroize::{self, DefaultIsZeroes, Zeroize as ZeroizableSecret};
-
-mod strategy;
-
-pub use strategy::{Strategy, WithType, WithoutType};
-mod abs;
-pub use abs::{ExposeInterface, ExposeOptionInterface, PeekInterface, SwitchStrategy};
-
-mod secret;
-mod strong_secret;
-#[cfg(feature = "serde")]
-pub use secret::JsonMaskStrategy;
-pub use secret::Secret;
-pub use strong_secret::StrongSecret;
-
-#[cfg(feature = "alloc")]
-extern crate alloc;
-
-#[cfg(feature = "alloc")]
-mod boxed;
-
-#[cfg(feature = "bytes")]
-mod bytes;
-#[cfg(feature = "bytes")]
-pub use self::bytes::SecretBytesMut;
-
-#[cfg(feature = "alloc")]
-mod string;
-
-#[cfg(feature = "alloc")]
-mod vec;
-
-#[cfg(feature = "serde")]
-mod serde;
-#[cfg(feature = "serde")]
-pub use crate::serde::{
- masked_serialize, Deserialize, ErasedMaskSerialize, SerializableSecret, Serialize,
-};
-
-/// This module should be included with asterisk.
-///
-/// `use masking::prelude::*;`
-pub mod prelude {
- pub use super::{ExposeInterface, ExposeOptionInterface, PeekInterface};
-}
-
-#[cfg(feature = "diesel")]
-mod diesel;
-
-#[cfg(feature = "cassandra")]
-mod cassandra;
-
-pub mod maskable;
-
-pub use maskable::*;
diff --git a/crates/masking/src/maskable.rs b/crates/masking/src/maskable.rs
deleted file mode 100644
index e957e89b35..0000000000
--- a/crates/masking/src/maskable.rs
+++ /dev/null
@@ -1,100 +0,0 @@
-//! This module contains Masking objects and traits
-
-use crate::{ExposeInterface, Secret};
-
-/// An Enum that allows us to optionally mask data, based on which enum variant that data is stored
-/// in.
-#[derive(Clone, Eq, PartialEq)]
-pub enum Maskable<T: Eq + PartialEq + Clone> {
- /// Variant which masks the data by wrapping in a Secret
- Masked(Secret<T>),
- /// Varant which doesn't mask the data
- Normal(T),
-}
-
-impl<T: std::fmt::Debug + Clone + Eq + PartialEq> std::fmt::Debug for Maskable<T> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- match self {
- Self::Masked(secret_value) => std::fmt::Debug::fmt(secret_value, f),
- Self::Normal(value) => std::fmt::Debug::fmt(value, f),
- }
- }
-}
-
-impl<T: Eq + PartialEq + Clone + std::hash::Hash> std::hash::Hash for Maskable<T> {
- fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
- match self {
- Self::Masked(value) => crate::PeekInterface::peek(value).hash(state),
- Self::Normal(value) => value.hash(state),
- }
- }
-}
-
-impl<T: Eq + PartialEq + Clone> Maskable<T> {
- /// Get the inner data while consuming self
- pub fn into_inner(self) -> T {
- match self {
- Self::Masked(inner_secret) => inner_secret.expose(),
- Self::Normal(inner) => inner,
- }
- }
-
- /// Create a new Masked data
- pub fn new_masked(item: Secret<T>) -> Self {
- Self::Masked(item)
- }
-
- /// Create a new non-masked data
- pub fn new_normal(item: T) -> Self {
- Self::Normal(item)
- }
-
- /// Checks whether the data is masked.
- /// Returns `true` if the data is wrapped in the `Masked` variant,
- /// returns `false` otherwise.
- pub fn is_masked(&self) -> bool {
- matches!(self, Self::Masked(_))
- }
-
- /// Checks whether the data is normal (not masked).
- /// Returns `true` if the data is wrapped in the `Normal` variant,
- /// returns `false` otherwise.
- pub fn is_normal(&self) -> bool {
- matches!(self, Self::Normal(_))
- }
-}
-
-/// Trait for providing a method on custom types for constructing `Maskable`
-pub trait Mask {
- /// The type returned by the `into_masked()` method. Must implement `PartialEq`, `Eq` and `Clone`
- type Output: Eq + Clone + PartialEq;
-
- /// Construct a `Maskable` instance that wraps `Self::Output` by consuming `self`
- fn into_masked(self) -> Maskable<Self::Output>;
-}
-
-impl Mask for String {
- type Output = Self;
- fn into_masked(self) -> Maskable<Self::Output> {
- Maskable::new_masked(self.into())
- }
-}
-
-impl Mask for Secret<String> {
- type Output = String;
- fn into_masked(self) -> Maskable<Self::Output> {
- Maskable::new_masked(self)
- }
-}
-
-impl<T: Eq + PartialEq + Clone> From<T> for Maskable<T> {
- fn from(value: T) -> Self {
- Self::new_normal(value)
- }
-}
-
-impl From<&str> for Maskable<String> {
- fn from(value: &str) -> Self {
- Self::new_normal(value.to_string())
- }
-}
diff --git a/crates/masking/src/secret.rs b/crates/masking/src/secret.rs
deleted file mode 100644
index bbedc0d543..0000000000
--- a/crates/masking/src/secret.rs
+++ /dev/null
@@ -1,523 +0,0 @@
-//! Structure describing secret.
-
-use std::{fmt, marker::PhantomData};
-
-use crate::{strategy::Strategy, PeekInterface, StrongSecret};
-
-/// Secret thing.
-///
-/// To get access to value use method `expose()` of trait [`crate::ExposeInterface`].
-///
-/// ## Masking
-/// Use the [`crate::strategy::Strategy`] trait to implement a masking strategy on a zero-variant
-/// enum and pass this enum as a second generic parameter to [`Secret`] while defining it.
-/// [`Secret`] will take care of applying the masking strategy on the inner secret when being
-/// displayed.
-///
-/// ## Masking Example
-///
-/// ```
-/// use masking::Strategy;
-/// use masking::Secret;
-/// use std::fmt;
-///
-/// enum MyStrategy {}
-///
-/// impl<T> Strategy<T> for MyStrategy
-/// where
-/// T: fmt::Display
-/// {
-/// fn fmt(val: &T, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-/// write!(f, "{}", val.to_string().to_ascii_lowercase())
-/// }
-/// }
-///
-/// let my_secret: Secret<String, MyStrategy> = Secret::new("HELLO".to_string());
-///
-/// assert_eq!("hello", &format!("{:?}", my_secret));
-/// ```
-pub struct Secret<Secret, MaskingStrategy = crate::WithType>
-where
- MaskingStrategy: Strategy<Secret>,
-{
- pub(crate) inner_secret: Secret,
- pub(crate) masking_strategy: PhantomData<MaskingStrategy>,
-}
-
-impl<SecretValue, MaskingStrategy> Secret<SecretValue, MaskingStrategy>
-where
- MaskingStrategy: Strategy<SecretValue>,
-{
- /// Take ownership of a secret value
- pub fn new(secret: SecretValue) -> Self {
- Self {
- inner_secret: secret,
- masking_strategy: PhantomData,
- }
- }
-
- /// Zip 2 secrets with the same masking strategy into one
- pub fn zip<OtherSecretValue>(
- self,
- other: Secret<OtherSecretValue, MaskingStrategy>,
- ) -> Secret<(SecretValue, OtherSecretValue), MaskingStrategy>
- where
- MaskingStrategy: Strategy<OtherSecretValue> + Strategy<(SecretValue, OtherSecretValue)>,
- {
- (self.inner_secret, other.inner_secret).into()
- }
-
- /// consume self and modify the inner value
- pub fn map<OtherSecretValue>(
- self,
- f: impl FnOnce(SecretValue) -> OtherSecretValue,
- ) -> Secret<OtherSecretValue, MaskingStrategy>
- where
- MaskingStrategy: Strategy<OtherSecretValue>,
- {
- f(self.inner_secret).into()
- }
-
- /// Convert to [`StrongSecret`]
- pub fn into_strong(self) -> StrongSecret<SecretValue, MaskingStrategy>
- where
- SecretValue: zeroize::DefaultIsZeroes,
- {
- StrongSecret::new(self.inner_secret)
- }
-
- /// Convert to [`Secret`] with a reference to the inner secret
- pub fn as_ref(&self) -> Secret<&SecretValue, MaskingStrategy>
- where
- MaskingStrategy: for<'a> Strategy<&'a SecretValue>,
- {
- Secret::new(self.peek())
- }
-}
-
-impl<SecretValue, MaskingStrategy> PeekInterface<SecretValue>
- for Secret<SecretValue, MaskingStrategy>
-where
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn peek(&self) -> &SecretValue {
- &self.inner_secret
- }
-
- fn peek_mut(&mut self) -> &mut SecretValue {
- &mut self.inner_secret
- }
-}
-
-impl<SecretValue, MaskingStrategy> From<SecretValue> for Secret<SecretValue, MaskingStrategy>
-where
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn from(secret: SecretValue) -> Self {
- Self::new(secret)
- }
-}
-
-impl<SecretValue, MaskingStrategy> Clone for Secret<SecretValue, MaskingStrategy>
-where
- SecretValue: Clone,
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn clone(&self) -> Self {
- Self {
- inner_secret: self.inner_secret.clone(),
- masking_strategy: PhantomData,
- }
- }
-}
-
-impl<SecretValue, MaskingStrategy> PartialEq for Secret<SecretValue, MaskingStrategy>
-where
- Self: PeekInterface<SecretValue>,
- SecretValue: PartialEq,
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn eq(&self, other: &Self) -> bool {
- self.peek().eq(other.peek())
- }
-}
-
-impl<SecretValue, MaskingStrategy> Eq for Secret<SecretValue, MaskingStrategy>
-where
- Self: PeekInterface<SecretValue>,
- SecretValue: Eq,
- MaskingStrategy: Strategy<SecretValue>,
-{
-}
-
-impl<SecretValue, MaskingStrategy> std::hash::Hash for Secret<SecretValue, MaskingStrategy>
-where
- Self: PeekInterface<SecretValue>,
- SecretValue: std::hash::Hash,
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
- self.peek().hash(state);
- }
-}
-
-impl<SecretValue, MaskingStrategy> fmt::Debug for Secret<SecretValue, MaskingStrategy>
-where
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- MaskingStrategy::fmt(&self.inner_secret, f)
- }
-}
-
-impl<SecretValue, MaskingStrategy> Default for Secret<SecretValue, MaskingStrategy>
-where
- SecretValue: Default,
- MaskingStrategy: Strategy<SecretValue>,
-{
- fn default() -> Self {
- SecretValue::default().into()
- }
-}
-
-// Required by base64-serde to serialize Secret of Vec<u8> which contains the base64 decoded value
-impl AsRef<[u8]> for Secret<Vec<u8>> {
- fn as_ref(&self) -> &[u8] {
- self.peek().as_slice()
- }
-}
-
-/// Strategy for masking JSON values
-#[cfg(feature = "serde")]
-pub enum JsonMaskStrategy {}
-
-#[cfg(feature = "serde")]
-impl Strategy<serde_json::Value> for JsonMaskStrategy {
- fn fmt(value: &serde_json::Value, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- match value {
- serde_json::Value::Object(map) => {
- write!(f, "{{")?;
- let mut first = true;
- for (key, val) in map {
- if !first {
- write!(f, ", ")?;
- }
- first = false;
- write!(f, "\"{key}\":")?;
- Self::fmt(val, f)?;
- }
- write!(f, "}}")
- }
- serde_json::Value::Array(arr) => {
- write!(f, "[")?;
- let mut first = true;
- for val in arr {
- if !first {
- write!(f, ", ")?;
- }
- first = false;
- Self::fmt(val, f)?;
- }
- write!(f, "]")
- }
- serde_json::Value::String(s) => {
- // For strings, we show a masked version that gives a hint about the content
- // String::chars().count() is an approximation and could be greater than
- // the actual "character" count, since it does not consider graphemes (what we
- // usually consider as a "character"). To be more accurate at the cost of some
- // performance we can use "graphemes()" from the unicode-segmentation crate
- let char_count = s.chars().count();
- let masked = if char_count <= 2 {
- "**".to_string()
- } else if char_count <= 6 {
- let first = s.chars().next().unwrap_or('*');
- format!("{first}**")
- } else {
- // For longer strings, show first and last character with length in between
- let first = s.chars().next().unwrap_or('*');
- let last = s.chars().last().unwrap_or('*');
- format!("{first}**{count}**{last}", count = char_count - 2)
- };
- write!(f, "\"{masked}\"")
- }
- serde_json::Value::Number(n) => {
- // For numbers, we can show the order of magnitude
- if n.is_i64() || n.is_u64() {
- let num_str = n.to_string();
- let masked_num = "*".repeat(num_str.len());
- write!(f, "{masked_num}")
- } else if n.is_f64() {
- // For floats, just use a generic mask
- write!(f, "**.**")
- } else {
- write!(f, "0")
- }
- }
- serde_json::Value::Bool(b) => {
- // For booleans, we can show a hint about which one it is
- write!(f, "{}", if *b { "**true" } else { "**false" })
- }
- serde_json::Value::Null => write!(f, "null"),
- }
- }
-}
-
-#[cfg(feature = "proto_tonic")]
-impl<T> prost::Message for Secret<T, crate::WithType>
-where
- T: prost::Message + Default + Clone,
-{
- fn encode_raw(&self, buf: &mut impl bytes::BufMut) {
- self.peek().encode_raw(buf);
- }
-
- fn merge_field(
- &mut self,
- tag: u32,
- wire_type: prost::encoding::WireType,
- buf: &mut impl bytes::Buf,
- ctx: prost::encoding::DecodeContext,
- ) -> Result<(), prost::DecodeError> {
- if tag == 1 {
- self.peek_mut().merge_field(tag, wire_type, buf, ctx)
- } else {
- prost::encoding::skip_field(wire_type, tag, buf, ctx)
- }
- }
-
- fn encoded_len(&self) -> usize {
- self.peek().encoded_len()
- }
-
- fn clear(&mut self) {
- self.peek_mut().clear();
- }
-}
-
-#[cfg(test)]
-mod hash_tests {
- use std::hash::{DefaultHasher, Hash, Hasher};
-
- use super::*;
-
- #[test]
- fn test_secret_hash_implementation() {
- let secret1: Secret<String> = Secret::new("test_string".to_string());
- let secret2: Secret<String> = Secret::new("test_string".to_string());
- let secret3: Secret<String> = Secret::new("different_string".to_string());
-
- // Test that equal secrets hash to the same value
- let mut hasher1 = DefaultHasher::new();
- let mut hasher2 = DefaultHasher::new();
- secret1.hash(&mut hasher1);
- secret2.hash(&mut hasher2);
- assert_eq!(hasher1.finish(), hasher2.finish());
-
- // Test that different secrets hash to different values (usually)
- let mut hasher3 = DefaultHasher::new();
- secret3.hash(&mut hasher3);
- assert_ne!(hasher1.finish(), hasher3.finish());
- }
-}
-
-#[cfg(test)]
-#[cfg(feature = "serde")]
-mod tests {
- use serde_json::json;
-
- use super::*;
-
- #[test]
- fn test_json_mask_strategy() {
- // Create a sample JSON with different types for testing
- let original = json!({ "user": { "name": "John Doe", "email": "[email protected]", "age": 35, "verified": true }, "card": { "number": "4242424242424242", "cvv": 123, "amount": 99.99 }, "tags": ["personal", "premium"], "null_value": null, "short": "hi" });
-
- // Apply the JsonMaskStrategy
- let secret = Secret::<_, JsonMaskStrategy>::new(original.clone());
- let masked_str = format!("{secret:?}");
-
- // Get specific values from original
- let original_obj = original.as_object().expect("Original should be an object");
- let user_obj = original_obj["user"]
- .as_object()
- .expect("User should be an object");
- let name = user_obj["name"].as_str().expect("Name should be a string");
- let email = user_obj["email"]
- .as_str()
- .expect("Email should be a string");
- let age = user_obj["age"].as_i64().expect("Age should be a number");
- let verified = user_obj["verified"]
- .as_bool()
- .expect("Verified should be a boolean");
-
- let card_obj = original_obj["card"]
- .as_object()
- .expect("Card should be an object");
- let card_number = card_obj["number"]
- .as_str()
- .expect("Card number should be a string");
- let cvv = card_obj["cvv"].as_i64().expect("CVV should be a number");
-
- let tags = original_obj["tags"]
- .as_array()
- .expect("Tags should be an array");
- let tag1 = tags
- .first()
- .and_then(|v| v.as_str())
- .expect("First tag should be a string");
-
- // Now explicitly verify the masking patterns for each value type
-
- // 1. String masking - pattern: first char + ** + length - 2 + ** + last char
- let expected_name_mask = format!(
- "\"{}**{}**{}\"",
- name.chars().next().unwrap(),
- name.chars().count() - 2,
- name.chars().last().unwrap()
- );
- let expected_email_mask = format!(
- "\"{}**{}**{}\"",
- email.chars().next().unwrap(),
- email.chars().count() - 2,
- email.chars().last().unwrap()
- );
- let expected_card_mask = format!(
- "\"{}**{}**{}\"",
- card_number.chars().next().unwrap(),
- card_number.chars().count() - 2,
- card_number.chars().last().unwrap()
- );
- let expected_tag1_mask = if tag1.chars().count() <= 2 {
- "\"**\"".to_string()
- } else if tag1.chars().count() <= 6 {
- format!("\"{}**\"", &tag1.chars().next().unwrap())
- } else {
- format!(
- "\"{}**{}**{}\"",
- tag1.chars().next().unwrap(),
- tag1.chars().count() - 2,
- tag1.chars().last().unwrap()
- )
- };
- let expected_short_mask = "\"**\"".to_string(); // For "hi"
-
- // 2. Number masking
- let expected_age_mask = "*".repeat(age.to_string().len()); // Repeat * for the number of digits
- let expected_cvv_mask = "*".repeat(cvv.to_string().len());
-
- // 3. Boolean masking
- let expected_verified_mask = if verified { "**true" } else { "**false" };
-
- // Check that the masked output includes the expected masked patterns
- assert!(
- masked_str.contains(&expected_name_mask),
- "Name not masked correctly. Expected: {expected_name_mask}"
- );
- assert!(
- masked_str.contains(&expected_email_mask),
- "Email not masked correctly. Expected: {expected_email_mask}",
- );
- assert!(
- masked_str.contains(&expected_card_mask),
- "Card number not masked correctly. Expected: {expected_card_mask}",
- );
- assert!(
- masked_str.contains(&expected_tag1_mask),
- "Tag not masked correctly. Expected: {expected_tag1_mask}",
- );
- assert!(
- masked_str.contains(&expected_short_mask),
- "Short string not masked correctly. Expected: {expected_short_mask}",
- );
-
- assert!(
- masked_str.contains(&expected_age_mask),
- "Age not masked correctly. Expected: {expected_age_mask}",
- );
- assert!(
- masked_str.contains(&expected_cvv_mask),
- "CVV not masked correctly. Expected: {expected_cvv_mask}",
- );
-
- assert!(
- masked_str.contains(expected_verified_mask),
- "Boolean not masked correctly. Expected: {expected_verified_mask}",
- );
-
- // Check structure preservation
- assert!(
- masked_str.contains("\"user\""),
- "Structure not preserved - missing user object"
- );
- assert!(
- masked_str.contains("\"card\""),
- "Structure not preserved - missing card object"
- );
- assert!(
- masked_str.contains("\"tags\""),
- "Structure not preserved - missing tags array"
- );
- assert!(
- masked_str.contains("\"null_value\":null"),
- "Null value not preserved correctly"
- );
-
- // Additional security checks to ensure no original values are exposed
- assert!(
- !masked_str.contains(name),
- "Original name value exposed in masked output"
- );
- assert!(
- !masked_str.contains(email),
- "Original email value exposed in masked output"
- );
- assert!(
- !masked_str.contains(card_number),
- "Original card number exposed in masked output"
- );
- assert!(
- !masked_str.contains(&age.to_string()),
- "Original age value exposed in masked output"
- );
- assert!(
- !masked_str.contains(&cvv.to_string()),
- "Original CVV value exposed in masked output"
- );
- assert!(
- !masked_str.contains(tag1),
- "Original tag value exposed in masked output"
- );
- assert!(
- !masked_str.contains("hi"),
- "Original short string value exposed in masked output"
- );
- }
-
- #[test]
- fn test_unicode_masking_safety() {
- // This test ensures that masking does not panic on multi-byte unicode characters,
- // and that the output is as expected.
- let unicode_test_cases = vec![
- ("ü", r#""**""#), // 1 char <= 2
- ("😀", r#""**""#), // 1 char <= 2
- ("überspringen", r#""ü**10**n""#), // 12 chars > 6
- ("end with ü", r#""e**8**ü""#), // 10 chars > 6
- ("😀-a-long-string-with-emoji-😀", r#""😀**26**😀""#), // 28 chars > 6
- ("a", r#""**""#), // 1 char <= 2
- ("ab", r#""**""#), // 2 chars <= 2
- ("abc", r#""a**""#), // 3 chars <= 6
- ("abcdef", r#""a**""#), // 6 chars <= 6
- ("abcdefg", r#""a**5**g""#), // 7 chars > 6
- ("Homyel’ Voblasc’", r#""H**14**’""#),
- ("кпукпукп", r#""к**6**п""#),
- ];
-
- for (input, expected_mask) in unicode_test_cases {
- let json = json!({ "key": input });
- let secret = Secret::<_, JsonMaskStrategy>::new(json);
- let masked_str = format!("{secret:?}");
- let expected_output = format!(r#"{{"key":{}}}"#, expected_mask);
- assert_eq!(masked_str, expected_output, "Failed for input: '{}'", input);
- }
- }
-}
diff --git a/crates/masking/src/serde.rs b/crates/masking/src/serde.rs
deleted file mode 100644
index 463c0ebc36..0000000000
--- a/crates/masking/src/serde.rs
+++ /dev/null
@@ -1,564 +0,0 @@
-//! Serde-related.
-
-pub use erased_serde::Serialize as ErasedSerialize;
-pub use serde::{de, Deserialize, Serialize, Serializer};
-use serde_json::{value::Serializer as JsonValueSerializer, Value};
-
-use crate::{Secret, Strategy, StrongSecret, ZeroizableSecret};
-
-/// Marker trait for secret types which can be [`Serialize`]-d by [`serde`].
-///
-/// When the `serde` feature of this crate is enabled and types are marked with
-/// this trait, they receive a [`Serialize` impl] for `Secret<T>`.
-/// (NOTE: all types which impl `DeserializeOwned` receive a [`Deserialize`]
-/// impl)
-///
-/// This is done deliberately to prevent accidental exfiltration of secrets
-/// via `serde` serialization.
-#[cfg_attr(docsrs, cfg(feature = "serde"))]
-pub trait SerializableSecret: Serialize {}
-// #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
-// pub trait NonSerializableSecret: Serialize {}
-
-impl SerializableSecret for Value {}
-impl SerializableSecret for u8 {}
-impl SerializableSecret for u16 {}
-impl SerializableSecret for i8 {}
-impl SerializableSecret for i32 {}
-impl SerializableSecret for i64 {}
-impl SerializableSecret for url::Url {}
-
-#[cfg(feature = "time")]
-impl SerializableSecret for time::Date {}
-
-impl<T: SerializableSecret> SerializableSecret for &T {}
-
-impl<'de, T, I> Deserialize<'de> for Secret<T, I>
-where
- T: Clone + de::DeserializeOwned + Sized,
- I: Strategy<T>,
-{
- fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
- where
- D: de::Deserializer<'de>,
- {
- T::deserialize(deserializer).map(Self::new)
- }
-}
-
-impl<T, I> Serialize for Secret<T, I>
-where
- T: SerializableSecret + Serialize + Sized,
- I: Strategy<T>,
-{
- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
- where
- S: Serializer,
- {
- pii_serializer::pii_serialize(self, serializer)
- }
-}
-
-impl<'de, T, I> Deserialize<'de> for StrongSecret<T, I>
-where
- T: Clone + de::DeserializeOwned + Sized + ZeroizableSecret,
- I: Strategy<T>,
-{
- fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
- where
- D: serde::Deserializer<'de>,
- {
- T::deserialize(deserializer).map(Self::new)
- }
-}
-
-impl<T, I> Serialize for StrongSecret<T, I>
-where
- T: SerializableSecret + Serialize + ZeroizableSecret + Sized,
- I: Strategy<T>,
-{
- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
- where
- S: Serializer,
- {
- pii_serializer::pii_serialize(self, serializer)
- }
-}
-
-/// Masked serialization.
-///
-/// the default behaviour for secrets is to serialize in exposed format since the common use cases
-/// for storing the secret to database or sending it over the network requires the secret to be exposed
-/// This method allows to serialize the secret in masked format if needed for logs or other insecure exposures
-pub fn masked_serialize<T: Serialize>(value: &T) -> Result<Value, serde_json::Error> {
- value.serialize(PIISerializer {
- inner: JsonValueSerializer,
- })
-}
-
-/// Masked serialization.
-///
-/// Trait object for supporting serialization to Value while accounting for masking
-/// The usual Serde Serialize trait cannot be used as trait objects
-/// like &dyn Serialize or boxed trait objects like Box<dyn Serialize> because of Rust's "object safety" rules.
-/// In particular, the trait contains generic methods which cannot be made into a trait object.
-/// In this case we remove the generic for assuming the serialization to be of 2 types only raw json or masked json
-pub trait ErasedMaskSerialize: ErasedSerialize {
- /// Masked serialization.
- fn masked_serialize(&self) -> Result<Value, serde_json::Error>;
-}
-
-impl<T: Serialize + ErasedSerialize> ErasedMaskSerialize for T {
- fn masked_serialize(&self) -> Result<Value, serde_json::Error> {
- masked_serialize(self)
- }
-}
-
-impl Serialize for dyn ErasedMaskSerialize + '_ {
- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
- where
- S: Serializer,
- {
- erased_serde::serialize(self, serializer)
- }
-}
-
-impl Serialize for dyn ErasedMaskSerialize + '_ + Send {
- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
- where
- S: Serializer,
- {
- erased_serde::serialize(self, serializer)
- }
-}
-
-use pii_serializer::PIISerializer;
-
-mod pii_serializer {
- use std::fmt::Display;
-
- pub(super) fn pii_serialize<
- V: Serialize,
- T: std::fmt::Debug + PeekInterface<V>,
- S: Serializer,
- >(
- value: &T,
- serializer: S,
- ) -> Result<S::Ok, S::Error> {
- // Mask the value if the serializer is of type PIISerializer
- // or send empty map if the serializer is of type FlatMapSerializer over PiiSerializer
- if std::any::type_name::<S>() == std::any::type_name::<PIISerializer>() {
- format!("{value:?}").serialize(serializer)
- } else if std::any::type_name::<S>()
- == std::any::type_name::<
- serde::__private::ser::FlatMapSerializer<'_, SerializeMap<PIISerializer>>,
- >()
- {
- std::collections::HashMap::<String, String>::from([]).serialize(serializer)
- } else {
- value.peek().serialize(serializer)
- }
- }
-
- use serde::{Serialize, Serializer};
- use serde_json::{value::Serializer as JsonValueSerializer, Map, Value};
-
- use crate::PeekInterface;
-
- pub(super) struct PIISerializer {
- pub inner: JsonValueSerializer,
- }
-
- impl Clone for PIISerializer {
- fn clone(&self) -> Self {
- Self {
- inner: JsonValueSerializer,
- }
- }
- }
-
- impl Serializer for PIISerializer {
- type Ok = Value;
- type Error = serde_json::Error;
-
- type SerializeSeq = SerializeVec<Self>;
- type SerializeTuple = SerializeVec<Self>;
- type SerializeTupleStruct = SerializeVec<Self>;
- type SerializeTupleVariant = SerializeTupleVariant<Self>;
- type SerializeMap = SerializeMap<Self>;
- type SerializeStruct = SerializeMap<Self>;
- type SerializeStructVariant = SerializeStructVariant<Self>;
-
- #[inline]
- fn serialize_bool(self, value: bool) -> Result<Self::Ok, Self::Error> {
- self.inner.serialize_bool(value)
- }
-
- #[inline]
- fn serialize_i8(self, value: i8) -> Result<Self::Ok, Self::Error> {
- self.serialize_i64(value.into())
- }
-
- #[inline]
- fn serialize_i16(self, value: i16) -> Result<Self::Ok, Self::Error> {
- self.serialize_i64(value.into())
- }
-
- #[inline]
- fn serialize_i32(self, value: i32) -> Result<Self::Ok, Self::Error> {
- self.serialize_i64(value.into())
- }
-
- fn serialize_i64(self, value: i64) -> Result<Self::Ok, Self::Error> {
- self.inner.serialize_i64(value)
- }
-
- fn serialize_i128(self, value: i128) -> Result<Self::Ok, Self::Error> {
- self.inner.serialize_i128(value)
- }
-
- #[inline]
- fn serialize_u8(self, value: u8) -> Result<Self::Ok, Self::Error> {
- self.serialize_u64(value.into())
- }
-
- #[inline]
- fn serialize_u16(self, value: u16) -> Result<Self::Ok, Self::Error> {
- self.serialize_u64(value.into())
- }
-
- #[inline]
- fn serialize_u32(self, value: u32) -> Result<Self::Ok, Self::Error> {
- self.serialize_u64(value.into())
- }
-
- #[inline]
- fn serialize_u64(self, value: u64) -> Result<Self::Ok, Self::Error> {
- Ok(Value::Number(value.into()))
- }
-
- fn serialize_u128(self, value: u128) -> Result<Self::Ok, Self::Error> {
- self.inner.serialize_u128(value)
- }
-
- #[inline]
- fn serialize_f32(self, float: f32) -> Result<Self::Ok, Self::Error> {
- Ok(Value::from(float))
- }
-
- #[inline]
- fn serialize_f64(self, float: f64) -> Result<Self::Ok, Self::Error> {
- Ok(Value::from(float))
- }
-
- #[inline]
- fn serialize_char(self, value: char) -> Result<Self::Ok, Self::Error> {
- let mut s = String::new();
- s.push(value);
- Ok(Value::String(s))
- }
-
- #[inline]
- fn serialize_str(self, value: &str) -> Result<Self::Ok, Self::Error> {
- Ok(Value::String(value.to_owned()))
- }
-
- fn serialize_bytes(self, value: &[u8]) -> Result<Self::Ok, Self::Error> {
- let vec = value.iter().map(|&b| Value::Number(b.into())).collect();
- Ok(Value::Array(vec))
- }
-
- #[inline]
- fn serialize_unit(self) -> Result<Self::Ok, Self::Error> {
- Ok(Value::Null)
- }
-
- #[inline]
- fn serialize_unit_struct(self, _name: &'static str) -> Result<Self::Ok, Self::Error> {
- self.serialize_unit()
- }
-
- #[inline]
- fn serialize_unit_variant(
- self,
- _name: &'static str,
- _variant_index: u32,
- variant: &'static str,
- ) -> Result<Self::Ok, Self::Error> {
- self.serialize_str(variant)
- }
-
- #[inline]
- fn serialize_newtype_struct<T>(
- self,
- _name: &'static str,
- value: &T,
- ) -> Result<Self::Ok, Self::Error>
- where
- T: ?Sized + Serialize,
- {
- value.serialize(self)
- }
-
- fn serialize_newtype_variant<T>(
- self,
- _name: &'static str,
- _variant_index: u32,
- variant: &'static str,
- value: &T,
- ) -> Result<Self::Ok, Self::Error>
- where
- T: ?Sized + Serialize,
- {
- let mut values = Map::new();
- values.insert(String::from(variant), value.serialize(self)?);
- Ok(Value::Object(values))
- }
-
- #[inline]
- fn serialize_none(self) -> Result<Self::Ok, Self::Error> {
- self.serialize_unit()
- }
-
- #[inline]
- fn serialize_some<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
- where
- T: ?Sized + Serialize,
- {
- value.serialize(self)
- }
-
- fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {
- Ok(SerializeVec {
- vec: Vec::with_capacity(len.unwrap_or(0)),
- ser: self,
- })
- }
-
- fn serialize_tuple(self, len: usize) -> Result<Self::SerializeTuple, Self::Error> {
- self.serialize_seq(Some(len))
- }
-
- fn serialize_tuple_struct(
- self,
- _name: &'static str,
- len: usize,
- ) -> Result<Self::SerializeTupleStruct, Self::Error> {
- self.serialize_seq(Some(len))
- }
-
- fn serialize_tuple_variant(
- self,
- _name: &'static str,
- _variant_index: u32,
- variant: &'static str,
- len: usize,
- ) -> Result<Self::SerializeTupleVariant, Self::Error> {
- Ok(SerializeTupleVariant {
- name: String::from(variant),
- vec: Vec::with_capacity(len),
- ser: self,
- })
- }
-
- fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, Self::Error> {
- Ok(SerializeMap {
- inner: self.clone().inner.serialize_map(len)?,
- ser: self,
- })
- }
-
- fn serialize_struct(
- self,
- _name: &'static str,
- len: usize,
- ) -> Result<Self::SerializeStruct, Self::Error> {
- self.serialize_map(Some(len))
- }
-
- fn serialize_struct_variant(
- self,
- _name: &'static str,
- _variant_index: u32,
- variant: &'static str,
- _len: usize,
- ) -> Result<Self::SerializeStructVariant, Self::Error> {
- Ok(SerializeStructVariant {
- name: String::from(variant),
- map: Map::new(),
- ser: self,
- })
- }
-
- fn collect_str<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
- where
- T: ?Sized + Display,
- {
- self.inner.collect_str(value)
- }
- }
-
- pub(super) struct SerializeVec<T: Serializer> {
- vec: Vec<Value>,
- ser: T,
- }
-
- impl<T: Serializer<Ok = Value> + Clone> serde::ser::SerializeSeq for SerializeVec<T> {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_element<V>(&mut self, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- self.vec.push(value.serialize(self.ser.clone())?);
- Ok(())
- }
-
- fn end(self) -> Result<Self::Ok, Self::Error> {
- Ok(Value::Array(self.vec))
- }
- }
-
- impl<T: Serializer<Ok = Value> + Clone> serde::ser::SerializeTuple for SerializeVec<T> {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_element<V>(&mut self, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- serde::ser::SerializeSeq::serialize_element(self, value)
- }
-
- fn end(self) -> Result<Self::Ok, Self::Error> {
- serde::ser::SerializeSeq::end(self)
- }
- }
-
- impl<T: Serializer<Ok = Value> + Clone> serde::ser::SerializeTupleStruct for SerializeVec<T> {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_field<V>(&mut self, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- serde::ser::SerializeSeq::serialize_element(self, value)
- }
-
- fn end(self) -> Result<Self::Ok, Self::Error> {
- serde::ser::SerializeSeq::end(self)
- }
- }
-
- pub(super) struct SerializeStructVariant<T: Serializer> {
- name: String,
- map: Map<String, Value>,
- ser: T,
- }
-
- impl<T: Serializer<Ok = Value> + Clone> serde::ser::SerializeStructVariant
- for SerializeStructVariant<T>
- {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_field<V>(&mut self, key: &'static str, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- self.map
- .insert(String::from(key), value.serialize(self.ser.clone())?);
- Ok(())
- }
-
- fn end(self) -> Result<Self::Ok, Self::Error> {
- let mut object = Map::new();
-
- object.insert(self.name, Value::Object(self.map));
-
- Ok(Value::Object(object))
- }
- }
-
- pub(super) struct SerializeTupleVariant<T: Serializer> {
- name: String,
- vec: Vec<Value>,
- ser: T,
- }
-
- impl<T: Serializer<Ok = Value> + Clone> serde::ser::SerializeTupleVariant
- for SerializeTupleVariant<T>
- {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_field<V>(&mut self, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- self.vec.push(value.serialize(self.ser.clone())?);
- Ok(())
- }
-
- fn end(self) -> Result<Value, Self::Error> {
- let mut object = Map::new();
-
- object.insert(self.name, Value::Array(self.vec));
-
- Ok(Value::Object(object))
- }
- }
-
- pub(super) struct SerializeMap<T: Serializer> {
- inner: <serde_json::value::Serializer as Serializer>::SerializeMap,
- ser: T,
- }
-
- impl<T: Serializer<Ok = Value, Error = serde_json::Error> + Clone> serde::ser::SerializeMap
- for SerializeMap<T>
- {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_key<V>(&mut self, key: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- self.inner.serialize_key(key)?;
- Ok(())
- }
-
- fn serialize_value<V>(&mut self, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- let value = value.serialize(self.ser.clone())?;
- self.inner.serialize_value(&value)?;
- Ok(())
- }
-
- fn end(self) -> Result<Value, Self::Error> {
- self.inner.end()
- }
- }
-
- impl<T: Serializer<Ok = Value, Error = serde_json::Error> + Clone> serde::ser::SerializeStruct
- for SerializeMap<T>
- {
- type Ok = Value;
- type Error = T::Error;
-
- fn serialize_field<V>(&mut self, key: &'static str, value: &V) -> Result<(), Self::Error>
- where
- V: ?Sized + Serialize,
- {
- serde::ser::SerializeMap::serialize_entry(self, key, value)
- }
-
- fn end(self) -> Result<Value, Self::Error> {
- serde::ser::SerializeMap::end(self)
- }
- }
-}
diff --git a/crates/masking/src/strategy.rs b/crates/masking/src/strategy.rs
deleted file mode 100644
index b497cc3ed4..0000000000
--- a/crates/masking/src/strategy.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-use core::fmt;
-
-/// Debugging trait which is specialized for handling secret values
-pub trait Strategy<T> {
- /// Format information about the secret's type.
- fn fmt(value: &T, fmt: &mut fmt::Formatter<'_>) -> fmt::Result;
-}
-
-/// Debug with type
-#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
-#[derive(Debug, Copy, Clone, PartialEq)]
-pub enum WithType {}
-
-impl<T> Strategy<T> for WithType {
- fn fmt(_: &T, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt.write_str("*** ")?;
- fmt.write_str(std::any::type_name::<T>())?;
- fmt.write_str(" ***")
- }
-}
-
-/// Debug without type
-pub enum WithoutType {}
-
-impl<T> Strategy<T> for WithoutType {
- fn fmt(_: &T, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt.write_str("*** ***")
- }
-}
diff --git a/crates/masking/src/string.rs b/crates/masking/src/string.rs
deleted file mode 100644
index be6e90a215..0000000000
--- a/crates/masking/src/string.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-//! Secret strings
-//!
-//! There is not alias type by design.
-
-use alloc::{
- str::FromStr,
- string::{String, ToString},
-};
-
-#[cfg(feature = "serde")]
-use super::SerializableSecret;
-use super::{Secret, Strategy};
-use crate::StrongSecret;
-
-#[cfg(feature = "serde")]
-impl SerializableSecret for String {}
-
-impl<I> FromStr for Secret<String, I>
-where
- I: Strategy<String>,
-{
- type Err = core::convert::Infallible;
-
- fn from_str(src: &str) -> Result<Self, Self::Err> {
- Ok(Self::new(src.to_string()))
- }
-}
-
-impl<I> FromStr for StrongSecret<String, I>
-where
- I: Strategy<String>,
-{
- type Err = core::convert::Infallible;
-
- fn from_str(src: &str) -> Result<Self, Self::Err> {
- Ok(Self::new(src.to_string()))
- }
-}
diff --git a/crates/masking/src/strong_secret.rs b/crates/masking/src/strong_secret.rs
deleted file mode 100644
index 31b559275b..0000000000
--- a/crates/masking/src/strong_secret.rs
+++ /dev/null
@@ -1,160 +0,0 @@
-//! Structure describing secret.
-
-use std::{fmt, marker::PhantomData};
-
-use subtle::ConstantTimeEq;
-use zeroize::{self, Zeroize as ZeroizableSecret};
-
-use crate::{strategy::Strategy, PeekInterface};
-
-/// Secret thing.
-///
-/// To get access to value use method `expose()` of trait [`crate::ExposeInterface`].
-pub struct StrongSecret<Secret: ZeroizableSecret, MaskingStrategy = crate::WithType> {
- /// Inner secret value
- pub(crate) inner_secret: Secret,
- pub(crate) masking_strategy: PhantomData<MaskingStrategy>,
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy> StrongSecret<Secret, MaskingStrategy> {
- /// Take ownership of a secret value
- pub fn new(secret: Secret) -> Self {
- Self {
- inner_secret: secret,
- masking_strategy: PhantomData,
- }
- }
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy> PeekInterface<Secret>
- for StrongSecret<Secret, MaskingStrategy>
-{
- fn peek(&self) -> &Secret {
- &self.inner_secret
- }
-
- fn peek_mut(&mut self) -> &mut Secret {
- &mut self.inner_secret
- }
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy> From<Secret>
- for StrongSecret<Secret, MaskingStrategy>
-{
- fn from(secret: Secret) -> Self {
- Self::new(secret)
- }
-}
-
-impl<Secret: Clone + ZeroizableSecret, MaskingStrategy> Clone
- for StrongSecret<Secret, MaskingStrategy>
-{
- fn clone(&self) -> Self {
- Self {
- inner_secret: self.inner_secret.clone(),
- masking_strategy: PhantomData,
- }
- }
-}
-
-impl<Secret, MaskingStrategy> PartialEq for StrongSecret<Secret, MaskingStrategy>
-where
- Self: PeekInterface<Secret>,
- Secret: ZeroizableSecret + StrongEq,
-{
- fn eq(&self, other: &Self) -> bool {
- StrongEq::strong_eq(self.peek(), other.peek())
- }
-}
-
-impl<Secret, MaskingStrategy> Eq for StrongSecret<Secret, MaskingStrategy>
-where
- Self: PeekInterface<Secret>,
- Secret: ZeroizableSecret + StrongEq,
-{
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy: Strategy<Secret>> fmt::Debug
- for StrongSecret<Secret, MaskingStrategy>
-{
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- MaskingStrategy::fmt(&self.inner_secret, f)
- }
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy: Strategy<Secret>> fmt::Display
- for StrongSecret<Secret, MaskingStrategy>
-{
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- MaskingStrategy::fmt(&self.inner_secret, f)
- }
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy> Default for StrongSecret<Secret, MaskingStrategy>
-where
- Secret: ZeroizableSecret + Default,
-{
- fn default() -> Self {
- Secret::default().into()
- }
-}
-
-impl<Secret: ZeroizableSecret, MaskingStrategy> Drop for StrongSecret<Secret, MaskingStrategy> {
- fn drop(&mut self) {
- self.inner_secret.zeroize();
- }
-}
-
-trait StrongEq {
- fn strong_eq(&self, other: &Self) -> bool;
-}
-
-impl StrongEq for String {
- fn strong_eq(&self, other: &Self) -> bool {
- let lhs = self.as_bytes();
- let rhs = other.as_bytes();
-
- bool::from(lhs.ct_eq(rhs))
- }
-}
-
-impl StrongEq for Vec<u8> {
- fn strong_eq(&self, other: &Self) -> bool {
- let lhs = &self;
- let rhs = &other;
-
- bool::from(lhs.ct_eq(rhs))
- }
-}
-
-#[cfg(feature = "proto_tonic")]
-impl<T> prost::Message for StrongSecret<T, crate::WithType>
-where
- T: prost::Message + Default + Clone + ZeroizableSecret,
-{
- fn encode_raw(&self, buf: &mut impl bytes::BufMut) {
- self.peek().encode_raw(buf);
- }
-
- fn merge_field(
- &mut self,
- tag: u32,
- wire_type: prost::encoding::WireType,
- buf: &mut impl bytes::Buf,
- ctx: prost::encoding::DecodeContext,
- ) -> Result<(), prost::DecodeError> {
- if tag == 1 {
- self.peek_mut().merge_field(tag, wire_type, buf, ctx)
- } else {
- prost::encoding::skip_field(wire_type, tag, buf, ctx)
- }
- }
-
- fn encoded_len(&self) -> usize {
- self.peek().encoded_len()
- }
-
- fn clear(&mut self) {
- self.peek_mut().clear();
- }
-}
diff --git a/crates/masking/src/vec.rs b/crates/masking/src/vec.rs
deleted file mode 100644
index 2a077be994..0000000000
--- a/crates/masking/src/vec.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-//! Secret `Vec` types
-//!
-//! There is not alias type by design.
-
-#[cfg(feature = "serde")]
-use super::{SerializableSecret, Serialize};
-
-#[cfg(feature = "serde")]
-impl<S: Serialize> SerializableSecret for Vec<S> {}
diff --git a/crates/masking/tests/basic.rs b/crates/masking/tests/basic.rs
deleted file mode 100644
index 0e67f3480d..0000000000
--- a/crates/masking/tests/basic.rs
+++ /dev/null
@@ -1,154 +0,0 @@
-#![allow(dead_code, clippy::panic_in_result_fn)]
-
-use masking::Secret;
-#[cfg(feature = "serde")]
-use masking::SerializableSecret;
-#[cfg(feature = "alloc")]
-use masking::ZeroizableSecret;
-#[cfg(feature = "serde")]
-use serde::Serialize;
-
-#[test]
-fn basic() {
- #[cfg_attr(feature = "serde", derive(Serialize))]
- #[derive(Clone, Debug, PartialEq, Eq)]
- pub struct AccountNumber(String);
-
- #[cfg(feature = "alloc")]
- impl ZeroizableSecret for AccountNumber {
- fn zeroize(&mut self) {
- self.0.zeroize();
- }
- }
-
- #[cfg(feature = "serde")]
- impl SerializableSecret for AccountNumber {}
-
- #[cfg_attr(feature = "serde", derive(Serialize))]
- #[derive(Clone, Debug, PartialEq, Eq)]
- pub struct Composite {
- secret_number: Secret<AccountNumber>,
- not_secret: String,
- }
-
- // construct
-
- let secret_number = Secret::<AccountNumber>::new(AccountNumber("abc".to_string()));
- let not_secret = "not secret".to_string();
- let composite = Composite {
- secret_number,
- not_secret,
- };
-
- // clone
- #[allow(clippy::redundant_clone)] // We are asserting that the cloned value is equal
- let composite2 = composite.clone();
- assert_eq!(composite, composite2);
-
- // format
-
- let got = format!("{composite:?}");
- let exp = r#"Composite { secret_number: *** basic::basic::AccountNumber ***, not_secret: "not secret" }"#;
- assert_eq!(got, exp);
-
- // serialize
-
- #[cfg(feature = "serde")]
- {
- let got = serde_json::to_string(&composite).unwrap();
- let exp = r#"{"secret_number":"abc","not_secret":"not secret"}"#;
- assert_eq!(got, exp);
- }
-
- // end
-}
-
-#[test]
-fn without_serialize() {
- #[cfg_attr(feature = "serde", derive(Serialize))]
- #[derive(Clone, Debug, PartialEq, Eq)]
- pub struct AccountNumber(String);
-
- #[cfg(feature = "alloc")]
- impl ZeroizableSecret for AccountNumber {
- fn zeroize(&mut self) {
- self.0.zeroize();
- }
- }
-
- #[cfg_attr(feature = "serde", derive(Serialize))]
- #[derive(Clone, Debug, PartialEq, Eq)]
- pub struct Composite {
- #[cfg_attr(feature = "serde", serde(skip))]
- secret_number: Secret<AccountNumber>,
- not_secret: String,
- }
-
- // construct
-
- let secret_number = Secret::<AccountNumber>::new(AccountNumber("abc".to_string()));
- let not_secret = "not secret".to_string();
- let composite = Composite {
- secret_number,
- not_secret,
- };
-
- // format
-
- let got = format!("{composite:?}");
- let exp = r#"Composite { secret_number: *** basic::without_serialize::AccountNumber ***, not_secret: "not secret" }"#;
- assert_eq!(got, exp);
-
- // serialize
-
- #[cfg(feature = "serde")]
- {
- let got = serde_json::to_string(&composite).unwrap();
- let exp = r#"{"not_secret":"not secret"}"#;
- assert_eq!(got, exp);
- }
-
- // end
-}
-
-#[test]
-fn for_string() {
- #[cfg_attr(all(feature = "alloc", feature = "serde"), derive(Serialize))]
- #[derive(Clone, Debug, PartialEq, Eq)]
- pub struct Composite {
- secret_number: Secret<String>,
- not_secret: String,
- }
-
- // construct
-
- let secret_number = Secret::<String>::new("abc".to_string());
- let not_secret = "not secret".to_string();
- let composite = Composite {
- secret_number,
- not_secret,
- };
-
- // clone
- #[allow(clippy::redundant_clone)] // We are asserting that the cloned value is equal
- let composite2 = composite.clone();
- assert_eq!(composite, composite2);
-
- // format
-
- let got = format!("{composite:?}");
- let exp =
- r#"Composite { secret_number: *** alloc::string::String ***, not_secret: "not secret" }"#;
- assert_eq!(got, exp);
-
- // serialize
-
- #[cfg(all(feature = "alloc", feature = "serde"))]
- {
- let got = serde_json::to_string(&composite).unwrap();
- let exp = r#"{"secret_number":"abc","not_secret":"not secret"}"#;
- assert_eq!(got, exp);
- }
-
- // end
-}
diff --git a/crates/payment_methods/Cargo.toml b/crates/payment_methods/Cargo.toml
index aac2a36302..59a48affc7 100644
--- a/crates/payment_methods/Cargo.toml
+++ b/crates/payment_methods/Cargo.toml
@@ -13,7 +13,7 @@ bytes = "1.10.1"
csv = "1.3.1"
dyn-clone = "1.0.19"
error-stack = "0.4.1"
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
rdkafka = "0.36.2"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
diff --git a/crates/payment_methods/src/client/create.rs b/crates/payment_methods/src/client/create.rs
index f5050f5805..6cad95527c 100644
--- a/crates/payment_methods/src/client/create.rs
+++ b/crates/payment_methods/src/client/create.rs
@@ -9,7 +9,7 @@ use common_utils::{
};
use hyperswitch_domain_models::payment_method_data::PaymentMethodData;
use hyperswitch_interfaces::micro_service::{MicroserviceClientError, MicroserviceClientErrorKind};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
/// V1-facing create flow type.
diff --git a/crates/payment_methods/src/client/update.rs b/crates/payment_methods/src/client/update.rs
index 2887bc7ea2..2dcdadfdd7 100644
--- a/crates/payment_methods/src/client/update.rs
+++ b/crates/payment_methods/src/client/update.rs
@@ -7,7 +7,7 @@ use common_utils::{
request::{Method, RequestContent},
};
use hyperswitch_interfaces::micro_service::{MicroserviceClientError, MicroserviceClientErrorKind};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
diff --git a/crates/payment_methods/src/configs/settings.rs b/crates/payment_methods/src/configs/settings.rs
index 8deb384714..a157ef6a3a 100644
--- a/crates/payment_methods/src/configs/settings.rs
+++ b/crates/payment_methods/src/configs/settings.rs
@@ -7,7 +7,7 @@ use hyperswitch_interfaces::secrets_interface::{
secret_state::{RawSecret, SecretStateContainer, SecuredSecret},
SecretManagementInterface, SecretsManagementError,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{self, Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
diff --git a/crates/payment_methods/src/controller.rs b/crates/payment_methods/src/controller.rs
index 8b50a6095b..3694f2aa87 100644
--- a/crates/payment_methods/src/controller.rs
+++ b/crates/payment_methods/src/controller.rs
@@ -12,7 +12,7 @@ use error_stack::ResultExt;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::payment_methods::PaymentMethodVaultSourceDetails;
use hyperswitch_domain_models::{merchant_key_store, payment_methods, type_encryption};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
#[cfg(feature = "v1")]
use scheduler::errors as sch_errors;
use serde::{Deserialize, Serialize};
@@ -295,7 +295,7 @@ where
.change_context(storage_errors::StorageError::SerializationFailed)
.attach_printable("Unable to encode data")?;
- let secret_data = Secret::<_, masking::WithType>::new(encoded_data);
+ let secret_data = Secret::<_, hyperswitch_masking::WithType>::new(encoded_data);
let encrypted_data = type_encryption::crypto_operation(
key_manager_state,
diff --git a/crates/payment_methods/src/core/migration.rs b/crates/payment_methods/src/core/migration.rs
index bc9f5f3cef..e278c7da5b 100644
--- a/crates/payment_methods/src/core/migration.rs
+++ b/crates/payment_methods/src/core/migration.rs
@@ -4,7 +4,7 @@ use csv::Reader;
use error_stack::ResultExt;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::{api, platform};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use rdkafka::message::ToBytes;
use router_env::{instrument, tracing};
@@ -218,8 +218,8 @@ fn parse_csv(data: &[u8]) -> csv::Result<Vec<pm_api::PaymentMethodRecord>> {
#[instrument(skip_all)]
pub fn validate_card_expiry(
- card_exp_month: &masking::Secret<String>,
- card_exp_year: &masking::Secret<String>,
+ card_exp_month: &hyperswitch_masking::Secret<String>,
+ card_exp_year: &hyperswitch_masking::Secret<String>,
) -> errors::CustomResult<(), errors::ApiErrorResponse> {
let exp_month = card_exp_month
.peek()
diff --git a/crates/payment_methods/src/core/migration/payment_methods.rs b/crates/payment_methods/src/core/migration/payment_methods.rs
index f52d55917f..a521d65e29 100644
--- a/crates/payment_methods/src/core/migration/payment_methods.rs
+++ b/crates/payment_methods/src/core/migration/payment_methods.rs
@@ -19,9 +19,9 @@ use hyperswitch_domain_models::{
};
#[cfg(feature = "v1")]
use hyperswitch_domain_models::{ext_traits::OptionExt, payment_methods as domain_pm};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
#[cfg(feature = "v1")]
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[cfg(feature = "v1")]
use router_env::{instrument, logger, tracing};
#[cfg(feature = "v1")]
diff --git a/crates/payment_methods/src/types.rs b/crates/payment_methods/src/types.rs
index e160533e8b..a672abc39d 100644
--- a/crates/payment_methods/src/types.rs
+++ b/crates/payment_methods/src/types.rs
@@ -86,7 +86,7 @@ pub struct ConnectorTokenDetails {
pub original_payment_authorized_amount: Option<common_utils::types::MinorUnit>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub metadata: Option<pii::SecretSerdeValue>,
- pub token: masking::Secret<String>,
+ pub token: hyperswitch_masking::Secret<String>,
}
/// V2 CardCVCTokenStorageDetails (for deserialization, ignored in transformation)
diff --git a/crates/pm_auth/Cargo.toml b/crates/pm_auth/Cargo.toml
index b7f3a7af8b..3086456bf9 100644
--- a/crates/pm_auth/Cargo.toml
+++ b/crates/pm_auth/Cargo.toml
@@ -15,7 +15,7 @@ v1 = ["api_models/v1", "common_utils/v1"]
api_models = { version = "0.1.0", path = "../api_models" }
common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
# Third party crates
async-trait = "0.1.88"
diff --git a/crates/pm_auth/src/connector/plaid.rs b/crates/pm_auth/src/connector/plaid.rs
index 0d933bf6a6..dd95057dfc 100644
--- a/crates/pm_auth/src/connector/plaid.rs
+++ b/crates/pm_auth/src/connector/plaid.rs
@@ -7,7 +7,7 @@ use common_utils::{
request::{Method, Request, RequestBuilder, RequestContent},
};
use error_stack::ResultExt;
-use masking::{Mask, Maskable};
+use hyperswitch_masking::{Mask, Maskable};
use transformers as plaid;
use crate::{
diff --git a/crates/pm_auth/src/connector/plaid/transformers.rs b/crates/pm_auth/src/connector/plaid/transformers.rs
index b15207770d..5342e71810 100644
--- a/crates/pm_auth/src/connector/plaid/transformers.rs
+++ b/crates/pm_auth/src/connector/plaid/transformers.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use common_enums::{PaymentMethod, PaymentMethodType};
use common_utils::{id_type, types as util_types};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{core::errors, types};
diff --git a/crates/pm_auth/src/types.rs b/crates/pm_auth/src/types.rs
index fbef8fadb5..6f5fdca885 100644
--- a/crates/pm_auth/src/types.rs
+++ b/crates/pm_auth/src/types.rs
@@ -6,7 +6,7 @@ use api::auth_service::{BankAccountCredentials, ExchangeToken, LinkToken, Recipi
use api_models::enums as api_enums;
use common_enums::{CountryAlpha2, PaymentMethod, PaymentMethodType};
use common_utils::{id_type, types};
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[derive(Debug, Clone)]
pub struct PaymentAuthRouterData<F, Request, Response> {
diff --git a/crates/pm_auth/src/types/api.rs b/crates/pm_auth/src/types/api.rs
index d4edf16098..c50c78f906 100644
--- a/crates/pm_auth/src/types/api.rs
+++ b/crates/pm_auth/src/types/api.rs
@@ -6,7 +6,7 @@ use common_utils::{
errors::CustomResult,
request::{Request, RequestContent},
};
-use masking::Maskable;
+use hyperswitch_masking::Maskable;
use crate::{
core::errors::ConnectorError,
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 64483ced06..656e866bdd 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -59,7 +59,7 @@ blake3 = "1.8.2"
bytes = "1.10.1"
clap = { version = "4.5.38", default-features = false, features = ["std", "derive", "help", "usage"] }
config = { version = "0.14.1", features = ["toml"] }
-prost-types = { version = "0.13", optional = true }
+prost-types = { version = "0.14", optional = true }
cookie = "0.18.1"
csv = "1.3.1"
diesel = { version = "2.2.10", features = ["postgres"] }
@@ -90,9 +90,8 @@ reqwest = { version = "0.11.27", features = ["json", "rustls-tls", "gzip", "mult
ring = "0.17.14"
rust_decimal = { version = "1.37.1", features = ["serde-with-float", "serde-with-str"] }
rust-i18n = { git = "https://github.com/kashif-m/rust-i18n", rev = "f2d8096aaaff7a87a847c35a5394c269f75e077a" }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "95144b0829b8b3d8c4b0914921b43540abb6ac50", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "95144b0829b8b3d8c4b0914921b43540abb6ac50", package = "ucs_cards" }
-unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.11.24.0", package = "masking" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.03.04.0-hotfix1", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.03.04.0-hotfix1", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = "0.22"
rustls-pemfile = "2"
@@ -136,7 +135,7 @@ hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_m
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces", default-features = false }
injector = { version = "0.1.0", path = "../injector", optional = true }
kgraph_utils = { version = "0.1.0", path = "../kgraph_utils" }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
pm_auth = { version = "0.1.0", path = "../pm_auth", package = "pm_auth" }
redis_interface = { version = "0.1.0", path = "../redis_interface" }
router_derive = { version = "0.1.0", path = "../router_derive" }
diff --git a/crates/router/src/analytics.rs b/crates/router/src/analytics.rs
index de14d6cee9..59e2b94258 100644
--- a/crates/router/src/analytics.rs
+++ b/crates/router/src/analytics.rs
@@ -30,7 +30,7 @@ pub mod routes {
use common_utils::{pii::Email, types::TimeRange};
use error_stack::{report, ResultExt};
use futures::{stream::FuturesUnordered, StreamExt};
- use masking::ExposeInterface;
+ use hyperswitch_masking::ExposeInterface;
use router_env::logger;
use crate::{
diff --git a/crates/router/src/compatibility/stripe/customers/types.rs b/crates/router/src/compatibility/stripe/customers/types.rs
index acfe8a2fb5..8b63e12814 100644
--- a/crates/router/src/compatibility/stripe/customers/types.rs
+++ b/crates/router/src/compatibility/stripe/customers/types.rs
@@ -19,28 +19,28 @@ use crate::types::{api, api::enums as api_enums};
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone)]
pub struct Shipping {
pub address: StripeAddressDetails,
- pub name: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
pub carrier: Option<String>,
- pub phone: Option<masking::Secret<String>>,
- pub tracking_number: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
+ pub tracking_number: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone)]
pub struct StripeAddressDetails {
pub city: Option<String>,
pub country: Option<api_enums::CountryAlpha2>,
- pub line1: Option<masking::Secret<String>>,
- pub line2: Option<masking::Secret<String>>,
- pub postal_code: Option<masking::Secret<String>>,
- pub state: Option<masking::Secret<String>>,
+ pub line1: Option<hyperswitch_masking::Secret<String>>,
+ pub line2: Option<hyperswitch_masking::Secret<String>>,
+ pub postal_code: Option<hyperswitch_masking::Secret<String>>,
+ pub state: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct CreateCustomerRequest {
pub email: Option<Email>,
pub invoice_prefix: Option<String>,
- pub name: Option<masking::Secret<String>>,
- pub phone: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
pub address: Option<StripeAddressDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub description: Option<Description>,
@@ -64,8 +64,8 @@ pub struct CreateCustomerRequest {
pub struct CustomerUpdateRequest {
pub description: Option<Description>,
pub email: Option<Email>,
- pub phone: Option<masking::Secret<String, masking::WithType>>,
- pub name: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String, hyperswitch_masking::WithType>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
pub address: Option<StripeAddressDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub shipping: Option<Shipping>,
@@ -91,8 +91,8 @@ pub struct CreateCustomerResponse {
pub description: Option<Description>,
pub email: Option<Email>,
pub metadata: Option<pii::SecretSerdeValue>,
- pub name: Option<masking::Secret<String>>,
- pub phone: Option<masking::Secret<String, masking::WithType>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String, hyperswitch_masking::WithType>>,
}
pub type CustomerRetrieveResponse = CreateCustomerResponse;
@@ -208,9 +208,9 @@ pub struct PaymentMethodData {
pub struct CardDetails {
pub country: Option<String>,
pub last4: Option<String>,
- pub exp_month: Option<masking::Secret<String>>,
- pub exp_year: Option<masking::Secret<String>>,
- pub fingerprint: Option<masking::Secret<String>>,
+ pub exp_month: Option<hyperswitch_masking::Secret<String>>,
+ pub exp_year: Option<hyperswitch_masking::Secret<String>>,
+ pub fingerprint: Option<hyperswitch_masking::Secret<String>>,
}
#[cfg(feature = "v1")]
diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs
index a69c97700a..308c3156df 100644
--- a/crates/router/src/compatibility/stripe/payment_intents/types.rs
+++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs
@@ -30,7 +30,7 @@ pub struct StripeBillingDetails {
pub address: Option<AddressDetails>,
pub email: Option<Email>,
pub name: Option<String>,
- pub phone: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
}
impl From<StripeBillingDetails> for payments::Address {
@@ -62,10 +62,10 @@ impl From<StripeBillingDetails> for payments::Address {
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone, Debug)]
pub struct StripeCard {
pub number: cards::CardNumber,
- pub exp_month: masking::Secret<String>,
- pub exp_year: masking::Secret<String>,
- pub cvc: masking::Secret<String>,
- pub holder_name: Option<masking::Secret<String>>,
+ pub exp_month: hyperswitch_masking::Secret<String>,
+ pub exp_year: hyperswitch_masking::Secret<String>,
+ pub cvc: hyperswitch_masking::Secret<String>,
+ pub holder_name: Option<hyperswitch_masking::Secret<String>>,
}
// ApplePay wallet param is not available in stripe Docs
@@ -77,7 +77,7 @@ pub enum StripeWallet {
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone, Debug)]
pub struct StripeUpi {
- pub vpa_id: masking::Secret<String, UpiVpaMaskingStrategy>,
+ pub vpa_id: hyperswitch_masking::Secret<String, UpiVpaMaskingStrategy>,
}
#[derive(Debug, Default, Serialize, PartialEq, Eq, Deserialize, Clone)]
@@ -172,20 +172,20 @@ impl From<StripePaymentMethodDetails> for payments::PaymentMethodData {
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone, Debug)]
pub struct Shipping {
pub address: AddressDetails,
- pub name: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
pub carrier: Option<String>,
- pub phone: Option<masking::Secret<String>>,
- pub tracking_number: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
+ pub tracking_number: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone, Debug)]
pub struct AddressDetails {
pub city: Option<String>,
pub country: Option<api_enums::CountryAlpha2>,
- pub line1: Option<masking::Secret<String>>,
- pub line2: Option<masking::Secret<String>>,
- pub postal_code: Option<masking::Secret<String>>,
- pub state: Option<masking::Secret<String>>,
+ pub line1: Option<hyperswitch_masking::Secret<String>>,
+ pub line2: Option<hyperswitch_masking::Secret<String>>,
+ pub postal_code: Option<hyperswitch_masking::Secret<String>>,
+ pub state: Option<hyperswitch_masking::Secret<String>>,
}
impl From<Shipping> for payments::Address {
@@ -242,7 +242,7 @@ pub enum AcceptanceType {
#[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct OnlineMandate {
- pub ip_address: masking::Secret<String, IpAddress>,
+ pub ip_address: hyperswitch_masking::Secret<String, IpAddress>,
pub user_agent: String,
}
@@ -266,7 +266,7 @@ pub struct StripePaymentIntentRequest {
pub statement_descriptor: Option<String>,
pub statement_descriptor_suffix: Option<String>,
pub metadata: Option<serde_json::Value>,
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,
pub mandate: Option<String>,
@@ -477,7 +477,7 @@ pub struct StripePaymentIntentResponse {
pub amount_capturable: i64,
pub currency: String,
pub status: StripePaymentStatus,
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
pub created: Option<i64>,
pub customer: Option<id_type::CustomerId>,
pub refunds: Option<Vec<stripe_refunds::StripeRefundResponse>>,
@@ -500,11 +500,11 @@ pub struct StripePaymentIntentResponse {
pub capture_on: Option<PrimitiveDateTime>,
pub payment_token: Option<String>,
pub email: Option<Email>,
- pub phone: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
pub statement_descriptor_suffix: Option<String>,
pub statement_descriptor_name: Option<String>,
pub capture_method: Option<api_models::enums::CaptureMethod>,
- pub name: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
pub last_payment_error: Option<LastPaymentError>,
pub connector_transaction_id: Option<String>,
}
@@ -715,7 +715,7 @@ pub struct MandateOption {
#[serde(default, with = "common_utils::custom_serde::timestamp::option")]
pub accepted_at: Option<PrimitiveDateTime>,
pub user_agent: Option<String>,
- pub ip_address: Option<masking::Secret<String, IpAddress>>,
+ pub ip_address: Option<hyperswitch_masking::Secret<String, IpAddress>>,
pub mandate_type: Option<StripeMandateType>,
pub amount: Option<i64>,
#[serde(default, with = "common_utils::custom_serde::timestamp::option")]
diff --git a/crates/router/src/compatibility/stripe/refunds/types.rs b/crates/router/src/compatibility/stripe/refunds/types.rs
index 2e8b74ff4f..de2e46a6a8 100644
--- a/crates/router/src/compatibility/stripe/refunds/types.rs
+++ b/crates/router/src/compatibility/stripe/refunds/types.rs
@@ -89,7 +89,7 @@ impl From<refunds::RefundResponse> for StripeRefundResponse {
created: res.created_at.map(|t| t.assume_utc().unix_timestamp()),
metadata: res
.metadata
- .unwrap_or_else(|| masking::Secret::new(serde_json::json!({}))),
+ .unwrap_or_else(|| hyperswitch_masking::Secret::new(serde_json::json!({}))),
}
}
}
diff --git a/crates/router/src/compatibility/stripe/setup_intents/types.rs b/crates/router/src/compatibility/stripe/setup_intents/types.rs
index cf220bfa04..49da9edbd0 100644
--- a/crates/router/src/compatibility/stripe/setup_intents/types.rs
+++ b/crates/router/src/compatibility/stripe/setup_intents/types.rs
@@ -96,7 +96,7 @@ impl From<StripeCard> for payments::Card {
card_number: card.number,
card_exp_month: card.exp_month,
card_exp_year: card.exp_year,
- card_holder_name: Some(masking::Secret::new("stripe_cust".to_owned())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("stripe_cust".to_owned())),
card_cvc: card.cvc,
card_issuer: None,
card_network: None,
@@ -228,10 +228,11 @@ impl TryFrom<StripeSetupIntentRequest> for payments::PaymentsRequest {
field_name: "currency",
})?,
email: item.receipt_email,
- name: item
- .billing_details
- .as_ref()
- .and_then(|b| b.name.as_ref().map(|x| masking::Secret::new(x.to_owned()))),
+ name: item.billing_details.as_ref().and_then(|b| {
+ b.name
+ .as_ref()
+ .map(|x| hyperswitch_masking::Secret::new(x.to_owned()))
+ }),
phone: item.shipping.as_ref().and_then(|s| s.phone.clone()),
description: item.description,
return_url: item.return_url,
@@ -502,7 +503,7 @@ pub struct StripeSetupIntentResponse {
pub id: id_type::PaymentId,
pub object: String,
pub status: StripeSetupStatus,
- pub client_secret: Option<masking::Secret<String>>,
+ pub client_secret: Option<hyperswitch_masking::Secret<String>>,
pub metadata: Option<Value>,
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::PrimitiveDateTime>,
diff --git a/crates/router/src/compatibility/stripe/webhooks.rs b/crates/router/src/compatibility/stripe/webhooks.rs
index 29942ef3c5..3e2913f4fc 100644
--- a/crates/router/src/compatibility/stripe/webhooks.rs
+++ b/crates/router/src/compatibility/stripe/webhooks.rs
@@ -119,9 +119,9 @@ pub struct StripePayoutResponse {
pub currency: String,
pub payout_type: Option<common_enums::PayoutType>,
pub status: StripePayoutStatus,
- pub name: Option<masking::Secret<String>>,
+ pub name: Option<hyperswitch_masking::Secret<String>>,
pub email: Option<Email>,
- pub phone: Option<masking::Secret<String>>,
+ pub phone: Option<hyperswitch_masking::Secret<String>>,
pub phone_country_code: Option<String>,
pub created: Option<i64>,
pub metadata: Option<pii::SecretSerdeValue>,
diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs
index 42a4004ae1..9c0c3206e9 100644
--- a/crates/router/src/configs/settings.rs
+++ b/crates/router/src/configs/settings.rs
@@ -33,7 +33,7 @@ pub use hyperswitch_interfaces::{
},
types::{ComparisonServiceConfig, Proxy},
};
-use masking::{Maskable, Secret};
+use hyperswitch_masking::{Maskable, Secret};
pub use payment_methods::configs::settings::{
BankRedirectConfig, BanksVector, ConnectorBankNames, ConnectorFields, EligiblePaymentMethods,
InstallmentConfig, Installments, Mandates, PaymentMethodAuth, PaymentMethodType,
diff --git a/crates/router/src/configs/validations.rs b/crates/router/src/configs/validations.rs
index 998b94013a..ba3191fdad 100644
--- a/crates/router/src/configs/validations.rs
+++ b/crates/router/src/configs/validations.rs
@@ -1,5 +1,5 @@
use common_utils::ext_traits::ConfigExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use storage_impl::errors::ApplicationError;
impl super::settings::Secrets {
diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs
index f82f736f0e..f6bfffd606 100644
--- a/crates/router/src/connector/utils.rs
+++ b/crates/router/src/connector/utils.rs
@@ -24,7 +24,7 @@ use common_utils::{
use diesel_models::{enums, types::OrderDetailsWithAmount};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt;
-use masking::{Deserialize, ExposeInterface, Secret};
+use hyperswitch_masking::{Deserialize, ExposeInterface, Secret};
use regex::Regex;
#[cfg(feature = "frm")]
diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs
index 5a0017a6f2..b88cc5e26b 100644
--- a/crates/router/src/core/admin.rs
+++ b/crates/router/src/core/admin.rs
@@ -19,7 +19,7 @@ use external_services::http_client::client;
use hyperswitch_domain_models::merchant_connector_account::{
FromRequestEncryptableMerchantConnectorAccount, UpdateEncryptableMerchantConnectorAccount,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use pm_auth::types as pm_auth_types;
use uuid::Uuid;
#[cfg(feature = "olap")]
@@ -340,7 +340,7 @@ pub async fn create_merchant_account(
key_manager_state,
EncryptionTransferRequest {
identifier: identifier.clone(),
- key: masking::StrongSecret::new(consts::BASE64_ENGINE.encode(key)),
+ key: hyperswitch_masking::StrongSecret::new(consts::BASE64_ENGINE.encode(key)),
},
)
.await
@@ -4700,7 +4700,9 @@ async fn locker_recipient_create_call(
let encrypted_data = domain_types::crypto_operation(
key_manager_state,
type_name!(payment_method::PaymentMethod),
- domain_types::CryptoOperation::Encrypt(Secret::<String, masking::WithType>::new(data_json)),
+ domain_types::CryptoOperation::Encrypt(
+ Secret::<String, hyperswitch_masking::WithType>::new(data_json),
+ ),
identifier,
key,
)
diff --git a/crates/router/src/core/api_keys.rs b/crates/router/src/core/api_keys.rs
index 8eeae7bda1..64f1485aa5 100644
--- a/crates/router/src/core/api_keys.rs
+++ b/crates/router/src/core/api_keys.rs
@@ -2,7 +2,7 @@ use common_utils::date_time;
#[cfg(feature = "email")]
use diesel_models::{api_keys::ApiKey, enums as storage_enums};
use error_stack::{report, ResultExt};
-use masking::{PeekInterface, StrongSecret};
+use hyperswitch_masking::{PeekInterface, StrongSecret};
use router_env::{instrument, tracing};
use crate::{
diff --git a/crates/router/src/core/apple_pay_certificates_migration.rs b/crates/router/src/core/apple_pay_certificates_migration.rs
index 106e738ca3..adb804767b 100644
--- a/crates/router/src/core/apple_pay_certificates_migration.rs
+++ b/crates/router/src/core/apple_pay_certificates_migration.rs
@@ -1,7 +1,7 @@
use api_models::apple_pay_certificates_migration;
use common_utils::{errors::CustomResult, type_name, types::keymanager::Identifier};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use super::{
errors::{self, StorageErrorExt},
diff --git a/crates/router/src/core/authentication.rs b/crates/router/src/core/authentication.rs
index a77686c935..eaf17b24c6 100644
--- a/crates/router/src/core/authentication.rs
+++ b/crates/router/src/core/authentication.rs
@@ -8,7 +8,7 @@ use common_enums::Currency;
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
use hyperswitch_domain_models::authentication;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use super::errors::StorageErrorExt;
use crate::{
@@ -206,7 +206,7 @@ pub async fn perform_post_authentication(
let authentication_store =
hyperswitch_domain_models::router_request_types::authentication::AuthenticationStore {
- cavv: tokenized_data.map(|data| masking::Secret::new(data.value1)),
+ cavv: tokenized_data.map(|data| hyperswitch_masking::Secret::new(data.value1)),
authentication: authentication_update,
};
diff --git a/crates/router/src/core/authentication/utils.rs b/crates/router/src/core/authentication/utils.rs
index e271960066..242a589aae 100644
--- a/crates/router/src/core/authentication/utils.rs
+++ b/crates/router/src/core/authentication/utils.rs
@@ -4,7 +4,7 @@ use hyperswitch_domain_models::{
authentication, router_data_v2::ExternalAuthenticationFlowData, router_request_types,
type_encryption::AsyncLift,
};
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use crate::{
consts,
@@ -83,7 +83,7 @@ pub async fn update_trackers<F: Clone, Req>(
.clone()
.map(|billing| {
common_utils::ext_traits::Encode::encode_to_value(&billing)
- .map(masking::Secret::<serde_json::Value>::new)
+ .map(hyperswitch_masking::Secret::<serde_json::Value>::new)
})
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
@@ -94,7 +94,7 @@ pub async fn update_trackers<F: Clone, Req>(
.clone()
.map(|shipping| {
common_utils::ext_traits::Encode::encode_to_value(&shipping)
- .map(masking::Secret::<serde_json::Value>::new)
+ .map(hyperswitch_masking::Secret::<serde_json::Value>::new)
})
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
diff --git a/crates/router/src/core/blocklist/transformers.rs b/crates/router/src/core/blocklist/transformers.rs
index f9262d2aeb..b8d80d6bce 100644
--- a/crates/router/src/core/blocklist/transformers.rs
+++ b/crates/router/src/core/blocklist/transformers.rs
@@ -1,6 +1,6 @@
use api_models::blocklist;
use error_stack::ResultExt;
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use router_env::{instrument, tracing};
use crate::{
diff --git a/crates/router/src/core/blocklist/utils.rs b/crates/router/src/core/blocklist/utils.rs
index 631bd1ba0c..1c78c331fa 100644
--- a/crates/router/src/core/blocklist/utils.rs
+++ b/crates/router/src/core/blocklist/utils.rs
@@ -3,7 +3,7 @@ use common_enums::MerchantDecision;
use common_utils::errors::CustomResult;
use diesel_models::configs;
use error_stack::ResultExt;
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use super::{errors, transformers::generate_fingerprint, SessionState};
use crate::{
diff --git a/crates/router/src/core/card_testing_guard/utils.rs b/crates/router/src/core/card_testing_guard/utils.rs
index 679babfc9f..e27dfdbf71 100644
--- a/crates/router/src/core/card_testing_guard/utils.rs
+++ b/crates/router/src/core/card_testing_guard/utils.rs
@@ -2,7 +2,7 @@ use error_stack::ResultExt;
use hyperswitch_domain_models::{
card_testing_guard_data::CardTestingGuardData, router_request_types::BrowserInformation,
};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::logger;
use super::errors;
diff --git a/crates/router/src/core/chat.rs b/crates/router/src/core/chat.rs
index a690986a04..6af3fb5217 100644
--- a/crates/router/src/core/chat.rs
+++ b/crates/router/src/core/chat.rs
@@ -8,7 +8,7 @@ use common_utils::{
use error_stack::ResultExt;
use external_services::http_client;
use hyperswitch_domain_models::chat as chat_domain;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::{
instrument, logger,
tracing::{self, Instrument},
diff --git a/crates/router/src/core/connector_onboarding.rs b/crates/router/src/core/connector_onboarding.rs
index 5813a5bcd0..8a83ac16f9 100644
--- a/crates/router/src/core/connector_onboarding.rs
+++ b/crates/router/src/core/connector_onboarding.rs
@@ -1,5 +1,5 @@
use api_models::{connector_onboarding as api, enums};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use crate::{
core::errors::{ApiErrorResponse, RouterResponse, RouterResult},
diff --git a/crates/router/src/core/connector_onboarding/paypal.rs b/crates/router/src/core/connector_onboarding/paypal.rs
index 1181a11660..09a99be1b3 100644
--- a/crates/router/src/core/connector_onboarding/paypal.rs
+++ b/crates/router/src/core/connector_onboarding/paypal.rs
@@ -2,7 +2,7 @@ use api_models::{admin::MerchantConnectorUpdate, connector_onboarding as api};
use common_utils::ext_traits::Encode;
use error_stack::ResultExt;
pub use external_services::http_client;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
core::{
diff --git a/crates/router/src/core/connector_validation.rs b/crates/router/src/core/connector_validation.rs
index 7167125a33..55f7376315 100644
--- a/crates/router/src/core/connector_validation.rs
+++ b/crates/router/src/core/connector_validation.rs
@@ -2,7 +2,7 @@ use api_models::enums as api_enums;
use common_utils::pii;
use error_stack::ResultExt;
use external_services::http_client::client;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use pm_auth::connector::plaid::transformers::PlaidAuthType;
use crate::{core::errors, types, types::transformers::ForeignTryFrom};
diff --git a/crates/router/src/core/customers.rs b/crates/router/src/core/customers.rs
index 61962b8e82..cef81a606d 100644
--- a/crates/router/src/core/customers.rs
+++ b/crates/router/src/core/customers.rs
@@ -16,7 +16,7 @@ use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
payment_methods as payment_methods_domain, type_encryption::AsyncLift,
};
-use masking::{ExposeInterface, Secret, SwitchStrategy};
+use hyperswitch_masking::{ExposeInterface, Secret, SwitchStrategy};
use payment_methods::controller::PaymentMethodsController;
use router_env::{instrument, tracing};
diff --git a/crates/router/src/core/debit_routing.rs b/crates/router/src/core/debit_routing.rs
index c1b9730dee..c933d54c94 100644
--- a/crates/router/src/core/debit_routing.rs
+++ b/crates/router/src/core/debit_routing.rs
@@ -4,7 +4,7 @@ use api_models::{enums as api_enums, open_router};
use common_enums::enums;
use common_utils::{errors::CustomResult, ext_traits::ValueExt, id_type};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use super::{
payments::{OperationSessionGetters, OperationSessionSetters},
diff --git a/crates/router/src/core/encryption.rs b/crates/router/src/core/encryption.rs
index 355746ecc2..e3270929d6 100644
--- a/crates/router/src/core/encryption.rs
+++ b/crates/router/src/core/encryption.rs
@@ -6,7 +6,7 @@ use common_utils::{
};
use error_stack::ResultExt;
use hyperswitch_domain_models::merchant_key_store::MerchantKeyStore;
-use masking::{ExposeInterface, StrongSecret};
+use hyperswitch_masking::{ExposeInterface, StrongSecret};
use crate::{consts::BASE64_ENGINE, errors, types::domain::UserKeyStore, SessionState};
diff --git a/crates/router/src/core/external_service_auth.rs b/crates/router/src/core/external_service_auth.rs
index 116576cfd5..55b8f8f7bf 100644
--- a/crates/router/src/core/external_service_auth.rs
+++ b/crates/router/src/core/external_service_auth.rs
@@ -1,7 +1,7 @@
use api_models::external_service_auth as external_service_auth_api;
use common_utils::fp_utils;
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use crate::{
core::errors::{self, RouterResponse},
diff --git a/crates/router/src/core/fraud_check.rs b/crates/router/src/core/fraud_check.rs
index 9ae1db3f26..6d75db152e 100644
--- a/crates/router/src/core/fraud_check.rs
+++ b/crates/router/src/core/fraud_check.rs
@@ -3,7 +3,7 @@ use std::fmt::Debug;
use api_models::{self, enums as api_enums};
use common_enums::CaptureMethod;
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{
logger,
tracing::{self, instrument},
@@ -179,7 +179,7 @@ where
D: payments::OperationSessionGetters<F> + Send + Sync + Clone,
{
use common_utils::ext_traits::OptionExt;
- use masking::ExposeInterface;
+ use hyperswitch_masking::ExposeInterface;
let db = &*state.store;
match platform
@@ -428,7 +428,7 @@ where
// when the order_details are present within the meta_data, we need to take those to support backward compatibility
payment_data.get_payment_intent().metadata.clone().and_then(|meta| {
let order_details = meta.get("order_details").to_owned();
- order_details.map(|order| vec![masking::Secret::new(order.to_owned())])
+ order_details.map(|order| vec![hyperswitch_masking::Secret::new(order.to_owned())])
}))
.map(|order_details_value| {
order_details_value
diff --git a/crates/router/src/core/fraud_check/flows/checkout_flow.rs b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
index 1db60bc104..316df9de6c 100644
--- a/crates/router/src/core/fraud_check/flows/checkout_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
@@ -2,7 +2,7 @@ use async_trait::async_trait;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::payment_intent;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use super::{ConstructFlowSpecificData, FeatureFrm};
use crate::{
diff --git a/crates/router/src/core/fraud_check/flows/sale_flow.rs b/crates/router/src/core/fraud_check/flows/sale_flow.rs
index 55766031ea..5369b04cf7 100644
--- a/crates/router/src/core/fraud_check/flows/sale_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/sale_flow.rs
@@ -2,7 +2,7 @@ use async_trait::async_trait;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::payment_intent;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use crate::{
core::{
diff --git a/crates/router/src/core/fraud_check/types.rs b/crates/router/src/core/fraud_check/types.rs
index 2aa486fdb3..28ee1dec6f 100644
--- a/crates/router/src/core/fraud_check/types.rs
+++ b/crates/router/src/core/fraud_check/types.rs
@@ -13,7 +13,7 @@ pub use hyperswitch_domain_models::{
},
types::OrderDetailsWithAmount,
};
-use masking::Serialize;
+use hyperswitch_masking::Serialize;
use serde::Deserialize;
use utoipa::ToSchema;
diff --git a/crates/router/src/core/locker_migration.rs b/crates/router/src/core/locker_migration.rs
index fbdb5d8524..0a8a2ad2d1 100644
--- a/crates/router/src/core/locker_migration.rs
+++ b/crates/router/src/core/locker_migration.rs
@@ -134,7 +134,7 @@ pub async fn call_to_locker(
card_exp_month: card.card_exp_month,
card_exp_year: card.card_exp_year,
card_holder_name: card.name_on_card,
- nick_name: card.nick_name.map(masking::Secret::new),
+ nick_name: card.nick_name.map(hyperswitch_masking::Secret::new),
card_cvc: None,
card_issuing_country: None,
card_issuing_country_code: None,
diff --git a/crates/router/src/core/mandate.rs b/crates/router/src/core/mandate.rs
index 1685d4259c..89bad7ad9e 100644
--- a/crates/router/src/core/mandate.rs
+++ b/crates/router/src/core/mandate.rs
@@ -179,7 +179,7 @@ pub async fn update_connector_mandate_id(
.map(|md| {
md.encode_to_value()
.change_context(errors::ApiErrorResponse::InternalServerError)
- .map(masking::Secret::new)
+ .map(hyperswitch_masking::Secret::new)
})
.transpose()?;
@@ -357,7 +357,7 @@ where
.map(|md| {
md.encode_to_value()
.change_context(errors::ApiErrorResponse::MandateSerializationFailed)
- .map(masking::Secret::new)
+ .map(hyperswitch_masking::Secret::new)
})
.transpose()?;
diff --git a/crates/router/src/core/payment_link.rs b/crates/router/src/core/payment_link.rs
index b7c849963d..2336ea78e8 100644
--- a/crates/router/src/core/payment_link.rs
+++ b/crates/router/src/core/payment_link.rs
@@ -12,7 +12,7 @@ use common_utils::{
use error_stack::{report, ResultExt};
use futures::future;
use hyperswitch_domain_models::api::{GenericLinks, GenericLinksData};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::logger;
use time::PrimitiveDateTime;
diff --git a/crates/router/src/core/payment_method_balance.rs b/crates/router/src/core/payment_method_balance.rs
index b298024c21..0d51bef6b7 100644
--- a/crates/router/src/core/payment_method_balance.rs
+++ b/crates/router/src/core/payment_method_balance.rs
@@ -19,7 +19,7 @@ use hyperswitch_domain_models::{
router_response_types::GiftCardBalanceCheckResponseData,
};
use hyperswitch_interfaces::connector_integration_interface::RouterDataConversion;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::{instrument, tracing};
use crate::{
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs
index dc66081574..7b3af64e0c 100644
--- a/crates/router/src/core/payment_methods.rs
+++ b/crates/router/src/core/payment_methods.rs
@@ -56,8 +56,8 @@ use hyperswitch_domain_models::{
};
use hyperswitch_interfaces::connector_integration_interface::RouterDataConversion;
#[cfg(feature = "v2")]
-use masking::ExposeInterface;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::{instrument, tracing};
use time::Duration;
diff --git a/crates/router/src/core/payment_methods/batch_retrieve.rs b/crates/router/src/core/payment_methods/batch_retrieve.rs
index 59d84dd99a..1697bc09cf 100644
--- a/crates/router/src/core/payment_methods/batch_retrieve.rs
+++ b/crates/router/src/core/payment_methods/batch_retrieve.rs
@@ -6,7 +6,7 @@ use api_models::payment_methods::{
};
use common_utils::{ext_traits::ValueExt, id_type};
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::logger;
use crate::{
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index dd0d174b8d..3f5cbe5286 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -50,9 +50,9 @@ use hyperswitch_constraint_graph as cgraph;
use hyperswitch_domain_models::customer::CustomerUpdate;
use hyperswitch_domain_models::mandates::CommonMandateReference;
use hyperswitch_interfaces::secrets_interface::secret_state::RawSecret;
+use hyperswitch_masking::Secret;
#[cfg(feature = "v1")]
use kgraph_utils::transformers::IntoDirValue;
-use masking::Secret;
use router_env::{instrument, tracing};
use scheduler::errors as sch_errors;
use strum::IntoEnumIterator;
@@ -95,7 +95,7 @@ use crate::{
utils as core_utils,
},
db, logger,
- pii::prelude::*,
+ pii::{ExposeInterface, ExposeOptionInterface, PeekInterface},
routes::{self, metrics, payment_methods::ParentPaymentMethodToken},
services,
types::{
@@ -4962,18 +4962,19 @@ where
{
let key = key_store.key.get_inner().peek();
let identifier = Identifier::Merchant(key_store.merchant_id.clone());
- let decrypted_data = domain::types::crypto_operation::<serde_json::Value, masking::WithType>(
- &state.into(),
- type_name!(T),
- domain::types::CryptoOperation::DecryptOptional(data),
- identifier,
- key,
- )
- .await
- .and_then(|val| val.try_into_optionaloperation())
- .change_context(errors::StorageError::DecryptionError)
- .change_context(errors::ApiErrorResponse::InternalServerError)
- .attach_printable("unable to decrypt data")?;
+ let decrypted_data =
+ domain::types::crypto_operation::<serde_json::Value, hyperswitch_masking::WithType>(
+ &state.into(),
+ type_name!(T),
+ domain::types::CryptoOperation::DecryptOptional(data),
+ identifier,
+ key,
+ )
+ .await
+ .and_then(|val| val.try_into_optionaloperation())
+ .change_context(errors::StorageError::DecryptionError)
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("unable to decrypt data")?;
decrypted_data
.map(|decrypted_data| decrypted_data.into_inner().expose())
@@ -5409,7 +5410,7 @@ where
.change_context(errors::StorageError::SerializationFailed)
.attach_printable("Unable to encode data")?;
- let secret_data = Secret::<_, masking::WithType>::new(encoded_data);
+ let secret_data = Secret::<_, hyperswitch_masking::WithType>::new(encoded_data);
let encrypted_data = domain::types::crypto_operation(
key_manager_state,
diff --git a/crates/router/src/core/payment_methods/migration.rs b/crates/router/src/core/payment_methods/migration.rs
index 37708531c8..c25bc014c4 100644
--- a/crates/router/src/core/payment_methods/migration.rs
+++ b/crates/router/src/core/payment_methods/migration.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
api::ApplicationResponse, errors::api_error_response as errors,
payment_methods::StoragePaymentMethodUpdate as PaymentMethodUpdate, platform,
};
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use payment_methods::core::migration::MerchantConnectorValidator;
use rdkafka::message::ToBytes;
use router_env::logger;
diff --git a/crates/router/src/core/payment_methods/network_tokenization.rs b/crates/router/src/core/payment_methods/network_tokenization.rs
index baa233c782..1ad0927dd5 100644
--- a/crates/router/src/core/payment_methods/network_tokenization.rs
+++ b/crates/router/src/core/payment_methods/network_tokenization.rs
@@ -22,8 +22,8 @@ use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payment_method_data::{
NetworkTokenDetails, NetworkTokenDetailsPaymentMethod,
};
+use hyperswitch_masking::{ErasedMaskSerialize, ExposeInterface, Mask, PeekInterface, Secret};
use josekit::jwe;
-use masking::{ErasedMaskSerialize, ExposeInterface, Mask, PeekInterface, Secret};
use super::transformers::DeleteCardResp;
#[cfg(feature = "v2")]
diff --git a/crates/router/src/core/payment_methods/tokenize.rs b/crates/router/src/core/payment_methods/tokenize.rs
index 7487d7221c..19214997ab 100644
--- a/crates/router/src/core/payment_methods/tokenize.rs
+++ b/crates/router/src/core/payment_methods/tokenize.rs
@@ -8,7 +8,7 @@ use common_utils::{
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::router_request_types as domain_request_types;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use router_env::logger;
use crate::{
diff --git a/crates/router/src/core/payment_methods/tokenize/card_executor.rs b/crates/router/src/core/payment_methods/tokenize/card_executor.rs
index c7e884944a..62dc74ca22 100644
--- a/crates/router/src/core/payment_methods/tokenize/card_executor.rs
+++ b/crates/router/src/core/payment_methods/tokenize/card_executor.rs
@@ -12,7 +12,7 @@ use common_utils::{
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::type_encryption::{crypto_operation, CryptoOperation};
-use masking::{ExposeInterface, PeekInterface, SwitchStrategy};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, SwitchStrategy};
use router_env::logger;
use super::{
@@ -179,7 +179,10 @@ impl<'a> NetworkTokenizationBuilder<'a, CardDetailsAssigned> {
impl<'a> NetworkTokenizationBuilder<'a, CustomerAssigned> {
pub fn get_optional_card_and_cvc(
&self,
- ) -> (Option<domain::CardDetail>, Option<masking::Secret<String>>) {
+ ) -> (
+ Option<domain::CardDetail>,
+ Option<hyperswitch_masking::Secret<String>>,
+ ) {
(self.card.clone(), self.card_cvc.clone())
}
pub fn set_token_details(
diff --git a/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs b/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs
index fab964316f..df3a67a5e8 100644
--- a/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs
+++ b/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs
@@ -1,7 +1,7 @@
use api_models::enums as api_enums;
use common_utils::{ext_traits::OptionExt, fp_utils::when, pii::Email};
use error_stack::{report, ResultExt};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::logger;
use super::{
diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs
index b3c86523b7..f49ece5f6f 100644
--- a/crates/router/src/core/payment_methods/transformers.rs
+++ b/crates/router/src/core/payment_methods/transformers.rs
@@ -14,10 +14,10 @@ use common_utils::{
use error_stack::ResultExt;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::{payment_method_data, sdk_auth::SdkAuthorization};
-use josekit::jwe;
#[cfg(feature = "v1")]
-use masking::Mask;
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::Mask;
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
+use josekit::jwe;
#[cfg(feature = "v1")]
use payment_methods::client::{
self as pm_client,
diff --git a/crates/router/src/core/payment_methods/utils.rs b/crates/router/src/core/payment_methods/utils.rs
index dab25670ea..fc6afdd22b 100644
--- a/crates/router/src/core/payment_methods/utils.rs
+++ b/crates/router/src/core/payment_methods/utils.rs
@@ -12,8 +12,8 @@ use common_utils::ext_traits::{OptionExt, StringExt};
use error_stack::ResultExt;
use euclid::frontend::dir;
use hyperswitch_constraint_graph as cgraph;
+use hyperswitch_masking::ExposeInterface;
use kgraph_utils::{error::KgraphError, transformers::IntoDirValue};
-use masking::ExposeInterface;
#[cfg(feature = "v1")]
use router_env::logger;
use storage_impl::redis::cache::{CacheKey, PM_FILTERS_CGRAPH_CACHE};
@@ -32,7 +32,7 @@ use crate::{
pub fn make_pm_graph(
builder: &mut cgraph::ConstraintGraphBuilder<dir::DirValue>,
domain_id: cgraph::DomainId,
- payment_methods: &[masking::Secret<serde_json::value::Value>],
+ payment_methods: &[hyperswitch_masking::Secret<serde_json::value::Value>],
connector: String,
pm_config_mapping: &settings::ConnectorFilters,
supported_payment_methods_for_mandate: &settings::SupportedPaymentMethodsForMandate,
diff --git a/crates/router/src/core/payment_methods/validator.rs b/crates/router/src/core/payment_methods/validator.rs
index 88492652bc..f0ef72ee77 100644
--- a/crates/router/src/core/payment_methods/validator.rs
+++ b/crates/router/src/core/payment_methods/validator.rs
@@ -2,7 +2,7 @@ use api_models::{admin, payment_methods::PaymentMethodCollectLinkRequest};
use common_utils::link_utils;
use diesel_models::generic_link::PaymentMethodCollectLinkData;
use error_stack::ResultExt;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use crate::{
consts,
diff --git a/crates/router/src/core/payment_methods/vault.rs b/crates/router/src/core/payment_methods/vault.rs
index 8652b416da..71096ab27e 100644
--- a/crates/router/src/core/payment_methods/vault.rs
+++ b/crates/router/src/core/payment_methods/vault.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::router_flow_types::{
use hyperswitch_domain_models::{
router_data_v2::flow_common_types::VaultConnectorFlowData, types::VaultRouterData,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use scheduler::{types::process_data, utils as process_tracker_utils};
@@ -139,7 +139,7 @@ impl Vaultable for domain::Card {
card_issuing_country: None,
card_issuing_country_code: None,
card_type: None,
- nick_name: value1.nickname.map(masking::Secret::new),
+ nick_name: value1.nickname.map(hyperswitch_masking::Secret::new),
card_holder_name: value1.card_holder_name,
co_badged_card_data: None,
};
@@ -536,7 +536,7 @@ impl Vaultable for api::CardPayout {
.map_err(|_| errors::VaultError::FetchCardFailed)?,
expiry_month: value1.exp_month.into(),
expiry_year: value1.exp_year.into(),
- card_holder_name: value1.name_on_card.map(masking::Secret::new),
+ card_holder_name: value1.name_on_card.map(hyperswitch_masking::Secret::new),
card_network: value1.card_network,
};
@@ -552,13 +552,13 @@ impl Vaultable for api::CardPayout {
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct TokenizedWalletSensitiveValues {
pub email: Option<Email>,
- pub telephone_number: Option<masking::Secret<String>>,
- pub wallet_id: Option<masking::Secret<String>>,
+ pub telephone_number: Option<hyperswitch_masking::Secret<String>>,
+ pub wallet_id: Option<hyperswitch_masking::Secret<String>>,
pub wallet_type: PaymentMethodType,
pub dpan: Option<cards::CardNumber>,
- pub expiry_month: Option<masking::Secret<String>>,
- pub expiry_year: Option<masking::Secret<String>>,
- pub card_holder_name: Option<masking::Secret<String>>,
+ pub expiry_month: Option<hyperswitch_masking::Secret<String>>,
+ pub expiry_year: Option<hyperswitch_masking::Secret<String>>,
+ pub card_holder_name: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
@@ -687,14 +687,14 @@ impl Vaultable for api::WalletPayout {
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct TokenizedBankSensitiveValues {
- pub bank_account_number: Option<masking::Secret<String>>,
- pub bank_routing_number: Option<masking::Secret<String>>,
- pub bic: Option<masking::Secret<String>>,
- pub bank_sort_code: Option<masking::Secret<String>>,
- pub iban: Option<masking::Secret<String>>,
- pub pix_key: Option<masking::Secret<String>>,
- pub tax_id: Option<masking::Secret<String>>,
- pub bank_number: Option<masking::Secret<String>>,
+ pub bank_account_number: Option<hyperswitch_masking::Secret<String>>,
+ pub bank_routing_number: Option<hyperswitch_masking::Secret<String>>,
+ pub bic: Option<hyperswitch_masking::Secret<String>>,
+ pub bank_sort_code: Option<hyperswitch_masking::Secret<String>>,
+ pub iban: Option<hyperswitch_masking::Secret<String>>,
+ pub pix_key: Option<hyperswitch_masking::Secret<String>>,
+ pub tax_id: Option<hyperswitch_masking::Secret<String>>,
+ pub bank_number: Option<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
@@ -1154,8 +1154,8 @@ impl Vaultable for api::PassthroughPayout {
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct TokenizedBankRedirectSensitiveValues {
pub email: Option<Email>,
- pub iban: Option<masking::Secret<String>>,
- pub account_holder_name: Option<masking::Secret<String>>,
+ pub iban: Option<hyperswitch_masking::Secret<String>>,
+ pub account_holder_name: Option<hyperswitch_masking::Secret<String>>,
pub bank_redirect_type: PaymentMethodType,
}
@@ -1166,7 +1166,7 @@ pub struct TokenizedBankRedirectInsensitiveValues {
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct TokenizedPassthroughSensitiveValues {
- pub psp_token: masking::Secret<String>,
+ pub psp_token: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
@@ -1322,7 +1322,7 @@ pub async fn create_tokenize_without_configurable_expiry(
value1: String,
value2: Option<String>,
lookup_key: String,
- encryption_key: &masking::Secret<Vec<u8>>,
+ encryption_key: &hyperswitch_masking::Secret<Vec<u8>>,
) -> RouterResult<String> {
create_tokenize(state, value1, value2, lookup_key, encryption_key, None).await
}
@@ -1333,7 +1333,7 @@ pub async fn create_tokenize_with_configurable_expiry(
value1: String,
value2: Option<String>,
lookup_key: String,
- encryption_key: &masking::Secret<Vec<u8>>,
+ encryption_key: &hyperswitch_masking::Secret<Vec<u8>>,
expiry_time: Option<i64>,
) -> RouterResult<String> {
create_tokenize(
@@ -1353,7 +1353,7 @@ async fn create_tokenize(
value1: String,
value2: Option<String>,
lookup_key: String,
- encryption_key: &masking::Secret<Vec<u8>>,
+ encryption_key: &hyperswitch_masking::Secret<Vec<u8>>,
expiry_time: Option<i64>,
) -> RouterResult<String> {
let redis_key = get_redis_locker_key(lookup_key.as_str());
@@ -1418,7 +1418,7 @@ pub async fn get_tokenized_data(
state: &routes::SessionState,
lookup_key: &str,
_should_get_value2: bool,
- encryption_key: &masking::Secret<Vec<u8>>,
+ encryption_key: &hyperswitch_masking::Secret<Vec<u8>>,
) -> RouterResult<api::TokenizePayloadRequest> {
let redis_key = get_redis_locker_key(lookup_key);
let func = || async {
@@ -1439,7 +1439,7 @@ pub async fn get_tokenized_data(
let decrypted_payload = GcmAes256
.decode_message(
encryption_key.peek().as_ref(),
- masking::Secret::new(resp.into()),
+ hyperswitch_masking::Secret::new(resp.into()),
)
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to decode redis temp locker data")?;
@@ -1864,7 +1864,7 @@ pub async fn retrieve_payment_method_from_vault_using_payment_token(
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct TemporaryVaultCvc {
- card_cvc: masking::Secret<String>,
+ card_cvc: hyperswitch_masking::Secret<String>,
}
#[cfg(feature = "v2")]
@@ -1872,7 +1872,7 @@ pub struct TemporaryVaultCvc {
pub async fn insert_cvc_using_payment_token(
state: &routes::SessionState,
payment_method_id: &id_type::GlobalPaymentMethodId,
- card_cvc: masking::Secret<String>,
+ card_cvc: hyperswitch_masking::Secret<String>,
fulfillment_time: i64,
key_store: &domain::MerchantKeyStore,
) -> RouterResult<api_models::payment_methods::CardCVCTokenStorageDetails> {
@@ -1925,7 +1925,7 @@ pub async fn retrieve_and_delete_cvc_from_payment_token(
state: &routes::SessionState,
payment_method_id: &String,
key_store: &domain::MerchantKeyStore,
-) -> RouterResult<masking::Secret<String>> {
+) -> RouterResult<hyperswitch_masking::Secret<String>> {
let redis_conn = state
.store
.get_redis_conn()
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index fe3dd54e0c..e7d0c0cd4b 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -72,7 +72,7 @@ use hyperswitch_domain_models::{
payments::{self, payment_intent::CustomerData, ClickToPayMetaData},
router_data::AccessToken,
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
#[cfg(feature = "v2")]
use operations::ValidateStatusForOperation;
use redis_interface::errors::RedisError;
diff --git a/crates/router/src/core/payments/customers.rs b/crates/router/src/core/payments/customers.rs
index 47c33dab01..cb79d998e5 100644
--- a/crates/router/src/core/payments/customers.rs
+++ b/crates/router/src/core/payments/customers.rs
@@ -1,6 +1,6 @@
pub use hyperswitch_domain_models::customer::update_connector_customer_in_customers;
use hyperswitch_interfaces::api::{gateway, ConnectorSpecifications};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
#[cfg(feature = "v2")]
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index 68af9235be..782657133c 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -22,9 +22,8 @@ use hyperswitch_interfaces::{
consts as interface_consts, errors as interface_errors,
unified_connector_service::transformers as ucs_transformers,
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
// use router_env::tracing::Instrument;
use super::{ConstructFlowSpecificData, Feature};
diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
index d8bac0ca9d..22f8cc2360 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -17,9 +17,8 @@ use hyperswitch_interfaces::{
consts as interface_consts, errors as interface_errors,
unified_connector_service::transformers as ucs_transformers,
};
-use masking::{self, ExposeInterface};
+use hyperswitch_masking::{self, ExposeInterface};
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
diff --git a/crates/router/src/core/payments/flows/external_proxy_flow.rs b/crates/router/src/core/payments/flows/external_proxy_flow.rs
index 9dfbcfb159..ffd1597589 100644
--- a/crates/router/src/core/payments/flows/external_proxy_flow.rs
+++ b/crates/router/src/core/payments/flows/external_proxy_flow.rs
@@ -11,9 +11,8 @@ use hyperswitch_domain_models::{
errors::api_error_response::ApiErrorResponse, payments as domain_payments,
};
use hyperswitch_interfaces::api::gateway;
-use masking::ExposeInterface;
+use hyperswitch_masking::{ExposeInterface, ExposeInterface as UcsMaskingExposeInterface};
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs
index 5458042d38..15b259b395 100644
--- a/crates/router/src/core/payments/flows/session_flow.rs
+++ b/crates/router/src/core/payments/flows/session_flow.rs
@@ -9,7 +9,7 @@ use error_stack::{Report, ResultExt};
#[cfg(feature = "v2")]
use hyperswitch_domain_models::payments::PaymentIntentData;
use hyperswitch_interfaces::api::gateway;
-use masking::{ExposeInterface, ExposeOptionInterface};
+use hyperswitch_masking::{ExposeInterface, ExposeOptionInterface};
use super::{ConstructFlowSpecificData, Feature};
use crate::{
@@ -237,8 +237,8 @@ fn is_dynamic_fields_required(
fn build_apple_pay_session_request(
state: &routes::SessionState,
request: payment_types::ApplepaySessionRequest,
- apple_pay_merchant_cert: masking::Secret<String>,
- apple_pay_merchant_cert_key: masking::Secret<String>,
+ apple_pay_merchant_cert: hyperswitch_masking::Secret<String>,
+ apple_pay_merchant_cert_key: hyperswitch_masking::Secret<String>,
) -> RouterResult<services::Request> {
let mut url = state.conf.connectors.applepay.base_url.to_owned();
url.push_str("paymentservices/paymentSession");
@@ -1246,7 +1246,7 @@ fn get_allowed_payment_methods_from_cards(
fn construct_stripe_publishable_key(
gpay_token_specific_parameters: &payment_types::GpayTokenParameters,
router_data: &types::PaymentsSessionRouterData,
-) -> Option<masking::Secret<String>> {
+) -> Option<hyperswitch_masking::Secret<String>> {
let suffix =
if let Some(common_types::payments::SplitPaymentsRequest::StripeSplitPayment(stripe)) =
&router_data.request.split_payments
@@ -1265,7 +1265,7 @@ fn construct_stripe_publishable_key(
gpay_token_specific_parameters
.stripe_publishable_key
.clone()
- .map(|key| masking::Secret::new(format!("{}{}", key, suffix)))
+ .map(|key| hyperswitch_masking::Secret::new(format!("{}{}", key, suffix)))
}
fn is_session_response_delayed(
diff --git a/crates/router/src/core/payments/gateway/authorize_gateway.rs b/crates/router/src/core/payments/gateway/authorize_gateway.rs
index d60a958ddf..331f463669 100644
--- a/crates/router/src/core/payments/gateway/authorize_gateway.rs
+++ b/crates/router/src/core/payments/gateway/authorize_gateway.rs
@@ -10,8 +10,8 @@ use hyperswitch_interfaces::{
connector_integration_interface::{BoxedConnectorIntegrationInterface, RouterDataConversion},
errors::ConnectorError,
};
+use hyperswitch_masking::ExposeInterface as UcsMaskingExposeInterface;
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use crate::{
core::{
diff --git a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs
index 8621052169..233dc8043c 100644
--- a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs
+++ b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs
@@ -10,8 +10,8 @@ use hyperswitch_interfaces::{
connector_integration_interface::{BoxedConnectorIntegrationInterface, RouterDataConversion},
errors::ConnectorError,
};
+use hyperswitch_masking::ExposeInterface as UcsMaskingExposeInterface;
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use crate::{
core::{
diff --git a/crates/router/src/core/payments/gateway/psync_gateway.rs b/crates/router/src/core/payments/gateway/psync_gateway.rs
index 5ce210a908..b042186194 100644
--- a/crates/router/src/core/payments/gateway/psync_gateway.rs
+++ b/crates/router/src/core/payments/gateway/psync_gateway.rs
@@ -14,8 +14,8 @@ use hyperswitch_interfaces::{
handle_unified_connector_service_response_for_payment_get,
},
};
+use hyperswitch_masking::ExposeInterface as UcsMaskingExposeInterface;
use unified_connector_service_client::payments as payments_grpc;
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use crate::{
core::{
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index a69248123d..4b8be14a18 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -54,8 +54,8 @@ pub use hyperswitch_interfaces::{
configs::MerchantConnectorAccountType,
integrity::{CheckIntegrity, FlowIntegrity, GetIntegrityObject},
};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, SwitchStrategy};
use josekit::jwe;
-use masking::{ExposeInterface, PeekInterface, SwitchStrategy};
use num_traits::{FromPrimitive, ToPrimitive};
use openssl::{
derive::Deriver,
@@ -211,11 +211,12 @@ pub async fn create_or_update_address_for_payment_by_request(
.and_then(utils::trim_string),
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
@@ -414,11 +415,12 @@ pub async fn get_domain_address(
zip: encryptable_address.zip,
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
@@ -1074,8 +1076,8 @@ pub fn validate_card_data(
#[instrument(skip_all)]
pub fn validate_card_expiry(
- card_exp_month: &masking::Secret<String>,
- card_exp_year: &masking::Secret<String>,
+ card_exp_month: &hyperswitch_masking::Secret<String>,
+ card_exp_year: &hyperswitch_masking::Secret<String>,
) -> CustomResult<(), errors::ApiErrorResponse> {
let exp_month = card_exp_month
.peek()
@@ -1578,7 +1580,7 @@ pub fn validate_customer_information(
pub async fn validate_card_ip_blocking_for_business_profile(
state: &SessionState,
ip: IpAddr,
- fingerprnt: masking::Secret<String>,
+ fingerprnt: hyperswitch_masking::Secret<String>,
card_testing_guard_config: &diesel_models::business_profile::CardTestingGuardConfig,
) -> RouterResult<String> {
let cache_key = format!(
@@ -1595,7 +1597,7 @@ pub async fn validate_card_ip_blocking_for_business_profile(
pub async fn validate_guest_user_card_blocking_for_business_profile(
state: &SessionState,
- fingerprnt: masking::Secret<String>,
+ fingerprnt: hyperswitch_masking::Secret<String>,
customer_id: Option<id_type::CustomerId>,
card_testing_guard_config: &diesel_models::business_profile::CardTestingGuardConfig,
) -> RouterResult<String> {
@@ -2012,7 +2014,7 @@ pub async fn create_customer_if_not_exist<'a, F: Clone, R, D>(
name: encryptable_customer.name,
email: encryptable_customer.email.map(|email| {
let encryptable: Encryptable<
- masking::Secret<String, pii::EmailStrategy>,
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
> = Encryptable::new(
email.clone().into_inner().switch_strategy(),
email.into_encrypted(),
@@ -2052,7 +2054,7 @@ pub async fn create_customer_if_not_exist<'a, F: Clone, R, D>(
name: encryptable_customer.name,
email: encryptable_customer.email.map(|email| {
let encryptable: Encryptable<
- masking::Secret<String, pii::EmailStrategy>,
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
> = Encryptable::new(
email.clone().into_inner().switch_strategy(),
email.into_encrypted(),
@@ -2880,7 +2882,7 @@ pub async fn fetch_card_details_from_internal_locker(
.card_cvc
.unwrap_or_default(),
card_issuer: None,
- nick_name: card.nick_name.map(masking::Secret::new),
+ nick_name: card.nick_name.map(hyperswitch_masking::Secret::new),
card_network: card
.card_brand
.map(|card_brand| enums::CardNetwork::from_str(&card_brand))
@@ -3001,7 +3003,7 @@ pub async fn fetch_network_token_details_from_locker(
token_cryptogram: None,
token_exp_month: token_data.card_exp_month,
token_exp_year: token_data.card_exp_year,
- nick_name: token_data.nick_name.map(masking::Secret::new),
+ nick_name: token_data.nick_name.map(hyperswitch_masking::Secret::new),
card_issuer: None,
card_network,
card_type: None,
@@ -3048,7 +3050,9 @@ pub async fn fetch_card_details_for_network_transaction_flow_from_locker(
card_issuing_country: None,
card_issuing_country_code: None,
bank_code: None,
- nick_name: card_details_from_locker.nick_name.map(masking::Secret::new),
+ nick_name: card_details_from_locker
+ .nick_name
+ .map(hyperswitch_masking::Secret::new),
card_holder_name: card_details_from_locker.name_on_card.clone(),
};
@@ -3700,7 +3704,7 @@ pub fn get_handle_response_url_for_modular_authentication(
response: &api_models::authentication::AuthenticationAuthenticateResponse,
connector: String,
return_url: Option<String>,
- client_secret: Option<&masking::Secret<String>>,
+ client_secret: Option<&hyperswitch_masking::Secret<String>>,
amount: Option<MinorUnit>,
) -> RouterResult<api::RedirectionResponse> {
let authentication_return_url = return_url;
@@ -3733,7 +3737,7 @@ pub fn make_merchant_url_with_response_for_authentication(
business_profile: &domain::Profile,
redirection_response: hyperswitch_domain_models::authentication::PgRedirectResponseForAuthentication,
request_return_url: Option<&String>,
- client_secret: Option<&masking::Secret<String>>,
+ client_secret: Option<&hyperswitch_masking::Secret<String>>,
manual_retry_allowed: Option<bool>,
) -> RouterResult<String> {
// take return url if provided in the request else use merchant return url
@@ -3799,7 +3803,7 @@ pub fn make_merchant_url_with_response(
business_profile: &domain::Profile,
redirection_response: api::PgRedirectResponse,
request_return_url: Option<&String>,
- client_secret: Option<&masking::Secret<String>>,
+ client_secret: Option<&hyperswitch_masking::Secret<String>>,
manual_retry_allowed: Option<bool>,
) -> RouterResult<String> {
// take return url if provided in the request else use merchant return url
@@ -3931,7 +3935,7 @@ pub async fn create_client_secret(
let store = &state.store;
let id = id_type::ClientSecretId::generate();
- let secret = masking::Secret::new(generate_time_ordered_id("cs"));
+ let secret = hyperswitch_masking::Secret::new(generate_time_ordered_id("cs"));
let client_secret = ephemeral_key::ClientSecretTypeNew {
id,
@@ -4129,7 +4133,7 @@ pub fn generate_mandate(
.set_customer_ip_address(
customer_acceptance
.get_ip_address()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
)
.set_customer_user_agent_extended(customer_acceptance.get_user_agent())
.set_customer_accepted_at(Some(customer_acceptance.get_accepted_at()))
@@ -6067,9 +6071,9 @@ pub fn is_apple_pay_simplified_flow(
// If yes, it will encrypt connector_wallets_details and store it in the database.
// If no, it will check if apple pay details are present in metadata and merge it with connector_wallets_details, encrypt and store it.
pub async fn get_connector_wallets_details_with_apple_pay_certificates(
- connector_metadata: &Option<masking::Secret<tera::Value>>,
+ connector_metadata: &Option<hyperswitch_masking::Secret<tera::Value>>,
connector_wallets_details_optional: &Option<api_models::admin::ConnectorWalletDetails>,
-) -> RouterResult<Option<masking::Secret<serde_json::Value>>> {
+) -> RouterResult<Option<hyperswitch_masking::Secret<serde_json::Value>>> {
let connector_wallet_details_with_apple_pay_metadata_optional =
get_apple_pay_metadata_if_needed(connector_metadata, connector_wallets_details_optional)
.await?;
@@ -6081,13 +6085,13 @@ pub async fn get_connector_wallets_details_with_apple_pay_certificates(
.attach_printable("Failed to serialize Apple Pay metadata as JSON")
})
.transpose()?
- .map(masking::Secret::new);
+ .map(hyperswitch_masking::Secret::new);
Ok(connector_wallets_details)
}
async fn get_apple_pay_metadata_if_needed(
- connector_metadata: &Option<masking::Secret<tera::Value>>,
+ connector_metadata: &Option<hyperswitch_masking::Secret<tera::Value>>,
connector_wallets_details_optional: &Option<api_models::admin::ConnectorWalletDetails>,
) -> RouterResult<Option<api_models::admin::ConnectorWalletDetails>> {
if let Some(connector_wallets_details) = connector_wallets_details_optional {
@@ -6109,7 +6113,7 @@ async fn get_apple_pay_metadata_if_needed(
}
async fn get_and_merge_apple_pay_metadata(
- connector_metadata: Option<masking::Secret<tera::Value>>,
+ connector_metadata: Option<hyperswitch_masking::Secret<tera::Value>>,
connector_wallets_details_optional: Option<api_models::admin::ConnectorWalletDetails>,
) -> RouterResult<Option<api_models::admin::ConnectorWalletDetails>> {
let apple_pay_metadata_optional = get_applepay_metadata(connector_metadata)
@@ -6131,7 +6135,9 @@ async fn get_and_merge_apple_pay_metadata(
.attach_printable("Failed to serialize Apple Pay combined metadata as JSON")?;
api_models::admin::ConnectorWalletDetails {
- apple_pay_combined: Some(masking::Secret::new(combined_metadata_json)),
+ apple_pay_combined: Some(hyperswitch_masking::Secret::new(
+ combined_metadata_json,
+ )),
apple_pay: connector_wallets_details_optional
.as_ref()
.and_then(|d| d.apple_pay.clone()),
@@ -6155,7 +6161,7 @@ async fn get_and_merge_apple_pay_metadata(
.attach_printable("Failed to serialize Apple Pay metadata as JSON")?;
api_models::admin::ConnectorWalletDetails {
- apple_pay: Some(masking::Secret::new(metadata_json)),
+ apple_pay: Some(hyperswitch_masking::Secret::new(metadata_json)),
apple_pay_combined: connector_wallets_details_optional
.as_ref()
.and_then(|d| d.apple_pay_combined.clone()),
@@ -6412,18 +6418,18 @@ pub async fn get_apple_pay_retryable_connectors(
#[derive(Debug, Serialize, Deserialize)]
pub struct ApplePayData {
- version: masking::Secret<String>,
- data: masking::Secret<String>,
- signature: masking::Secret<String>,
+ version: hyperswitch_masking::Secret<String>,
+ data: hyperswitch_masking::Secret<String>,
+ signature: hyperswitch_masking::Secret<String>,
header: ApplePayHeader,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayHeader {
- ephemeral_public_key: masking::Secret<String>,
- public_key_hash: masking::Secret<String>,
- transaction_id: masking::Secret<String>,
+ ephemeral_public_key: hyperswitch_masking::Secret<String>,
+ public_key_hash: hyperswitch_masking::Secret<String>,
+ transaction_id: hyperswitch_masking::Secret<String>,
}
impl ApplePayData {
@@ -6439,8 +6445,8 @@ impl ApplePayData {
pub async fn decrypt(
&self,
- payment_processing_certificate: &masking::Secret<String>,
- payment_processing_certificate_key: &masking::Secret<String>,
+ payment_processing_certificate: &hyperswitch_masking::Secret<String>,
+ payment_processing_certificate_key: &hyperswitch_masking::Secret<String>,
) -> CustomResult<serde_json::Value, errors::ApplePayDecryptionError> {
let merchant_id = self.merchant_id(payment_processing_certificate)?;
let shared_secret = self.shared_secret(payment_processing_certificate_key)?;
@@ -6453,7 +6459,7 @@ impl ApplePayData {
pub fn merchant_id(
&self,
- payment_processing_certificate: &masking::Secret<String>,
+ payment_processing_certificate: &hyperswitch_masking::Secret<String>,
) -> CustomResult<String, errors::ApplePayDecryptionError> {
let cert_data = payment_processing_certificate.clone().expose();
@@ -6492,7 +6498,7 @@ impl ApplePayData {
pub fn shared_secret(
&self,
- payment_processing_certificate_key: &masking::Secret<String>,
+ payment_processing_certificate_key: &hyperswitch_masking::Secret<String>,
) -> CustomResult<Vec<u8>, errors::ApplePayDecryptionError> {
let public_ec_bytes = BASE64_ENGINE
.decode(self.header.ephemeral_public_key.peek().as_bytes())
@@ -6576,7 +6582,7 @@ impl ApplePayData {
// Structs for keys and the main decryptor
pub struct GooglePayTokenDecryptor {
root_signing_keys: Vec<GooglePayRootSigningKey>,
- recipient_id: masking::Secret<String>,
+ recipient_id: hyperswitch_masking::Secret<String>,
private_key: PKey<openssl::pkey::Private>,
}
@@ -6594,31 +6600,31 @@ pub struct EncryptedData {
#[serde(rename_all = "camelCase")]
pub struct GooglePaySignedMessage {
#[serde(with = "common_utils::Base64Serializer")]
- encrypted_message: masking::Secret<Vec<u8>>,
+ encrypted_message: hyperswitch_masking::Secret<Vec<u8>>,
#[serde(with = "common_utils::Base64Serializer")]
- ephemeral_public_key: masking::Secret<Vec<u8>>,
+ ephemeral_public_key: hyperswitch_masking::Secret<Vec<u8>>,
#[serde(with = "common_utils::Base64Serializer")]
- tag: masking::Secret<Vec<u8>>,
+ tag: hyperswitch_masking::Secret<Vec<u8>>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct IntermediateSigningKey {
- signed_key: masking::Secret<String>,
- signatures: Vec<masking::Secret<String>>,
+ signed_key: hyperswitch_masking::Secret<String>,
+ signatures: Vec<hyperswitch_masking::Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePaySignedKey {
- key_value: masking::Secret<String>,
+ key_value: hyperswitch_masking::Secret<String>,
key_expiration: String,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayRootSigningKey {
- key_value: masking::Secret<String>,
+ key_value: hyperswitch_masking::Secret<String>,
key_expiration: String,
protocol_version: GooglePayProtocolVersion,
}
@@ -6682,9 +6688,9 @@ fn filter_root_signing_keys(
impl GooglePayTokenDecryptor {
pub fn new(
- root_keys: masking::Secret<String>,
- recipient_id: masking::Secret<String>,
- private_key: masking::Secret<String>,
+ root_keys: hyperswitch_masking::Secret<String>,
+ recipient_id: hyperswitch_masking::Secret<String>,
+ private_key: hyperswitch_masking::Secret<String>,
) -> CustomResult<Self, errors::GooglePayDecryptionError> {
// base64 decode the private key
let decoded_key = BASE64_ENGINE
@@ -7109,8 +7115,8 @@ impl GooglePayTokenDecryptor {
pub fn decrypt_paze_token(
paze_wallet_data: PazeWalletData,
- paze_private_key: masking::Secret<String>,
- paze_private_key_passphrase: masking::Secret<String>,
+ paze_private_key: hyperswitch_masking::Secret<String>,
+ paze_private_key_passphrase: hyperswitch_masking::Secret<String>,
) -> CustomResult<serde_json::Value, errors::PazeDecryptionError> {
let decoded_paze_private_key = BASE64_ENGINE
.decode(paze_private_key.expose().as_bytes())
@@ -7169,7 +7175,7 @@ pub fn decrypt_paze_token(
pub struct JwsBody {
pub payload_id: String,
pub session_id: String,
- pub secured_payload: masking::Secret<String>,
+ pub secured_payload: hyperswitch_masking::Secret<String>,
}
pub fn get_key_params_for_surcharge_details(
@@ -7710,7 +7716,7 @@ pub async fn get_payment_method_data_and_encrypted_payment_method_data(
) -> CustomResult<
(
Option<serde_json::Value>,
- Option<Encryptable<masking::Secret<serde_json::Value>>>,
+ Option<Encryptable<hyperswitch_masking::Secret<serde_json::Value>>>,
),
errors::ApiErrorResponse,
> {
diff --git a/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs b/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
index 1a8a823594..052483f7e5 100644
--- a/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
+++ b/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData, payments::PaymentConfirmData,
};
use hyperswitch_interfaces::api::ConnectorSpecifications;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use super::{Domain, GetTracker, Operation, PostUpdateTracker, UpdateTracker, ValidateRequest};
diff --git a/crates/router/src/core/payments/operations/payment_attempt_record.rs b/crates/router/src/core/payments/operations/payment_attempt_record.rs
index da4747ccda..25c7047368 100644
--- a/crates/router/src/core/payments/operations/payment_attempt_record.rs
+++ b/crates/router/src/core/payments/operations/payment_attempt_record.rs
@@ -9,7 +9,7 @@ use common_utils::{
};
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::PaymentAttemptRecordData;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
@@ -150,7 +150,7 @@ impl<F: Send + Clone + Sync>
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to encode payment_method_billing address")?
- .map(masking::Secret::new);
+ .map(hyperswitch_masking::Secret::new);
let batch_encrypted_data = domain_types::crypto_operation(
key_manager_state,
diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs
index 92ea14e8fe..6bd2345d23 100644
--- a/crates/router/src/core/payments/operations/payment_cancel.rs
+++ b/crates/router/src/core/payments/operations/payment_cancel.rs
@@ -259,7 +259,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsCancelReques
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
};
(Some(payment_intent_update), enums::AttemptStatus::Voided)
} else {
diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs
index fdf304fd44..a7156deccd 100644
--- a/crates/router/src/core/payments/operations/payment_confirm.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm.rs
@@ -20,7 +20,7 @@ use hyperswitch_domain_models::{
payment_method_data::RecurringDetails as domain_recurring_details,
router_request_types::unified_authentication_service,
};
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use router_derive::PaymentOperation;
use router_env::{instrument, logger, tracing};
use tracing_futures::Instrument;
@@ -440,7 +440,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed while encoding customer_acceptance to value")?
- .map(masking::Secret::new)
+ .map(hyperswitch_masking::Secret::new)
.or(payment_attempt.customer_acceptance);
currency = payment_attempt.currency.get_required_value("currency")?;
@@ -2092,7 +2092,7 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsRequest, PaymentData<F>> for
};
let authentication_store = hyperswitch_domain_models::router_request_types::authentication::AuthenticationStore {
- cavv: tokenized_data.map(|tokenized_data| masking::Secret::new(tokenized_data.value1)),
+ cavv: tokenized_data.map(|tokenized_data| hyperswitch_masking::Secret::new(tokenized_data.value1)),
authentication: updated_authentication
};
@@ -2600,7 +2600,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
tax_status: payment_data.payment_intent.tax_status,
discount_amount: payment_data.payment_intent.discount_amount,
order_date: payment_data.payment_intent.order_date,
diff --git a/crates/router/src/core/payments/operations/payment_confirm_intent.rs b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
index b86e5cb893..b5809c20e0 100644
--- a/crates/router/src/core/payments/operations/payment_confirm_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
@@ -4,7 +4,7 @@ use common_utils::{ext_traits::Encode, fp_utils::when, id_type, types::keymanage
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::PaymentConfirmData;
use hyperswitch_interfaces::api::ConnectorSpecifications;
-use masking::{ExposeOptionInterface, PeekInterface};
+use hyperswitch_masking::{ExposeOptionInterface, PeekInterface};
use router_env::{instrument, tracing};
use super::{Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
@@ -187,7 +187,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentConfirmData<F>, PaymentsConfir
domain_types::CryptoOperation::BatchEncrypt(
hyperswitch_domain_models::payments::payment_attempt::FromRequestEncryptablePaymentAttempt::to_encryptable(
hyperswitch_domain_models::payments::payment_attempt::FromRequestEncryptablePaymentAttempt {
- payment_method_billing_address: request.payment_method_data.billing.as_ref().map(|address| address.clone().encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode payment_method_billing address")?.map(masking::Secret::new),
+ payment_method_billing_address: request.payment_method_data.billing.as_ref().map(|address| address.clone().encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode payment_method_billing address")?.map(hyperswitch_masking::Secret::new),
},
),
),
@@ -325,7 +325,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentConfirmData<F>, PaymentsConfir
domain_types::CryptoOperation::BatchEncrypt(
hyperswitch_domain_models::payments::payment_attempt::FromRequestEncryptablePaymentAttempt::to_encryptable(
hyperswitch_domain_models::payments::payment_attempt::FromRequestEncryptablePaymentAttempt {
- payment_method_billing_address: request.payment_method_data.billing.as_ref().map(|address| address.clone().encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode payment_method_billing address")?.map(masking::Secret::new),
+ payment_method_billing_address: request.payment_method_data.billing.as_ref().map(|address| address.clone().encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode payment_method_billing address")?.map(hyperswitch_masking::Secret::new),
},
),
),
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index e5b7961495..bc64898f28 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
payment_method_data::RecurringDetails as domain_recurring_details,
payments::{payment_attempt::PaymentAttempt, FromRequestEncryptablePaymentIntent},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_derive::PaymentOperation;
use router_env::{instrument, logger, tracing};
use storage_impl::platform_wrapper;
diff --git a/crates/router/src/core/payments/operations/payment_create_intent.rs b/crates/router/src/core/payments/operations/payment_create_intent.rs
index 355fefc7e3..aaa6557022 100644
--- a/crates/router/src/core/payments/operations/payment_create_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_create_intent.rs
@@ -8,7 +8,7 @@ use common_utils::{
types::{authentication, keymanager::ToEncryptable},
};
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
@@ -119,8 +119,8 @@ impl<F: Send + Clone + Sync>
domain_types::CryptoOperation::BatchEncrypt(
hyperswitch_domain_models::payments::FromRequestEncryptablePaymentIntent::to_encryptable(
hyperswitch_domain_models::payments::FromRequestEncryptablePaymentIntent {
- shipping_address: request.shipping.clone().map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode shipping address")?.map(masking::Secret::new),
- billing_address: request.billing.clone().map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode billing address")?.map(masking::Secret::new),
+ shipping_address: request.shipping.clone().map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode shipping address")?.map(hyperswitch_masking::Secret::new),
+ billing_address: request.billing.clone().map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode billing address")?.map(hyperswitch_masking::Secret::new),
customer_details: None,
},
),
diff --git a/crates/router/src/core/payments/operations/payment_get.rs b/crates/router/src/core/payments/operations/payment_get.rs
index acc22e511a..31dd9b4cc1 100644
--- a/crates/router/src/core/payments/operations/payment_get.rs
+++ b/crates/router/src/core/payments/operations/payment_get.rs
@@ -194,7 +194,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentStatusData<F>, PaymentsRetriev
payment_attempt.encoded_data = request
.param
.as_ref()
- .map(|val| masking::Secret::new(val.clone()));
+ .map(|val| hyperswitch_masking::Secret::new(val.clone()));
let should_sync_with_connector =
request.force_sync && payment_intent.status.should_force_sync_with_connector();
diff --git a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
index 68b33b09f3..9688f437a8 100644
--- a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
+++ b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
@@ -3,7 +3,7 @@ use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index 9c6bd61fd2..188e33850a 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -25,7 +25,7 @@ use hyperswitch_domain_models::payments::{
};
use hyperswitch_domain_models::{behaviour::Conversion, payments::payment_attempt::PaymentAttempt};
#[cfg(feature = "v2")]
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use router_derive;
use router_env::{instrument, logger, tracing};
#[cfg(feature = "v1")]
@@ -157,7 +157,9 @@ where
.payment_attempt
.currency,
metadata: mandate_reference.mandate_metadata,
- token: masking::Secret::new(connector_mandate_id),
+ token: hyperswitch_masking::Secret::new(
+ connector_mandate_id,
+ ),
}
})
}
@@ -189,7 +191,8 @@ where
let payload = UpdatePaymentMethodV1Payload {
payment_method_data,
connector_token_details,
- network_transaction_id: network_transaction_id.map(masking::Secret::new),
+ network_transaction_id: network_transaction_id
+ .map(hyperswitch_masking::Secret::new),
acknowledgement_status,
};
@@ -1311,7 +1314,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsUpdateMetadat
.payment_intent
.metadata
.clone(),
- feature_metadata: payment_intent.feature_metadata.clone().map(masking::Secret::new),
+ feature_metadata: payment_intent.feature_metadata.clone().map(hyperswitch_masking::Secret::new),
updated_by: payment_data.payment_intent.updated_by.clone(),
};
@@ -2880,7 +2883,7 @@ fn get_payment_intent_update_data<F: Clone, T: types::Capturable>(
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
},
Ok(types::PaymentsResponseData::PostCaptureVoidResponse {
post_capture_void_status,
@@ -2919,7 +2922,7 @@ fn get_payment_intent_update_data<F: Clone, T: types::Capturable>(
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
},
}
}
@@ -3666,7 +3669,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentConfirmData<F>, types::SetupMandateRe
original_payment_authorized_amount: Some(net_amount),
original_payment_authorized_currency: Some(currency),
metadata: None,
- token: masking::Secret::new(token),
+ token: hyperswitch_masking::Secret::new(token),
token_type: common_enums::TokenizationType::MultiUse,
};
@@ -3710,7 +3713,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentConfirmData<F>, types::SetupMandateRe
#[cfg(feature = "v1")]
fn update_connector_mandate_details_for_the_flow<F: Clone>(
connector_mandate_id: Option<String>,
- mandate_metadata: Option<masking::Secret<serde_json::Value>>,
+ mandate_metadata: Option<hyperswitch_masking::Secret<serde_json::Value>>,
connector_mandate_request_reference_id: Option<String>,
payment_data: &mut PaymentData<F>,
) -> RouterResult<()> {
diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs
index 6a7acaf06b..0b1f04e299 100644
--- a/crates/router/src/core/payments/operations/payment_session.rs
+++ b/crates/router/src/core/payments/operations/payment_session.rs
@@ -266,7 +266,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsSessionReque
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new);
+ .map(hyperswitch_masking::Secret::new);
payment_data.payment_intent = match metadata {
Some(metadata) => state
.store
diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs
index d3a1f0650f..c1aed28fcc 100644
--- a/crates/router/src/core/payments/operations/payment_update.rs
+++ b/crates/router/src/core/payments/operations/payment_update.rs
@@ -1058,7 +1058,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
tax_status: payment_data.payment_intent.tax_status,
discount_amount: payment_data.payment_intent.discount_amount,
order_date: payment_data.payment_intent.order_date,
diff --git a/crates/router/src/core/payments/operations/payment_update_intent.rs b/crates/router/src/core/payments/operations/payment_update_intent.rs
index 7fabcbac76..f98e935fb5 100644
--- a/crates/router/src/core/payments/operations/payment_update_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_update_intent.rs
@@ -16,7 +16,7 @@ use hyperswitch_domain_models::{
payments::payment_intent::{PaymentIntentUpdate, PaymentIntentUpdateFields},
ApiModelToDieselModelConvertor,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
@@ -201,8 +201,8 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentIntentData<F>, PaymentsUpda
domain_types::CryptoOperation::BatchEncrypt(
hyperswitch_domain_models::payments::FromRequestEncryptablePaymentIntent::to_encryptable(
hyperswitch_domain_models::payments::FromRequestEncryptablePaymentIntent {
- shipping_address: shipping.map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode shipping address")?.map(masking::Secret::new),
- billing_address: billing.map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode billing address")?.map(masking::Secret::new),
+ shipping_address: shipping.map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode shipping address")?.map(hyperswitch_masking::Secret::new),
+ billing_address: billing.map(|address| address.encode_to_value()).transpose().change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to encode billing address")?.map(hyperswitch_masking::Secret::new),
customer_details: None,
},
),
@@ -224,7 +224,7 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentIntentData<F>, PaymentsUpda
order_details
.into_iter()
.map(|order_detail| {
- masking::Secret::new(
+ hyperswitch_masking::Secret::new(
diesel_models::types::OrderDetailsWithAmount::convert_from(order_detail),
)
})
@@ -377,7 +377,7 @@ impl<F: Clone> UpdateTracker<F, payments::PaymentIntentData<F>, PaymentsUpdateIn
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to serialize connector_metadata")?
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
feature_metadata: intent.feature_metadata,
payment_link_config: intent.payment_link_config,
request_incremental_authorization: Some(intent.request_incremental_authorization),
diff --git a/crates/router/src/core/payments/operations/payment_update_metadata.rs b/crates/router/src/core/payments/operations/payment_update_metadata.rs
index 04337d9f3c..ec090a4b7a 100644
--- a/crates/router/src/core/payments/operations/payment_update_metadata.rs
+++ b/crates/router/src/core/payments/operations/payment_update_metadata.rs
@@ -4,7 +4,7 @@ use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
@@ -286,7 +286,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsUpdateMetada
.payment_intent
.feature_metadata
.clone()
- .map(masking::Secret::new);
+ .map(hyperswitch_masking::Secret::new);
payment_data.payment_intent = state
.store
diff --git a/crates/router/src/core/payments/operations/proxy_payments_intent.rs b/crates/router/src/core/payments/operations/proxy_payments_intent.rs
index 63ba23d443..d9a5cc45e7 100644
--- a/crates/router/src/core/payments/operations/proxy_payments_intent.rs
+++ b/crates/router/src/core/payments/operations/proxy_payments_intent.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData, payments::PaymentConfirmData,
};
use hyperswitch_interfaces::api::ConnectorSpecifications;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use super::{Domain, GetTracker, Operation, PostUpdateTracker, UpdateTracker, ValidateRequest};
diff --git a/crates/router/src/core/payments/operations/tax_calculation.rs b/crates/router/src/core/payments/operations/tax_calculation.rs
index 3cf43ed3fa..47919661ae 100644
--- a/crates/router/src/core/payments/operations/tax_calculation.rs
+++ b/crates/router/src/core/payments/operations/tax_calculation.rs
@@ -4,7 +4,7 @@ use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::ext_traits::AsyncExt;
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs
index 2b451a6268..7d0a640b11 100644
--- a/crates/router/src/core/payments/routing.rs
+++ b/crates/router/src/core/payments/routing.rs
@@ -37,12 +37,12 @@ use hyperswitch_domain_models::{
};
#[cfg(all(feature = "v1", feature = "dynamic_routing"))]
use hyperswitch_interfaces::events::routing_api_logs::{ApiMethod, RoutingEngine};
+use hyperswitch_masking::{PeekInterface, Secret};
use kgraph_utils::{
mca as mca_graph,
transformers::{IntoContext, IntoDirValue},
types::CountryCurrencyFilter,
};
-use masking::{PeekInterface, Secret};
use rand::distributions::{self, Distribution};
#[cfg(all(feature = "v1", feature = "dynamic_routing"))]
use rand::SeedableRng;
diff --git a/crates/router/src/core/payments/session_operation.rs b/crates/router/src/core/payments/session_operation.rs
index 0117ebcac0..74aefeb460 100644
--- a/crates/router/src/core/payments/session_operation.rs
+++ b/crates/router/src/core/payments/session_operation.rs
@@ -17,7 +17,7 @@ use hyperswitch_interfaces::{
api::Connector as ConnectorTrait,
connector_integration_v2::{ConnectorIntegrationV2, ConnectorV2},
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::{env::Env, instrument, tracing};
use crate::{
diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs
index 017d7f22dc..b7f4fb8e3d 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -23,7 +23,7 @@ use hyperswitch_domain_models::{
payment_method_data,
};
use hyperswitch_interfaces::api::gateway;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use router_env::{instrument, tracing};
use super::helpers;
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 54f0cb7b90..65a684263f 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -49,9 +49,9 @@ use hyperswitch_domain_models::{
use hyperswitch_interfaces::api::ConnectorSpecifications;
#[cfg(feature = "v2")]
use hyperswitch_interfaces::connector_integration_interface::RouterDataConversion;
-use masking::{ExposeInterface, Maskable, Secret};
+use hyperswitch_masking::{ExposeInterface, Maskable, Secret};
#[cfg(feature = "v2")]
-use masking::{ExposeOptionInterface, PeekInterface};
+use hyperswitch_masking::{ExposeOptionInterface, PeekInterface};
use router_env::{instrument, tracing};
use super::{flows::Feature, types::AuthenticationData, OperationSessionGetters, PaymentData};
@@ -324,7 +324,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
_merchant_recipient_data: Option<types::MerchantRecipientData>,
header_payload: Option<hyperswitch_domain_models::payments::HeaderPayload>,
) -> RouterResult<types::PaymentsAuthorizeRouterData> {
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
fp_utils::when(merchant_connector_account.is_disabled(), || {
Err(errors::ApiErrorResponse::MerchantConnectorAccountDisabled)
@@ -599,7 +599,7 @@ pub async fn construct_external_vault_proxy_payment_router_data<'a>(
_merchant_recipient_data: Option<types::MerchantRecipientData>,
header_payload: Option<hyperswitch_domain_models::payments::HeaderPayload>,
) -> RouterResult<types::ExternalVaultProxyPaymentsRouterData> {
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
fp_utils::when(merchant_connector_account.is_disabled(), || {
Err(errors::ApiErrorResponse::MerchantConnectorAccountDisabled)
@@ -775,7 +775,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(
_merchant_recipient_data: Option<types::MerchantRecipientData>,
header_payload: Option<hyperswitch_domain_models::payments::HeaderPayload>,
) -> RouterResult<types::PaymentsCaptureRouterData> {
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
fp_utils::when(merchant_connector_account.is_disabled(), || {
Err(errors::ApiErrorResponse::MerchantConnectorAccountDisabled)
@@ -947,7 +947,7 @@ pub async fn construct_router_data_for_psync<'a>(
_merchant_recipient_data: Option<types::MerchantRecipientData>,
header_payload: Option<hyperswitch_domain_models::payments::HeaderPayload>,
) -> RouterResult<types::PaymentsSyncRouterData> {
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
fp_utils::when(merchant_connector_account.is_disabled(), || {
Err(errors::ApiErrorResponse::MerchantConnectorAccountDisabled)
@@ -5295,7 +5295,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD
type Error = error_stack::Report<errors::ApiErrorResponse>;
fn try_from(additional_data: PaymentAdditionalData<'_, F>) -> Result<Self, Self::Error> {
- use masking::ExposeOptionInterface;
+ use hyperswitch_masking::ExposeOptionInterface;
let payment_data = additional_data.payment_data;
let connector = api::ConnectorData::get_connector_by_name(
diff --git a/crates/router/src/core/payments/vault_session.rs b/crates/router/src/core/payments/vault_session.rs
index 0be07a6113..431d099044 100644
--- a/crates/router/src/core/payments/vault_session.rs
+++ b/crates/router/src/core/payments/vault_session.rs
@@ -17,7 +17,7 @@ use hyperswitch_interfaces::{
api::Connector as ConnectorTrait,
connector_integration_v2::{ConnectorIntegrationV2, ConnectorV2},
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::{env::Env, instrument, tracing};
use crate::{
@@ -302,8 +302,8 @@ async fn generate_hyperswitch_vault_session_details(
merchant_connector_account_type: &domain::MerchantConnectorAccountTypeDetails,
connector_customer_id: Option<String>,
connector_name: String,
- vault_publishable_key: masking::Secret<String>,
- vault_profile_id: masking::Secret<String>,
+ vault_publishable_key: hyperswitch_masking::Secret<String>,
+ vault_profile_id: hyperswitch_masking::Secret<String>,
) -> RouterResult<Option<api::VaultSessionDetails>> {
let connector_response = call_external_vault_create(
state,
diff --git a/crates/router/src/core/payout_link.rs b/crates/router/src/core/payout_link.rs
index 87dc8f5194..2155d1133a 100644
--- a/crates/router/src/core/payout_link.rs
+++ b/crates/router/src/core/payout_link.rs
@@ -216,7 +216,7 @@ pub async fn initiate_payout_link(
));
let js_data = payouts::PayoutLinkDetails {
- publishable_key: masking::Secret::new(
+ publishable_key: hyperswitch_masking::Secret::new(
platform
.get_processor()
.get_account()
@@ -331,7 +331,7 @@ pub async fn filter_payout_methods(
payout: &hyperswitch_domain_models::payouts::payouts::Payouts,
address: Option<&domain::Address>,
) -> errors::RouterResult<Vec<link_utils::EnabledPaymentMethod>> {
- use masking::ExposeInterface;
+ use hyperswitch_masking::ExposeInterface;
let db = &*state.store;
//Fetch all merchant connector accounts
diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rs
index a29a9cc8fd..cafdfb3e7d 100644
--- a/crates/router/src/core/payouts.rs
+++ b/crates/router/src/core/payouts.rs
@@ -32,7 +32,7 @@ use error_stack::{report, ResultExt};
#[cfg(feature = "olap")]
use futures::future::join_all;
use hyperswitch_domain_models::{self as domain_models, payment_methods::PaymentMethod};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
#[cfg(feature = "payout_retry")]
use retry::GsmValidation;
use router_env::{instrument, logger, tracing, Env};
diff --git a/crates/router/src/core/payouts/helpers.rs b/crates/router/src/core/payouts/helpers.rs
index 80c1eaad4f..d6308750b2 100644
--- a/crates/router/src/core/payouts/helpers.rs
+++ b/crates/router/src/core/payouts/helpers.rs
@@ -15,7 +15,7 @@ use common_utils::{
use common_utils::{generate_customer_id_of_default_length, types::keymanager::ToEncryptable};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::type_encryption::{crypto_operation, CryptoOperation};
-use masking::{ExposeInterface, PeekInterface, Secret, SwitchStrategy};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret, SwitchStrategy};
use router_env::logger;
use super::PayoutData;
diff --git a/crates/router/src/core/payouts/transformers.rs b/crates/router/src/core/payouts/transformers.rs
index 7040559d9f..7b8cd9f473 100644
--- a/crates/router/src/core/payouts/transformers.rs
+++ b/crates/router/src/core/payouts/transformers.rs
@@ -153,7 +153,9 @@ impl
required_fields.entry(key.to_string()).and_modify(
|required_field| {
required_field.value =
- Some(masking::Secret::new(value.to_string()));
+ Some(hyperswitch_masking::Secret::new(
+ value.to_string(),
+ ));
},
);
}
diff --git a/crates/router/src/core/pm_auth.rs b/crates/router/src/core/pm_auth.rs
index 0bd4aebfb5..ad0ff557b2 100644
--- a/crates/router/src/core/pm_auth.rs
+++ b/crates/router/src/core/pm_auth.rs
@@ -18,7 +18,7 @@ use common_utils::{
use error_stack::ResultExt;
use helpers::PaymentAuthConnectorDataExt;
use hyperswitch_domain_models::payments::PaymentIntent;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use pm_auth::{
connector::plaid::transformers::PlaidAuthType,
types::{
diff --git a/crates/router/src/core/proxy/utils.rs b/crates/router/src/core/proxy/utils.rs
index 87b5ab801d..e7dc36a65c 100644
--- a/crates/router/src/core/proxy/utils.rs
+++ b/crates/router/src/core/proxy/utils.rs
@@ -7,7 +7,7 @@ use common_utils::{
};
use error_stack::ResultExt;
use hyperswitch_domain_models::{behaviour::Conversion, payment_methods};
-use masking::{Mask, PeekInterface};
+use hyperswitch_masking::{Mask, PeekInterface};
use serde_json::Value;
use x509_parser::nom::{
bytes::complete::{tag, take_while1},
@@ -125,7 +125,7 @@ impl ProxyRequestWrapper {
}
}
- pub fn get_headers(&self) -> Vec<(String, masking::Maskable<String>)> {
+ pub fn get_headers(&self) -> Vec<(String, hyperswitch_masking::Maskable<String>)> {
self.0
.headers
.as_map()
diff --git a/crates/router/src/core/recon.rs b/crates/router/src/core/recon.rs
index b78643908b..b5a1cca394 100644
--- a/crates/router/src/core/recon.rs
+++ b/crates/router/src/core/recon.rs
@@ -3,7 +3,7 @@ use api_models::recon as recon_api;
use common_utils::{ext_traits::AsyncExt, types::user::ThemeLineage};
use error_stack::ResultExt;
#[cfg(feature = "email")]
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
#[cfg(feature = "email")]
use crate::{
diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs
index e0ced9cf84..83515bb782 100644
--- a/crates/router/src/core/refunds.rs
+++ b/crates/router/src/core/refunds.rs
@@ -163,7 +163,10 @@ pub async fn trigger_refund_to_gateway(
creds_identifier: Option<String>,
split_refunds: Option<SplitRefundsRequest>,
all_keys_required: Option<bool>,
-) -> RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let routed_through = payment_attempt
.connector
.clone()
@@ -729,7 +732,10 @@ pub async fn refund_retrieve_core(
profile_id: Option<common_utils::id_type::ProfileId>,
request: refunds::RefundsRetrieveRequest,
refund: diesel_refund::Refund,
-) -> RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let db = &*state.store;
let processor_merchant_id = platform.get_processor().get_account().get_id();
core_utils::validate_profile_id_from_auth_layer(profile_id, &refund)?;
@@ -852,7 +858,10 @@ pub async fn sync_refund_with_gateway(
creds_identifier: Option<String>,
split_refunds: Option<SplitRefundsRequest>,
all_keys_required: Option<bool>,
-) -> RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let connector_id = refund.connector.to_string();
let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(
&state.conf.connectors,
@@ -1630,7 +1639,10 @@ pub async fn refund_retrieve_core_with_refund_id(
platform: domain::Platform,
profile_id: Option<common_utils::id_type::ProfileId>,
request: refunds::RefundsRetrieveRequest,
-) -> RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let refund_id = request.refund_id.clone();
let db = &*state.store;
let merchant_id = platform.get_processor().get_account().get_id();
@@ -1828,8 +1840,18 @@ impl ForeignFrom<diesel_refund::Refund> for api::RefundResponse {
}
}
-impl ForeignFrom<(diesel_refund::Refund, Option<masking::Secret<String>>)> for api::RefundResponse {
- fn foreign_from(item: (diesel_refund::Refund, Option<masking::Secret<String>>)) -> Self {
+impl
+ ForeignFrom<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+ )> for api::RefundResponse
+{
+ fn foreign_from(
+ item: (
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+ ),
+ ) -> Self {
let (refund, raw_connector_response) = item;
Self {
@@ -1876,7 +1898,10 @@ pub async fn schedule_refund_execution(
creds_identifier: Option<String>,
split_refunds: Option<SplitRefundsRequest>,
all_keys_required: Option<bool>,
-) -> RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
// refunds::RefundResponse> {
let db = &*state.store;
let runner = storage::ProcessTrackerRunner::RefundWorkflowRouter;
diff --git a/crates/router/src/core/refunds_v2.rs b/crates/router/src/core/refunds_v2.rs
index d1d7870ef6..bd3333cfb8 100644
--- a/crates/router/src/core/refunds_v2.rs
+++ b/crates/router/src/core/refunds_v2.rs
@@ -121,7 +121,10 @@ pub async fn trigger_refund_to_gateway(
payment_attempt: &storage::PaymentAttempt,
payment_intent: &storage::PaymentIntent,
return_raw_connector_response: Option<bool>,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let db = &*state.store;
let mca_id = payment_attempt.get_attempt_merchant_connector_account_id()?;
@@ -244,7 +247,10 @@ pub async fn internal_trigger_refund_to_gateway(
payment_intent: &storage::PaymentIntent,
merchant_connector_details: common_types::domain::MerchantConnectorAuthDetails,
return_raw_connector_response: Option<bool>,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let storage_scheme = platform.get_processor().get_account().storage_scheme;
let routed_through = payment_attempt
@@ -705,7 +711,10 @@ pub async fn refund_retrieve_core(
profile_id: Option<id_type::ProfileId>,
request: refunds::RefundsRetrieveRequest,
refund: diesel_refund::Refund,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let db = &*state.store;
core_utils::validate_profile_id_from_auth_layer(profile_id, &refund)?;
@@ -826,7 +835,10 @@ pub async fn sync_refund_with_gateway(
payment_intent: &storage::PaymentIntent,
refund: &diesel_refund::Refund,
return_raw_connector_response: Option<bool>,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let db = &*state.store;
let connector_id = refund.connector.to_string();
@@ -933,7 +945,10 @@ pub async fn internal_sync_refund_with_gateway(
refund: &diesel_refund::Refund,
merchant_connector_details: common_types::domain::MerchantConnectorAuthDetails,
return_raw_connector_response: Option<bool>,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let connector_enum = merchant_connector_details.connector_name;
let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(
@@ -1365,7 +1380,10 @@ pub async fn schedule_refund_execution(
payment_intent: &storage::PaymentIntent,
merchant_connector_details: Option<common_types::domain::MerchantConnectorAuthDetails>,
return_raw_connector_response: Option<bool>,
-) -> errors::RouterResult<(diesel_refund::Refund, Option<masking::Secret<String>>)> {
+) -> errors::RouterResult<(
+ diesel_refund::Refund,
+ Option<hyperswitch_masking::Secret<String>>,
+)> {
let db = &*state.store;
let runner = storage::ProcessTrackerRunner::RefundWorkflowRouter;
let task = "EXECUTE_REFUND";
diff --git a/crates/router/src/core/revenue_recovery/transformers.rs b/crates/router/src/core/revenue_recovery/transformers.rs
index 8b09b4a354..178241d3a4 100644
--- a/crates/router/src/core/revenue_recovery/transformers.rs
+++ b/crates/router/src/core/revenue_recovery/transformers.rs
@@ -1,5 +1,5 @@
use common_enums::IntentStatus;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use crate::{
core::revenue_recovery::types::RevenueRecoveryPaymentIntentStatus,
diff --git a/crates/router/src/core/revenue_recovery_data_backfill.rs b/crates/router/src/core/revenue_recovery_data_backfill.rs
index 2d2b06f993..9c7ab1ad0a 100644
--- a/crates/router/src/core/revenue_recovery_data_backfill.rs
+++ b/crates/router/src/core/revenue_recovery_data_backfill.rs
@@ -9,7 +9,7 @@ use common_enums::{CardNetwork, PaymentMethodType};
use common_utils::id_type;
use error_stack::ResultExt;
use hyperswitch_domain_models::api::ApplicationResponse;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use router_env::{instrument, logger};
use time::{macros::format_description, Date};
@@ -403,8 +403,8 @@ fn build_comprehensive_card_data(
.as_deref(),
)?;
- let card_exp_month = exp_month.map(masking::Secret::new);
- let card_exp_year = exp_year.map(masking::Secret::new);
+ let card_exp_month = exp_month.map(hyperswitch_masking::Secret::new);
+ let card_exp_year = exp_year.map(hyperswitch_masking::Secret::new);
// Extract card network
let card_network = record.card_network.clone();
diff --git a/crates/router/src/core/routing/transformers.rs b/crates/router/src/core/routing/transformers.rs
index b13dee1bcb..5f244f4bd4 100644
--- a/crates/router/src/core/routing/transformers.rs
+++ b/crates/router/src/core/routing/transformers.rs
@@ -14,7 +14,7 @@ use diesel_models::{
};
#[cfg(feature = "v1")]
use hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use crate::{
core::{errors, routing},
diff --git a/crates/router/src/core/split_payments.rs b/crates/router/src/core/split_payments.rs
index 66bb3e7fc5..b3e83c506e 100644
--- a/crates/router/src/core/split_payments.rs
+++ b/crates/router/src/core/split_payments.rs
@@ -15,7 +15,7 @@ use error_stack::{report, Report, ResultExt};
use hyperswitch_domain_models::payments::{
split_payments, HeaderPayload, PaymentConfirmData, PaymentIntent,
};
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use super::errors::StorageErrorExt;
use crate::{
@@ -570,7 +570,7 @@ pub async fn create_domain_model_for_split_payment(
customer_acceptance: request
.customer_acceptance
.clone()
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
profile_id: payment_intent.profile_id.clone(),
organization_id: payment_intent.organization_id.clone(),
payment_method_type,
diff --git a/crates/router/src/core/unified_authentication_service.rs b/crates/router/src/core/unified_authentication_service.rs
index 4a4218fcad..00a5cad0fb 100644
--- a/crates/router/src/core/unified_authentication_service.rs
+++ b/crates/router/src/core/unified_authentication_service.rs
@@ -43,7 +43,7 @@ use hyperswitch_domain_models::{
UasPreAuthenticationRouterData,
},
};
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use super::{
errors::{RouterResponse, RouterResult},
@@ -782,7 +782,7 @@ pub async fn authentication_create_core(
customer_details
.map(|details| {
common_utils::ext_traits::Encode::encode_to_value(&details)
- .map(masking::Secret::<serde_json::Value>::new)
+ .map(hyperswitch_masking::Secret::<serde_json::Value>::new)
.change_context(ApiErrorResponse::InternalServerError)
.attach_printable(
"Unable to encode customer details to serde_json::Value",
@@ -851,7 +851,7 @@ pub async fn authentication_create_core(
.customer_details
.clone()
.async_lift(|inner| async {
- domain::types::crypto_operation::<serde_json::Value, masking::WithType>(
+ domain::types::crypto_operation::<serde_json::Value, hyperswitch_masking::WithType>(
&key_manager_state,
common_utils::type_name!(Authentication),
domain::types::CryptoOperation::DecryptOptional(inner),
@@ -952,7 +952,7 @@ impl
authentication_id: authentication.authentication_id,
client_secret: authentication
.authentication_client_secret
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
amount,
currency,
force_3ds_challenge: authentication.force_3ds_challenge,
@@ -1399,7 +1399,7 @@ pub async fn authentication_authenticate_core(
.inspect_err(|err| router_env::logger::error!(tokenized_data_result=?err))
.attach_printable("cavv not present after authentication status is success")?;
(
- Some(masking::Secret::new(tokenised_data.value1)),
+ Some(hyperswitch_masking::Secret::new(tokenised_data.value1)),
authentication.eci.clone(),
)
} else {
@@ -1692,7 +1692,7 @@ pub async fn authentication_retrieve_eligibility_check_core(
impl
ForeignTryFrom<(
&hyperswitch_domain_models::authentication::Authentication,
- Option<masking::Secret<String>>,
+ Option<hyperswitch_masking::Secret<String>>,
Option<String>,
diesel_models::business_profile::AuthenticationConnectorDetails,
)> for AuthenticationAuthenticateResponse
@@ -1702,7 +1702,7 @@ impl
fn foreign_try_from(
(authentication, authentication_value, eci, authentication_details): (
&hyperswitch_domain_models::authentication::Authentication,
- Option<masking::Secret<String>>,
+ Option<hyperswitch_masking::Secret<String>>,
Option<String>,
diesel_models::business_profile::AuthenticationConnectorDetails,
),
@@ -2051,7 +2051,7 @@ pub async fn authentication_sync_core(
status: updated_authentication.authentication_status,
client_secret: updated_authentication
.authentication_client_secret
- .map(masking::Secret::new),
+ .map(hyperswitch_masking::Secret::new),
amount,
currency,
authentication_connector,
@@ -2203,7 +2203,7 @@ pub async fn authentication_post_sync_core(
updated_authentication
.authentication_client_secret
.clone()
- .map(masking::Secret::new)
+ .map(hyperswitch_masking::Secret::new)
.as_ref(),
updated_authentication.amount,
)?;
@@ -2349,7 +2349,7 @@ pub async fn get_session_token_for_click_to_pay(
.customer_details
.clone()
.async_lift(|inner| async {
- domain::types::crypto_operation::<serde_json::Value, masking::WithType>(
+ domain::types::crypto_operation::<serde_json::Value, hyperswitch_masking::WithType>(
key_manager_state,
common_utils::type_name!(Authentication),
domain::types::CryptoOperation::DecryptOptional(inner),
diff --git a/crates/router/src/core/unified_authentication_service/utils.rs b/crates/router/src/core/unified_authentication_service/utils.rs
index 1dfacbbe2d..d5961153ff 100644
--- a/crates/router/src/core/unified_authentication_service/utils.rs
+++ b/crates/router/src/core/unified_authentication_service/utils.rs
@@ -21,7 +21,7 @@ use hyperswitch_domain_models::{
type_encryption::AsyncLift,
};
use hyperswitch_interfaces::webhooks::IncomingWebhookRequestDetails;
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use super::types::{
IRRELEVANT_ATTEMPT_ID_IN_AUTHENTICATION_FLOW,
@@ -179,7 +179,7 @@ pub async fn external_authentication_update_trackers<F: Clone, Req>(
.clone()
.map(|billing| {
common_utils::ext_traits::Encode::encode_to_value(&billing)
- .map(masking::Secret::<serde_json::Value>::new)
+ .map(hyperswitch_masking::Secret::<serde_json::Value>::new)
})
.transpose()
.change_context(ApiErrorResponse::InternalServerError)
@@ -189,7 +189,7 @@ pub async fn external_authentication_update_trackers<F: Clone, Req>(
.clone()
.map(|shipping| {
common_utils::ext_traits::Encode::encode_to_value(&shipping)
- .map(masking::Secret::<serde_json::Value>::new)
+ .map(hyperswitch_masking::Secret::<serde_json::Value>::new)
})
.transpose()
.change_context(ApiErrorResponse::InternalServerError)
diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rs
index 4ad75bd4aa..ab8da019b4 100644
--- a/crates/router/src/core/unified_connector_service.rs
+++ b/crates/router/src/core/unified_connector_service.rs
@@ -38,7 +38,7 @@ use hyperswitch_domain_models::{
router_request_types::RefundsData,
router_response_types::{PaymentsResponseData, RefundsResponseData},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::{instrument, logger, tracing};
use unified_connector_service_cards::CardNumber;
use unified_connector_service_client::payments::{
@@ -2293,7 +2293,7 @@ where
let payout_id = router_data.payout_id.clone();
let grpc_header = grpc_header_builder.build();
// Log the actual gRPC request with masking
- let grpc_request_body = masking::masked_serialize(&grpc_request)
+ let grpc_request_body = hyperswitch_masking::masked_serialize(&grpc_request)
.unwrap_or_else(|_| serde_json::json!({"error": "failed_to_serialize_grpc_request"}));
// Update connector call count metrics for UCS operations
@@ -2324,9 +2324,10 @@ where
.unwrap_or(200);
// Log the actual gRPC response with masking
- let grpc_response_body = masking::masked_serialize(&grpc_response).unwrap_or_else(
- |_| serde_json::json!({"error": "failed_to_serialize_grpc_response"}),
- );
+ let grpc_response_body = hyperswitch_masking::masked_serialize(&grpc_response)
+ .unwrap_or_else(
+ |_| serde_json::json!({"error": "failed_to_serialize_grpc_response"}),
+ );
(
status,
@@ -2436,7 +2437,7 @@ where
let payout_id = router_data.payout_id.clone();
let grpc_header = grpc_header_builder.build();
// Log the actual gRPC request with masking
- let grpc_request_body = masking::masked_serialize(&grpc_request)
+ let grpc_request_body = hyperswitch_masking::masked_serialize(&grpc_request)
.unwrap_or_else(|_| serde_json::json!({"error": "failed_to_serialize_grpc_request"}));
// Update connector call count metrics for UCS operations
@@ -2467,9 +2468,10 @@ where
.unwrap_or(200);
// Log the actual gRPC response
- let grpc_response_body = masking::masked_serialize(&grpc_response).unwrap_or_else(
- |_| serde_json::json!({"error": "failed_to_serialize_grpc_response"}),
- );
+ let grpc_response_body = hyperswitch_masking::masked_serialize(&grpc_response)
+ .unwrap_or_else(
+ |_| serde_json::json!({"error": "failed_to_serialize_grpc_response"}),
+ );
(
status,
@@ -2612,14 +2614,23 @@ pub async fn send_comparison_data(
.set_body(RequestContent::Json(Box::new(comparison_data)))
.build();
- request.add_header(X_CONNECTOR_NAME, masking::Maskable::Normal(connector_name));
+ request.add_header(
+ X_CONNECTOR_NAME,
+ hyperswitch_masking::Maskable::Normal(connector_name),
+ );
if let Some(sub_flow_name) = sub_flow_name.filter(|name| !name.is_empty()) {
- request.add_header(X_SUB_FLOW_NAME, masking::Maskable::Normal(sub_flow_name));
+ request.add_header(
+ X_SUB_FLOW_NAME,
+ hyperswitch_masking::Maskable::Normal(sub_flow_name),
+ );
}
if let Some(req_id) = &state.request_id {
- request.add_header(X_REQUEST_ID, masking::Maskable::Normal(req_id.to_string()));
+ request.add_header(
+ X_REQUEST_ID,
+ hyperswitch_masking::Maskable::Normal(req_id.to_string()),
+ );
}
let _ = http_client::send_request(&state.conf.proxy, request, comparison_config.timeout_secs)
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 355d40facb..b94939187c 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -41,7 +41,7 @@ pub use hyperswitch_interfaces::{
WebhookTransformationStatus,
},
};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::tracing;
use time::{Duration, OffsetDateTime};
use unified_connector_service_cards::{CardNumber, NetworkToken};
@@ -49,7 +49,6 @@ use unified_connector_service_client::payments::{
self as payments_grpc, session_token, ConnectorState, Identifier,
PaymentServiceTransformRequest, PaymentServiceTransformResponse,
};
-use unified_connector_service_masking::ExposeInterface as UcsMaskingExposeInterface;
use crate::{
core::{errors, mandate::MandateBehaviour, unified_connector_service},
@@ -339,9 +338,7 @@ impl
.payment_method_token
.as_ref()
.and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| {
- unified_connector_service_masking::Secret::new(payment_method_token.expose())
- }),
+ .map(|payment_method_token| Secret::new(payment_method_token.expose())),
merchant_account_metadata,
description: router_data.description.clone(),
setup_mandate_details: router_data
@@ -553,9 +550,7 @@ impl
.payment_method_token
.as_ref()
.and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| {
- unified_connector_service_masking::Secret::new(payment_method_token.expose())
- }),
+ .map(|payment_method_token| Secret::new(payment_method_token.expose())),
merchant_account_metadata,
description: router_data.description.clone(),
setup_mandate_details: router_data
@@ -1818,9 +1813,7 @@ impl
.payment_method_token
.as_ref()
.and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| {
- unified_connector_service_masking::Secret::new(payment_method_token.expose())
- }),
+ .map(|payment_method_token| Secret::new(payment_method_token.expose())),
request_ref_id: Some(Identifier {
id_type: Some(payments_grpc::identifier::IdType::Id(
router_data.connector_request_reference_id.clone(),
@@ -1905,9 +1898,11 @@ impl
.transpose()?
.map(|payment_channel| payment_channel.into()),
locale: None,
- connector_testing_data: router_data.request.connector_testing_data.as_ref().map(
- |data| unified_connector_service_masking::Secret::new(data.peek().to_string()),
- ),
+ connector_testing_data: router_data
+ .request
+ .connector_testing_data
+ .as_ref()
+ .map(|data| Secret::new(data.peek().to_string())),
})
}
}
@@ -2104,16 +2099,16 @@ impl
authentication_data,
connector_metadata: None,
locale: router_data.request.locale.clone(),
- connector_testing_data: router_data.request.connector_testing_data.as_ref().map(
- |data| unified_connector_service_masking::Secret::new(data.peek().to_string()),
- ),
- merchant_account_id: router_data.request.merchant_account_id.as_ref().map(
- |merchant_account_id| {
- unified_connector_service_masking::Secret::new(
- merchant_account_id.clone().expose(),
- )
- },
- ),
+ connector_testing_data: router_data
+ .request
+ .connector_testing_data
+ .as_ref()
+ .map(|data| Secret::new(data.peek().to_string())),
+ merchant_account_id: router_data
+ .request
+ .merchant_account_id
+ .as_ref()
+ .map(|merchant_account_id| Secret::new(merchant_account_id.clone().expose())),
merchant_configured_currency: router_data
.request
.merchant_config_currency
diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs
index 40ddfa4e81..1a80f6ae67 100644
--- a/crates/router/src/core/user.rs
+++ b/crates/router/src/core/user.rs
@@ -21,7 +21,7 @@ use diesel_models::{
user_authentication_method::{UserAuthenticationMethodNew, UserAuthenticationMethodUpdate},
};
use error_stack::{report, ResultExt};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::{env, logger};
use storage_impl::errors::StorageError;
#[cfg(not(feature = "email"))]
@@ -2409,7 +2409,7 @@ pub async fn update_totp(
totp_status: None,
totp_secret: Some(
// TODO: Impl conversion trait for User and move this there
- domain::types::crypto_operation::<String, masking::WithType>(
+ domain::types::crypto_operation::<String, hyperswitch_masking::WithType>(
&(&state).into(),
type_name!(storage_user::User),
domain::types::CryptoOperation::Encrypt(totp.get_secret_base32().into()),
diff --git a/crates/router/src/core/user/dashboard_metadata.rs b/crates/router/src/core/user/dashboard_metadata.rs
index 3ba0aa15f7..cee4f0b180 100644
--- a/crates/router/src/core/user/dashboard_metadata.rs
+++ b/crates/router/src/core/user/dashboard_metadata.rs
@@ -7,8 +7,8 @@ use diesel_models::{
use error_stack::{report, ResultExt};
use hyperswitch_interfaces::crm::CrmPayload;
#[cfg(feature = "email")]
-use masking::ExposeInterface;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::logger;
use crate::{
diff --git a/crates/router/src/core/user/theme.rs b/crates/router/src/core/user/theme.rs
index b28e520907..8ed455b26a 100644
--- a/crates/router/src/core/user/theme.rs
+++ b/crates/router/src/core/user/theme.rs
@@ -7,7 +7,7 @@ use common_utils::{
use diesel_models::user::theme::{ThemeNew, ThemeUpdate};
use error_stack::ResultExt;
use hyperswitch_domain_models::api::ApplicationResponse;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use rdkafka::message::ToBytes;
use uuid::Uuid;
diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs
index bfd7cafc47..8609fe7004 100644
--- a/crates/router/src/core/user_role.rs
+++ b/crates/router/src/core/user_role.rs
@@ -14,7 +14,7 @@ use diesel_models::{
user_role::UserRoleUpdate,
};
use error_stack::{report, ResultExt};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::logger;
use crate::{
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index 155cf5dc14..47f89119d2 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -28,10 +28,10 @@ use hyperswitch_domain_models::{
};
use hyperswitch_interfaces::api::ConnectorSpecifications;
#[cfg(feature = "v2")]
-use masking::ExposeOptionInterface;
-use masking::Secret;
+use hyperswitch_masking::ExposeOptionInterface;
+use hyperswitch_masking::Secret;
#[cfg(feature = "payouts")]
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use maud::{html, PreEscaped};
use regex::Regex;
use router_env::{instrument, tracing};
diff --git a/crates/router/src/core/verification.rs b/crates/router/src/core/verification.rs
index 3bf0eef104..47a8634e4d 100644
--- a/crates/router/src/core/verification.rs
+++ b/crates/router/src/core/verification.rs
@@ -2,7 +2,7 @@ pub mod utils;
use api_models::verifications::{self, ApplepayMerchantResponse};
use common_utils::{errors::CustomResult, request::RequestContent};
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use crate::{core::errors, headers, logger, routes::SessionState, services};
diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs
index c890f5aec3..5778a37bfa 100644
--- a/crates/router/src/core/webhooks/incoming.rs
+++ b/crates/router/src/core/webhooks/incoming.rs
@@ -31,7 +31,7 @@ use hyperswitch_domain_models::{
use hyperswitch_interfaces::webhooks::{
IncomingWebhookFlowError, IncomingWebhookRequestDetails, WebhookContext, WebhookResourceData,
};
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use router_env::{instrument, tracing, RequestId};
use unified_connector_service_client::payments as payments_grpc;
@@ -406,7 +406,8 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(
&& is_webhook_event_supported
&& !matches!(flow_type, api::WebhookFlow::ReturnResponse);
logger::info!(process_webhook=?process_webhook_further);
- let mut event_object: Box<dyn masking::ErasedMaskSerialize> = Box::new(serde_json::Value::Null);
+ let mut event_object: Box<dyn hyperswitch_masking::ErasedMaskSerialize> =
+ Box::new(serde_json::Value::Null);
let webhook_effect = match process_webhook_further {
true => {
@@ -787,7 +788,7 @@ async fn process_non_ucs_webhook<'a>(
/// Extract resource object from UCS WebhookResponseContent
fn get_ucs_webhook_resource_object(
webhook_response_content: &payments_grpc::WebhookResponseContent,
-) -> errors::RouterResult<Box<dyn masking::ErasedMaskSerialize>> {
+) -> errors::RouterResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>> {
let resource_object = match &webhook_response_content.content {
Some(payments_grpc::webhook_response_content::Content::IncompleteTransformation(
incomplete_transformation_response,
@@ -814,7 +815,7 @@ fn extract_webhook_event_object(
webhook_transform_data: &Option<Box<unified_connector_service::WebhookTransformData>>,
connector: &ConnectorEnum,
request_details: &IncomingWebhookRequestDetails<'_>,
-) -> errors::RouterResult<Box<dyn masking::ErasedMaskSerialize>> {
+) -> errors::RouterResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>> {
match webhook_transform_data {
Some(webhook_transform_data) => webhook_transform_data
.webhook_content
@@ -956,31 +957,34 @@ async fn process_webhook_business_logic(
logger::info!(source_verified=?source_verified);
- let event_object: Box<dyn masking::ErasedMaskSerialize> = match webhook_transform_data {
- Some(webhook_transform_data) => {
- // Extract resource_object from UCS webhook content
- webhook_transform_data
- .webhook_content
- .as_ref()
- .map(|webhook_response_content| {
- get_ucs_webhook_resource_object(webhook_response_content)
- })
- .unwrap_or_else(|| {
- // Fall back to connector extraction
- connector
- .get_webhook_resource_object(request_details)
- .switch()
- .attach_printable("Could not find resource object in incoming webhook body")
- })?
- }
- None => {
- // Use traditional connector extraction
- connector
- .get_webhook_resource_object(request_details)
- .switch()
- .attach_printable("Could not find resource object in incoming webhook body")?
- }
- };
+ let event_object: Box<dyn hyperswitch_masking::ErasedMaskSerialize> =
+ match webhook_transform_data {
+ Some(webhook_transform_data) => {
+ // Extract resource_object from UCS webhook content
+ webhook_transform_data
+ .webhook_content
+ .as_ref()
+ .map(|webhook_response_content| {
+ get_ucs_webhook_resource_object(webhook_response_content)
+ })
+ .unwrap_or_else(|| {
+ // Fall back to connector extraction
+ connector
+ .get_webhook_resource_object(request_details)
+ .switch()
+ .attach_printable(
+ "Could not find resource object in incoming webhook body",
+ )
+ })?
+ }
+ None => {
+ // Use traditional connector extraction
+ connector
+ .get_webhook_resource_object(request_details)
+ .switch()
+ .attach_printable("Could not find resource object in incoming webhook body")?
+ }
+ };
let webhook_details = api::IncomingWebhookDetails {
object_reference_id: object_ref_id.clone(),
@@ -994,7 +998,7 @@ async fn process_webhook_business_logic(
};
// Create shadow_event_object and shadow_webhook_details using shadow UCS data
- let shadow_event_object: Option<Box<dyn masking::ErasedMaskSerialize>> =
+ let shadow_event_object: Option<Box<dyn hyperswitch_masking::ErasedMaskSerialize>> =
shadow_ucs_data.as_ref().and_then(|shadow_data| {
// Create shadow event object using UCS transform data and shadow request details
let shadow_event_result = shadow_data
@@ -3327,7 +3331,7 @@ async fn update_connector_mandate_details(
.transpose()?;
let pm_update = diesel_models::PaymentMethodUpdate::ConnectorNetworkTransactionIdAndMandateDetailsUpdate {
- connector_mandate_details: connector_mandate_details_value.map(masking::Secret::new),
+ connector_mandate_details: connector_mandate_details_value.map(hyperswitch_masking::Secret::new),
network_transaction_id: webhook_connector_network_transaction_id
.map(|webhook_network_transaction_id| webhook_network_transaction_id.get_id().clone()),
last_modified_by: platform.get_initiator().and_then(|initiator| initiator.to_created_by()).map(|last_modified_by| last_modified_by.to_string()),
diff --git a/crates/router/src/core/webhooks/incoming_v2.rs b/crates/router/src/core/webhooks/incoming_v2.rs
index 1b9da55064..7e8dce06be 100644
--- a/crates/router/src/core/webhooks/incoming_v2.rs
+++ b/crates/router/src/core/webhooks/incoming_v2.rs
@@ -249,7 +249,8 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(
logger::info!(process_webhook=?process_webhook_further);
let flow_type: api::WebhookFlow = event_type.into();
- let mut event_object: Box<dyn masking::ErasedMaskSerialize> = Box::new(serde_json::Value::Null);
+ let mut event_object: Box<dyn hyperswitch_masking::ErasedMaskSerialize> =
+ Box::new(serde_json::Value::Null);
let webhook_effect = if process_webhook_further
&& !matches!(flow_type, api::WebhookFlow::ReturnResponse)
{
diff --git a/crates/router/src/core/webhooks/network_tokenization_incoming.rs b/crates/router/src/core/webhooks/network_tokenization_incoming.rs
index 484837b7c8..dbe2b63464 100644
--- a/crates/router/src/core/webhooks/network_tokenization_incoming.rs
+++ b/crates/router/src/core/webhooks/network_tokenization_incoming.rs
@@ -10,7 +10,7 @@ use common_utils::{
};
use error_stack::{report, ResultExt};
use http::HeaderValue;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
@@ -71,7 +71,8 @@ impl NetworkTokenWebhookResponse {
pub fn get_network_token_resource_object(
request_details: &api::IncomingWebhookRequestDetails<'_>,
-) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::NetworkTokenizationError> {
+) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::NetworkTokenizationError>
+{
let response: NetworkTokenWebhookResponse = request_details
.body
.parse_struct("NetworkTokenWebhookResponse")
diff --git a/crates/router/src/core/webhooks/outgoing.rs b/crates/router/src/core/webhooks/outgoing.rs
index 6c2f58e19c..de75938bb5 100644
--- a/crates/router/src/core/webhooks/outgoing.rs
+++ b/crates/router/src/core/webhooks/outgoing.rs
@@ -14,7 +14,7 @@ use diesel_models::process_tracker::business_status;
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::type_encryption::{crypto_operation, CryptoOperation};
use hyperswitch_interfaces::consts;
-use masking::{ExposeInterface, Mask, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, PeekInterface, Secret};
use router_env::{
instrument,
tracing::{self, Instrument},
diff --git a/crates/router/src/core/webhooks/outgoing_v2.rs b/crates/router/src/core/webhooks/outgoing_v2.rs
index d16d90064d..ad6e27caf3 100644
--- a/crates/router/src/core/webhooks/outgoing_v2.rs
+++ b/crates/router/src/core/webhooks/outgoing_v2.rs
@@ -102,10 +102,10 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook(
ext_traits::Encode::encode_to_string_of_json(&request_content)
.change_context(errors::ApiErrorResponse::WebhookProcessingFailure)
.attach_printable("Failed to encode outgoing webhook request content")
- .map(masking::Secret::new)?,
+ .map(hyperswitch_masking::Secret::new)?,
),
keymanager::Identifier::Merchant(merchant_key_store.merchant_id.clone()),
- masking::PeekInterface::peek(merchant_key_store.key.get_inner()),
+ hyperswitch_masking::PeekInterface::peek(merchant_key_store.key.get_inner()),
)
.await
.and_then(|val| val.try_into_operation())
@@ -286,7 +286,7 @@ async fn raise_webhooks_analytics_event(
let webhook_response: Option<webhook_events::OutgoingWebhookResponseContent> =
updated_event.response.and_then(|res| {
ext_traits::StringExt::parse_struct(
- masking::PeekInterface::peek(res.get_inner()),
+ hyperswitch_masking::PeekInterface::peek(res.get_inner()),
"OutgoingWebhookResponseContent",
)
.map_err(|error| {
@@ -340,7 +340,7 @@ pub(crate) fn get_outgoing_webhook_request(
.clone()
.map(|headers| {
ext_traits::ValueExt::parse_value::<HashMap<String, String>>(
- masking::ExposeInterface::expose(headers.into_inner()),
+ hyperswitch_masking::ExposeInterface::expose(headers.into_inner()),
"HashMap<String,String>",
)
.change_context(errors::WebhooksFlowError::OutgoingWebhookEncodingFailed)
@@ -348,10 +348,12 @@ pub(crate) fn get_outgoing_webhook_request(
})
.transpose()?;
if let Some(ref map) = custom_headers {
- headers.extend(
- map.iter()
- .map(|(key, value)| (key.clone(), masking::Mask::into_masked(value.clone()))),
- );
+ headers.extend(map.iter().map(|(key, value)| {
+ (
+ key.clone(),
+ hyperswitch_masking::Mask::into_masked(value.clone()),
+ )
+ }));
};
let outgoing_webhooks_signature = transformed_outgoing_webhook
.get_outgoing_webhooks_signature(payment_response_hash_key)?;
@@ -364,7 +366,7 @@ pub(crate) fn get_outgoing_webhook_request(
body: outgoing_webhooks_signature.payload,
headers: headers
.into_iter()
- .map(|(name, value)| (name, masking::Secret::new(value.into_inner())))
+ .map(|(name, value)| (name, hyperswitch_masking::Secret::new(value.into_inner())))
.collect(),
})
}
@@ -383,7 +385,7 @@ async fn build_and_send_request(
let headers = request_content
.headers
.into_iter()
- .map(|(name, value)| (name, masking::Mask::into_masked(value)))
+ .map(|(name, value)| (name, hyperswitch_masking::Mask::into_masked(value)))
.collect();
let request = services::RequestBuilder::new()
.method(services::Method::Post)
@@ -391,7 +393,7 @@ async fn build_and_send_request(
.attach_default_headers()
.headers(headers)
.set_body(request::RequestContent::RawBytes(
- masking::ExposeInterface::expose(request_content.body).into_bytes(),
+ hyperswitch_masking::ExposeInterface::expose(request_content.body).into_bytes(),
))
.build();
@@ -474,10 +476,10 @@ async fn update_event_in_storage(
.change_context(
errors::WebhooksFlowError::OutgoingWebhookResponseEncodingFailed,
)
- .map(masking::Secret::new)?,
+ .map(hyperswitch_masking::Secret::new)?,
),
keymanager::Identifier::Merchant(merchant_key_store.merchant_id.clone()),
- masking::PeekInterface::peek(merchant_key_store.key.get_inner()),
+ hyperswitch_masking::PeekInterface::peek(merchant_key_store.key.get_inner()),
)
.await
.and_then(|val| val.try_into_operation())
diff --git a/crates/router/src/core/webhooks/recovery_incoming.rs b/crates/router/src/core/webhooks/recovery_incoming.rs
index 6f26018dfa..285375021c 100644
--- a/crates/router/src/core/webhooks/recovery_incoming.rs
+++ b/crates/router/src/core/webhooks/recovery_incoming.rs
@@ -18,7 +18,7 @@ use hyperswitch_domain_models::{
types as router_types,
};
use hyperswitch_interfaces::webhooks as interface_webhooks;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::{instrument, logger, tracing};
use services::kafka;
use storage::business_status;
diff --git a/crates/router/src/core/webhooks/types.rs b/crates/router/src/core/webhooks/types.rs
index dcea7f9c16..9035de4ad1 100644
--- a/crates/router/src/core/webhooks/types.rs
+++ b/crates/router/src/core/webhooks/types.rs
@@ -1,7 +1,7 @@
use api_models::{webhook_events, webhooks};
use common_utils::{crypto::SignMessage, ext_traits::Encode};
use error_stack::ResultExt;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::Serialize;
use crate::{
diff --git a/crates/router/src/core/webhooks/webhook_events.rs b/crates/router/src/core/webhooks/webhook_events.rs
index deefb5d6b2..5ebb0f93c8 100644
--- a/crates/router/src/core/webhooks/webhook_events.rs
+++ b/crates/router/src/core/webhooks/webhook_events.rs
@@ -2,7 +2,7 @@ use std::collections::HashSet;
use common_utils::{self, errors::CustomResult, fp_utils};
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use crate::{
diff --git a/crates/router/src/db/dispute.rs b/crates/router/src/db/dispute.rs
index 448eec9dba..1cd2258f50 100644
--- a/crates/router/src/db/dispute.rs
+++ b/crates/router/src/db/dispute.rs
@@ -466,7 +466,7 @@ mod tests {
enums::{DisputeStage, DisputeStatus},
};
use hyperswitch_domain_models::disputes::DisputeListConstraints;
- use masking::Secret;
+ use hyperswitch_masking::Secret;
use redis_interface::RedisSettings;
use serde_json::Value;
use time::macros::datetime;
@@ -756,7 +756,7 @@ mod tests {
dispute::DisputeUpdate,
enums::{DisputeStage, DisputeStatus},
};
- use masking::Secret;
+ use hyperswitch_masking::Secret;
use serde_json::Value;
use time::macros::datetime;
diff --git a/crates/router/src/db/ephemeral_key.rs b/crates/router/src/db/ephemeral_key.rs
index 2799d1c9cc..e8c1018e54 100644
--- a/crates/router/src/db/ephemeral_key.rs
+++ b/crates/router/src/db/ephemeral_key.rs
@@ -60,7 +60,7 @@ mod storage {
use common_utils::id_type;
use error_stack::ResultExt;
#[cfg(feature = "v2")]
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
#[cfg(feature = "v2")]
use redis_interface::errors::RedisError;
use redis_interface::HsetnxReply;
diff --git a/crates/router/src/db/events.rs b/crates/router/src/db/events.rs
index aa040122e0..b6c3e0e81f 100644
--- a/crates/router/src/db/events.rs
+++ b/crates/router/src/db/events.rs
@@ -1281,7 +1281,7 @@ mod tests {
webhook_version: None,
webhook_username: None,
webhook_password: None,
- webhook_url: Some(masking::Secret::new(
+ webhook_url: Some(hyperswitch_masking::Secret::new(
"https://example.com/webhooks".to_string(),
)),
payment_created_enabled: None,
@@ -1348,7 +1348,7 @@ mod tests {
webhook_version: None,
webhook_username: None,
webhook_password: None,
- webhook_url: Some(masking::Secret::new(
+ webhook_url: Some(hyperswitch_masking::Secret::new(
"https://example.com/webhooks".to_string(),
)),
payment_created_enabled: None,
diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs
index 0047bac81f..826d21ddea 100644
--- a/crates/router/src/db/kafka_store.rs
+++ b/crates/router/src/db/kafka_store.rs
@@ -37,7 +37,7 @@ use hyperswitch_domain_models::{
};
#[cfg(not(feature = "payouts"))]
use hyperswitch_domain_models::{PayoutAttemptInterface, PayoutsInterface};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use redis_interface::{errors::RedisError, RedisConnectionPool, RedisEntryId};
use router_env::{instrument, logger, tracing};
use scheduler::{
diff --git a/crates/router/src/db/merchant_connector_account.rs b/crates/router/src/db/merchant_connector_account.rs
index e8201d93a0..845dd42818 100644
--- a/crates/router/src/db/merchant_connector_account.rs
+++ b/crates/router/src/db/merchant_connector_account.rs
@@ -100,7 +100,7 @@ mod merchant_connector_account_cache_tests {
use diesel_models::enums::ConnectorType;
use error_stack::ResultExt;
use hyperswitch_domain_models::master_key::MasterKeyInterface;
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
use storage_impl::redis::{
cache::{self, CacheKey, CacheKind, ACCOUNTS_CACHE},
kv_store::RedisConnInterface,
diff --git a/crates/router/src/db/user.rs b/crates/router/src/db/user.rs
index 032c389b51..9f96835d76 100644
--- a/crates/router/src/db/user.rs
+++ b/crates/router/src/db/user.rs
@@ -1,6 +1,6 @@
use diesel_models::{enums::TotpStatus, user as storage};
use error_stack::report;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::{instrument, tracing};
use super::{domain, MockDb};
diff --git a/crates/router/src/db/user_key_store.rs b/crates/router/src/db/user_key_store.rs
index ce90cfa835..26df8aeb51 100644
--- a/crates/router/src/db/user_key_store.rs
+++ b/crates/router/src/db/user_key_store.rs
@@ -1,6 +1,6 @@
use common_utils::{errors::CustomResult, types::keymanager};
use error_stack::{report, ResultExt};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::{instrument, tracing};
use storage_impl::MockDb;
diff --git a/crates/router/src/events.rs b/crates/router/src/events.rs
index 27ba1fc764..d8ea2bf537 100644
--- a/crates/router/src/events.rs
+++ b/crates/router/src/events.rs
@@ -4,7 +4,7 @@ use common_utils::types::TenantConfig;
use error_stack::ResultExt;
use events::{EventsError, Message, MessagingInterface};
use hyperswitch_interfaces::events as events_interfaces;
-use masking::ErasedMaskSerialize;
+use hyperswitch_masking::ErasedMaskSerialize;
use router_env::logger;
use serde::{Deserialize, Serialize};
use storage_impl::errors::{ApplicationError, StorageError, StorageResult};
diff --git a/crates/router/src/events/event_logger.rs b/crates/router/src/events/event_logger.rs
index 004f94942d..3515328e00 100644
--- a/crates/router/src/events/event_logger.rs
+++ b/crates/router/src/events/event_logger.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use events::{EventsError, Message, MessagingInterface};
-use masking::ErasedMaskSerialize;
+use hyperswitch_masking::ErasedMaskSerialize;
use time::PrimitiveDateTime;
use super::EventType;
diff --git a/crates/router/src/events/outgoing_webhook_logs.rs b/crates/router/src/events/outgoing_webhook_logs.rs
index 2d625a733b..c08cb654b4 100644
--- a/crates/router/src/events/outgoing_webhook_logs.rs
+++ b/crates/router/src/events/outgoing_webhook_logs.rs
@@ -89,32 +89,32 @@ impl OutgoingWebhookEventMetric for OutgoingWebhookContent {
match self {
Self::PaymentDetails(payment_payload) => Some(OutgoingWebhookEventContent::Payment {
payment_id: payment_payload.payment_id.clone(),
- content: masking::masked_serialize(&payment_payload)
+ content: hyperswitch_masking::masked_serialize(&payment_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::RefundDetails(refund_payload) => Some(OutgoingWebhookEventContent::Refund {
payment_id: refund_payload.payment_id.clone(),
refund_id: refund_payload.get_refund_id_as_string(),
- content: masking::masked_serialize(&refund_payload)
+ content: hyperswitch_masking::masked_serialize(&refund_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::DisputeDetails(dispute_payload) => Some(OutgoingWebhookEventContent::Dispute {
payment_id: dispute_payload.payment_id.clone(),
attempt_id: dispute_payload.attempt_id.clone(),
dispute_id: dispute_payload.dispute_id.clone(),
- content: masking::masked_serialize(&dispute_payload)
+ content: hyperswitch_masking::masked_serialize(&dispute_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::MandateDetails(mandate_payload) => Some(OutgoingWebhookEventContent::Mandate {
payment_method_id: mandate_payload.payment_method_id.clone(),
mandate_id: mandate_payload.mandate_id.clone(),
- content: masking::masked_serialize(&mandate_payload)
+ content: hyperswitch_masking::masked_serialize(&mandate_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
#[cfg(feature = "payouts")]
Self::PayoutDetails(payout_payload) => Some(OutgoingWebhookEventContent::Payout {
payout_id: payout_payload.payout_id.clone(),
- content: masking::masked_serialize(&payout_payload)
+ content: hyperswitch_masking::masked_serialize(&payout_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::SubscriptionDetails(subscription) => {
@@ -122,7 +122,7 @@ impl OutgoingWebhookEventMetric for OutgoingWebhookContent {
subscription_id: subscription.id.clone(),
invoice_id: subscription.get_optional_invoice_id(),
payment_id: subscription.get_optional_payment_id(),
- content: masking::masked_serialize(&subscription)
+ content: hyperswitch_masking::masked_serialize(&subscription)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
})
}
@@ -136,13 +136,13 @@ impl OutgoingWebhookEventMetric for OutgoingWebhookContent {
match self {
Self::PaymentDetails(payment_payload) => Some(OutgoingWebhookEventContent::Payment {
payment_id: payment_payload.id.clone(),
- content: masking::masked_serialize(&payment_payload)
+ content: hyperswitch_masking::masked_serialize(&payment_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::RefundDetails(refund_payload) => Some(OutgoingWebhookEventContent::Refund {
payment_id: refund_payload.payment_id.clone(),
refund_id: refund_payload.id.clone(),
- content: masking::masked_serialize(&refund_payload)
+ content: hyperswitch_masking::masked_serialize(&refund_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
Self::DisputeDetails(dispute_payload) => {
@@ -152,13 +152,13 @@ impl OutgoingWebhookEventMetric for OutgoingWebhookContent {
Self::MandateDetails(mandate_payload) => Some(OutgoingWebhookEventContent::Mandate {
payment_method_id: mandate_payload.payment_method_id.clone(),
mandate_id: mandate_payload.mandate_id.clone(),
- content: masking::masked_serialize(&mandate_payload)
+ content: hyperswitch_masking::masked_serialize(&mandate_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
#[cfg(feature = "payouts")]
Self::PayoutDetails(payout_payload) => Some(OutgoingWebhookEventContent::Payout {
payout_id: payout_payload.payout_id.clone(),
- content: masking::masked_serialize(&payout_payload)
+ content: hyperswitch_masking::masked_serialize(&payout_payload)
.unwrap_or(serde_json::json!({"error":"failed to serialize"})),
}),
}
diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rs
index 6d33b7c40a..ba672646e2 100644
--- a/crates/router/src/lib.rs
+++ b/crates/router/src/lib.rs
@@ -108,7 +108,7 @@ pub mod pii {
pub(crate) use common_utils::pii::Email;
#[doc(inline)]
- pub use masking::*;
+ pub use hyperswitch_masking::*;
}
pub fn mk_app(
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index aa5522fd1e..6fab5c739b 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -249,7 +249,7 @@ impl SessionStateInfo for SessionState {
fn get_detached_auth(&self) -> RouterResult<(Blake3, &[u8])> {
use error_stack::ResultExt;
use hyperswitch_domain_models::errors::api_error_response as errors;
- use masking::prelude::PeekInterface as _;
+ use hyperswitch_masking::PeekInterface as _;
use router_env::logger;
let output = CHECKSUM_KEY.get_or_try_init(|| {
@@ -263,8 +263,8 @@ impl SessionStateInfo for SessionState {
let key = conf.api_keys.get_inner().checksum_auth_key.peek();
hex::decode(key).map(|key| {
(
- masking::StrongSecret::new(context),
- masking::StrongSecret::new(key),
+ hyperswitch_masking::StrongSecret::new(context),
+ hyperswitch_masking::StrongSecret::new(key),
)
})
});
@@ -357,8 +357,8 @@ pub trait AppStateInfo {
#[cfg(feature = "partial-auth")]
static CHECKSUM_KEY: once_cell::sync::OnceCell<(
- masking::StrongSecret<String>,
- masking::StrongSecret<Vec<u8>>,
+ hyperswitch_masking::StrongSecret<String>,
+ hyperswitch_masking::StrongSecret<Vec<u8>>,
)> = once_cell::sync::OnceCell::new();
impl AppStateInfo for AppState {
diff --git a/crates/router/src/routes/authentication.rs b/crates/router/src/routes/authentication.rs
index c6427fe7a3..931f00591b 100644
--- a/crates/router/src/routes/authentication.rs
+++ b/crates/router/src/routes/authentication.rs
@@ -6,7 +6,7 @@ use api_models::authentication::{
AuthenticationRetrieveEligibilityCheckRequest, AuthenticationSessionTokenRequest,
AuthenticationSyncPostUpdateRequest, AuthenticationSyncRequest,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::{instrument, tracing, Flow};
use crate::{
diff --git a/crates/router/src/routes/dummy_connector/types.rs b/crates/router/src/routes/dummy_connector/types.rs
index 237a0fa2ea..9167612285 100644
--- a/crates/router/src/routes/dummy_connector/types.rs
+++ b/crates/router/src/routes/dummy_connector/types.rs
@@ -1,7 +1,7 @@
use api_models::enums::Currency;
use common_utils::{errors::CustomResult, generate_id_with_default_len, pii};
use error_stack::report;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::types::FlowMetric;
use strum::Display;
use time::PrimitiveDateTime;
diff --git a/crates/router/src/routes/dummy_connector/utils.rs b/crates/router/src/routes/dummy_connector/utils.rs
index 0bec039819..080ea7a7de 100644
--- a/crates/router/src/routes/dummy_connector/utils.rs
+++ b/crates/router/src/routes/dummy_connector/utils.rs
@@ -2,7 +2,7 @@ use std::fmt::Debug;
use common_utils::ext_traits::AsyncExt;
use error_stack::{report, ResultExt};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use maud::html;
use rand::{distributions::Uniform, prelude::Distribution};
use tokio::time as tokio;
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index 2261a2d3bb..eeaf685bfa 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -6,7 +6,7 @@ pub mod helpers;
use actix_web::{web, Responder};
use error_stack::report;
use hyperswitch_domain_models::{ext_traits::OptionExt, payments::HeaderPayload};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router_env::{env, instrument, logger, tracing, types, Flow};
use super::app::ReqState;
diff --git a/crates/router/src/routes/payments/helpers.rs b/crates/router/src/routes/payments/helpers.rs
index 1ca4d6815e..d6fa4bac9c 100644
--- a/crates/router/src/routes/payments/helpers.rs
+++ b/crates/router/src/routes/payments/helpers.rs
@@ -83,7 +83,7 @@ pub fn populate_browser_info(
{
*req_ip = req_ip
.clone()
- .or_else(|| ip_address.map(|ip| masking::Secret::new(ip.to_string())));
+ .or_else(|| ip_address.map(|ip| hyperswitch_masking::Secret::new(ip.to_string())));
}
let encoded = browser_info
diff --git a/crates/router/src/routes/tokenization.rs b/crates/router/src/routes/tokenization.rs
index 40b4dce334..dcf2075d2a 100644
--- a/crates/router/src/routes/tokenization.rs
+++ b/crates/router/src/routes/tokenization.rs
@@ -11,7 +11,7 @@ use common_utils::{
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
use error_stack::ResultExt;
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
-use masking::Secret;
+use hyperswitch_masking::Secret;
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
use router_env::{instrument, logger, tracing, Flow};
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
diff --git a/crates/router/src/routes/user/theme.rs b/crates/router/src/routes/user/theme.rs
index 9a554e08e9..8e5384dd56 100644
--- a/crates/router/src/routes/user/theme.rs
+++ b/crates/router/src/routes/user/theme.rs
@@ -2,7 +2,7 @@ use actix_multipart::form::MultipartForm;
use actix_web::{web, HttpRequest, HttpResponse};
use api_models::user::theme as theme_api;
use common_utils::types::user::ThemeLineage;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::Flow;
use crate::{
diff --git a/crates/router/src/services.rs b/crates/router/src/services.rs
index 8c7e5892b4..3862c4a8ca 100644
--- a/crates/router/src/services.rs
+++ b/crates/router/src/services.rs
@@ -24,7 +24,7 @@ use error_stack::ResultExt;
pub use hyperswitch_interfaces::connector_integration_v2::{
BoxedConnectorIntegrationV2, ConnectorIntegrationAnyV2, ConnectorIntegrationV2,
};
-use masking::{ExposeInterface, StrongSecret};
+use hyperswitch_masking::{ExposeInterface, StrongSecret};
#[cfg(feature = "kv_store")]
use storage_impl::kv_router_store::KVRouterStore;
use storage_impl::{errors::StorageResult, redis::RedisStore, RouterStore};
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index f6e8c170b9..2e6fd07d63 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -47,7 +47,7 @@ pub use hyperswitch_interfaces::{
BoxedConnectorIntegrationV2, ConnectorIntegrationAnyV2, ConnectorIntegrationV2,
},
};
-use masking::{Maskable, PeekInterface};
+use hyperswitch_masking::{Maskable, PeekInterface};
pub use payment_link::{PaymentLinkFormData, PaymentLinkStatusData};
use router_env::{instrument, tracing, RequestId, Tag};
use serde::Serialize;
@@ -190,7 +190,7 @@ where
let mut app_state = state.get_ref().clone();
let start_instant = Instant::now();
- let serialized_request = masking::masked_serialize(&payload)
+ let serialized_request = hyperswitch_masking::masked_serialize(&payload)
.attach_printable("Failed to serialize json request")
.change_context(errors::ApiErrorResponse::InternalServerError.switch())?;
@@ -294,13 +294,13 @@ where
if let ApplicationResponse::Json(data) = res {
serialized_response.replace(
- masking::masked_serialize(&data)
+ hyperswitch_masking::masked_serialize(&data)
.attach_printable("Failed to serialize json response")
.change_context(errors::ApiErrorResponse::InternalServerError.switch())?,
);
} else if let ApplicationResponse::JsonWithHeaders((data, headers)) = res {
serialized_response.replace(
- masking::masked_serialize(&data)
+ hyperswitch_masking::masked_serialize(&data)
.attach_printable("Failed to serialize json response")
.change_context(errors::ApiErrorResponse::InternalServerError.switch())?,
);
diff --git a/crates/router/src/services/api/client.rs b/crates/router/src/services/api/client.rs
index 6bc2e4860e..872c488a30 100644
--- a/crates/router/src/services/api/client.rs
+++ b/crates/router/src/services/api/client.rs
@@ -8,7 +8,7 @@ pub use hyperswitch_interfaces::{
api_client::{ApiClient, ApiClientWrapper, RequestBuilder},
types::Proxy,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use reqwest::multipart::Form;
use router_env::RequestId;
@@ -37,8 +37,8 @@ impl ProxyClient {
pub fn get_reqwest_client(
&self,
- client_certificate: Option<masking::Secret<String>>,
- client_certificate_key: Option<masking::Secret<String>>,
+ client_certificate: Option<hyperswitch_masking::Secret<String>>,
+ client_certificate_key: Option<hyperswitch_masking::Secret<String>>,
) -> CustomResult<reqwest::Client, ApiClientError> {
match (client_certificate, client_certificate_key) {
(Some(certificate), Some(certificate_key)) => {
@@ -124,8 +124,8 @@ impl ApiClient for ProxyClient {
&self,
method: Method,
url: String,
- certificate: Option<masking::Secret<String>>,
- certificate_key: Option<masking::Secret<String>>,
+ certificate: Option<hyperswitch_masking::Secret<String>>,
+ certificate_key: Option<hyperswitch_masking::Secret<String>>,
) -> CustomResult<Box<dyn RequestBuilder>, ApiClientError> {
let client_builder = self
.get_reqwest_client(certificate, certificate_key)
@@ -180,8 +180,8 @@ impl ApiClient for MockApiClient {
&self,
_method: Method,
_url: String,
- _certificate: Option<masking::Secret<String>>,
- _certificate_key: Option<masking::Secret<String>>,
+ _certificate: Option<hyperswitch_masking::Secret<String>>,
+ _certificate_key: Option<hyperswitch_masking::Secret<String>>,
) -> CustomResult<Box<dyn RequestBuilder>, ApiClientError> {
// [#2066]: Add Mock implementation for ApiClient
Err(ApiClientError::UnexpectedState.into())
diff --git a/crates/router/src/services/api/request.rs b/crates/router/src/services/api/request.rs
index 7cf35ff0d8..700ea60ea4 100644
--- a/crates/router/src/services/api/request.rs
+++ b/crates/router/src/services/api/request.rs
@@ -1,2 +1,2 @@
pub use common_utils::request::ContentType;
-pub use masking::{Mask, Maskable};
+pub use hyperswitch_masking::{Mask, Maskable};
diff --git a/crates/router/src/services/authentication.rs b/crates/router/src/services/authentication.rs
index bc7bbd17cf..1aa2951f28 100644
--- a/crates/router/src/services/authentication.rs
+++ b/crates/router/src/services/authentication.rs
@@ -16,12 +16,12 @@ use common_utils::{date_time, fp_utils, id_type};
use diesel_models::ephemeral_key;
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::sdk_auth::SdkAuthorization;
+#[cfg(feature = "v2")]
+use hyperswitch_masking::ExposeInterface;
+use hyperswitch_masking::PeekInterface;
use jsonwebtoken::{
decode, errors::ErrorKind::ExpiredSignature, Algorithm, DecodingKey, Validation,
};
-#[cfg(feature = "v2")]
-use masking::ExposeInterface;
-use masking::PeekInterface;
use router_env::logger;
use serde::Serialize;
@@ -422,7 +422,7 @@ pub trait BasicAuthProvider {
fn get_credentials<A>(
state: &A,
identifier: &str,
- ) -> RouterResult<(Self::Identity, masking::Secret<String>)>
+ ) -> RouterResult<(Self::Identity, hyperswitch_masking::Secret<String>)>
where
A: SessionStateInfo;
}
@@ -448,7 +448,7 @@ impl BasicAuthProvider for OidcAuthProvider {
fn get_credentials<A>(
state: &A,
identifier: &str,
- ) -> RouterResult<(Self::Identity, masking::Secret<String>)>
+ ) -> RouterResult<(Self::Identity, hyperswitch_masking::Secret<String>)>
where
A: SessionStateInfo,
{
@@ -2030,7 +2030,8 @@ where
get_api_key(request_headers).change_context(errors::ApiErrorResponse::Unauthorized)?;
let conf = state.conf();
- let admin_api_key: &masking::Secret<String> = &conf.secrets.get_inner().admin_api_key;
+ let admin_api_key: &hyperswitch_masking::Secret<String> =
+ &conf.secrets.get_inner().admin_api_key;
if request_api_key == admin_api_key.peek() {
let (key_store, merchant) =
@@ -6019,7 +6020,7 @@ pub fn strip_basic_auth_token(token: &str) -> RouterResult<&str> {
fn parse_basic_auth_credentials(
headers: &HeaderMap,
-) -> RouterResult<(String, masking::Secret<String>)> {
+) -> RouterResult<(String, hyperswitch_masking::Secret<String>)> {
let authorization_header = get_header_value_by_key(headers::AUTHORIZATION.to_string(), headers)
.change_context(errors::ApiErrorResponse::InvalidBasicAuth)?
.get_required_value(headers::AUTHORIZATION)?;
@@ -6046,7 +6047,7 @@ fn parse_basic_auth_credentials(
Ok((
identifier.to_string(),
- masking::Secret::new(secret.to_string()),
+ hyperswitch_masking::Secret::new(secret.to_string()),
))
}
diff --git a/crates/router/src/services/authentication/cookies.rs b/crates/router/src/services/authentication/cookies.rs
index 4a297c0f0e..8210e44efe 100644
--- a/crates/router/src/services/authentication/cookies.rs
+++ b/crates/router/src/services/authentication/cookies.rs
@@ -6,9 +6,7 @@ use cookie::{
};
use error_stack::{report, ResultExt};
#[cfg(feature = "olap")]
-use masking::Mask;
-#[cfg(feature = "olap")]
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Mask, Secret};
use crate::{
consts::JWT_TOKEN_COOKIE_NAME,
diff --git a/crates/router/src/services/authentication/decision.rs b/crates/router/src/services/authentication/decision.rs
index a1796f97c3..e53f597709 100644
--- a/crates/router/src/services/authentication/decision.rs
+++ b/crates/router/src/services/authentication/decision.rs
@@ -1,5 +1,5 @@
use common_utils::{errors::CustomResult, request::RequestContent};
-use masking::{ErasedMaskSerialize, Secret};
+use hyperswitch_masking::{ErasedMaskSerialize, Secret};
use serde::Serialize;
use storage_impl::errors::ApiClientError;
diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs
index eb73347911..68a96f220e 100644
--- a/crates/router/src/services/email/types.rs
+++ b/crates/router/src/services/email/types.rs
@@ -4,7 +4,7 @@ use common_utils::{errors::CustomResult, pii, types::user::EmailThemeConfig};
use diesel_models::organization::OrganizationBridge;
use error_stack::ResultExt;
use external_services::email::{EmailContents, EmailData, EmailError};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use crate::{configs, consts, routes::SessionState};
#[cfg(feature = "olap")]
diff --git a/crates/router/src/services/jwt.rs b/crates/router/src/services/jwt.rs
index aec9ae85e6..263a6dac71 100644
--- a/crates/router/src/services/jwt.rs
+++ b/crates/router/src/services/jwt.rs
@@ -1,7 +1,7 @@
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
+use hyperswitch_masking::PeekInterface;
use jsonwebtoken::{encode, EncodingKey, Header};
-use masking::PeekInterface;
use crate::{configs::Settings, core::errors::UserErrors};
diff --git a/crates/router/src/services/kafka.rs b/crates/router/src/services/kafka.rs
index f8f81d72ba..1714e06ef5 100644
--- a/crates/router/src/services/kafka.rs
+++ b/crates/router/src/services/kafka.rs
@@ -695,7 +695,7 @@ impl MessagingInterface for KafkaProducer {
timestamp: PrimitiveDateTime,
) -> error_stack::Result<(), EventsError>
where
- T: Message<Class = Self::MessageClass> + masking::ErasedMaskSerialize,
+ T: Message<Class = Self::MessageClass> + hyperswitch_masking::ErasedMaskSerialize,
{
let topic = self.get_topic(data.get_message_class());
let json_data = data
diff --git a/crates/router/src/services/kafka/dispute.rs b/crates/router/src/services/kafka/dispute.rs
index b308611047..7a30dbf88b 100644
--- a/crates/router/src/services/kafka/dispute.rs
+++ b/crates/router/src/services/kafka/dispute.rs
@@ -4,7 +4,7 @@ use common_utils::{
types::{AmountConvertor, MinorUnit, StringMinorUnitForConnector},
};
use diesel_models::enums as storage_enums;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::OffsetDateTime;
use crate::types::storage::dispute::Dispute;
diff --git a/crates/router/src/services/kafka/dispute_event.rs b/crates/router/src/services/kafka/dispute_event.rs
index d8d06ce9a5..138d82cbe6 100644
--- a/crates/router/src/services/kafka/dispute_event.rs
+++ b/crates/router/src/services/kafka/dispute_event.rs
@@ -3,7 +3,7 @@ use common_utils::{
types::{AmountConvertor, MinorUnit, StringMinorUnitForConnector},
};
use diesel_models::enums as storage_enums;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::OffsetDateTime;
use crate::types::storage::dispute::Dispute;
diff --git a/crates/router/src/services/kafka/payment_attempt.rs b/crates/router/src/services/kafka/payment_attempt.rs
index 5a71b95f3d..99a543c3e0 100644
--- a/crates/router/src/services/kafka/payment_attempt.rs
+++ b/crates/router/src/services/kafka/payment_attempt.rs
@@ -200,12 +200,12 @@ pub struct KafkaPaymentAttempt<'a> {
pub preprocessing_step_id: Option<String>,
pub connector_response_reference_id: Option<String>,
pub updated_by: &'a String,
- pub encoded_data: Option<&'a masking::Secret<String>>,
+ pub encoded_data: Option<&'a hyperswitch_masking::Secret<String>>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub fingerprint_id: Option<String>,
- pub customer_acceptance: Option<&'a masking::Secret<payments::CustomerAcceptance>>,
+ pub customer_acceptance: Option<&'a hyperswitch_masking::Secret<payments::CustomerAcceptance>>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub charges: Option<payments::ConnectorChargeResponseData>,
@@ -217,7 +217,7 @@ pub struct KafkaPaymentAttempt<'a> {
pub authentication_applied: Option<common_enums::AuthenticationType>,
pub external_reference_id: Option<String>,
pub tax_on_surcharge: Option<MinorUnit>,
- pub payment_method_billing_address: Option<masking::Secret<&'a address::Address>>, // adjusted from Encryption
+ pub payment_method_billing_address: Option<hyperswitch_masking::Secret<&'a address::Address>>,
pub redirection_data: Option<&'a RedirectForm>,
pub connector_payment_data: Option<String>,
pub connector_token_details: Option<&'a payment_attempt::ConnectorTokenDetails>,
@@ -231,7 +231,7 @@ pub struct KafkaPaymentAttempt<'a> {
#[cfg(feature = "v2")]
impl<'a> KafkaPaymentAttempt<'a> {
pub fn from_storage(attempt: &'a PaymentAttempt) -> Self {
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
let PaymentAttempt {
payment_id,
merchant_id,
@@ -371,7 +371,7 @@ impl<'a> KafkaPaymentAttempt<'a> {
tax_on_surcharge: amount_details.get_tax_on_surcharge(),
payment_method_billing_address: payment_method_billing_address
.as_ref()
- .map(|v| masking::Secret::new(v.get_inner())),
+ .map(|v| hyperswitch_masking::Secret::new(v.get_inner())),
redirection_data: redirection_data.as_ref(),
connector_payment_data,
connector_token_details: connector_token_details.as_ref(),
diff --git a/crates/router/src/services/kafka/payment_attempt_event.rs b/crates/router/src/services/kafka/payment_attempt_event.rs
index cfe25416da..f3db7ffca4 100644
--- a/crates/router/src/services/kafka/payment_attempt_event.rs
+++ b/crates/router/src/services/kafka/payment_attempt_event.rs
@@ -202,12 +202,12 @@ pub struct KafkaPaymentAttemptEvent<'a> {
pub preprocessing_step_id: Option<String>,
pub connector_response_reference_id: Option<String>,
pub updated_by: &'a String,
- pub encoded_data: Option<&'a masking::Secret<String>>,
+ pub encoded_data: Option<&'a hyperswitch_masking::Secret<String>>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub fingerprint_id: Option<String>,
- pub customer_acceptance: Option<&'a masking::Secret<payments::CustomerAcceptance>>,
+ pub customer_acceptance: Option<&'a hyperswitch_masking::Secret<payments::CustomerAcceptance>>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub charges: Option<payments::ConnectorChargeResponseData>,
@@ -219,7 +219,7 @@ pub struct KafkaPaymentAttemptEvent<'a> {
pub authentication_applied: Option<common_enums::AuthenticationType>,
pub external_reference_id: Option<String>,
pub tax_on_surcharge: Option<MinorUnit>,
- pub payment_method_billing_address: Option<masking::Secret<&'a address::Address>>, // adjusted from Encryption
+ pub payment_method_billing_address: Option<hyperswitch_masking::Secret<&'a address::Address>>,
pub redirection_data: Option<&'a RedirectForm>,
pub connector_payment_data: Option<String>,
pub connector_token_details: Option<&'a payment_attempt::ConnectorTokenDetails>,
@@ -233,7 +233,7 @@ pub struct KafkaPaymentAttemptEvent<'a> {
#[cfg(feature = "v2")]
impl<'a> KafkaPaymentAttemptEvent<'a> {
pub fn from_storage(attempt: &'a PaymentAttempt) -> Self {
- use masking::PeekInterface;
+ use hyperswitch_masking::PeekInterface;
let PaymentAttempt {
payment_id,
merchant_id,
@@ -373,7 +373,7 @@ impl<'a> KafkaPaymentAttemptEvent<'a> {
tax_on_surcharge: amount_details.get_tax_on_surcharge(),
payment_method_billing_address: payment_method_billing_address
.as_ref()
- .map(|v| masking::Secret::new(v.get_inner())),
+ .map(|v| hyperswitch_masking::Secret::new(v.get_inner())),
redirection_data: redirection_data.as_ref(),
connector_payment_data,
connector_token_details: connector_token_details.as_ref(),
diff --git a/crates/router/src/services/kafka/payment_intent.rs b/crates/router/src/services/kafka/payment_intent.rs
index d458013e92..8936be94d9 100644
--- a/crates/router/src/services/kafka/payment_intent.rs
+++ b/crates/router/src/services/kafka/payment_intent.rs
@@ -16,7 +16,7 @@ use diesel_models::{types::OrderDetailsWithAmount, TaxDetails};
use hyperswitch_domain_models::payments::PaymentIntent;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::{address, routing};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde_json::Value;
use time::OffsetDateTime;
diff --git a/crates/router/src/services/kafka/payment_intent_event.rs b/crates/router/src/services/kafka/payment_intent_event.rs
index 652ec24e5a..66bbb17bb7 100644
--- a/crates/router/src/services/kafka/payment_intent_event.rs
+++ b/crates/router/src/services/kafka/payment_intent_event.rs
@@ -16,7 +16,7 @@ use diesel_models::{types::OrderDetailsWithAmount, TaxDetails};
use hyperswitch_domain_models::payments::PaymentIntent;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::{address, routing};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use serde_json::Value;
use time::OffsetDateTime;
diff --git a/crates/router/src/services/kafka/revenue_recovery.rs b/crates/router/src/services/kafka/revenue_recovery.rs
index 93294dca4c..9ae3ef1ae0 100644
--- a/crates/router/src/services/kafka/revenue_recovery.rs
+++ b/crates/router/src/services/kafka/revenue_recovery.rs
@@ -1,5 +1,5 @@
use common_utils::{id_type, types::MinorUnit};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::OffsetDateTime;
#[derive(serde::Serialize, Debug)]
pub struct RevenueRecovery<'a> {
diff --git a/crates/router/src/services/oidc_provider.rs b/crates/router/src/services/oidc_provider.rs
index e28f000de9..6b14832a38 100644
--- a/crates/router/src/services/oidc_provider.rs
+++ b/crates/router/src/services/oidc_provider.rs
@@ -5,7 +5,7 @@ use api_models::oidc::{
OidcTokenRequest, OidcTokenResponse, Scope, SigningAlgorithm,
};
use error_stack::{report, ResultExt};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use once_cell::sync::OnceCell;
use router_env::logger;
diff --git a/crates/router/src/services/openidconnect.rs b/crates/router/src/services/openidconnect.rs
index 69b890d657..447a97f62f 100644
--- a/crates/router/src/services/openidconnect.rs
+++ b/crates/router/src/services/openidconnect.rs
@@ -1,7 +1,7 @@
use common_utils::errors::ErrorSwitch;
use error_stack::ResultExt;
use external_services::http_client::client;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, Secret};
use oidc::TokenResponse;
use openidconnect::{self as oidc, core as oidc_core};
use redis_interface::RedisConnectionPool;
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index 11ac54b0b2..a1d3ba0b09 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -14,7 +14,7 @@ pub mod domain;
pub mod fraud_check;
pub mod payment_methods;
pub mod pm_auth;
-use masking::Secret;
+use hyperswitch_masking::Secret;
pub mod storage;
pub mod transformers;
use std::marker::PhantomData;
diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs
index 1016b464be..9a9864e912 100644
--- a/crates/router/src/types/api/admin.rs
+++ b/crates/router/src/types/api/admin.rs
@@ -20,7 +20,7 @@ use common_utils::{ext_traits::ValueExt, types::keymanager as km_types};
use diesel_models::{business_profile::CardTestingGuardConfig, organization::OrganizationBridge};
use error_stack::ResultExt;
use hyperswitch_domain_models::merchant_key_store::MerchantKeyStore;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
consts,
diff --git a/crates/router/src/types/api/authentication.rs b/crates/router/src/types/api/authentication.rs
index 118d3178c2..c34209e588 100644
--- a/crates/router/src/types/api/authentication.rs
+++ b/crates/router/src/types/api/authentication.rs
@@ -63,7 +63,7 @@ impl TryFrom<hyperswitch_domain_models::authentication::Authentication> for Auth
#[derive(Clone, serde::Deserialize, Debug, serde::Serialize)]
pub struct PostAuthenticationResponse {
pub trans_status: String,
- pub authentication_value: Option<masking::Secret<String>>,
+ pub authentication_value: Option<hyperswitch_masking::Secret<String>>,
pub eci: Option<String>,
}
diff --git a/crates/router/src/types/api/disputes.rs b/crates/router/src/types/api/disputes.rs
index 62bda6157c..0b8698ee4a 100644
--- a/crates/router/src/types/api/disputes.rs
+++ b/crates/router/src/types/api/disputes.rs
@@ -4,7 +4,7 @@ pub use hyperswitch_interfaces::{
},
disputes::DisputePayload,
};
-use masking::{Deserialize, Serialize};
+use hyperswitch_masking::{Deserialize, Serialize};
use crate::types;
diff --git a/crates/router/src/types/api/files.rs b/crates/router/src/types/api/files.rs
index 50ca78a1d6..4d23477c3e 100644
--- a/crates/router/src/types/api/files.rs
+++ b/crates/router/src/types/api/files.rs
@@ -1,7 +1,7 @@
use api_models::enums::FileUploadProvider;
pub use hyperswitch_domain_models::router_flow_types::files::{Retrieve, Upload};
pub use hyperswitch_interfaces::api::files::{FilePurpose, FileUpload, RetrieveFile, UploadFile};
-use masking::{Deserialize, Serialize};
+use hyperswitch_masking::{Deserialize, Serialize};
use serde_with::serde_as;
pub use super::files_v2::{FileUploadV2, RetrieveFileV2, UploadFileV2};
diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs
index 9fad2d8a7f..e10ab33230 100644
--- a/crates/router/src/types/api/payments.rs
+++ b/crates/router/src/types/api/payments.rs
@@ -141,7 +141,7 @@ mod payments_test {
card_number: "1234432112344321".to_string().try_into().unwrap(),
card_exp_month: "12".to_string().into(),
card_exp_year: "99".to_string().into(),
- card_holder_name: Some(masking::Secret::new("JohnDoe".to_string())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("JohnDoe".to_string())),
card_cvc: "123".to_string().into(),
card_issuer: Some("HDFC".to_string()),
card_network: Some(api_models::enums::CardNetwork::Visa),
@@ -149,7 +149,7 @@ mod payments_test {
card_issuing_country: None,
card_issuing_country_code: None,
card_type: None,
- nick_name: Some(masking::Secret::new("nick_name".into())),
+ nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),
}
}
diff --git a/crates/router/src/types/domain/address.rs b/crates/router/src/types/domain/address.rs
index 01d6cdda61..7030c48c35 100644
--- a/crates/router/src/types/domain/address.rs
+++ b/crates/router/src/types/domain/address.rs
@@ -9,7 +9,7 @@ use common_utils::{
};
use diesel_models::{address::AddressUpdateInternal, enums};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret, SwitchStrategy};
+use hyperswitch_masking::{PeekInterface, Secret, SwitchStrategy};
use rustc_hash::FxHashMap;
use time::{OffsetDateTime, PrimitiveDateTime};
diff --git a/crates/router/src/types/domain/event.rs b/crates/router/src/types/domain/event.rs
index e74ff65221..bb0657f27c 100644
--- a/crates/router/src/types/domain/event.rs
+++ b/crates/router/src/types/domain/event.rs
@@ -9,7 +9,7 @@ use diesel_models::{
events::{EventMetadata, EventUpdateInternal},
};
use error_stack::ResultExt;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use rustc_hash::FxHashMap;
use crate::{
diff --git a/crates/router/src/types/domain/user.rs b/crates/router/src/types/domain/user.rs
index 1f85f4278f..1a2909eb7c 100644
--- a/crates/router/src/types/domain/user.rs
+++ b/crates/router/src/types/domain/user.rs
@@ -25,7 +25,7 @@ use diesel_models::{
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::api::ApplicationResponse;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use rand::distributions::{Alphanumeric, DistString};
use time::PrimitiveDateTime;
use unicode_segmentation::UnicodeSegmentation;
@@ -1259,7 +1259,7 @@ impl UserFromStorage {
key_manager_state,
EncryptionTransferRequest {
identifier: Identifier::User(self.get_user_id().to_string()),
- key: masking::StrongSecret::new(consts::BASE64_ENGINE.encode(key)),
+ key: hyperswitch_masking::StrongSecret::new(consts::BASE64_ENGINE.encode(key)),
},
)
.await
@@ -1322,17 +1322,19 @@ impl UserFromStorage {
.await
.change_context(UserErrors::InternalServerError)?;
- Ok(domain_types::crypto_operation::<String, masking::WithType>(
- key_manager_state,
- type_name!(storage_user::User),
- domain_types::CryptoOperation::DecryptOptional(self.0.totp_secret.clone()),
- Identifier::User(user_key_store.user_id.clone()),
- user_key_store.key.peek(),
+ Ok(
+ domain_types::crypto_operation::<String, hyperswitch_masking::WithType>(
+ key_manager_state,
+ type_name!(storage_user::User),
+ domain_types::CryptoOperation::DecryptOptional(self.0.totp_secret.clone()),
+ Identifier::User(user_key_store.user_id.clone()),
+ user_key_store.key.peek(),
+ )
+ .await
+ .and_then(|val| val.try_into_optionaloperation())
+ .change_context(UserErrors::InternalServerError)?
+ .map(Encryptable::into_inner),
)
- .await
- .and_then(|val| val.try_into_optionaloperation())
- .change_context(UserErrors::InternalServerError)?
- .map(Encryptable::into_inner))
}
}
diff --git a/crates/router/src/types/domain/user/dashboard_metadata.rs b/crates/router/src/types/domain/user/dashboard_metadata.rs
index 364ef7a474..6e2e74310d 100644
--- a/crates/router/src/types/domain/user/dashboard_metadata.rs
+++ b/crates/router/src/types/domain/user/dashboard_metadata.rs
@@ -1,6 +1,6 @@
use api_models::user::dashboard_metadata as api;
use diesel_models::enums::DashboardMetadata as DBEnum;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use time::PrimitiveDateTime;
pub enum MetaData {
diff --git a/crates/router/src/types/domain/user/decision_manager.rs b/crates/router/src/types/domain/user/decision_manager.rs
index 2251ac74b2..0cb921f41a 100644
--- a/crates/router/src/types/domain/user/decision_manager.rs
+++ b/crates/router/src/types/domain/user/decision_manager.rs
@@ -5,7 +5,7 @@ use diesel_models::{
user_role::UserRole,
};
use error_stack::ResultExt;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::logger;
use super::UserFromStorage;
diff --git a/crates/router/src/types/domain/user_key_store.rs b/crates/router/src/types/domain/user_key_store.rs
index 8df3732a0b..932d0ca960 100644
--- a/crates/router/src/types/domain/user_key_store.rs
+++ b/crates/router/src/types/domain/user_key_store.rs
@@ -5,7 +5,7 @@ use common_utils::{
};
use error_stack::ResultExt;
use hyperswitch_domain_models::type_encryption::{crypto_operation, CryptoOperation};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use time::PrimitiveDateTime;
use crate::errors::{CustomResult, ValidationError};
diff --git a/crates/router/src/types/payment_methods.rs b/crates/router/src/types/payment_methods.rs
index 7dbf9680e0..c532ab5089 100644
--- a/crates/router/src/types/payment_methods.rs
+++ b/crates/router/src/types/payment_methods.rs
@@ -9,7 +9,7 @@ use common_utils::generate_id;
use common_utils::id_type;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::payment_method_data::NetworkTokenDetails;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "v2")]
diff --git a/crates/router/src/types/storage/revenue_recovery.rs b/crates/router/src/types/storage/revenue_recovery.rs
index c7d1fa0b4a..536efc297b 100644
--- a/crates/router/src/types/storage/revenue_recovery.rs
+++ b/crates/router/src/types/storage/revenue_recovery.rs
@@ -9,7 +9,7 @@ use hyperswitch_domain_models::{
payment_method_data::{Card, PaymentMethodData},
payments::{payment_attempt::PaymentAttempt, PaymentIntent, PaymentStatusData},
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::logger;
use serde::{Deserialize, Serialize};
diff --git a/crates/router/src/types/storage/revenue_recovery_redis_operation.rs b/crates/router/src/types/storage/revenue_recovery_redis_operation.rs
index 17d6c2bd92..379c016dc2 100644
--- a/crates/router/src/types/storage/revenue_recovery_redis_operation.rs
+++ b/crates/router/src/types/storage/revenue_recovery_redis_operation.rs
@@ -4,7 +4,7 @@ use api_models::revenue_recovery_data_backfill::{self, AccountUpdateHistoryRecor
use common_enums::enums::CardNetwork;
use common_utils::{date_time, errors::CustomResult, id_type};
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use redis_interface::{DelReply, SetnxReply};
use router_env::{instrument, logger, tracing};
use serde::{Deserialize, Deserializer, Serialize};
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index aaa4895aa1..9e5a3f2cf8 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -16,7 +16,7 @@ use diesel_models::enums as storage_enums;
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payments::payment_intent::CustomerData;
use hyperswitch_interfaces::api::ConnectorSpecifications;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use super::domain;
#[cfg(feature = "v2")]
@@ -643,7 +643,7 @@ impl
crate::core::api_keys::PlaintextApiKey,
),
) -> Self {
- use masking::StrongSecret;
+ use hyperswitch_masking::StrongSecret;
let (api_key, plaintext_api_key) = item;
Self {
diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rs
index 5e777517de..cd61e43b8c 100644
--- a/crates/router/src/utils.rs
+++ b/crates/router/src/utils.rs
@@ -38,7 +38,7 @@ pub use hyperswitch_connectors::utils::QrImage;
use hyperswitch_domain_models::payments::PaymentIntent;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::type_encryption::{crypto_operation, CryptoOperation};
-use masking::{ExposeInterface, SwitchStrategy};
+use hyperswitch_masking::{ExposeInterface, SwitchStrategy};
use nanoid::nanoid;
use serde::de::DeserializeOwned;
use serde_json::Value;
@@ -700,9 +700,11 @@ pub fn get_http_status_code_type(
}
// Trims whitespace from a Secret string and returns None if empty
-pub fn trim_secret_string(secret: masking::Secret<String>) -> Option<masking::Secret<String>> {
+pub fn trim_secret_string(
+ secret: hyperswitch_masking::Secret<String>,
+) -> Option<hyperswitch_masking::Secret<String>> {
let trimmed = secret.expose().trim().to_string();
- (!trimmed.is_empty()).then(|| masking::Secret::new(trimmed))
+ (!trimmed.is_empty()).then(|| hyperswitch_masking::Secret::new(trimmed))
}
// Trims whitespace from a regular string and returns None if empty
@@ -805,11 +807,12 @@ impl CustomerAddress for api_models::customers::CustomerRequest {
country_code: self.phone_country_code.clone(),
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
@@ -873,11 +876,12 @@ impl CustomerAddress for api_models::customers::CustomerRequest {
modified_at: common_utils::date_time::now(),
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
@@ -944,11 +948,12 @@ impl CustomerAddress for api_models::customers::CustomerUpdateRequest {
country_code: self.phone_country_code.clone(),
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
@@ -1011,11 +1016,12 @@ impl CustomerAddress for api_models::customers::CustomerUpdateRequest {
modified_at: common_utils::date_time::now(),
updated_by: storage_scheme.to_string(),
email: encryptable_address.email.map(|email| {
- let encryptable: Encryptable<masking::Secret<String, pii::EmailStrategy>> =
- Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
+ let encryptable: Encryptable<
+ hyperswitch_masking::Secret<String, pii::EmailStrategy>,
+ > = Encryptable::new(
+ email.clone().into_inner().switch_strategy(),
+ email.into_encrypted(),
+ );
encryptable
}),
origin_zip: encryptable_address.origin_zip,
diff --git a/crates/router/src/utils/chat.rs b/crates/router/src/utils/chat.rs
index 74fcb6d0bc..6efa8c19f4 100644
--- a/crates/router/src/utils/chat.rs
+++ b/crates/router/src/utils/chat.rs
@@ -5,7 +5,7 @@ use common_utils::{
};
use diesel_models::hyperswitch_ai_interaction::HyperswitchAiInteractionNew;
use error_stack::ResultExt;
-use masking::ExposeInterface;
+use hyperswitch_masking::ExposeInterface;
use crate::{
core::errors::{self, CustomResult},
diff --git a/crates/router/src/utils/currency.rs b/crates/router/src/utils/currency.rs
index 44b42cd3bc..28e19d0696 100644
--- a/crates/router/src/utils/currency.rs
+++ b/crates/router/src/utils/currency.rs
@@ -9,7 +9,7 @@ use api_models::enums;
use common_utils::{date_time, errors::CustomResult, events::ApiEventMetric, ext_traits::AsyncExt};
use currency_conversion::types::{CurrencyFactors, ExchangeRates};
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use redis_interface::DelReply;
use router_env::{instrument, tracing};
use rust_decimal::Decimal;
diff --git a/crates/router/src/utils/oidc.rs b/crates/router/src/utils/oidc.rs
index 4947bb2b88..cddfd60d31 100644
--- a/crates/router/src/utils/oidc.rs
+++ b/crates/router/src/utils/oidc.rs
@@ -1,6 +1,6 @@
use common_utils::ext_traits::StringExt;
use error_stack::{report, ResultExt};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use url::Url;
use crate::{
diff --git a/crates/router/src/utils/user.rs b/crates/router/src/utils/user.rs
index 50e9b40e76..054ae2fd64 100644
--- a/crates/router/src/utils/user.rs
+++ b/crates/router/src/utils/user.rs
@@ -19,8 +19,8 @@ use error_stack::ResultExt;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::merchant_connector_account::MerchantConnectorAccount as DomainMerchantConnectorAccount;
#[cfg(feature = "v1")]
-use masking::PeekInterface;
-use masking::{ExposeInterface, Secret};
+use hyperswitch_masking::PeekInterface;
+use hyperswitch_masking::{ExposeInterface, Secret};
use redis_interface::RedisConnectionPool;
use router_env::{env, logger};
@@ -183,18 +183,20 @@ pub async fn construct_public_and_private_db_configs(
.change_context(UserErrors::InternalServerError)
.attach_printable("Failed to convert auth config to json")?;
- let encrypted_config =
- domain::types::crypto_operation::<serde_json::Value, masking::WithType>(
- &state.into(),
- type_name!(diesel_models::user::User),
- domain::types::CryptoOperation::Encrypt(private_config_value.into()),
- Identifier::UserAuth(id),
- encryption_key,
- )
- .await
- .and_then(|val| val.try_into_operation())
- .change_context(UserErrors::InternalServerError)
- .attach_printable("Failed to encrypt auth config")?;
+ let encrypted_config = domain::types::crypto_operation::<
+ serde_json::Value,
+ hyperswitch_masking::WithType,
+ >(
+ &state.into(),
+ type_name!(diesel_models::user::User),
+ domain::types::CryptoOperation::Encrypt(private_config_value.into()),
+ Identifier::UserAuth(id),
+ encryption_key,
+ )
+ .await
+ .and_then(|val| val.try_into_operation())
+ .change_context(UserErrors::InternalServerError)
+ .attach_printable("Failed to encrypt auth config")?;
Ok((
Some(encrypted_config.into()),
@@ -235,21 +237,22 @@ pub async fn decrypt_oidc_private_config(
.change_context(UserErrors::InternalServerError)
.attach_printable("Failed to decode DEK")?;
- let private_config = domain::types::crypto_operation::<serde_json::Value, masking::WithType>(
- &state.into(),
- type_name!(diesel_models::user::User),
- domain::types::CryptoOperation::DecryptOptional(encrypted_config),
- Identifier::UserAuth(id),
- &user_auth_key,
- )
- .await
- .and_then(|val| val.try_into_optionaloperation())
- .change_context(UserErrors::InternalServerError)
- .attach_printable("Failed to decrypt private config")?
- .ok_or(UserErrors::InternalServerError)
- .attach_printable("Private config not found")?
- .into_inner()
- .expose();
+ let private_config =
+ domain::types::crypto_operation::<serde_json::Value, hyperswitch_masking::WithType>(
+ &state.into(),
+ type_name!(diesel_models::user::User),
+ domain::types::CryptoOperation::DecryptOptional(encrypted_config),
+ Identifier::UserAuth(id),
+ &user_auth_key,
+ )
+ .await
+ .and_then(|val| val.try_into_optionaloperation())
+ .change_context(UserErrors::InternalServerError)
+ .attach_printable("Failed to decrypt private config")?
+ .ok_or(UserErrors::InternalServerError)
+ .attach_printable("Private config not found")?
+ .into_inner()
+ .expose();
serde_json::from_value::<user_api::OpenIdConnectPrivateConfig>(private_config)
.change_context(UserErrors::InternalServerError)
diff --git a/crates/router/src/utils/user/dashboard_metadata.rs b/crates/router/src/utils/user/dashboard_metadata.rs
index 0fade67279..40286ee6ca 100644
--- a/crates/router/src/utils/user/dashboard_metadata.rs
+++ b/crates/router/src/utils/user/dashboard_metadata.rs
@@ -10,7 +10,7 @@ use diesel_models::{
user::dashboard_metadata::{DashboardMetadata, DashboardMetadataNew, DashboardMetadataUpdate},
};
use error_stack::{report, ResultExt};
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use router_env::logger;
use crate::{
diff --git a/crates/router/src/utils/user/password.rs b/crates/router/src/utils/user/password.rs
index e01181acb9..36c1536fc0 100644
--- a/crates/router/src/utils/user/password.rs
+++ b/crates/router/src/utils/user/password.rs
@@ -7,7 +7,7 @@ use argon2::{
};
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use rand::{seq::SliceRandom, Rng};
use crate::core::errors::UserErrors;
diff --git a/crates/router/src/utils/user/two_factor_auth.rs b/crates/router/src/utils/user/two_factor_auth.rs
index f539562614..26139c0d61 100644
--- a/crates/router/src/utils/user/two_factor_auth.rs
+++ b/crates/router/src/utils/user/two_factor_auth.rs
@@ -1,6 +1,6 @@
use common_utils::pii;
use error_stack::ResultExt;
-use masking::{ExposeInterface, PeekInterface};
+use hyperswitch_masking::{ExposeInterface, PeekInterface};
use totp_rs::{Algorithm, TOTP};
use crate::{
@@ -11,7 +11,7 @@ use crate::{
pub fn generate_default_totp(
email: pii::Email,
- secret: Option<masking::Secret<String>>,
+ secret: Option<hyperswitch_masking::Secret<String>>,
issuer: String,
) -> UserResult<TOTP> {
let secret = secret
@@ -66,7 +66,7 @@ pub async fn insert_totp_in_redis(state: &SessionState, user_id: &str) -> UserRe
pub async fn insert_totp_secret_in_redis(
state: &SessionState,
user_id: &str,
- secret: &masking::Secret<String>,
+ secret: &hyperswitch_masking::Secret<String>,
) -> UserResult<()> {
let redis_conn = super::get_redis_connection_for_global_tenant(state)?;
redis_conn
@@ -82,7 +82,7 @@ pub async fn insert_totp_secret_in_redis(
pub async fn get_totp_secret_from_redis(
state: &SessionState,
user_id: &str,
-) -> UserResult<Option<masking::Secret<String>>> {
+) -> UserResult<Option<hyperswitch_masking::Secret<String>>> {
let redis_conn = super::get_redis_connection_for_global_tenant(state)?;
redis_conn
.get_key::<Option<String>>(&get_totp_secret_key(user_id).into())
diff --git a/crates/router/src/utils/verify_connector.rs b/crates/router/src/utils/verify_connector.rs
index ec8a624b6f..6847642170 100644
--- a/crates/router/src/utils/verify_connector.rs
+++ b/crates/router/src/utils/verify_connector.rs
@@ -15,10 +15,10 @@ pub fn generate_card_from_details(
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Error while parsing card number")?,
card_issuer: None,
- card_cvc: masking::Secret::new(card_cvv),
+ card_cvc: hyperswitch_masking::Secret::new(card_cvv),
card_network: None,
- card_exp_year: masking::Secret::new(card_exp_year),
- card_exp_month: masking::Secret::new(card_exp_month),
+ card_exp_year: hyperswitch_masking::Secret::new(card_exp_year),
+ card_exp_month: hyperswitch_masking::Secret::new(card_exp_month),
nick_name: None,
card_type: None,
card_issuing_country: None,
diff --git a/crates/router/src/workflows/outgoing_webhook_retry.rs b/crates/router/src/workflows/outgoing_webhook_retry.rs
index 35f356ca58..14b601b465 100644
--- a/crates/router/src/workflows/outgoing_webhook_retry.rs
+++ b/crates/router/src/workflows/outgoing_webhook_retry.rs
@@ -12,7 +12,7 @@ use common_utils::{
};
use diesel_models::process_tracker::business_status;
use error_stack::ResultExt;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::tracing::{self, instrument};
use scheduler::{
consumer::{self, workflows::ProcessTrackerWorkflow},
diff --git a/crates/router/src/workflows/payment_sync.rs b/crates/router/src/workflows/payment_sync.rs
index 863a0adc1c..eb59813a6a 100644
--- a/crates/router/src/workflows/payment_sync.rs
+++ b/crates/router/src/workflows/payment_sync.rs
@@ -147,7 +147,7 @@ impl ProcessTrackerWorkflow<SessionState> for PaymentsSyncWorkflow {
.as_ref()
.is_none()
{
- let payment_intent_update = hyperswitch_domain_models::payments::payment_intent::PaymentIntentUpdate::PGStatusUpdate { status: api_models::enums::IntentStatus::Failed,updated_by: merchant_account.storage_scheme.to_string(), incremental_authorization_allowed: Some(false), feature_metadata: payment_data.payment_intent.feature_metadata.clone().map(masking::Secret::new), };
+ let payment_intent_update = hyperswitch_domain_models::payments::payment_intent::PaymentIntentUpdate::PGStatusUpdate { status: api_models::enums::IntentStatus::Failed,updated_by: merchant_account.storage_scheme.to_string(), incremental_authorization_allowed: Some(false), feature_metadata: payment_data.payment_intent.feature_metadata.clone().map(hyperswitch_masking::Secret::new), };
let payment_attempt_update =
hyperswitch_domain_models::payments::payment_attempt::PaymentAttemptUpdate::ErrorUpdate {
connector: None,
diff --git a/crates/router/src/workflows/revenue_recovery.rs b/crates/router/src/workflows/revenue_recovery.rs
index 7639fb8dcd..97932049b6 100644
--- a/crates/router/src/workflows/revenue_recovery.rs
+++ b/crates/router/src/workflows/revenue_recovery.rs
@@ -30,7 +30,7 @@ use hyperswitch_domain_models::{
router_flow_types::Authorize,
};
#[cfg(feature = "v2")]
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
#[cfg(feature = "v2")]
use rand::Rng;
use router_env::{
diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs
index d6fc082b43..bd3150f38d 100644
--- a/crates/router/tests/connectors/aci.rs
+++ b/crates/router/tests/connectors/aci.rs
@@ -5,7 +5,7 @@ use hyperswitch_domain_models::{
payment_method_data::{Card, PaymentMethodData},
router_request_types::AuthenticationData,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rs
index d30a4c0f63..523256b3ce 100644
--- a/crates/router/tests/connectors/adyen.rs
+++ b/crates/router/tests/connectors/adyen.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/affirm.rs b/crates/router/tests/connectors/affirm.rs
index dfabb854ff..e8a3f98c6a 100644
--- a/crates/router/tests/connectors/affirm.rs
+++ b/crates/router/tests/connectors/affirm.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/airwallex.rs b/crates/router/tests/connectors/airwallex.rs
index 901b4a467e..088dde2f65 100644
--- a/crates/router/tests/connectors/airwallex.rs
+++ b/crates/router/tests/connectors/airwallex.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use router::types::{self, domain, storage::enums, AccessToken};
use crate::{
diff --git a/crates/router/tests/connectors/amazonpay.rs b/crates/router/tests/connectors/amazonpay.rs
index 36ebb3178f..dff50d4573 100644
--- a/crates/router/tests/connectors/amazonpay.rs
+++ b/crates/router/tests/connectors/amazonpay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/authipay.rs b/crates/router/tests/connectors/authipay.rs
index 8f0a7830dd..5b64b545b2 100644
--- a/crates/router/tests/connectors/authipay.rs
+++ b/crates/router/tests/connectors/authipay.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
core::errors,
types::{self, api, storage::enums},
diff --git a/crates/router/tests/connectors/authorizedotnet.rs b/crates/router/tests/connectors/authorizedotnet.rs
index e7519136b3..1dca370ba8 100644
--- a/crates/router/tests/connectors/authorizedotnet.rs
+++ b/crates/router/tests/connectors/authorizedotnet.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/bambora.rs b/crates/router/tests/connectors/bambora.rs
index eabad59cc7..41a77f8c51 100644
--- a/crates/router/tests/connectors/bambora.rs
+++ b/crates/router/tests/connectors/bambora.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use common_utils::types::MinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/bamboraapac.rs b/crates/router/tests/connectors/bamboraapac.rs
index 3cf70b6ff5..5db5f30dfe 100644
--- a/crates/router/tests/connectors/bamboraapac.rs
+++ b/crates/router/tests/connectors/bamboraapac.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/bankofamerica.rs b/crates/router/tests/connectors/bankofamerica.rs
index cea3c2d6d8..41e0eef2d4 100644
--- a/crates/router/tests/connectors/bankofamerica.rs
+++ b/crates/router/tests/connectors/bankofamerica.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/barclaycard.rs b/crates/router/tests/connectors/barclaycard.rs
index 2087131c4e..6d3cbbe3e2 100644
--- a/crates/router/tests/connectors/barclaycard.rs
+++ b/crates/router/tests/connectors/barclaycard.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/billwerk.rs b/crates/router/tests/connectors/billwerk.rs
index b772e5465c..3061009974 100644
--- a/crates/router/tests/connectors/billwerk.rs
+++ b/crates/router/tests/connectors/billwerk.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/bitpay.rs b/crates/router/tests/connectors/bitpay.rs
index a41dd25357..f68aa3ed09 100644
--- a/crates/router/tests/connectors/bitpay.rs
+++ b/crates/router/tests/connectors/bitpay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/blackhawknetwork.rs b/crates/router/tests/connectors/blackhawknetwork.rs
index 6e942f0eb6..41594f6c54 100644
--- a/crates/router/tests/connectors/blackhawknetwork.rs
+++ b/crates/router/tests/connectors/blackhawknetwork.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/bluesnap.rs b/crates/router/tests/connectors/bluesnap.rs
index d6df20d7ee..8a58be64ee 100644
--- a/crates/router/tests/connectors/bluesnap.rs
+++ b/crates/router/tests/connectors/bluesnap.rs
@@ -2,7 +2,7 @@ use std::str::FromStr;
use common_utils::pii::Email;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, ConnectorAuthType, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/boku.rs b/crates/router/tests/connectors/boku.rs
index 3c95464f22..f9ff1cf9d1 100644
--- a/crates/router/tests/connectors/boku.rs
+++ b/crates/router/tests/connectors/boku.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/breadpay.rs b/crates/router/tests/connectors/breadpay.rs
index 38d6898adc..01ba4eb5c4 100644
--- a/crates/router/tests/connectors/breadpay.rs
+++ b/crates/router/tests/connectors/breadpay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/calida.rs b/crates/router/tests/connectors/calida.rs
index 2307570c8d..ac5cfed052 100644
--- a/crates/router/tests/connectors/calida.rs
+++ b/crates/router/tests/connectors/calida.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/celero.rs b/crates/router/tests/connectors/celero.rs
index 7d4e942471..099125d803 100644
--- a/crates/router/tests/connectors/celero.rs
+++ b/crates/router/tests/connectors/celero.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/chargebee.rs b/crates/router/tests/connectors/chargebee.rs
index 33d1c8f18d..121303dd13 100644
--- a/crates/router/tests/connectors/chargebee.rs
+++ b/crates/router/tests/connectors/chargebee.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/checkbook.rs b/crates/router/tests/connectors/checkbook.rs
index a312de7fdf..8c8c1726d9 100644
--- a/crates/router/tests/connectors/checkbook.rs
+++ b/crates/router/tests/connectors/checkbook.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums, Email};
use crate::utils::{self, ConnectorActions};
diff --git a/crates/router/tests/connectors/checkout.rs b/crates/router/tests/connectors/checkout.rs
index 21a904a2ca..ecb1d0f261 100644
--- a/crates/router/tests/connectors/checkout.rs
+++ b/crates/router/tests/connectors/checkout.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/coinbase.rs b/crates/router/tests/connectors/coinbase.rs
index 5b6a5b92d5..7ae2b5c2aa 100644
--- a/crates/router/tests/connectors/coinbase.rs
+++ b/crates/router/tests/connectors/coinbase.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, PaymentAddress};
use serde_json::json;
diff --git a/crates/router/tests/connectors/coingate.rs b/crates/router/tests/connectors/coingate.rs
index 572aecb3dd..6b7cb6860d 100644
--- a/crates/router/tests/connectors/coingate.rs
+++ b/crates/router/tests/connectors/coingate.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use crate::utils::{self, ConnectorActions};
diff --git a/crates/router/tests/connectors/cryptopay.rs b/crates/router/tests/connectors/cryptopay.rs
index 2817967185..466a2a9cc4 100644
--- a/crates/router/tests/connectors/cryptopay.rs
+++ b/crates/router/tests/connectors/cryptopay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/custombilling.rs b/crates/router/tests/connectors/custombilling.rs
index f92552ab14..9f20722bd1 100644
--- a/crates/router/tests/connectors/custombilling.rs
+++ b/crates/router/tests/connectors/custombilling.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
types::{self, api, storage::enums,
}};
diff --git a/crates/router/tests/connectors/cybersource.rs b/crates/router/tests/connectors/cybersource.rs
index 4a1c5af567..ad0683a1a9 100644
--- a/crates/router/tests/connectors/cybersource.rs
+++ b/crates/router/tests/connectors/cybersource.rs
@@ -2,7 +2,7 @@ use std::str::FromStr;
use common_utils::pii::Email;
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/cybersourcedecisionmanager.rs b/crates/router/tests/connectors/cybersourcedecisionmanager.rs
index 9a58c25c66..a90b4ba634 100644
--- a/crates/router/tests/connectors/cybersourcedecisionmanager.rs
+++ b/crates/router/tests/connectors/cybersourcedecisionmanager.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/datatrans.rs b/crates/router/tests/connectors/datatrans.rs
index 7c040c607f..d3aaeb6a3b 100644
--- a/crates/router/tests/connectors/datatrans.rs
+++ b/crates/router/tests/connectors/datatrans.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/deutschebank.rs b/crates/router/tests/connectors/deutschebank.rs
index e5d8896444..91a3339919 100644
--- a/crates/router/tests/connectors/deutschebank.rs
+++ b/crates/router/tests/connectors/deutschebank.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/digitalvirgo.rs b/crates/router/tests/connectors/digitalvirgo.rs
index 422c95e383..4e906bcb2c 100644
--- a/crates/router/tests/connectors/digitalvirgo.rs
+++ b/crates/router/tests/connectors/digitalvirgo.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
types::{self, api, storage::enums,
}};
diff --git a/crates/router/tests/connectors/dlocal.rs b/crates/router/tests/connectors/dlocal.rs
index 0f0d6fa641..9a51103807 100644
--- a/crates/router/tests/connectors/dlocal.rs
+++ b/crates/router/tests/connectors/dlocal.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/dummyconnector.rs b/crates/router/tests/connectors/dummyconnector.rs
index bf901f32c3..887f7c6719 100644
--- a/crates/router/tests/connectors/dummyconnector.rs
+++ b/crates/router/tests/connectors/dummyconnector.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use cards::CardNumber;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/dwolla.rs b/crates/router/tests/connectors/dwolla.rs
index 4500b7ee0f..a69010fe16 100644
--- a/crates/router/tests/connectors/dwolla.rs
+++ b/crates/router/tests/connectors/dwolla.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/ebanx.rs b/crates/router/tests/connectors/ebanx.rs
index 28b571dac1..1f588c831b 100644
--- a/crates/router/tests/connectors/ebanx.rs
+++ b/crates/router/tests/connectors/ebanx.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/elavon.rs b/crates/router/tests/connectors/elavon.rs
index af00ab909a..1f7ada3b68 100644
--- a/crates/router/tests/connectors/elavon.rs
+++ b/crates/router/tests/connectors/elavon.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/envoy.rs b/crates/router/tests/connectors/envoy.rs
index 50e53111aa..6c4b9149b4 100644
--- a/crates/router/tests/connectors/envoy.rs
+++ b/crates/router/tests/connectors/envoy.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/facilitapay.rs b/crates/router/tests/connectors/facilitapay.rs
index 717eeb916f..16e6228f25 100644
--- a/crates/router/tests/connectors/facilitapay.rs
+++ b/crates/router/tests/connectors/facilitapay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/finix.rs b/crates/router/tests/connectors/finix.rs
index 4efe9a9bd8..eaacbeaade 100644
--- a/crates/router/tests/connectors/finix.rs
+++ b/crates/router/tests/connectors/finix.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/fiserv.rs b/crates/router/tests/connectors/fiserv.rs
index 390255f854..bd873e8d1c 100644
--- a/crates/router/tests/connectors/fiserv.rs
+++ b/crates/router/tests/connectors/fiserv.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use serde_json::json;
diff --git a/crates/router/tests/connectors/fiservcommercehub.rs b/crates/router/tests/connectors/fiservcommercehub.rs
index deaed9e66b..6efff50d60 100644
--- a/crates/router/tests/connectors/fiservcommercehub.rs
+++ b/crates/router/tests/connectors/fiservcommercehub.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/fiservemea.rs b/crates/router/tests/connectors/fiservemea.rs
index d8c7330420..95b5e025c2 100644
--- a/crates/router/tests/connectors/fiservemea.rs
+++ b/crates/router/tests/connectors/fiservemea.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/fiuu.rs b/crates/router/tests/connectors/fiuu.rs
index c27d097a9c..a912e438b7 100644
--- a/crates/router/tests/connectors/fiuu.rs
+++ b/crates/router/tests/connectors/fiuu.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/flexiti.rs b/crates/router/tests/connectors/flexiti.rs
index cef4dc970c..ff8136baa8 100644
--- a/crates/router/tests/connectors/flexiti.rs
+++ b/crates/router/tests/connectors/flexiti.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/forte.rs b/crates/router/tests/connectors/forte.rs
index 3c5cde492c..a5d6d20caf 100644
--- a/crates/router/tests/connectors/forte.rs
+++ b/crates/router/tests/connectors/forte.rs
@@ -3,7 +3,7 @@ use std::{str::FromStr, time::Duration};
use cards::CardNumber;
use common_utils::types::MinorUnit;
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/getnet.rs b/crates/router/tests/connectors/getnet.rs
index d8441df440..c82757df26 100644
--- a/crates/router/tests/connectors/getnet.rs
+++ b/crates/router/tests/connectors/getnet.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/gigadat.rs b/crates/router/tests/connectors/gigadat.rs
index f77277ad24..2f77f94f0d 100644
--- a/crates/router/tests/connectors/gigadat.rs
+++ b/crates/router/tests/connectors/gigadat.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/globalpay.rs b/crates/router/tests/connectors/globalpay.rs
index cd7e6c6b79..5a3c05d64f 100644
--- a/crates/router/tests/connectors/globalpay.rs
+++ b/crates/router/tests/connectors/globalpay.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, AccessToken, ConnectorAuthType};
use serde_json::json;
diff --git a/crates/router/tests/connectors/globepay.rs b/crates/router/tests/connectors/globepay.rs
index 342feac6ec..01832b7378 100644
--- a/crates/router/tests/connectors/globepay.rs
+++ b/crates/router/tests/connectors/globepay.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/gocardless.rs b/crates/router/tests/connectors/gocardless.rs
index afe98c150a..daec36d748 100644
--- a/crates/router/tests/connectors/gocardless.rs
+++ b/crates/router/tests/connectors/gocardless.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/helcim.rs b/crates/router/tests/connectors/helcim.rs
index 5b02e2f843..709882a2de 100644
--- a/crates/router/tests/connectors/helcim.rs
+++ b/crates/router/tests/connectors/helcim.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/hipay.rs b/crates/router/tests/connectors/hipay.rs
index 343e555c67..147185d602 100644
--- a/crates/router/tests/connectors/hipay.rs
+++ b/crates/router/tests/connectors/hipay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/hyperpg.rs b/crates/router/tests/connectors/hyperpg.rs
index c334c3cdad..fc527a72dd 100644
--- a/crates/router/tests/connectors/hyperpg.rs
+++ b/crates/router/tests/connectors/hyperpg.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/hyperswitch_vault.rs b/crates/router/tests/connectors/hyperswitch_vault.rs
index 8f8fd5f169..454fbbd407 100644
--- a/crates/router/tests/connectors/hyperswitch_vault.rs
+++ b/crates/router/tests/connectors/hyperswitch_vault.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/hyperwallet.rs b/crates/router/tests/connectors/hyperwallet.rs
index cfd1bcb79e..3be31d953e 100644
--- a/crates/router/tests/connectors/hyperwallet.rs
+++ b/crates/router/tests/connectors/hyperwallet.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/iatapay.rs b/crates/router/tests/connectors/iatapay.rs
index 89fc270e6a..3b0bfeb54a 100644
--- a/crates/router/tests/connectors/iatapay.rs
+++ b/crates/router/tests/connectors/iatapay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums, AccessToken};
use crate::{
diff --git a/crates/router/tests/connectors/inespay.rs b/crates/router/tests/connectors/inespay.rs
index 6fb8914aec..7c4066db02 100644
--- a/crates/router/tests/connectors/inespay.rs
+++ b/crates/router/tests/connectors/inespay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/itaubank.rs b/crates/router/tests/connectors/itaubank.rs
index 221bf7a449..1c43242e18 100644
--- a/crates/router/tests/connectors/itaubank.rs
+++ b/crates/router/tests/connectors/itaubank.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/jpmorgan.rs b/crates/router/tests/connectors/jpmorgan.rs
index 9e364a3bbb..b5a5e9d70c 100644
--- a/crates/router/tests/connectors/jpmorgan.rs
+++ b/crates/router/tests/connectors/jpmorgan.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/juspaythreedsserver.rs b/crates/router/tests/connectors/juspaythreedsserver.rs
index 108ac2d1e0..0d4b3e04ab 100644
--- a/crates/router/tests/connectors/juspaythreedsserver.rs
+++ b/crates/router/tests/connectors/juspaythreedsserver.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/katapult.rs b/crates/router/tests/connectors/katapult.rs
index 7cbe361a2b..3de7f5785e 100644
--- a/crates/router/tests/connectors/katapult.rs
+++ b/crates/router/tests/connectors/katapult.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/loonio.rs b/crates/router/tests/connectors/loonio.rs
index c9756e2280..aecf90ed82 100644
--- a/crates/router/tests/connectors/loonio.rs
+++ b/crates/router/tests/connectors/loonio.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/mifinity.rs b/crates/router/tests/connectors/mifinity.rs
index 89349be07b..76abf300ed 100644
--- a/crates/router/tests/connectors/mifinity.rs
+++ b/crates/router/tests/connectors/mifinity.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/moneris.rs b/crates/router/tests/connectors/moneris.rs
index ba8c7e491f..cf5aab243a 100644
--- a/crates/router/tests/connectors/moneris.rs
+++ b/crates/router/tests/connectors/moneris.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/mpgs.rs b/crates/router/tests/connectors/mpgs.rs
index 7c68fa79a3..a494713583 100644
--- a/crates/router/tests/connectors/mpgs.rs
+++ b/crates/router/tests/connectors/mpgs.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/multisafepay.rs b/crates/router/tests/connectors/multisafepay.rs
index 11d846eb3a..8c2ec8a057 100644
--- a/crates/router/tests/connectors/multisafepay.rs
+++ b/crates/router/tests/connectors/multisafepay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/nexinets.rs b/crates/router/tests/connectors/nexinets.rs
index 4d30d0e08b..cb62f8184e 100644
--- a/crates/router/tests/connectors/nexinets.rs
+++ b/crates/router/tests/connectors/nexinets.rs
@@ -2,7 +2,7 @@ use std::str::FromStr;
use cards::CardNumber;
use common_utils::types::MinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, PaymentsAuthorizeData};
use crate::{
diff --git a/crates/router/tests/connectors/nexixpay.rs b/crates/router/tests/connectors/nexixpay.rs
index ebb68dd289..90a7c33e44 100644
--- a/crates/router/tests/connectors/nexixpay.rs
+++ b/crates/router/tests/connectors/nexixpay.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/nomupay.rs b/crates/router/tests/connectors/nomupay.rs
index 4d2f9cff03..a5c462ec7b 100644
--- a/crates/router/tests/connectors/nomupay.rs
+++ b/crates/router/tests/connectors/nomupay.rs
@@ -1,5 +1,5 @@
use api_models::payments::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums, PaymentAddress};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/noon.rs b/crates/router/tests/connectors/noon.rs
index 8810607186..6f1e586698 100644
--- a/crates/router/tests/connectors/noon.rs
+++ b/crates/router/tests/connectors/noon.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/nordea.rs b/crates/router/tests/connectors/nordea.rs
index af5d7b4d4b..9b14f03099 100644
--- a/crates/router/tests/connectors/nordea.rs
+++ b/crates/router/tests/connectors/nordea.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/novalnet.rs b/crates/router/tests/connectors/novalnet.rs
index 2337cae383..4e2cf3abef 100644
--- a/crates/router/tests/connectors/novalnet.rs
+++ b/crates/router/tests/connectors/novalnet.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/nuvei.rs b/crates/router/tests/connectors/nuvei.rs
index 395ad1d1ea..c26a3b0649 100644
--- a/crates/router/tests/connectors/nuvei.rs
+++ b/crates/router/tests/connectors/nuvei.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums};
use serde_json::json;
diff --git a/crates/router/tests/connectors/opayo.rs b/crates/router/tests/connectors/opayo.rs
index 585a6f4486..952b462370 100644
--- a/crates/router/tests/connectors/opayo.rs
+++ b/crates/router/tests/connectors/opayo.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/opennode.rs b/crates/router/tests/connectors/opennode.rs
index e54bb3688e..76fdffda3f 100644
--- a/crates/router/tests/connectors/opennode.rs
+++ b/crates/router/tests/connectors/opennode.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails, PhoneDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/paybox.rs b/crates/router/tests/connectors/paybox.rs
index 0741e3a1a3..c34c37b214 100644
--- a/crates/router/tests/connectors/paybox.rs
+++ b/crates/router/tests/connectors/paybox.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/payeezy.rs b/crates/router/tests/connectors/payeezy.rs
index a91f5b0fed..41f1f0f3fc 100644
--- a/crates/router/tests/connectors/payeezy.rs
+++ b/crates/router/tests/connectors/payeezy.rs
@@ -2,7 +2,7 @@ use std::str::FromStr;
use cards::CardNumber;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
core::errors,
types::{self, storage::enums, PaymentsAuthorizeData},
diff --git a/crates/router/tests/connectors/payjustnow.rs b/crates/router/tests/connectors/payjustnow.rs
index e435348fa7..7c896b2467 100644
--- a/crates/router/tests/connectors/payjustnow.rs
+++ b/crates/router/tests/connectors/payjustnow.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/payjustnowinstore.rs b/crates/router/tests/connectors/payjustnowinstore.rs
index e9391ca67b..9d8e713dae 100644
--- a/crates/router/tests/connectors/payjustnowinstore.rs
+++ b/crates/router/tests/connectors/payjustnowinstore.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/payload.rs b/crates/router/tests/connectors/payload.rs
index fcbff7090e..3e1d1fded9 100644
--- a/crates/router/tests/connectors/payload.rs
+++ b/crates/router/tests/connectors/payload.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/payme.rs b/crates/router/tests/connectors/payme.rs
index 01a3fb3549..836c9d9937 100644
--- a/crates/router/tests/connectors/payme.rs
+++ b/crates/router/tests/connectors/payme.rs
@@ -3,7 +3,7 @@ use std::str::FromStr;
use common_utils::{pii::Email, types::MinorUnit};
use diesel_models::types::OrderDetailsWithAmount;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, PaymentAddress};
use crate::{
diff --git a/crates/router/tests/connectors/payone.rs b/crates/router/tests/connectors/payone.rs
index 08ad259d90..8caf1956ca 100644
--- a/crates/router/tests/connectors/payone.rs
+++ b/crates/router/tests/connectors/payone.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/paypal.rs b/crates/router/tests/connectors/paypal.rs
index 5dfe186e11..b732e43953 100644
--- a/crates/router/tests/connectors/paypal.rs
+++ b/crates/router/tests/connectors/paypal.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use common_utils::types::MinorUnit;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, AccessToken, ConnectorAuthType};
use crate::{
diff --git a/crates/router/tests/connectors/paysafe.rs b/crates/router/tests/connectors/paysafe.rs
index 36afbb0368..c17c704686 100644
--- a/crates/router/tests/connectors/paysafe.rs
+++ b/crates/router/tests/connectors/paysafe.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/paystack.rs b/crates/router/tests/connectors/paystack.rs
index 2aaac95b20..8be2b8b135 100644
--- a/crates/router/tests/connectors/paystack.rs
+++ b/crates/router/tests/connectors/paystack.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/paytm.rs b/crates/router/tests/connectors/paytm.rs
index 9dc1798a03..c14f31306f 100644
--- a/crates/router/tests/connectors/paytm.rs
+++ b/crates/router/tests/connectors/paytm.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/payu.rs b/crates/router/tests/connectors/payu.rs
index 17278bf5e1..0994dd4954 100644
--- a/crates/router/tests/connectors/payu.rs
+++ b/crates/router/tests/connectors/payu.rs
@@ -1,5 +1,5 @@
use common_enums::GooglePayCardFundingSource;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router::types::{self, domain, storage::enums, AccessToken, ConnectorAuthType};
use crate::{
diff --git a/crates/router/tests/connectors/peachpayments.rs b/crates/router/tests/connectors/peachpayments.rs
index f7da85872a..bc78a87b5e 100644
--- a/crates/router/tests/connectors/peachpayments.rs
+++ b/crates/router/tests/connectors/peachpayments.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/phonepe.rs b/crates/router/tests/connectors/phonepe.rs
index 9a4c7f28f1..55bd03f951 100644
--- a/crates/router/tests/connectors/phonepe.rs
+++ b/crates/router/tests/connectors/phonepe.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/placetopay.rs b/crates/router/tests/connectors/placetopay.rs
index 4937f03e33..294235be01 100644
--- a/crates/router/tests/connectors/placetopay.rs
+++ b/crates/router/tests/connectors/placetopay.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/plaid.rs b/crates/router/tests/connectors/plaid.rs
index bcce36347e..1a25835248 100644
--- a/crates/router/tests/connectors/plaid.rs
+++ b/crates/router/tests/connectors/plaid.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/powertranz.rs b/crates/router/tests/connectors/powertranz.rs
index b595081ee8..d91da59fd1 100644
--- a/crates/router/tests/connectors/powertranz.rs
+++ b/crates/router/tests/connectors/powertranz.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/prophetpay.rs b/crates/router/tests/connectors/prophetpay.rs
index dc42649fbf..f1beb81ec1 100644
--- a/crates/router/tests/connectors/prophetpay.rs
+++ b/crates/router/tests/connectors/prophetpay.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/rapyd.rs b/crates/router/tests/connectors/rapyd.rs
index db09f6b92d..d00e8205b4 100644
--- a/crates/router/tests/connectors/rapyd.rs
+++ b/crates/router/tests/connectors/rapyd.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use futures::future::OptionFuture;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use serial_test::serial;
diff --git a/crates/router/tests/connectors/razorpay.rs b/crates/router/tests/connectors/razorpay.rs
index 7ab77cc65c..388dfabd55 100644
--- a/crates/router/tests/connectors/razorpay.rs
+++ b/crates/router/tests/connectors/razorpay.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/redsys.rs b/crates/router/tests/connectors/redsys.rs
index 532bbb6f55..0813991902 100644
--- a/crates/router/tests/connectors/redsys.rs
+++ b/crates/router/tests/connectors/redsys.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/revolv3.rs b/crates/router/tests/connectors/revolv3.rs
index 7f54d82262..36201c3550 100644
--- a/crates/router/tests/connectors/revolv3.rs
+++ b/crates/router/tests/connectors/revolv3.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/santander.rs b/crates/router/tests/connectors/santander.rs
index 5cf2d603f3..05e9bd2956 100644
--- a/crates/router/tests/connectors/santander.rs
+++ b/crates/router/tests/connectors/santander.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/shift4.rs b/crates/router/tests/connectors/shift4.rs
index ce10c9dad1..e182c60872 100644
--- a/crates/router/tests/connectors/shift4.rs
+++ b/crates/router/tests/connectors/shift4.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/sift.rs b/crates/router/tests/connectors/sift.rs
index 815ce9cdb2..436b8d4797 100644
--- a/crates/router/tests/connectors/sift.rs
+++ b/crates/router/tests/connectors/sift.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/silverflow.rs b/crates/router/tests/connectors/silverflow.rs
index 5d4f48943d..89b8187b76 100644
--- a/crates/router/tests/connectors/silverflow.rs
+++ b/crates/router/tests/connectors/silverflow.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/square.rs b/crates/router/tests/connectors/square.rs
index 43cfe97096..addb974743 100644
--- a/crates/router/tests/connectors/square.rs
+++ b/crates/router/tests/connectors/square.rs
@@ -1,6 +1,6 @@
use std::{str::FromStr, time::Duration};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, storage::enums, PaymentsResponseData};
use test_utils::connector_auth::ConnectorAuthentication;
diff --git a/crates/router/tests/connectors/stax.rs b/crates/router/tests/connectors/stax.rs
index 38700f0ca4..55b0113c4e 100644
--- a/crates/router/tests/connectors/stax.rs
+++ b/crates/router/tests/connectors/stax.rs
@@ -1,6 +1,6 @@
use std::{str::FromStr, time::Duration};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums, PaymentsResponseData};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/stripe.rs b/crates/router/tests/connectors/stripe.rs
index 5b99e0f859..a2d0969133 100644
--- a/crates/router/tests/connectors/stripe.rs
+++ b/crates/router/tests/connectors/stripe.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/stripebilling.rs b/crates/router/tests/connectors/stripebilling.rs
index 8fccb9cb88..6425c56fa6 100644
--- a/crates/router/tests/connectors/stripebilling.rs
+++ b/crates/router/tests/connectors/stripebilling.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/taxjar.rs b/crates/router/tests/connectors/taxjar.rs
index 6bb044777f..80b48590a8 100644
--- a/crates/router/tests/connectors/taxjar.rs
+++ b/crates/router/tests/connectors/taxjar.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/tesouro.rs b/crates/router/tests/connectors/tesouro.rs
index 44e74552fa..72988c53df 100644
--- a/crates/router/tests/connectors/tesouro.rs
+++ b/crates/router/tests/connectors/tesouro.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/thunes.rs b/crates/router/tests/connectors/thunes.rs
index 379e102a53..9b37ac2152 100644
--- a/crates/router/tests/connectors/thunes.rs
+++ b/crates/router/tests/connectors/thunes.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
// use router::{
// types::{self, api, storage::enums,
// }};
diff --git a/crates/router/tests/connectors/tokenex.rs b/crates/router/tests/connectors/tokenex.rs
index 72fe2daacc..37fb8922ff 100644
--- a/crates/router/tests/connectors/tokenex.rs
+++ b/crates/router/tests/connectors/tokenex.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/tokenio.rs b/crates/router/tests/connectors/tokenio.rs
index f0ea963ee0..56c039df6c 100644
--- a/crates/router/tests/connectors/tokenio.rs
+++ b/crates/router/tests/connectors/tokenio.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/truelayer.rs b/crates/router/tests/connectors/truelayer.rs
index 3ecea97af5..172363b7a3 100644
--- a/crates/router/tests/connectors/truelayer.rs
+++ b/crates/router/tests/connectors/truelayer.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/trustly.rs b/crates/router/tests/connectors/trustly.rs
index 931b496cd1..ee3756eeed 100644
--- a/crates/router/tests/connectors/trustly.rs
+++ b/crates/router/tests/connectors/trustly.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/trustpay.rs b/crates/router/tests/connectors/trustpay.rs
index bb635996ad..6eea9aa7e1 100644
--- a/crates/router/tests/connectors/trustpay.rs
+++ b/crates/router/tests/connectors/trustpay.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums, BrowserInformation};
use crate::{
diff --git a/crates/router/tests/connectors/trustpayments.rs b/crates/router/tests/connectors/trustpayments.rs
index a5e75c407c..ef54ce42fe 100644
--- a/crates/router/tests/connectors/trustpayments.rs
+++ b/crates/router/tests/connectors/trustpayments.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/tsys.rs b/crates/router/tests/connectors/tsys.rs
index 6a4843ac2c..bc03d7d0d5 100644
--- a/crates/router/tests/connectors/tsys.rs
+++ b/crates/router/tests/connectors/tsys.rs
@@ -1,7 +1,7 @@
use std::{str::FromStr, time::Duration};
use cards::CardNumber;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/unified_authentication_service.rs b/crates/router/tests/connectors/unified_authentication_service.rs
index 0a403d9d26..1d6faa17a9 100644
--- a/crates/router/tests/connectors/unified_authentication_service.rs
+++ b/crates/router/tests/connectors/unified_authentication_service.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index 7edce78ac5..65587e7658 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -4,7 +4,7 @@ use async_trait::async_trait;
use common_utils::{id_type::GenerateId, pii::Email};
use error_stack::Report;
use hyperswitch_domain_models::router_data_v2::flow_common_types::PaymentFlowData;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
configs::settings::Settings,
core::{errors::ConnectorError, payments},
diff --git a/crates/router/tests/connectors/vgs.rs b/crates/router/tests/connectors/vgs.rs
index 70ce104596..6a77969a46 100644
--- a/crates/router/tests/connectors/vgs.rs
+++ b/crates/router/tests/connectors/vgs.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/volt.rs b/crates/router/tests/connectors/volt.rs
index 6e7212d145..bc9f75dd7a 100644
--- a/crates/router/tests/connectors/volt.rs
+++ b/crates/router/tests/connectors/volt.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/wellsfargo.rs b/crates/router/tests/connectors/wellsfargo.rs
index cab82c59ac..b1282b8aa0 100644
--- a/crates/router/tests/connectors/wellsfargo.rs
+++ b/crates/router/tests/connectors/wellsfargo.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, domain, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/wellsfargopayout.rs b/crates/router/tests/connectors/wellsfargopayout.rs
index 7612abb650..4d9e76cb0a 100644
--- a/crates/router/tests/connectors/wellsfargopayout.rs
+++ b/crates/router/tests/connectors/wellsfargopayout.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/wise.rs b/crates/router/tests/connectors/wise.rs
index 2156cfb147..c276edfe08 100644
--- a/crates/router/tests/connectors/wise.rs
+++ b/crates/router/tests/connectors/wise.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
types,
types::{api, storage::enums, PaymentAddress},
diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rs
index 17d8051269..a3ac378c0e 100644
--- a/crates/router/tests/connectors/worldline.rs
+++ b/crates/router/tests/connectors/worldline.rs
@@ -1,7 +1,7 @@
use std::str::FromStr;
use hyperswitch_domain_models::address::{Address, AddressDetails};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
connector::Worldline,
core::errors,
diff --git a/crates/router/tests/connectors/worldpaymodular.rs b/crates/router/tests/connectors/worldpaymodular.rs
index 5e4acf6614..a42858501a 100644
--- a/crates/router/tests/connectors/worldpaymodular.rs
+++ b/crates/router/tests/connectors/worldpaymodular.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/worldpayvantiv.rs b/crates/router/tests/connectors/worldpayvantiv.rs
index d4c21d04cb..75cb89b897 100644
--- a/crates/router/tests/connectors/worldpayvantiv.rs
+++ b/crates/router/tests/connectors/worldpayvantiv.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/worldpayxml.rs b/crates/router/tests/connectors/worldpayxml.rs
index e93d5acc02..d4911ba59f 100644
--- a/crates/router/tests/connectors/worldpayxml.rs
+++ b/crates/router/tests/connectors/worldpayxml.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/connectors/xendit.rs b/crates/router/tests/connectors/xendit.rs
index 452f22a112..82640bf82c 100644
--- a/crates/router/tests/connectors/xendit.rs
+++ b/crates/router/tests/connectors/xendit.rs
@@ -1,4 +1,4 @@
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::{
types::{self, api, storage::enums,
}};
diff --git a/crates/router/tests/connectors/zen.rs b/crates/router/tests/connectors/zen.rs
index 3823008b95..c8bd4482d0 100644
--- a/crates/router/tests/connectors/zen.rs
+++ b/crates/router/tests/connectors/zen.rs
@@ -3,7 +3,7 @@ use std::str::FromStr;
use cards::CardNumber;
use common_utils::{pii::Email, types::MinorUnit};
use hyperswitch_domain_models::types::OrderDetailsWithAmount;
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, domain, storage::enums};
use crate::{
diff --git a/crates/router/tests/connectors/zift.rs b/crates/router/tests/connectors/zift.rs
index c169aa9ad5..f0b3005eed 100644
--- a/crates/router/tests/connectors/zift.rs
+++ b/crates/router/tests/connectors/zift.rs
@@ -1,5 +1,5 @@
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
diff --git a/crates/router/tests/integration_demo.rs b/crates/router/tests/integration_demo.rs
index 84015af3e0..5a7f1a765b 100644
--- a/crates/router/tests/integration_demo.rs
+++ b/crates/router/tests/integration_demo.rs
@@ -1,5 +1,5 @@
mod utils;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use test_utils::connector_auth::ConnectorAuthentication;
use utils::{mk_service, ApiKey, AppClient, MerchantId, PaymentId, Status};
diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs
index e14d989fca..d5a5a0c468 100644
--- a/crates/router/tests/payments.rs
+++ b/crates/router/tests/payments.rs
@@ -342,7 +342,7 @@ async fn payments_create_core() {
card_number: "4242424242424242".to_string().try_into().unwrap(),
card_exp_month: "10".to_string().into(),
card_exp_year: "35".to_string().into(),
- card_holder_name: Some(masking::Secret::new("Arun Raj".to_string())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("Arun Raj".to_string())),
card_cvc: "123".to_string().into(),
card_issuer: None,
card_network: None,
@@ -350,7 +350,7 @@ async fn payments_create_core() {
card_issuing_country: None,
card_issuing_country_code: None,
bank_code: None,
- nick_name: Some(masking::Secret::new("nick_name".into())),
+ nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
@@ -643,7 +643,7 @@ async fn payments_create_core_adyen_no_redirect() {
card_number: "5555 3412 4444 1115".to_string().try_into().unwrap(),
card_exp_month: "03".to_string().into(),
card_exp_year: "2030".to_string().into(),
- card_holder_name: Some(masking::Secret::new("JohnDoe".to_string())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("JohnDoe".to_string())),
card_cvc: "737".to_string().into(),
card_issuer: None,
card_network: None,
@@ -651,7 +651,7 @@ async fn payments_create_core_adyen_no_redirect() {
card_issuing_country: None,
card_issuing_country_code: None,
bank_code: None,
- nick_name: Some(masking::Secret::new("nick_name".into())),
+ nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs
index d0c2cec148..24527efda1 100644
--- a/crates/router/tests/payments2.rs
+++ b/crates/router/tests/payments2.rs
@@ -102,7 +102,7 @@ async fn payments_create_core() {
card_number: "4242424242424242".to_string().try_into().unwrap(),
card_exp_month: "10".to_string().into(),
card_exp_year: "35".to_string().into(),
- card_holder_name: Some(masking::Secret::new("Arun Raj".to_string())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("Arun Raj".to_string())),
card_cvc: "123".to_string().into(),
card_issuer: None,
card_network: None,
@@ -110,7 +110,7 @@ async fn payments_create_core() {
card_issuing_country: None,
card_issuing_country_code: None,
bank_code: None,
- nick_name: Some(masking::Secret::new("nick_name".into())),
+ nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
@@ -411,7 +411,7 @@ async fn payments_create_core_adyen_no_redirect() {
card_number: "5555 3412 4444 1115".to_string().try_into().unwrap(),
card_exp_month: "03".to_string().into(),
card_exp_year: "2030".to_string().into(),
- card_holder_name: Some(masking::Secret::new("JohnDoe".to_string())),
+ card_holder_name: Some(hyperswitch_masking::Secret::new("JohnDoe".to_string())),
card_cvc: "737".to_string().into(),
bank_code: None,
card_issuer: None,
@@ -419,7 +419,7 @@ async fn payments_create_core_adyen_no_redirect() {
card_type: None,
card_issuing_country: None,
card_issuing_country_code: None,
- nick_name: Some(masking::Secret::new("nick_name".into())),
+ nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
diff --git a/crates/storage_impl/Cargo.toml b/crates/storage_impl/Cargo.toml
index 7bf6d83876..700d587e2f 100644
--- a/crates/storage_impl/Cargo.toml
+++ b/crates/storage_impl/Cargo.toml
@@ -25,7 +25,7 @@ common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils" }
diesel_models = { version = "0.1.0", path = "../diesel_models", default-features = false }
hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_models", default-features = false }
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
redis_interface = { version = "0.1.0", path = "../redis_interface" }
router_derive = { version = "0.1.0", path = "../router_derive" }
router_env = { version = "0.1.0", path = "../router_env" }
diff --git a/crates/storage_impl/src/config.rs b/crates/storage_impl/src/config.rs
index d8c736b774..170fe8fcb1 100644
--- a/crates/storage_impl/src/config.rs
+++ b/crates/storage_impl/src/config.rs
@@ -1,6 +1,6 @@
use common_utils::DbConnectionParams;
use hyperswitch_domain_models::master_key::MasterKeyInterface;
-use masking::{PeekInterface, Secret};
+use hyperswitch_masking::{PeekInterface, Secret};
use crate::{kv_router_store, DatabaseStore, MockDb, RouterStore};
diff --git a/crates/storage_impl/src/customers.rs b/crates/storage_impl/src/customers.rs
index dc018f2b46..05ff222f8d 100644
--- a/crates/storage_impl/src/customers.rs
+++ b/crates/storage_impl/src/customers.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
customer as domain,
merchant_key_store::MerchantKeyStore,
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
use crate::{
diff --git a/crates/storage_impl/src/kv_router_store.rs b/crates/storage_impl/src/kv_router_store.rs
index e9347b6132..3fffe49814 100644
--- a/crates/storage_impl/src/kv_router_store.rs
+++ b/crates/storage_impl/src/kv_router_store.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
};
#[cfg(not(feature = "payouts"))]
use hyperswitch_domain_models::{PayoutAttemptInterface, PayoutsInterface};
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use redis_interface::{errors::RedisError, types::HsetnxReply, RedisConnectionPool};
use router_env::logger;
use serde::de;
diff --git a/crates/storage_impl/src/lib.rs b/crates/storage_impl/src/lib.rs
index 469f7bb43f..149be3048c 100644
--- a/crates/storage_impl/src/lib.rs
+++ b/crates/storage_impl/src/lib.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
behaviour::{Conversion, ReverseConversion},
merchant_key_store::MerchantKeyStore,
};
-use masking::StrongSecret;
+use hyperswitch_masking::StrongSecret;
use redis::{kv_store::RedisConnInterface, pub_sub::PubSubInterface, RedisStore};
mod address;
pub mod business_profile;
diff --git a/crates/storage_impl/src/merchant_account.rs b/crates/storage_impl/src/merchant_account.rs
index 250c44300d..ade2b0223f 100644
--- a/crates/storage_impl/src/merchant_account.rs
+++ b/crates/storage_impl/src/merchant_account.rs
@@ -10,7 +10,7 @@ use hyperswitch_domain_models::{
merchant_account::{self as domain, MerchantAccountInterface},
merchant_key_store::{MerchantKeyStore, MerchantKeyStoreInterface},
};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use router_env::{instrument, tracing};
#[cfg(feature = "accounts_cache")]
diff --git a/crates/storage_impl/src/merchant_key_store.rs b/crates/storage_impl/src/merchant_key_store.rs
index ebeb95d2f6..5793509c2c 100644
--- a/crates/storage_impl/src/merchant_key_store.rs
+++ b/crates/storage_impl/src/merchant_key_store.rs
@@ -4,7 +4,7 @@ use hyperswitch_domain_models::{
merchant_key_store as domain,
merchant_key_store::MerchantKeyStoreInterface,
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use router_env::{instrument, tracing};
#[cfg(feature = "accounts_cache")]
diff --git a/crates/subscriptions/Cargo.toml b/crates/subscriptions/Cargo.toml
index 368d06b248..3ae536039a 100644
--- a/crates/subscriptions/Cargo.toml
+++ b/crates/subscriptions/Cargo.toml
@@ -9,7 +9,7 @@ license.workspace = true
async-trait = "0.1.88"
dyn-clone = "1.0.19"
error-stack = "0.4.1"
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
time = { version = "0.3.41", features = ["serde", "std"] }
diff --git a/crates/subscriptions/src/core/invoice_handler.rs b/crates/subscriptions/src/core/invoice_handler.rs
index ec602caa33..116a31ce04 100644
--- a/crates/subscriptions/src/core/invoice_handler.rs
+++ b/crates/subscriptions/src/core/invoice_handler.rs
@@ -7,7 +7,7 @@ use common_enums::connector_enums;
use common_utils::{pii, types::MinorUnit};
use error_stack::ResultExt;
use hyperswitch_domain_models::router_response_types::subscriptions as subscription_response_types;
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use super::errors;
use crate::{
diff --git a/crates/subscriptions/src/core/payments_api_client.rs b/crates/subscriptions/src/core/payments_api_client.rs
index 6fcfc86a19..2b67f395c6 100644
--- a/crates/subscriptions/src/core/payments_api_client.rs
+++ b/crates/subscriptions/src/core/payments_api_client.rs
@@ -25,11 +25,11 @@ impl PaymentsApiClient {
state: &SessionState,
merchant_id: &str,
profile_id: &str,
- ) -> Vec<(String, masking::Maskable<String>)> {
+ ) -> Vec<(String, hyperswitch_masking::Maskable<String>)> {
vec![
(
helpers::X_INTERNAL_API_KEY.to_string(),
- masking::Maskable::Masked(
+ hyperswitch_masking::Maskable::Masked(
state
.conf
.internal_merchant_id_profile_id_auth
@@ -39,15 +39,17 @@ impl PaymentsApiClient {
),
(
helpers::X_TENANT_ID.to_string(),
- masking::Maskable::Normal(state.tenant.tenant_id.get_string_repr().to_string()),
+ hyperswitch_masking::Maskable::Normal(
+ state.tenant.tenant_id.get_string_repr().to_string(),
+ ),
),
(
helpers::X_MERCHANT_ID.to_string(),
- masking::Maskable::Normal(merchant_id.to_string()),
+ hyperswitch_masking::Maskable::Normal(merchant_id.to_string()),
),
(
helpers::X_PROFILE_ID.to_string(),
- masking::Maskable::Normal(profile_id.to_string()),
+ hyperswitch_masking::Maskable::Normal(profile_id.to_string()),
),
]
}
diff --git a/crates/subscriptions/src/core/subscription_handler.rs b/crates/subscriptions/src/core/subscription_handler.rs
index befbb32afb..3293cfc663 100644
--- a/crates/subscriptions/src/core/subscription_handler.rs
+++ b/crates/subscriptions/src/core/subscription_handler.rs
@@ -13,7 +13,7 @@ use hyperswitch_domain_models::{
router_response_types::{self, subscriptions as subscription_response_types},
subscription::{Subscription, SubscriptionStatus},
};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use super::errors;
use crate::{
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml
index 65ca60c606..e4f388445d 100644
--- a/crates/test_utils/Cargo.toml
+++ b/crates/test_utils/Cargo.toml
@@ -30,7 +30,7 @@ tokio = "1.48.0"
toml = "0.8.22"
# First party crates
-masking = { version = "0.1.0", path = "../masking" }
+hyperswitch_masking = "0.0.1"
common_enums = { version = "0.1.0", path = "../common_enums" }
[lints]
diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rs
index f9e2fe6049..57580007a2 100644
--- a/crates/test_utils/src/connector_auth.rs
+++ b/crates/test_utils/src/connector_auth.rs
@@ -1,6 +1,6 @@
use std::{collections::HashMap, env};
-use masking::Secret;
+use hyperswitch_masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
diff --git a/crates/test_utils/src/newman_runner.rs b/crates/test_utils/src/newman_runner.rs
index d5d5df7be4..9e0157d789 100644
--- a/crates/test_utils/src/newman_runner.rs
+++ b/crates/test_utils/src/newman_runner.rs
@@ -8,7 +8,7 @@ use std::{
use anyhow::{Context, Result};
use clap::{Parser, ValueEnum};
-use masking::PeekInterface;
+use hyperswitch_masking::PeekInterface;
use regex::Regex;
use crate::connector_auth::{