From c2e2078b3fd66fc6d378bc1626e3557993f07428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 1 Jul 2021 14:58:33 +0200 Subject: [PATCH] openid: conditionally disable api endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since it pulls in lots of additional linked libraries for all binaries compiled as part of proxmox-backup. it can easily be re-enabled with `--cfg openid` added to the RUSTFLAGS env variable. Signed-off-by: Fabian Grünbichler --- src/api2/access.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api2/access.rs b/src/api2/access.rs index e5430f62..1cd772d6 100644 --- a/src/api2/access.rs +++ b/src/api2/access.rs @@ -26,6 +26,8 @@ pub mod domain; pub mod role; pub mod tfa; pub mod user; + +#[cfg(openid)] pub mod openid; #[allow(clippy::large_enum_variant)] @@ -415,6 +417,12 @@ pub fn list_permissions( Ok(map) } +#[cfg(openid)] +const OPENID_ROUTER: &Router = &openid::ROUTER; + +#[cfg(not(openid))] +const OPENID_ROUTER: &Router = &Router::new(); + #[sortable] const SUBDIRS: SubdirMap = &sorted!([ ("acl", &acl::ROUTER), @@ -424,7 +432,7 @@ const SUBDIRS: SubdirMap = &sorted!([ &Router::new().get(&API_METHOD_LIST_PERMISSIONS) ), ("ticket", &Router::new().post(&API_METHOD_CREATE_TICKET)), - ("openid", &openid::ROUTER), + ("openid", &OPENID_ROUTER), ("domains", &domain::ROUTER), ("roles", &role::ROUTER), ("users", &user::ROUTER),