From: Shannon Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox v3 7/7] access-control: split crate in `default` and `impl` features
Date: Wed, 19 Jun 2024 11:54:18 +0200 [thread overview]
Message-ID: <20240619095418.126368-8-s.sterz@proxmox.com> (raw)
In-Reply-To: <20240619095418.126368-1-s.sterz@proxmox.com>
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>
---
proxmox-access-control/Cargo.toml | 32 +++++++++++++++++++++----------
proxmox-access-control/src/lib.rs | 12 +++++++++++-
2 files changed, 33 insertions(+), 11 deletions(-)
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 types;
+
+#[cfg(feature = "impl")]
pub mod acl;
+
+#[cfg(feature = "impl")]
pub mod init;
+
+#[cfg(feature = "impl")]
pub mod token_shadow;
-pub mod types;
+
+#[cfg(feature = "impl")]
pub mod user;
+#[cfg(feature = "impl")]
mod cached_user_info;
+#[cfg(feature = "impl")]
pub use cached_user_info::CachedUserInfo;
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-06-19 9:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 9:54 [pbs-devel] [PATCH proxmox v3 0/7] add proxmox-access-control crate Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 1/7] access-control: add the proxmox-access crate to reuse acl trees Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 2/7] access-control: define `User`, `UserWithTokens` and `ApiTokens` types Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 3/7] access-control: make token shadow implementation re-usable Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 4/7] access-control: factor out user config handling Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 5/7] access: increment user cache generation when saving acl config Shannon Sterz
2024-06-19 9:54 ` [pbs-devel] [PATCH proxmox v3 6/7] access: move to flatten `User` into `UserWithToken` Shannon Sterz
2024-06-19 9:54 ` Shannon Sterz [this message]
2024-06-19 12:48 ` [pbs-devel] applied-series: [PATCH proxmox v3 0/7] add proxmox-access-control crate Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240619095418.126368-8-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.