diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-19 17:38:57 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-19 17:38:57 -0600 |
| commit | 1041f07d7ef3faedf759c31cd8b2c9df264799ff (patch) | |
| tree | 91e143cb49cde4c3f2277465d2b1a54f64089f3e | |
| parent | 3291163206f16d2d624b98e11125abf76da36c47 (diff) | |
refactor: rename client_headers to headers
| -rw-r--r-- | src/authorization.rs | 5 |
1 files 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; } |
