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

feat(superposition): Add get resolved config explanation proxy support (#13132)

CHALLA NISHANTH BABU5969b5073087
diff --git a/crates/api_models/src/superposition_proxy.rs b/crates/api_models/src/superposition_proxy.rs
index 854cb990f2..21bb270acd 100644
--- a/crates/api_models/src/superposition_proxy.rs
+++ b/crates/api_models/src/superposition_proxy.rs
@@ -173,3 +173,33 @@ impl ApiEventMetric for ResolveConfigResponse {
Some(ApiEventsType::Miscellaneous)
}
}
+
+/// A single matching context in a resolved-config explanation timeline.
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
+pub struct ResolveExplanationEntry {
+ /// Identifier of the context that matched.
+ pub context_id: String,
+ /// Dimension conditions that made this context match.
+ pub condition: serde_json::Value,
+ /// Identifier of the override applied by this context.
+ pub override_id: String,
+ /// Value before this context's override was applied.
+ pub value_before: serde_json::Value,
+ /// Value after this context's override was applied.
+ pub value_after: serde_json::Value,
+}
+
+/// Explanation of how matching contexts affect a single resolved config key.
+#[derive(Debug, serde::Serialize)]
+pub struct ResolveConfigExplanationResponse {
+ /// The configuration key being explained.
+ pub key: String,
+ /// Ordered list of contexts that contributed to the resolved value.
+ pub timeline: Vec<ResolveExplanationEntry>,
+}
+
+impl ApiEventMetric for ResolveConfigExplanationResponse {
+ fn get_api_event_type(&self) -> Option<ApiEventsType> {
+ Some(ApiEventsType::Miscellaneous)
+ }
+}
diff --git a/crates/external_services/src/superposition.rs b/crates/external_services/src/superposition.rs
index 915a491734..1b59f4f5e3 100644
--- a/crates/external_services/src/superposition.rs
+++ b/crates/external_services/src/superposition.rs
@@ -7,7 +7,7 @@ use std::collections::HashMap;
use api_models::superposition_proxy::{
AuditLogResponse, ContextResponse, DefaultConfigResponse, DimensionResponse,
- PaginatedListResponse,
+ PaginatedListResponse, ResolveConfigExplanationResponse, ResolveExplanationEntry,
};
pub use aws_smithy_types::DateTime;
use aws_smithy_types::{Document, Number};
@@ -23,7 +23,10 @@ use superposition_sdk::operation::{
pub use superposition_sdk::{
operation::{
create_context::builders::CreateContextInputBuilder,
+ get_default_config::builders::GetDefaultConfigInputBuilder,
get_detailed_resolved_config::builders::GetDetailedResolvedConfigInputBuilder,
+ get_dimension::builders::GetDimensionInputBuilder,
+ get_resolved_config_explanation::builders::GetResolvedConfigExplanationInputBuilder,
list_audit_logs::builders::ListAuditLogsInputBuilder,
list_contexts::builders::ListContextsInputBuilder,
list_default_configs::builders::ListDefaultConfigsInputBuilder,
@@ -333,12 +336,9 @@ pub fn default_config_response_to_struct(
}
}
-/// Convert a Superposition SDK `DimensionResponse` into the typed response struct.
-pub fn dimension_response_to_struct(
- dim: &superposition_sdk::types::DimensionResponse,
-) -> DimensionResponse {
- let dep_graph: Map<String, serde_json::Value> = dim
- .dependency_graph()
+/// Convert a dimension dependency graph into a JSON object value.
+fn dependency_graph_to_value(graph: &HashMap<String, Vec<String>>) -> serde_json::Value {
+ let dep_graph: Map<String, serde_json::Value> = graph
.iter()
.map(|(k, v)| {
(
@@ -351,6 +351,13 @@ pub fn dimension_response_to_struct(
)
})
.collect();
+ serde_json::Value::Object(dep_graph)
+}
+
+/// Convert a Superposition SDK `DimensionResponse` into the typed response struct.
+pub fn dimension_response_to_struct(
+ dim: &superposition_sdk::types::DimensionResponse,
+) -> DimensionResponse {
DimensionResponse {
dimension: dim.dimension().to_owned(),
position: dim.position(),
@@ -362,13 +369,54 @@ pub fn dimension_response_to_struct(
last_modified_by: dim.last_modified_by().to_owned(),
created_at: datetime_to_string(dim.created_at()),
created_by: dim.created_by().to_owned(),
- dependency_graph: serde_json::Value::Object(dep_graph),
+ dependency_graph: dependency_graph_to_value(dim.dependency_graph()),
dimension_type: dimension_type_to_value(dim.dimension_type()),
value_compute_function_name: dim.value_compute_function_name().map(str::to_owned),
mandatory: dim.mandatory(),
}
}
+/// Convert a Superposition SDK `GetDimensionOutput` into the typed response struct.
+pub fn get_dimension_output_to_struct(
+ dim: &superposition_sdk::operation::get_dimension::GetDimensionOutput,
+) -> DimensionResponse {
+ DimensionResponse {
+ dimension: dim.dimension().to_owned(),
+ position: dim.position(),
+ schema: doc_map_to_json(dim.schema()),
+ value_validation_function_name: dim.value_validation_function_name().map(str::to_owned),
+ description: dim.description().to_owned(),
+ change_reason: dim.change_reason().to_owned(),
+ last_modified_at: datetime_to_string(dim.last_modified_at()),
+ last_modified_by: dim.last_modified_by().to_owned(),
+ created_at: datetime_to_string(dim.created_at()),
+ created_by: dim.created_by().to_owned(),
+ dependency_graph: dependency_graph_to_value(dim.dependency_graph()),
+ dimension_type: dimension_type_to_value(dim.dimension_type()),
+ value_compute_function_name: dim.value_compute_function_name().map(str::to_owned),
+ mandatory: dim.mandatory(),
+ }
+}
+
+/// Convert a Superposition SDK `GetDefaultConfigOutput` into the typed response struct.
+pub fn get_default_config_output_to_struct(
+ cfg: &superposition_sdk::operation::get_default_config::GetDefaultConfigOutput,
+) -> DefaultConfigResponse {
+ DefaultConfigResponse {
+ key: cfg.key().to_owned(),
+ value: document_to_value(cfg.value().clone()),
+ schema: doc_map_to_json(cfg.schema()),
+ description: cfg.description().to_owned(),
+ change_reason: cfg.change_reason().to_owned(),
+ value_validation_function_name: cfg.value_validation_function_name().map(str::to_owned),
+ value_compute_function_name: cfg.value_compute_function_name().map(str::to_owned),
+ created_at: datetime_to_string(cfg.created_at()),
+ created_by: cfg.created_by().to_owned(),
+ last_modified_at: datetime_to_string(cfg.last_modified_at()),
+ last_modified_by: cfg.last_modified_by().to_owned(),
+ }
+}
+
/// Convert a Superposition SDK `AuditLogFull` into the typed response struct.
pub fn audit_log_full_to_struct(log: &superposition_sdk::types::AuditLogFull) -> AuditLogResponse {
AuditLogResponse {
@@ -439,6 +487,27 @@ pub fn list_audit_logs_to_response(
}
}
+/// Convert a Superposition SDK `GetResolvedConfigExplanationOutput` into the typed response.
+pub fn resolve_config_explanation_to_response(
+ output: &superposition_sdk::operation::get_resolved_config_explanation::GetResolvedConfigExplanationOutput,
+) -> ResolveConfigExplanationResponse {
+ let explanation = output.explanation();
+ ResolveConfigExplanationResponse {
+ key: explanation.key().to_owned(),
+ timeline: explanation
+ .timeline()
+ .iter()
+ .map(|item| ResolveExplanationEntry {
+ context_id: item.context_id().to_owned(),
+ condition: doc_map_to_json(item.condition()),
+ override_id: item.override_id().to_owned(),
+ value_before: document_to_value(item.value_before().clone()),
+ value_after: document_to_value(item.value_after().clone()),
+ })
+ .collect(),
+ }
+}
+
/// Convert a `ContextPutRequest` into the SDK `ContextPut` type.
pub fn context_put_from_request(
body: &ContextPutRequest,
diff --git a/crates/router/src/core/superposition_proxy.rs b/crates/router/src/core/superposition_proxy.rs
index b5983faf74..b2b98a1d42 100644
--- a/crates/router/src/core/superposition_proxy.rs
+++ b/crates/router/src/core/superposition_proxy.rs
@@ -1,18 +1,20 @@
use actix_web::{HttpRequest, HttpResponse};
pub use api_models::superposition_proxy::{
AuditLogResponse, ContextResponse, DefaultConfigResponse, DimensionResponse,
- PaginatedListResponse, ResolveConfigResponse,
+ PaginatedListResponse, ResolveConfigExplanationResponse, ResolveConfigResponse,
};
use async_trait::async_trait;
use common_utils::events::ApiEventMetric;
use external_services::superposition::{
context_put_from_request, create_context_output_to_struct, doc_map_to_json, document_to_value,
+ get_default_config_output_to_struct, get_dimension_output_to_struct,
list_audit_logs_to_response, list_contexts_to_response, list_default_configs_to_response,
- list_dimensions_to_response, map_sdk_error, parse_datetime, value_to_document, AuditAction,
- ContextFilterSortOn, ContextPutRequest, CreateContextInputBuilder, DateTime,
- DimensionMatchStrategy, GetDetailedResolvedConfigInputBuilder, ListAuditLogsInputBuilder,
- ListContextsInputBuilder, ListDefaultConfigsInputBuilder, ListDimensionsInputBuilder, SortBy,
- SuperpositionError,
+ list_dimensions_to_response, map_sdk_error, parse_datetime,
+ resolve_config_explanation_to_response, value_to_document, AuditAction, ContextFilterSortOn,
+ ContextPutRequest, CreateContextInputBuilder, DateTime, DimensionMatchStrategy,
+ GetDefaultConfigInputBuilder, GetDetailedResolvedConfigInputBuilder, GetDimensionInputBuilder,
+ GetResolvedConfigExplanationInputBuilder, ListAuditLogsInputBuilder, ListContextsInputBuilder,
+ ListDefaultConfigsInputBuilder, ListDimensionsInputBuilder, SortBy, SuperpositionError,
};
use crate::{
@@ -349,7 +351,7 @@ pub trait SuperpositionProxyFlow: Sized {
/// Generic entry point shared by every Superposition proxy handler: runs the flow and
/// wraps the result in a JSON `ApplicationResponse`.
-pub async fn handle_proxy_flow<R: SuperpositionProxyFlow>(
+pub async fn handle_superposition_proxy_flow<R: SuperpositionProxyFlow>(
state: SessionState,
auth: UserFromToken,
request: R,
@@ -499,6 +501,90 @@ impl SuperpositionProxyFlow for ListDimensionsQuery {
}
}
+/// `GetDimension` request: the name of the dimension to fetch.
+#[derive(Debug, Clone)]
+pub struct GetDimensionRequest(pub String);
+
+#[async_trait(?Send)]
+impl SuperpositionProxyFlow for GetDimensionRequest {
+ type InputBuilder = GetDimensionInputBuilder;
+ type Response = DimensionResponse;
+
+ fn into_input(
+ self,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::InputBuilder, error_stack::Report<errors::ApiErrorResponse>> {
+ Ok(GetDimensionInputBuilder::default()
+ .org_id(org_id)
+ .workspace_id(workspace_id)
+ .dimension(self.0))
+ }
+
+ async fn execute(
+ self,
+ state: &SessionState,
+ _auth: &UserFromToken,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::Response, error_stack::Report<errors::ApiErrorResponse>> {
+ let output = self
+ .into_input(org_id, workspace_id)?
+ .send_with(state.superposition_service.superposition_sdk_client())
+ .await
+ .map_err(|sdk_error| {
+ map_superposition_err(
+ error_stack::report!(map_sdk_error(sdk_error)),
+ "Failed to get dimension from Superposition",
+ )
+ })?;
+
+ Ok(get_dimension_output_to_struct(&output))
+ }
+}
+
+/// `GetDefaultConfig` request: the key of the default config to fetch.
+#[derive(Debug, Clone)]
+pub struct GetDefaultConfigRequest(pub String);
+
+#[async_trait(?Send)]
+impl SuperpositionProxyFlow for GetDefaultConfigRequest {
+ type InputBuilder = GetDefaultConfigInputBuilder;
+ type Response = DefaultConfigResponse;
+
+ fn into_input(
+ self,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::InputBuilder, error_stack::Report<errors::ApiErrorResponse>> {
+ Ok(GetDefaultConfigInputBuilder::default()
+ .org_id(org_id)
+ .workspace_id(workspace_id)
+ .key(self.0))
+ }
+
+ async fn execute(
+ self,
+ state: &SessionState,
+ _auth: &UserFromToken,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::Response, error_stack::Report<errors::ApiErrorResponse>> {
+ let output = self
+ .into_input(org_id, workspace_id)?
+ .send_with(state.superposition_service.superposition_sdk_client())
+ .await
+ .map_err(|sdk_error| {
+ map_superposition_err(
+ error_stack::report!(map_sdk_error(sdk_error)),
+ "Failed to get default config from Superposition",
+ )
+ })?;
+
+ Ok(get_default_config_output_to_struct(&output))
+ }
+}
+
#[async_trait(?Send)]
impl SuperpositionProxyFlow for ContextPutRequest {
type InputBuilder = CreateContextInputBuilder;
@@ -607,6 +693,60 @@ impl SuperpositionProxyFlow for ResolveDetailedConfigRequest {
}
}
+/// `GetResolvedConfigExplanation` request: config key plus context dimensions.
+#[derive(Debug, Clone)]
+pub struct ResolveConfigExplanationRequest {
+ pub key: String,
+ pub context: serde_json::Map<String, serde_json::Value>,
+}
+
+#[async_trait(?Send)]
+impl SuperpositionProxyFlow for ResolveConfigExplanationRequest {
+ type InputBuilder = GetResolvedConfigExplanationInputBuilder;
+ type Response = ResolveConfigExplanationResponse;
+
+ fn into_input(
+ self,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::InputBuilder, error_stack::Report<errors::ApiErrorResponse>> {
+ let mut builder = GetResolvedConfigExplanationInputBuilder::default()
+ .org_id(org_id)
+ .workspace_id(workspace_id)
+ .key(self.key);
+
+ for (dimension_key, dimension_value) in self.context {
+ builder = builder.context(dimension_key, value_to_document(dimension_value));
+ }
+
+ Ok(builder)
+ }
+
+ async fn execute(
+ self,
+ state: &SessionState,
+ auth: &UserFromToken,
+ org_id: String,
+ workspace_id: String,
+ ) -> Result<Self::Response, error_stack::Report<errors::ApiErrorResponse>> {
+ let context_json = serde_json::Value::Object(self.context.clone());
+ validate_superposition_context_body(&context_json, auth)?;
+
+ let output = self
+ .into_input(org_id, workspace_id)?
+ .send_with(state.superposition_service.superposition_sdk_client())
+ .await
+ .map_err(|sdk_error| {
+ map_superposition_err(
+ error_stack::report!(map_sdk_error(sdk_error)),
+ "Failed to resolve config explanation from Superposition",
+ )
+ })?;
+
+ Ok(resolve_config_explanation_to_response(&output))
+ }
+}
+
#[async_trait(?Send)]
impl SuperpositionProxyFlow for ListAuditLogsQuery {
type InputBuilder = ListAuditLogsInputBuilder;
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index eeda7ca32f..86a378937d 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -3459,14 +3459,26 @@ impl SuperpositionProxy {
web::resource("/default-config")
.route(web::get().to(super::superposition_proxy::list_default_configs)),
)
+ .service(
+ web::resource("/default-config/{key}")
+ .route(web::get().to(super::superposition_proxy::get_default_config)),
+ )
.service(
web::resource("/dimension")
.route(web::get().to(super::superposition_proxy::list_dimensions)),
)
+ .service(
+ web::resource("/dimension/{dimension_name}")
+ .route(web::get().to(super::superposition_proxy::get_dimension)),
+ )
.service(
web::resource("/config/resolve/detailed")
.route(web::post().to(super::superposition_proxy::resolve_detailed_config)),
)
+ .service(
+ web::resource("/config/resolve/explain/{key}")
+ .route(web::post().to(super::superposition_proxy::resolve_config_explanation)),
+ )
.service(
web::resource("/audit")
.route(web::get().to(super::superposition_proxy::list_audit_logs)),
diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs
index 1f38a74b9d..daee35a438 100644
--- a/crates/router/src/routes/lock_utils.rs
+++ b/crates/router/src/routes/lock_utils.rs
@@ -400,8 +400,11 @@ impl From<Flow> for ApiIdentifier {
| Flow::SuperpositionListContexts
| Flow::SuperpositionListDefaultConfigs
| Flow::SuperpositionListDimensions
+ | Flow::SuperpositionGetDimension
+ | Flow::SuperpositionGetDefaultConfig
| Flow::SuperpositionCreateContext
| Flow::SuperpositionResolveDetailedConfig
+ | Flow::SuperpositionResolveConfigExplanation
| Flow::SuperpositionListAuditLogs => Self::Superposition,
Flow::MerchantConnectorWebhookRegister
| Flow::MerchantConnectorWebhookList
diff --git a/crates/router/src/routes/superposition_proxy.rs b/crates/router/src/routes/superposition_proxy.rs
index 1cf55cca68..5112c6f80e 100644
--- a/crates/router/src/routes/superposition_proxy.rs
+++ b/crates/router/src/routes/superposition_proxy.rs
@@ -7,8 +7,9 @@ use crate::{
core::{
api_locking,
superposition_proxy::{
- self, ListAuditLogsQuery, ListContextsQuery, ListDefaultConfigsQuery,
- ListDimensionsQuery, ResolveDetailedConfigRequest,
+ self, GetDefaultConfigRequest, GetDimensionRequest, ListAuditLogsQuery,
+ ListContextsQuery, ListDefaultConfigsQuery, ListDimensionsQuery,
+ ResolveConfigExplanationRequest, ResolveDetailedConfigRequest,
},
},
services::{api, authentication as auth, authorization::permissions::Permission},
@@ -37,8 +38,14 @@ pub async fn list_contexts(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
@@ -74,8 +81,14 @@ pub async fn list_default_configs(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
@@ -111,8 +124,100 @@ pub async fn list_dimensions(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
+ }
+ },
+ &auth::JWTAuth {
+ permission: Permission::ProfileSuperpositionConfigRead,
+ allow_connected: true,
+ allow_platform: true,
+ },
+ api_locking::LockAction::NotApplicable,
+ ))
+ .await
+}
+
+#[instrument(skip_all, fields(flow = ?Flow::SuperpositionGetDimension))]
+pub async fn get_dimension(
+ state: web::Data<AppState>,
+ req: HttpRequest,
+ path: web::Path<String>,
+) -> HttpResponse {
+ let flow = Flow::SuperpositionGetDimension;
+ let (org_id, workspace_id) = match superposition_proxy::extract_proxy_headers(&req) {
+ Ok(headers) => headers,
+ Err(response) => return response,
+ };
+ let request = GetDimensionRequest(path.into_inner());
+
+ Box::pin(api::server_wrap(
+ flow,
+ state,
+ &req,
+ (),
+ move |state, user, _, _| {
+ let request = request.clone();
+ let org_id = org_id.clone();
+ let workspace_id = workspace_id.clone();
+ async move {
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
+ }
+ },
+ &auth::JWTAuth {
+ permission: Permission::ProfileSuperpositionConfigRead,
+ allow_connected: true,
+ allow_platform: true,
+ },
+ api_locking::LockAction::NotApplicable,
+ ))
+ .await
+}
+
+#[instrument(skip_all, fields(flow = ?Flow::SuperpositionGetDefaultConfig))]
+pub async fn get_default_config(
+ state: web::Data<AppState>,
+ req: HttpRequest,
+ path: web::Path<String>,
+) -> HttpResponse {
+ let flow = Flow::SuperpositionGetDefaultConfig;
+ let (org_id, workspace_id) = match superposition_proxy::extract_proxy_headers(&req) {
+ Ok(headers) => headers,
+ Err(response) => return response,
+ };
+ let request = GetDefaultConfigRequest(path.into_inner());
+
+ Box::pin(api::server_wrap(
+ flow,
+ state,
+ &req,
+ (),
+ move |state, user, _, _| {
+ let request = request.clone();
+ let org_id = org_id.clone();
+ let workspace_id = workspace_id.clone();
+ async move {
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
@@ -148,8 +253,14 @@ pub async fn create_context(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
@@ -185,8 +296,61 @@ pub async fn resolve_detailed_config(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
+ }
+ },
+ &auth::JWTAuth {
+ permission: Permission::ProfileSuperpositionConfigRead,
+ allow_connected: true,
+ allow_platform: true,
+ },
+ api_locking::LockAction::NotApplicable,
+ ))
+ .await
+}
+
+#[instrument(skip_all, fields(flow = ?Flow::SuperpositionResolveConfigExplanation))]
+pub async fn resolve_config_explanation(
+ state: web::Data<AppState>,
+ req: HttpRequest,
+ path: web::Path<String>,
+ body: web::Json<ResolveConfigBody>,
+) -> HttpResponse {
+ let flow = Flow::SuperpositionResolveConfigExplanation;
+ let (org_id, workspace_id) = match superposition_proxy::extract_proxy_headers(&req) {
+ Ok((org_id, workspace_id)) => (org_id, workspace_id),
+ Err(response) => return response,
+ };
+ let request = ResolveConfigExplanationRequest {
+ key: path.into_inner(),
+ context: body.into_inner().context,
+ };
+
+ Box::pin(api::server_wrap(
+ flow,
+ state,
+ &req,
+ (),
+ move |state, user, _, _| {
+ let request = request.clone();
+ let org_id = org_id.clone();
+ let workspace_id = workspace_id.clone();
+ async move {
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
@@ -222,8 +386,14 @@ pub async fn list_audit_logs(
let org_id = org_id.clone();
let workspace_id = workspace_id.clone();
async move {
- superposition_proxy::handle_proxy_flow(state, user, request, org_id, workspace_id)
- .await
+ superposition_proxy::handle_superposition_proxy_flow(
+ state,
+ user,
+ request,
+ org_id,
+ workspace_id,
+ )
+ .await
}
},
&auth::JWTAuth {
diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs
index 40b103567b..5ac49efa7a 100644
--- a/crates/router_env/src/logger/types.rs
+++ b/crates/router_env/src/logger/types.rs
@@ -769,10 +769,16 @@ pub enum Flow {
SuperpositionListDefaultConfigs,
/// Superposition Proxy Get Dimensions List flow
SuperpositionListDimensions,
+ /// Superposition Proxy Get Dimension flow
+ SuperpositionGetDimension,
+ /// Superposition Proxy Get Default Config flow
+ SuperpositionGetDefaultConfig,
/// Superposition Proxy Create Context flow
SuperpositionCreateContext,
/// Superposition Proxy Resolve Detailed Config flow
SuperpositionResolveDetailedConfig,
+ /// Superposition Proxy Resolve Config Explanation flow
+ SuperpositionResolveConfigExplanation,
/// Superposition Proxy List Audit Logs flow
SuperpositionListAuditLogs,
// Get user details internal