summaryrefslogtreecommitdiffstats
path: root/src/api/debug.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 05:26:30 +0100
committertv <tv@krebsco.de>2026-10-26 05:26:30 +0100
commitca5fbf8736aef1c754f5048cc21bacb2f91360e2 (patch)
tree544c5786a42285f6f2079a8f09a666c669083658 /src/api/debug.rs
parent982cf915cca3598a7dcceedc46d5c75dd79efe80 (diff)
remove /debug/blacklist endpint
Diffstat (limited to 'src/api/debug.rs')
-rw-r--r--src/api/debug.rs25
1 files changed, 2 insertions, 23 deletions
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<AppState>, body: Bytes) -> StatusCode {
- match serde_json::from_slice::<HashSet<String>>(&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
- }
- }
-}