Skip to content

Commit 7df9a21

Browse files
Fix formatting
1 parent 2ea0097 commit 7df9a21

4 files changed

Lines changed: 34 additions & 31 deletions

File tree

crates/agentgateway/src/app.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ pub async fn run(config: Arc<Config>) -> anyhow::Result<Bound> {
109109
.await
110110
.context("admin server starts")?;
111111
#[cfg(feature = "ui")]
112-
admin_server.set_admin_handler(Arc::new(crate::ui::UiHandler::new(config.clone(), stores.guard_registry.clone())));
112+
admin_server.set_admin_handler(Arc::new(crate::ui::UiHandler::new(
113+
config.clone(),
114+
stores.guard_registry.clone(),
115+
)));
113116
#[cfg(feature = "ui")]
114117
info!("serving UI at http://{}/ui", config.admin_addr);
115118

crates/agentgateway/src/mcp/handler.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ impl Relay {
177177
identity: None,
178178
metadata: serde_json::Value::Null,
179179
};
180-
match self.security_guards.evaluate_connection(&server_name, None, &context) {
180+
match self
181+
.security_guards
182+
.evaluate_connection(&server_name, None, &context)
183+
{
181184
Ok(crate::mcp::security::GuardDecision::Allow) => {
182185
tracing::info!(server = %server_name, "Connection guard: allowed");
183186
},

crates/agentgateway/src/mcp/security/wasm.rs

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -625,20 +625,17 @@ impl NativeGuard for WasmGuard {
625625
})?;
626626

627627
// Try to get evaluate-tool-invoke — if not exported, allow (backward compat)
628-
let func_export_idx = match instance.get_export(
629-
&mut store,
630-
Some(&guard_export_idx),
631-
"evaluate-tool-invoke",
632-
) {
633-
Some(idx) => idx,
634-
None => {
635-
tracing::debug!(
636-
guard_id = %self.guard_id,
637-
"WASM guard does not export evaluate-tool-invoke, allowing"
638-
);
639-
return Ok(GuardDecision::Allow);
640-
},
641-
};
628+
let func_export_idx =
629+
match instance.get_export(&mut store, Some(&guard_export_idx), "evaluate-tool-invoke") {
630+
Some(idx) => idx,
631+
None => {
632+
tracing::debug!(
633+
guard_id = %self.guard_id,
634+
"WASM guard does not export evaluate-tool-invoke, allowing"
635+
);
636+
return Ok(GuardDecision::Allow);
637+
},
638+
};
642639

643640
let func = instance
644641
.get_func(&mut store, &func_export_idx)
@@ -715,20 +712,17 @@ impl NativeGuard for WasmGuard {
715712
})?;
716713

717714
// Try to get evaluate-response — if not exported, allow (backward compat)
718-
let func_export_idx = match instance.get_export(
719-
&mut store,
720-
Some(&guard_export_idx),
721-
"evaluate-response",
722-
) {
723-
Some(idx) => idx,
724-
None => {
725-
tracing::debug!(
726-
guard_id = %self.guard_id,
727-
"WASM guard does not export evaluate-response, allowing"
728-
);
729-
return Ok(GuardDecision::Allow);
730-
},
731-
};
715+
let func_export_idx =
716+
match instance.get_export(&mut store, Some(&guard_export_idx), "evaluate-response") {
717+
Some(idx) => idx,
718+
None => {
719+
tracing::debug!(
720+
guard_id = %self.guard_id,
721+
"WASM guard does not export evaluate-response, allowing"
722+
);
723+
return Ok(GuardDecision::Allow);
724+
},
725+
};
732726

733727
let func = instance
734728
.get_func(&mut store, &func_export_idx)

crates/agentgateway/src/ui.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ fn collect_wasm_schemas_from_config(config: &Value, schemas: &mut serde_json::Ma
209209

210210
/// Extract schemas from a list of guard config values.
211211
#[allow(unused_variables)]
212-
fn collect_wasm_schemas_from_guards(guards: &[Value], schemas: &mut serde_json::Map<String, Value>) {
212+
fn collect_wasm_schemas_from_guards(
213+
guards: &[Value],
214+
schemas: &mut serde_json::Map<String, Value>,
215+
) {
213216
for guard_val in guards {
214217
let Some(guard_type) = guard_val.get("type").and_then(|v| v.as_str()) else {
215218
continue;

0 commit comments

Comments
 (0)