summaryrefslogtreecommitdiff
path: root/src/authorization.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization.rs')
-rw-r--r--src/authorization.rs5
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;
}