access-control: split crate in default and impl features

this way the types defined in this crate can be re-used in places
without necessarily having to use the ACL, token shadow and
(cached) user config implementations.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
This commit is contained in:
Shannon Sterz 2024-06-19 11:54:18 +02:00 committed by Wolfgang Bumiller
parent 1dc88b5e3c
commit 46d8423d72
2 changed files with 35 additions and 13 deletions

View File

@ -14,17 +14,29 @@ description = "A collection of utilities to implement access control management.
[dependencies] [dependencies]
anyhow.workspace = true anyhow.workspace = true
nix.workspace = true nix = { workspace = true, optional = true }
openssl.workspace = true openssl = { workspace = true, optional = true }
serde.workspace = 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-auth-api = { workspace = true, features = [ "api-types" ] }
proxmox-router = { workspace = true } proxmox-router = { workspace = true, optional = true }
proxmox-schema.workspace = true proxmox-schema.workspace = true
proxmox-section-config.workspace = true proxmox-section-config = { workspace = true, optional = true }
proxmox-product-config.workspace = true proxmox-product-config = { workspace = true, optional = true }
proxmox-shared-memory.workspace = true proxmox-shared-memory = { workspace = true, optional = true }
proxmox-sys = { workspace = true, features = [ "crypt" ] } proxmox-sys = { workspace = true, features = [ "crypt" ], optional = true }
proxmox-time.workspace = 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",
]

View File

@ -1,8 +1,18 @@
pub mod acl;
pub mod init;
pub mod token_shadow;
pub mod types; 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; pub mod user;
#[cfg(feature = "impl")]
mod cached_user_info; mod cached_user_info;
#[cfg(feature = "impl")]
pub use cached_user_info::CachedUserInfo; pub use cached_user_info::CachedUserInfo;