summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-10 14:27:31 -0600
committermo khan <mo@mokhan.ca>2025-07-10 14:27:31 -0600
commitb7338b400eea2ce06de362f046da927ed135d048 (patch)
tree3e41d02c235d07887faaddec432e1c49a71d404f /src
parent76d64d9699c12ec3f30eda40b1489e50c6fe2790 (diff)
refactor: remove unused context value
Diffstat (limited to 'src')
-rw-r--r--src/authorization/cedar_authorizer.rs14
1 files changed, 0 insertions, 14 deletions
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<cedar_policy::Context, Box<dyn std::error::Error>> {
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())
}