public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly
@ 2025-11-28 10:09 Shannon Sterz
  2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: set root@pam as the current auth id Shannon Sterz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-11-28 10:09 UTC (permalink / raw)
  To: pdm-devel

these patches intend to make the proxmox-datacenter-manager-admin
command work as intended again. the first commit sets an auth id for the
rpc environment while the second one initializes the access control
config.

Shannon Sterz (2):
  cli: admin: set root@pam as the current auth id
  cli: admin: initialize the access control configuration

 cli/admin/Cargo.toml  |  2 ++
 cli/admin/src/main.rs | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

--
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: set root@pam as the current auth id
  2025-11-28 10:09 [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Shannon Sterz
@ 2025-11-28 10:09 ` Shannon Sterz
  2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 2/2] cli: admin: initialize the access control configuration Shannon Sterz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-11-28 10:09 UTC (permalink / raw)
  To: pdm-devel

otherwise several cli commands relying on the rpc environment
providing a current auth id will fail.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 cli/admin/src/main.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cli/admin/src/main.rs b/cli/admin/src/main.rs
index 831b573..ef72d76 100644
--- a/cli/admin/src/main.rs
+++ b/cli/admin/src/main.rs
@@ -4,6 +4,7 @@ use proxmox_router::cli::{
     default_table_format_options, format_and_print_result_full, get_output_format, run_cli_command,
     CliCommand, CliCommandMap, CliEnvironment, ColumnConfig, OUTPUT_FORMAT,
 };
+use proxmox_router::RpcEnvironment;
 
 use proxmox_schema::api;
 
@@ -27,7 +28,9 @@ fn main() {
         .insert("remote", remotes::cli())
         .insert("versions", CliCommand::new(&API_METHOD_GET_VERSIONS));
 
-    let rpcenv = CliEnvironment::new();
+    let mut rpcenv = CliEnvironment::new();
+    rpcenv.set_auth_id(Some("root@pam".into()));
+
     run_cli_command(
         cmd_def,
         rpcenv,
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 2/2] cli: admin: initialize the access control configuration
  2025-11-28 10:09 [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Shannon Sterz
  2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: set root@pam as the current auth id Shannon Sterz
@ 2025-11-28 10:09 ` Shannon Sterz
  2025-11-28 10:58 ` [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Lukas Wagner
  2025-11-28 18:53 ` [pdm-devel] applied: " Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-11-28 10:09 UTC (permalink / raw)
  To: pdm-devel

otherwise it will just panic.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 cli/admin/Cargo.toml  | 2 ++
 cli/admin/src/main.rs | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/cli/admin/Cargo.toml b/cli/admin/Cargo.toml
index 17155a8..0dec423 100644
--- a/cli/admin/Cargo.toml
+++ b/cli/admin/Cargo.toml
@@ -18,7 +18,9 @@ proxmox-log.workspace = true
 proxmox-product-config.workspace = true
 proxmox-router = { workspace = true, features = [ "cli" ], default-features = false }
 proxmox-schema = { workspace = true, features = [ "api-macro" ] }
+proxmox-access-control.workspace = true
 
 pdm-api-types.workspace = true
 pdm-config.workspace = true
+pdm-buildcfg.workspace = true
 server.workspace = true
diff --git a/cli/admin/src/main.rs b/cli/admin/src/main.rs
index ef72d76..19d387f 100644
--- a/cli/admin/src/main.rs
+++ b/cli/admin/src/main.rs
@@ -17,6 +17,12 @@ fn main() {
     let priv_user = pdm_config::priv_user().expect("cannot get privileged user");
     proxmox_product_config::init(api_user, priv_user);
 
+    proxmox_access_control::init::init(
+        &pdm_api_types::AccessControlConfig,
+        pdm_buildcfg::configdir!("/access"),
+    )
+    .expect("failed to setup access control config");
+
     proxmox_log::Logger::from_env("PDM_LOG", proxmox_log::LevelFilter::INFO)
         .stderr()
         .init()
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly
  2025-11-28 10:09 [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Shannon Sterz
  2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: set root@pam as the current auth id Shannon Sterz
  2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 2/2] cli: admin: initialize the access control configuration Shannon Sterz
@ 2025-11-28 10:58 ` Lukas Wagner
  2025-11-28 18:53 ` [pdm-devel] applied: " Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Lukas Wagner @ 2025-11-28 10:58 UTC (permalink / raw)
  To: Proxmox Datacenter Manager development discussion, Shannon Sterz

On Fri Nov 28, 2025 at 11:09 AM CET, Shannon Sterz wrote:
> these patches intend to make the proxmox-datacenter-manager-admin
> command work as intended again. the first commit sets an auth id for the
> rpc environment while the second one initializes the access control
> config.
>
> Shannon Sterz (2):
>   cli: admin: set root@pam as the current auth id
>   cli: admin: initialize the access control configuration
>

This fixes the issue, thank you!

Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pdm-devel] applied: [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly
  2025-11-28 10:09 [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Shannon Sterz
                   ` (2 preceding siblings ...)
  2025-11-28 10:58 ` [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Lukas Wagner
@ 2025-11-28 18:53 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2025-11-28 18:53 UTC (permalink / raw)
  To: pdm-devel, Shannon Sterz

On Fri, 28 Nov 2025 11:09:32 +0100, Shannon Sterz wrote:
> these patches intend to make the proxmox-datacenter-manager-admin
> command work as intended again. the first commit sets an auth id for the
> rpc environment while the second one initializes the access control
> config.
> 
> Shannon Sterz (2):
>   cli: admin: set root@pam as the current auth id
>   cli: admin: initialize the access control configuration
> 
> [...]

Applied, thanks!

[1/2] cli: admin: set root@pam as the current auth id
      commit: e1e5ee53065c67f9a4bd7147ce8f9e5784f2e9aa
[2/2] cli: admin: initialize the access control configuration
      commit: be1da5b7bc48279beeb457d68c4e23ef777f60b7


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-28 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-28 10:09 [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Shannon Sterz
2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: set root@pam as the current auth id Shannon Sterz
2025-11-28 10:09 ` [pdm-devel] [PATCH datacenter-manager 2/2] cli: admin: initialize the access control configuration Shannon Sterz
2025-11-28 10:58 ` [pdm-devel] [PATCH datacenter-manager 0/2] set up proxmox-datacenter-manager-admin properly Lukas Wagner
2025-11-28 18:53 ` [pdm-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal