From 1041f07d7ef3faedf759c31cd8b2c9df264799ff Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 19 Jun 2025 17:38:57 -0600 Subject: refactor: rename client_headers to headers --- src/authorization.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/authorization.rs b/src/authorization.rs index d86e8938..35062d84 100644 --- a/src/authorization.rs +++ b/src/authorization.rs @@ -16,16 +16,15 @@ impl CedarAuthorizer { impl Authorizer for CedarAuthorizer { fn authorize(&self, request: CheckRequest) -> bool { - let client_headers = request + let headers = request .attributes .as_ref() .and_then(|attr| attr.request.as_ref()) .and_then(|req| req.http.as_ref()) .map(|http| &http.headers) - .ok_or_else(|| Status::invalid_argument("client headers not populated by envoy")) .unwrap(); - if let Some(authorization) = client_headers.get("authorization") { + if let Some(authorization) = headers.get("authorization") { if authorization == "Bearer valid-token" { return true; } -- cgit v1.2.3