diff --git a/compute_tools/src/http/middleware/authorize.rs b/compute_tools/src/http/middleware/authorize.rs index f1137de0ab..e6c3269b15 100644 --- a/compute_tools/src/http/middleware/authorize.rs +++ b/compute_tools/src/http/middleware/authorize.rs @@ -1,7 +1,7 @@ -use std::{collections::HashSet, net::SocketAddr}; +use std::collections::HashSet; use anyhow::{Result, anyhow}; -use axum::{RequestExt, body::Body, extract::ConnectInfo}; +use axum::{RequestExt, body::Body}; use axum_extra::{ TypedHeader, headers::{Authorization, authorization::Bearer}, @@ -64,19 +64,6 @@ impl AsyncAuthorizeRequest for Authorize { return Ok(request); } - let connect_info = request - .extract_parts::>() - .await - .unwrap(); - - // In the event the request is coming from the loopback interface, - // allow all requests - if connect_info.ip().is_loopback() { - warn!(%request_id, "Bypassed authorization because request is coming from the loopback interface"); - - return Ok(request); - } - let TypedHeader(Authorization(bearer)) = request .extract_parts::>>() .await