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

chore(superposition): bump superposition crates to 0.118.2 and use millisecond polling config (#14892)

Sahkal Poddar8ad71d2d11bb
diff --git a/Cargo.lock b/Cargo.lock
index 4e69662328..69844d44ca 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9875,9 +9875,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "superposition_core"
-version = "0.115.5"
+version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fed4c2aa7224ad8d848bc2266cc8f5908667ac9caf99c3cf6da97b76efa25ef6"
+checksum = "c80b82118971128e6da0edfe58b04522b31e1046ee1ae192e5d4fc3ebdaed780"
dependencies = [
"bigdecimal 0.3.1",
"blake3",
@@ -9896,9 +9896,9 @@ dependencies = [
[[package]]
name = "superposition_derives"
-version = "0.115.5"
+version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e1f5f16481c2a0e4654ccf2c7a834991f1ac2cd189820f4e8a6d26ddb86c4af"
+checksum = "1efc2a4c201597b70ccf1fdf4ba3ec1f7518e95a99f55d033fd29c5453720625"
dependencies = [
"proc-macro-crate 3.2.0",
"quote",
@@ -9907,9 +9907,9 @@ dependencies = [
[[package]]
name = "superposition_provider"
-version = "0.115.5"
+version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be01f2952ff92c8ea21e57f7b8615491863b07e5ddc830c59f3e9fdcbb298325"
+checksum = "8cc376cefdfff66b202b77d6c37e126abd7b2948460a28090db262d245eef211"
dependencies = [
"async-trait",
"aws-smithy-types",
@@ -9932,9 +9932,9 @@ dependencies = [
[[package]]
name = "superposition_sdk"
-version = "0.115.5"
+version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "732c84601c078655a4ee6f7888ad4f6a1fef3e619027de03d94837c4df881094"
+checksum = "82172c3361f0d3b5914939fd2cd220d4348566c4a3b9b2f405e876e2d906dd27"
dependencies = [
"aws-smithy-async",
"aws-smithy-http 0.62.1",
@@ -9950,9 +9950,9 @@ dependencies = [
[[package]]
name = "superposition_types"
-version = "0.115.5"
+version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f9c04634344b80b2e0ebb50b5c4f752fd636dabf98902fe5986a1121be9d2fe"
+checksum = "b755c3781c619c3f65608342c45424a407549504b896ba8a637be855beacccf0"
dependencies = [
"bigdecimal 0.3.1",
"chrono",
diff --git a/config/config.example.toml b/config/config.example.toml
index c9effbfe0a..6edc580b29 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -1702,8 +1702,8 @@ endpoint = "http://superposition:8080" # Superposition service endpoint
token = "your_superposition_token" # Superposition token
org_id = "your_org_id" # Organization ID in Superposition
workspace_id = "your_workspace_id" # Workspace ID in Superposition
-polling_interval = 15 # Polling interval in seconds for configuration updates
-request_timeout = 60 # Request timeout in seconds for Superposition API calls (optional, default: none)
+polling_interval_milliseconds = 15000 # Polling interval in milliseconds for configuration updates
+request_timeout_milliseconds = 60000 # Request timeout in milliseconds for Superposition API calls (optional, default: none)
backup_file_path = "./config/superposition_seed.toml" # Path to a local file for fallback configuration. Used when the Superposition HTTP service is unavailable. If set, the client will fall back to reading configuration from this file instead of failing completely. This ensures graceful degradation during network outages or service disruptions.
[offer_engine]
diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml
index 4019a82f08..9a9f89b674 100644
--- a/config/deployments/env_specific.toml
+++ b/config/deployments/env_specific.toml
@@ -608,8 +608,8 @@ endpoint = "http://superposition:8080" # Superposition service endpoint
token = "your_superposition_token" # Superposition token
org_id = "your_org_id" # Organization ID in Superposition
workspace_id = "your_workspace_id" # Workspace ID in Superposition
-polling_interval = 15 # Polling interval in seconds for configuration updates
-# request_timeout = # Request timeout in seconds for Superposition API calls (optional, default: none)
+polling_interval_milliseconds = 15000 # Polling interval in milliseconds for configuration updates
+# request_timeout_milliseconds = # Request timeout in milliseconds for Superposition API calls (optional, default: none)
backup_file_path = "./config/superposition_seed.toml" # Path to a local file for fallback configuration. Used when the Superposition HTTP service is unavailable. If set, the client will fall back to reading configuration from this file instead of failing completely. This ensures graceful degradation during network outages or service disruptions.
[trace_header]
diff --git a/config/development.toml b/config/development.toml
index ae9f4f14fe..1766bf108e 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1775,8 +1775,8 @@ endpoint = "http://localhost:8081" # Superposition service endpoint
token = "sp_5d72598782fdd5d984f273eb5a452c33a952e07a4e0dd6de8c4ea37a621918d5" # Superposition token
org_id = "localorg" # Organization ID in Superposition
workspace_id = "dev" # Workspace ID in Superposition
-polling_interval = 300 # Polling interval in seconds for configuration updates
-# request_timeout = # Request timeout in seconds for Superposition API calls (optional, default: none)
+polling_interval_milliseconds = 300000 # Polling interval in milliseconds for configuration updates
+# request_timeout_milliseconds = # Request timeout in milliseconds for Superposition API calls (optional, default: none)
backup_file_path = "./config/superposition_seed.toml" # Path to a local file for fallback configuration. Used when the Superposition HTTP service is unavailable. If set, the client will fall back to reading configuration from this file instead of failing completely. This ensures graceful degradation during network outages or service disruptions.
# Merchant Advice Code Configuration
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 254b59366e..2c1e129e83 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -1627,8 +1627,8 @@ endpoint = "http://superposition:8080" # Superposition service endpoint
token = "123456" # Superposition token
org_id = "localorg" # Organization ID in Superposition
workspace_id = "dev" # Workspace ID in Superposition
-polling_interval = 15 # Polling interval in seconds for configuration updates
-# request_timeout = # Request timeout in seconds for Superposition API calls (optional, default: none)
+polling_interval_milliseconds = 15000 # Polling interval in milliseconds for configuration updates
+# request_timeout_milliseconds = # Request timeout in milliseconds for Superposition API calls (optional, default: none)
backup_file_path = "./config/superposition_seed.toml" # Path to a local file for fallback configuration. Used when the Superposition HTTP service is unavailable. If set, the client will fall back to reading configuration from this file instead of failing completely. This ensures graceful degradation during network outages or service disruptions.
# Merchant Advice Code Configuration
diff --git a/crates/api_models/Cargo.toml b/crates/api_models/Cargo.toml
index 7b00831872..4df8dcd886 100644
--- a/crates/api_models/Cargo.toml
+++ b/crates/api_models/Cargo.toml
@@ -47,7 +47,7 @@ utoipa = { version = "4.2.3", features = [
] }
nutype = { version = "0.4.3", features = ["serde"] }
deserialize_form_style_query_parameter = "0.2.2"
-superposition_types = "0.115.5"
+superposition_types = "0.118.2"
# First party crates
cards = { version = "0.1.0", path = "../cards" }
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 4cd674e387..a0eb8e4ec6 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -91,9 +91,9 @@ unified-connector-service-client = { git = "https://github.com/juspay/connector-
open-feature = { version = "0.2.5", optional = true }
bytes = { version = "1.10.1", optional = true }
futures = { version = "0.3.31", optional = true }
-superposition_provider = { version = "0.115.5", optional = true }
-superposition_types = "0.115.5"
-superposition_sdk = { version = "0.115.5", optional = true }
+superposition_provider = { version = "0.118.2", optional = true }
+superposition_types = "0.118.2"
+superposition_sdk = { version = "0.118.2", optional = true }
# First party crates
diff --git a/crates/external_services/src/superposition.rs b/crates/external_services/src/superposition.rs
index 654233b1f1..3c83fb6a68 100644
--- a/crates/external_services/src/superposition.rs
+++ b/crates/external_services/src/superposition.rs
@@ -725,18 +725,19 @@ impl SuperpositionClient {
) -> CustomResult<Self, SuperpositionError> {
let token_value = config.token.expose();
- let refresh_strategy = superposition_provider::RefreshStrategy::Polling(
- superposition_provider::PollingStrategy {
- interval: config.polling_interval,
- timeout: config.request_timeout,
- },
- );
+ let polling_strategy =
+ superposition_provider::PollingStrategy::new(config.polling_interval_milliseconds);
+ let polling_strategy = match config.request_timeout_milliseconds {
+ Some(timeout_milliseconds) => polling_strategy.with_timeout(timeout_milliseconds),
+ None => polling_strategy,
+ };
+ let refresh_strategy = superposition_provider::RefreshStrategy::Polling(polling_strategy);
// --- Build HTTP (primary) data source ---
let http_source = superposition_provider::data_source::http::HttpDataSource::new(
superposition_provider::types::SuperpositionOptions::new(
config.endpoint.clone(),
- token_value.clone(),
+ superposition_provider::AuthMethod::Token(token_value.clone()),
config.org_id.clone(),
config.workspace_id.clone(),
),
@@ -985,7 +986,7 @@ impl SuperpositionClient {
use superposition_provider::data_source::SuperpositionDataSource;
let response = self
.provider
- .fetch_filtered_config(dimension_filter, prefix_filter, None)
+ .fetch_filtered_config(dimension_filter, prefix_filter, None, None)
.await
.map_err(|e| {
report!(SuperpositionError::ProviderError(format!(
@@ -1011,7 +1012,7 @@ impl SuperpositionClient {
use superposition_provider::data_source::SuperpositionDataSource;
let response = self
.provider
- .fetch_filtered_config(dimension_filter, prefix_filter, None)
+ .fetch_filtered_config(dimension_filter, prefix_filter, None, None)
.await
.map_err(|e| {
report!(SuperpositionError::ProviderError(format!(
diff --git a/crates/external_services/src/superposition/types.rs b/crates/external_services/src/superposition/types.rs
index 970e3ed101..25c5bacd4f 100644
--- a/crates/external_services/src/superposition/types.rs
+++ b/crates/external_services/src/superposition/types.rs
@@ -78,10 +78,10 @@ pub struct SuperpositionClientConfig {
pub org_id: String,
/// Workspace ID in Superposition
pub workspace_id: String,
- /// Polling interval in seconds for configuration updates
- pub polling_interval: u64,
- /// Request timeout in seconds for Superposition API calls (None = no timeout)
- pub request_timeout: Option<u64>,
+ /// Polling interval in milliseconds for configuration updates
+ pub polling_interval_milliseconds: u64,
+ /// Request timeout in milliseconds for Superposition API calls (None = no timeout)
+ pub request_timeout_milliseconds: Option<u64>,
/// Path to a TOML backup config file on PVC/EFS.
/// Used as fallback if the primary HTTP init fails at startup.
pub backup_file_path: Option<std::path::PathBuf>,
@@ -94,8 +94,8 @@ impl Default for SuperpositionClientConfig {
token: Secret::new(String::new()),
org_id: String::new(),
workspace_id: String::new(),
- polling_interval: 15,
- request_timeout: None,
+ polling_interval_milliseconds: 15_000,
+ request_timeout_milliseconds: None,
backup_file_path: None,
}
}
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 8231102f7e..c980fd9238 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -344,7 +344,7 @@ storage_impl = { version = "0.1.0", path = "../storage_impl", default-features =
payment_link = { version = "0.1.0", path = "../payment_link", default-features = false }
payment_methods = { version = "0.1.0", path = "../payment_methods", default-features = false }
subscriptions = { version = "0.1.0", path = "../subscriptions", default-features = false }
-superposition_sdk = { version = "0.115.5" }
+superposition_sdk = { version = "0.118.2" }
[build-dependencies]
router_env = { version = "0.1.0", path = "../router_env", default-features = false }