diff --git a/proxmox-access-control/Cargo.toml b/proxmox-access-control/Cargo.toml index 239dcc91..8f50a074 100644 --- a/proxmox-access-control/Cargo.toml +++ b/proxmox-access-control/Cargo.toml @@ -14,17 +14,29 @@ description = "A collection of utilities to implement access control management. [dependencies] anyhow.workspace = true -nix.workspace = true -openssl.workspace = true +nix = { workspace = true, optional = true } +openssl = { workspace = true, optional = true } serde.workspace = true -serde_json.workspace = true +serde_json = { workspace = true, optional = true } -# proxmox-notify.workspace = true proxmox-auth-api = { workspace = true, features = [ "api-types" ] } -proxmox-router = { workspace = true } +proxmox-router = { workspace = true, optional = true } proxmox-schema.workspace = true -proxmox-section-config.workspace = true -proxmox-product-config.workspace = true -proxmox-shared-memory.workspace = true -proxmox-sys = { workspace = true, features = [ "crypt" ] } -proxmox-time.workspace = true +proxmox-section-config = { workspace = true, optional = true } +proxmox-product-config = { workspace = true, optional = true } +proxmox-shared-memory = { workspace = true, optional = true } +proxmox-sys = { workspace = true, features = [ "crypt" ], optional = true } +proxmox-time = { workspace = true } + +[features] +default = [] +impl = [ + "dep:nix", + "dep:openssl", + "dep:proxmox-product-config", + "dep:proxmox-router", + "dep:proxmox-section-config", + "dep:proxmox-shared-memory", + "dep:proxmox-sys", + "dep:serde_json", +] diff --git a/proxmox-access-control/src/lib.rs b/proxmox-access-control/src/lib.rs index 16132072..7fabcfb5 100644 --- a/proxmox-access-control/src/lib.rs +++ b/proxmox-access-control/src/lib.rs @@ -1,8 +1,18 @@ -pub mod acl; -pub mod init; -pub mod token_shadow; pub mod types; + +#[cfg(feature = "impl")] +pub mod acl; + +#[cfg(feature = "impl")] +pub mod init; + +#[cfg(feature = "impl")] +pub mod token_shadow; + +#[cfg(feature = "impl")] pub mod user; +#[cfg(feature = "impl")] mod cached_user_info; +#[cfg(feature = "impl")] pub use cached_user_info::CachedUserInfo;