summaryrefslogtreecommitdiff
path: root/src/authorization
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-04 12:40:38 -0600
committermo khan <mo@mokhan.ca>2025-07-04 12:40:38 -0600
commitf8549af8d64b551449957c3004b74ed0bf69c593 (patch)
tree62ca253b16da2e8239f9409a3159e19699301c66 /src/authorization
parent7c2b698c5723e43fa4eb73a3fdb2bee829841ddb (diff)
feat: allow access to sparkle homepage
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()