From ca5fbf8736aef1c754f5048cc21bacb2f91360e2 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 05:26:30 +0100 Subject: remove /debug/blacklist endpint --- src/api/debug.rs | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/api/debug.rs') diff --git a/src/api/debug.rs b/src/api/debug.rs index 6a56a9c..01b7bc0 100644 --- a/src/api/debug.rs +++ b/src/api/debug.rs @@ -1,9 +1,7 @@ //! /debug/* handlers (only routed with --debug-api). -use std::collections::HashSet; - -use axum::{Json, body::Bytes, extract::State, http::StatusCode}; -use tracing::{info, warn}; +use axum::{Json, extract::State, http::StatusCode}; +use tracing::info; use crate::state::AppState; use crate::transport::firewall::FirewallRules; @@ -20,22 +18,3 @@ pub(crate) async fn put_debug_firewall( state.firewall.set_rules(rules); StatusCode::NO_CONTENT } - -/// Compatibility for the existing harness: block a set of peers in both directions. -/// Parses the body without requiring a Content-Type header, as before. -pub(crate) async fn put_debug_blacklist(State(state): State, body: Bytes) -> StatusCode { - match serde_json::from_slice::>(&body) { - Ok(peers) => { - info!(peers = ?peers, "Blacklist replaced (both directions)"); - state.firewall.set_rules(FirewallRules { - inbound: peers.clone(), - outbound: peers, - }); - StatusCode::NO_CONTENT - } - Err(error) => { - warn!(error = %error, "Invalid blacklist body"); - StatusCode::BAD_REQUEST - } - } -} -- cgit v1.3.1