aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/router.rs
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2023-01-12 13:35:14 +0000
committerJonathan Davies <jpds@protonmail.com>2023-01-13 09:38:58 +0000
commit100b01e85916d57ebff2eb63c915e2c4d2801b47 (patch)
tree99ef9953b86fd779286ea784a1a61c84293019ff /src/api/admin/router.rs
parent94d723f27cea7aa58d11af3e18a165283b40f19a (diff)
downloadgarage-100b01e85916d57ebff2eb63c915e2c4d2801b47.tar.gz
garage-100b01e85916d57ebff2eb63c915e2c4d2801b47.zip
Implemented website hosting authorization endpoint.
Fixes: #468
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r--src/api/admin/router.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs
index 62e6abc3..0dcb1546 100644
--- a/src/api/admin/router.rs
+++ b/src/api/admin/router.rs
@@ -17,6 +17,7 @@ router_match! {@func
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Endpoint {
Options,
+ CheckWebsiteEnabled,
Health,
Metrics,
GetClusterStatus,
@@ -91,6 +92,7 @@ impl Endpoint {
let res = router_match!(@gen_path_parser (req.method(), path, query) [
OPTIONS _ => Options,
+ GET "/check" => CheckWebsiteEnabled,
GET "/health" => Health,
GET "/metrics" => Metrics,
GET "/v0/status" => GetClusterStatus,
@@ -136,6 +138,7 @@ impl Endpoint {
pub fn authorization_type(&self) -> Authorization {
match self {
Self::Health => Authorization::None,
+ Self::CheckWebsiteEnabled => Authorization::None,
Self::Metrics => Authorization::MetricsToken,
_ => Authorization::AdminToken,
}