Skip to content

Commit

Permalink
Serving dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Sep 20, 2024
1 parent c0ee950 commit 2cad77e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/serv-api/web/src/middleware/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ where
let cache = self.cache.clone();
let service = self.service.clone();

// TODO: remove this hack; possibly by enabling creation of arbitrary appkey from CLI
if req.uri().to_string().starts_with("/metrics-api")
|| req.uri().to_string().starts_with("/version")
{
log::debug!("skipping authorization for uri={}", req.uri());
return Box::pin(service.borrow_mut().call(req));
let allowed_uris = vec!["/metrics-api", "/version", "/dashboard"];

for uri in allowed_uris {
if req.uri().to_string().starts_with(uri) {
log::debug!("skipping authorization for uri={}", req.uri());
return Box::pin(service.borrow_mut().call(req));
}
}

Box::pin(async move {
Expand Down

0 comments on commit 2cad77e

Please sign in to comment.