From 33083559c6d43d266ca77fcd1beb94c6feb4b547 Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 4 Jul 2025 13:11:19 -0600 Subject: style: fix linter errors --- src/authorization/cedar_authorizer.rs | 36 ++++++----------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'src/authorization') diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs index 61142b71..432102ef 100644 --- a/src/authorization/cedar_authorizer.rs +++ b/src/authorization/cedar_authorizer.rs @@ -79,14 +79,11 @@ impl Authorizer for CedarAuthorizer { "Processing HTTP request" ); - if http_request.host == "sparkle.staging.runway.gitlab.net" { - if http_request.method == "GET" && http_request.path == "/" { - tracing::info!( - host = %http_request.host, - "Allowing health check request" - ); - return true; - } + if http_request.host == "sparkle.staging.runway.gitlab.net" + && http_request.method == "GET" + && http_request.path == "/" + { + return true; } let headers = &http_request.headers; @@ -96,15 +93,6 @@ impl Authorizer for CedarAuthorizer { .and_then(|auth| auth.strip_prefix("Bearer ")) .unwrap_or(""); - tracing::info!( - path = %http_request.path, - has_bearer_token = !bearer_token.is_empty(), - user_agent = ?headers.get("user-agent"), - x_request_id = ?headers.get("x-request-id"), - content_type = ?headers.get("content-type"), - "Extracted request details" - ); - match self.create_cedar_request(bearer_token, &http_request.path.to_string()) { Ok(cedar_request) => { let entities = Entities::empty(); @@ -112,19 +100,7 @@ impl Authorizer for CedarAuthorizer { self.authorizer .is_authorized(&cedar_request, &self.policies, &entities); - let decision = response.decision(); - let is_allowed = matches!(decision, cedar_policy::Decision::Allow); - - tracing::info!( - method = %http_request.method, - host = %http_request.host, - path = %http_request.path, - decision = ?decision, - allowed = is_allowed, - "Authorization decision" - ); - - is_allowed + matches!(response.decision(), cedar_policy::Decision::Allow) } Err(e) => { tracing::error!( -- cgit v1.2.3