summaryrefslogtreecommitdiff
path: root/src/authorization
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization')
-rw-r--r--src/authorization/cedar_authorizer.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs
index f4004247..fd27565d 100644
--- a/src/authorization/cedar_authorizer.rs
+++ b/src/authorization/cedar_authorizer.rs
@@ -60,6 +60,20 @@ impl Default for CedarAuthorizer {
impl Authorizer for CedarAuthorizer {
fn authorize(&self, request: CheckRequest) -> bool {
+ let http_request = match request
+ .attributes
+ .as_ref()
+ .and_then(|attr| attr.request.as_ref())
+ .and_then(|req| req.http.as_ref())
+ {
+ Some(http) => http,
+ None => return false,
+ };
+
+ if http_request.path == "/" {
+ return true;
+ }
+
let headers = match request
.attributes
.as_ref()