From b7338b400eea2ce06de362f046da927ed135d048 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 10 Jul 2025 14:27:31 -0600 Subject: refactor: remove unused context value --- src/authorization/cedar_authorizer.rs | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src') diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs index ceaee51c..0f53dacb 100644 --- a/src/authorization/cedar_authorizer.rs +++ b/src/authorization/cedar_authorizer.rs @@ -113,7 +113,6 @@ impl CedarAuthorizer { ) -> Result> { let mut items = std::collections::HashMap::new(); - items.insert("bearer_token".to_string(), self.token_from(&http_request)); items.insert("host".to_string(), self.safe_string(&http_request.host)); items.insert("method".to_string(), self.safe_string(&http_request.method)); items.insert("path".to_string(), self.safe_string(&http_request.path)); @@ -123,19 +122,6 @@ impl CedarAuthorizer { )?) } - fn token_from( - &self, - http_request: &envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest, - ) -> cedar_policy::RestrictedExpression { - let bearer_token = &http_request - .headers - .get("authorization") - .and_then(|auth| auth.strip_prefix("Bearer ")) - .unwrap_or(""); - - self.safe_string(bearer_token) - } - fn safe_string(&self, item: &str) -> cedar_policy::RestrictedExpression { cedar_policy::RestrictedExpression::new_string(item.to_string()) } -- cgit v1.2.3