* [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token
@ 2026-02-11 15:20 Shan Shaji
2026-02-11 15:20 ` [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method Shan Shaji
` (7 more replies)
0 siblings, 8 replies; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
**note**: Sending v3 because the generated code for the delete_token
method in pve-api-types has changed. I rebased the series onto master and
re-tested the changes.
If a user removed a remote without deleting its associated token,
PDM would not allow re-adding the same remote unless the token
was changed. To fix this, support for optionally deleting the token
from the remote has been added.
This patch series adds support to delete the token using an optional
boolean flag in CLIs ie. on both admin and client. Additionaly, added a
check box inside the UI that allow users to choose whether to
delete the token while removing the remote.
History
=======
changes since v2:
- Regenerate the `delete_token` method. The new generate code has
`percent_encoding` wrapped around the params to handle non-alphanumeric
characters.
changes since v3:
- Locked the remote config inorder to avoid race condition. Thanks @Michael
- Included missing admin cli implementation. Thanks @Michael
- Addressed nit comments. Thanks @Shannon
proxmox-datacenter-manager:
Shan Shaji (6):
server: pbs-client: add delete admin token method
server: api: add support to optionally delete token from remote
pdm-client: accept `delete-token` argument for deleting api token
cli: client: add `delete-token` option to delete token from remote
fix: ui: add remove confirmation dialog with optional token deletion
cli: admin: add `delete-token` option to delete token from remote
cli/admin/src/remotes.rs | 20 ++++--
cli/client/src/remotes.rs | 11 ++-
lib/pdm-client/src/lib.rs | 11 ++-
server/src/api/remotes.rs | 46 ++++++++++++-
server/src/pbs_client.rs | 7 ++
ui/src/remotes/config.rs | 38 ++++++++---
ui/src/remotes/mod.rs | 2 +
ui/src/remotes/remove_remote.rs | 117 ++++++++++++++++++++++++++++++++
8 files changed, 231 insertions(+), 21 deletions(-)
create mode 100644 ui/src/remotes/remove_remote.rs
proxmox:
Shan Shaji (1):
pve-api-types: generate missing `delete_token` method
pve-api-types/generate.pl | 1 +
pve-api-types/src/generated/code.rs | 15 +++++++++++++++
2 files changed, 16 insertions(+)
Summary over all repositories:
10 files changed, 247 insertions(+), 21 deletions(-)
--
Generated by git-murpp 0.8.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote Shan Shaji
` (6 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Inorder to allow deleting the generated token of PBS from PDM, add
method inside the PbsClient to delete the admin token.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v2: No changes
changes since v1:
- Revert the dropping of '/' from the comment.
- Remove unnecessary colon.
server/src/pbs_client.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/server/src/pbs_client.rs b/server/src/pbs_client.rs
index f4f1f82..31befdd 100644
--- a/server/src/pbs_client.rs
+++ b/server/src/pbs_client.rs
@@ -260,6 +260,13 @@ impl PbsClient {
Ok(token)
}
+ /// Delete API-Token from the PBS remote.
+ pub async fn delete_admin_token(&self, userid: &Userid, tokenid: &str) -> Result<(), Error> {
+ let path = format!("/api2/extjs/access/users/{userid}/token/{tokenid}");
+ self.0.delete(&path).await?.nodata()?;
+ Ok(())
+ }
+
/// Return the status the Proxmox Backup Server instance
pub async fn node_status(&self) -> Result<pbs_api_types::NodeStatus, Error> {
let path = "/api2/extjs/nodes/localhost/status";
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
2026-02-11 15:20 ` [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token Shan Shaji
` (5 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Previously, when removing a remote, the token was still present in the
remote configuration. When users tried to add the remote again, they
received an error because a token with the same name already existed.
To support deleting the token from the remote, add an optional
parameter to the API endpoint.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v2: No changes.
changes since v1:
- nit: inlined the id argument using the format string.
- used `get` instead of `get_mut` inorder to access remote.
- removed unnecessary `&` operator use.
server/src/api/remotes.rs | 46 +++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/server/src/api/remotes.rs b/server/src/api/remotes.rs
index 298ad13..82b8469 100644
--- a/server/src/api/remotes.rs
+++ b/server/src/api/remotes.rs
@@ -27,6 +27,7 @@ use crate::api::remote_updates;
use crate::metric_collection;
use crate::{connection, pbs_client};
+use super::pbs;
use super::pve;
use super::rrd_common;
use super::rrd_common::DataPoint;
@@ -292,16 +293,57 @@ pub fn update_remote(
input: {
properties: {
id: { schema: REMOTE_ID_SCHEMA },
+ "delete-token": {
+ type: bool,
+ description: "Optional boolean value to delete the token from remote.",
+ optional: true,
+ }
},
},
access: {
permission: &Permission::Privilege(&["resource"], PRIV_RESOURCE_MODIFY, false),
},
)]
-/// List all the remotes this instance is managing.
-pub fn remove_remote(id: String) -> Result<(), Error> {
+/// Remove a remote that this instance is managing.
+pub async fn remove_remote(id: String, delete_token: Option<bool>) -> Result<(), Error> {
+ let _lock = pdm_config::remotes::lock_config()?;
let (mut remotes, _) = pdm_config::remotes::config()?;
+ if delete_token.unwrap_or(false) {
+ let remote = remotes
+ .get(&id)
+ .ok_or_else(|| http_err!(NOT_FOUND, "no such remote {id:?}"))?;
+
+ let user = remote.authid.user();
+
+ let short_delete_err = |err: proxmox_client::Error| {
+ format_err!("error deleting token: {}", err.source().unwrap_or(&err))
+ };
+
+ let token_name = remote
+ .authid
+ .tokenname()
+ .ok_or_else(|| format_err!("Unable to find the token for the remote {id:?}"))?;
+
+ // connect to remote and delete the already existing token.
+ match remote.ty {
+ RemoteType::Pve => {
+ let client = pve::connect_or_login(remote).await?;
+ client
+ .delete_token(user.as_str(), token_name.as_str())
+ .await
+ .map_err(short_delete_err)?
+ }
+ RemoteType::Pbs => {
+ let client = pbs::connect_or_login(remote).await?;
+ client
+ .delete_admin_token(user, token_name.as_str())
+ .await
+ .map_err(short_delete_err)?
+ }
+ };
+ }
+
if remotes.remove(&id).is_none() {
http_bail!(NOT_FOUND, "no such entry {id:?}");
}
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
2026-02-11 15:20 ` [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method Shan Shaji
2026-02-11 15:20 ` [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote Shan Shaji
` (4 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v2: No changes.
changes since v1:
- reformated using `rustfmt`.
- added doc comment.
lib/pdm-client/src/lib.rs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
index 01ee6f7..ef534cc 100644
--- a/lib/pdm-client/src/lib.rs
+++ b/lib/pdm-client/src/lib.rs
@@ -136,8 +136,15 @@ impl<T: HttpApiClient> PdmClient<T> {
Ok(())
}
- pub async fn delete_remote(&self, remote: &str) -> Result<(), Error> {
- let path = format!("/api2/extjs/remotes/remote/{remote}");
+ /// Deletes a remote, with optional support to also delete the associated token.
+ pub async fn delete_remote(
+ &self,
+ remote: &str,
+ delete_token: &Option<bool>,
+ ) -> Result<(), Error> {
+ let path = ApiPathBuilder::new(format!("/api2/extjs/remotes/remote/{remote}"))
+ .maybe_arg("delete-token", delete_token)
+ .build();
self.0.delete(&path).await?.nodata()?;
Ok(())
}
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
` (2 preceding siblings ...)
2026-02-11 15:20 ` [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion Shan Shaji
` (3 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
**note:** No changes since v2
cli/client/src/remotes.rs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cli/client/src/remotes.rs b/cli/client/src/remotes.rs
index 4145dac..0b4df3c 100644
--- a/cli/client/src/remotes.rs
+++ b/cli/client/src/remotes.rs
@@ -116,12 +116,17 @@ async fn update_remote(id: String, updater: RemoteUpdater) -> Result<(), Error>
input: {
properties: {
id: { schema: REMOTE_ID_SCHEMA },
+ "delete-token": {
+ type: bool,
+ optional: true,
+ description: "Remove the API-Token from remote."
+ }
}
}
)]
-/// Add a new remote.
-async fn delete_remote(id: String) -> Result<(), Error> {
- client()?.delete_remote(&id).await?;
+/// Delete a remote.
+async fn delete_remote(id: String, delete_token: Option<bool>) -> Result<(), Error> {
+ client()?.delete_remote(&id, &delete_token).await?;
Ok(())
}
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
` (3 preceding siblings ...)
2026-02-11 15:20 ` [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote Shan Shaji
` (2 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Previously, removing a remote did not remove its token, which
prevented users from re-adding the same remote later with the same token
name. To fix this, add a new checkbox that lets users choose to also
delete the token when deleting the remote.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v2: No changes
changes since v1:
- Updated commit message.
- Remove unnecesary comma.
- Removed uneccary `clone` of the state variable.
- added module level imports.
- use `on_activate` instead of `on_click`.
ui/src/remotes/config.rs | 38 ++++++++---
ui/src/remotes/mod.rs | 2 +
ui/src/remotes/remove_remote.rs | 117 ++++++++++++++++++++++++++++++++
3 files changed, 147 insertions(+), 10 deletions(-)
create mode 100644 ui/src/remotes/remove_remote.rs
diff --git a/ui/src/remotes/config.rs b/ui/src/remotes/config.rs
index 0737f1b..0481c78 100644
--- a/ui/src/remotes/config.rs
+++ b/ui/src/remotes/config.rs
@@ -7,6 +7,7 @@ use anyhow::Error;
use proxmox_schema::property_string::PropertyString;
use crate::remotes::edit_remote::EditRemote;
+use crate::remotes::remove_remote::RemoveRemote;
//use pwt::widget::form::{Field, FormContext, InputType};
use pdm_api_types::remotes::Remote;
@@ -17,7 +18,7 @@ use proxmox_yew_comp::percent_encoding::percent_encode_component;
//use proxmox_schema::api_types::{CERT_FINGERPRINT_SHA256_SCHEMA, DNS_NAME_OR_IP_SCHEMA};
-use serde_json::Value;
+use serde_json::{json, Value};
use yew::virtual_dom::{Key, VComp, VNode};
use pwt::prelude::*;
@@ -32,7 +33,7 @@ use pwt::widget::{
//use proxmox_yew_comp::EditWindow;
use proxmox_yew_comp::{
- ConfirmButton, LoadableComponent, LoadableComponentContext, LoadableComponentMaster,
+ LoadableComponent, LoadableComponentContext, LoadableComponentMaster,
LoadableComponentScopeExt, LoadableComponentState,
};
@@ -42,10 +43,13 @@ async fn load_remotes() -> Result<Vec<Remote>, Error> {
proxmox_yew_comp::http_get("/remotes/remote", None).await
}
-async fn delete_item(key: Key) -> Result<(), Error> {
+async fn delete_item(key: Key, delete_token: bool) -> Result<(), Error> {
let id = key.to_string();
+ let param = Some(json!({
+ "delete-token": delete_token,
+ }));
let url = format!("/remotes/remote/{}", percent_encode_component(&id));
- proxmox_yew_comp::http_delete(&url, None).await?;
+ proxmox_yew_comp::http_delete(&url, param).await?;
Ok(())
}
@@ -100,10 +104,11 @@ impl RemoteConfigPanel {
pub enum ViewState {
Add(RemoteType),
Edit,
+ Remove,
}
pub enum Msg {
- RemoveItem,
+ RemoveItem(bool),
}
pub struct PbsRemoteConfigPanel {
@@ -156,11 +161,11 @@ impl LoadableComponent for PbsRemoteConfigPanel {
fn update(&mut self, ctx: &LoadableComponentContext<Self>, msg: Self::Message) -> bool {
match msg {
- Msg::RemoveItem => {
+ Msg::RemoveItem(v) => {
if let Some(key) = self.selection.selected_key() {
let link = ctx.link().clone();
self.spawn(async move {
- if let Err(err) = delete_item(key).await {
+ if let Err(err) = delete_item(key, v).await {
link.show_error(tr!("Unable to delete item"), err, true);
}
link.send_reload();
@@ -205,10 +210,9 @@ impl LoadableComponent for PbsRemoteConfigPanel {
.onclick(link.change_view_callback(|_| Some(ViewState::Edit))),
)
.with_child(
- ConfirmButton::new(tr!("Remove"))
- .confirm_message(tr!("Are you sure you want to remove this remote?"))
+ Button::new(tr!("Remove"))
.disabled(disabled)
- .on_activate(link.callback(|_| Msg::RemoveItem)),
+ .on_activate(link.change_view_callback(|_| Some(ViewState::Remove))),
)
.with_flex_spacer()
.with_child({
@@ -243,6 +247,7 @@ impl LoadableComponent for PbsRemoteConfigPanel {
.selection
.selected_key()
.map(|key| self.create_edit_dialog(ctx, key)),
+ ViewState::Remove => Some(self.create_remove_remote_dialog(ctx)),
}
}
}
@@ -303,6 +308,19 @@ impl PbsRemoteConfigPanel {
.on_done(ctx.link().change_view_callback(|_| None))
.into()
}
+
+ fn create_remove_remote_dialog(&self, ctx: &LoadableComponentContext<Self>) -> Html {
+ let link = ctx.link().clone();
+ let close = link.change_view_callback(|_| None);
+
+ RemoveRemote::new()
+ .on_dismiss(close.clone())
+ .on_confirm(Callback::from(move |v| {
+ link.send_message(Msg::RemoveItem(v));
+ link.change_view(None);
+ }))
+ .into()
+ }
}
impl From<RemoteConfigPanel> for VNode {
diff --git a/ui/src/remotes/mod.rs b/ui/src/remotes/mod.rs
index 603077c..bfe9dc0 100644
--- a/ui/src/remotes/mod.rs
+++ b/ui/src/remotes/mod.rs
@@ -27,6 +27,8 @@ pub use tasks::RemoteTaskList;
mod updates;
pub use updates::UpdateTree;
+mod remove_remote;
+
mod firewall;
pub use firewall::FirewallTree;
diff --git a/ui/src/remotes/remove_remote.rs b/ui/src/remotes/remove_remote.rs
new file mode 100644
index 0000000..63b55ee
--- /dev/null
+++ b/ui/src/remotes/remove_remote.rs
@@ -0,0 +1,117 @@
+use std::rc::Rc;
+
+use yew::html::IntoEventCallback;
+use yew::prelude::*;
+use yew::virtual_dom::{VComp, VNode};
+
+use pwt::css::{AlignItems, FontColor, JustifyContent};
+use pwt::prelude::*;
+use pwt::widget::form::Checkbox;
+use pwt::widget::{Button, Column, Container, Dialog, Fa, Row};
+
+use pwt_macros::builder;
+
+#[derive(PartialEq, Properties)]
+#[builder]
+pub struct RemoveRemote {
+ /// A callback for an action that needs to be confirmed by the user.
+ #[prop_or_default]
+ #[builder_cb(IntoEventCallback, into_event_callback, bool)]
+ pub on_confirm: Option<Callback<bool>>,
+
+ /// A callback that will trigger if the user dismisses the dialog.
+ #[prop_or_default]
+ #[builder_cb(IntoEventCallback, into_event_callback, ())]
+ pub on_dismiss: Option<Callback<()>>,
+}
+
+impl RemoveRemote {
+ pub fn new() -> Self {
+ yew::props!(Self {})
+ }
+}
+
+pub enum Msg {
+ SelectCheckBox(bool),
+}
+
+pub struct PdmRemoveRemote {
+ delete_token: bool,
+}
+
+impl Component for PdmRemoveRemote {
+ type Message = Msg;
+
+ type Properties = RemoveRemote;
+
+ fn create(_ctx: &Context<Self>) -> Self {
+ Self {
+ delete_token: false,
+ }
+ }
+
+ fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
+ match msg {
+ Msg::SelectCheckBox(v) => {
+ self.delete_token = v;
+ true
+ }
+ }
+ }
+
+ fn view(&self, ctx: &Context<Self>) -> Html {
+ let props = ctx.props();
+ let delete_token = self.delete_token;
+
+ let on_confirm = props.on_confirm.clone();
+ let on_dismiss = props.on_dismiss.clone();
+
+ Dialog::new(tr!("Confirm"))
+ .on_close(on_dismiss.clone())
+ .min_height(100)
+ .with_child(
+ Column::new()
+ .padding(4)
+ .gap(2)
+ .with_child(
+ Row::new()
+ .gap(2)
+ .class(AlignItems::Center)
+ .with_child(Container::new().class("pwt-message-sign").with_child(
+ Fa::new("exclamation-triangle").class(FontColor::Error),
+ ))
+ .with_child(tr!("Are you sure you want to remove this remote?")),
+ )
+ .with_child(
+ Checkbox::new()
+ .default(false)
+ .box_label(tr!("Delete API token from remote"))
+ .checked(self.delete_token)
+ .on_change(ctx.link().callback(|v| Msg::SelectCheckBox(v))),
+ )
+ .with_child(
+ Row::new()
+ .gap(2)
+ .class(JustifyContent::Center)
+ .with_child(Button::new(tr!("Yes")).on_activate(move |_| {
+ if let Some(on_confirm) = &on_confirm {
+ on_confirm.emit(delete_token);
+ }
+ }))
+ .with_child(Button::new(tr!("No")).on_activate(move |_| {
+ if let Some(on_dismiss) = &on_dismiss {
+ on_dismiss.emit(());
+ }
+ })),
+ ),
+ )
+ .into()
+ }
+}
+
+impl From<RemoveRemote> for VNode {
+ fn from(val: RemoveRemote) -> Self {
+ let comp = VComp::new::<PdmRemoveRemote>(Rc::new(val), None);
+ VNode::from(comp)
+ }
+}
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
` (4 preceding siblings ...)
2026-02-11 15:20 ` [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH proxmox v3 1/1] pve-api-types: generate missing `delete_token` method Shan Shaji
2026-02-13 13:19 ` [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Lukas Wagner
7 siblings, 1 reply; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Inorder to allow deleting the remote API token from PDM, added optional
boolean flag.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
**note**: No changes since v2. This was not included in v1.
cli/admin/src/remotes.rs | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/cli/admin/src/remotes.rs b/cli/admin/src/remotes.rs
index edd3fd8..6702667 100644
--- a/cli/admin/src/remotes.rs
+++ b/cli/admin/src/remotes.rs
@@ -217,16 +217,28 @@ fn update_remote(
input: {
properties: {
id: { schema: REMOTE_ID_SCHEMA },
+ "delete-token": {
+ type: bool,
+ optional: true,
+ description: "Remove the API-Token from remote."
+ }
}
}
)]
-/// Add a new remote.
-fn remove_remote(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> {
- let param = json!({ "id": id });
+/// Remove a new remote.
+async fn remove_remote(
+ id: String,
+ delete_token: Option<bool>,
+ rpcenv: &mut dyn RpcEnvironment,
+) -> Result<(), Error> {
+ let mut param = json!({ "id": id });
+ if delete_token.is_some() {
+ param["delete-token"] = delete_token.into();
+ }
let info = &dc_api::remotes::API_METHOD_REMOVE_REMOTE;
match info.handler {
- ApiHandler::Sync(handler) => (handler)(param, info, rpcenv).map(drop),
+ ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await.map(drop),
_ => unreachable!(),
}
}
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH proxmox v3 1/1] pve-api-types: generate missing `delete_token` method
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
` (5 preceding siblings ...)
2026-02-11 15:20 ` [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote Shan Shaji
@ 2026-02-11 15:20 ` Shan Shaji
2026-02-13 13:19 ` [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Lukas Wagner
7 siblings, 0 replies; 15+ messages in thread
From: Shan Shaji @ 2026-02-11 15:20 UTC (permalink / raw)
To: pdm-devel
Removing a remote node from PDM and adding it again is prevented
by the already existing token. Inorder to allow deletion of token
from PVE generate the endpoint that is necessary to call from
PDM.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
changes since v2:
- Regenerate `delete_token` method. The new change wraps the params with
percent_encode function.
pve-api-types/generate.pl | 1 +
pve-api-types/src/generated/code.rs | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
index e5c5d051..da8c2d47 100755
--- a/pve-api-types/generate.pl
+++ b/pve-api-types/generate.pl
@@ -362,6 +362,7 @@ Schema2Rust::derive('ListRealm' => 'Clone', 'PartialEq');
# api(GET => '/access/users/{userid}', 'get_user', 'return-name' => 'User');
api(POST => '/access/users/{userid}/token/{tokenid}', 'create_token', 'param-name' => 'CreateToken');
Schema2Rust::derive('CreateToken' => 'Default');
+api(DELETE => '/access/users/{userid}/token/{tokenid}', 'delete_token');
api(GET => '/nodes/{node}/apt/update', 'list_available_updates', 'return-name' => 'AptUpdateInfo');
api(POST => '/nodes/{node}/apt/update', 'update_apt_database', 'output-type' => 'PveUpid', 'param-name' => 'AptUpdateParams');
diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index bdf93884..c12f6bbe 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -634,6 +634,11 @@ pub trait PveClient {
))
}
+ /// Remove API token for a specific user.
+ async fn delete_token(&self, userid: &str, tokenid: &str) -> Result<(), Error> {
+ Err(Error::Other("delete_token not implemented"))
+ }
+
/// Get APT repository information.
async fn get_apt_repositories(&self, node: &str) -> Result<APTRepositoriesResult, Error> {
Err(Error::Other("get_apt_repositories not implemented"))
@@ -1802,6 +1807,16 @@ where
self.0.delete(url).await?.nodata()
}
+ /// Remove API token for a specific user.
+ async fn delete_token(&self, userid: &str, tokenid: &str) -> Result<(), Error> {
+ let url = &format!(
+ "/api2/extjs/access/users/{}/token/{}",
+ percent_encode(userid.as_bytes(), percent_encoding::NON_ALPHANUMERIC),
+ percent_encode(tokenid.as_bytes(), percent_encoding::NON_ALPHANUMERIC)
+ );
+ self.0.delete(url).await?.nodata()
+ }
+
/// Get APT repository information.
async fn get_apt_repositories(&self, node: &str) -> Result<APTRepositoriesResult, Error> {
let url = &format!(
--
2.47.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
` (6 preceding siblings ...)
2026-02-11 15:20 ` [PATCH proxmox v3 1/1] pve-api-types: generate missing `delete_token` method Shan Shaji
@ 2026-02-13 13:19 ` Lukas Wagner
7 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:19 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> **note**: Sending v3 because the generated code for the delete_token
> method in pve-api-types has changed. I rebased the series onto master and
> re-tested the changes.
>
> If a user removed a remote without deleting its associated token,
> PDM would not allow re-adding the same remote unless the token
> was changed. To fix this, support for optionally deleting the token
> from the remote has been added.
>
> This patch series adds support to delete the token using an optional
> boolean flag in CLIs ie. on both admin and client. Additionaly, added a
> check box inside the UI that allow users to choose whether to
> delete the token while removing the remote.
>
Seems to work fine, test both, PVE and PBS remotes. Can confirm the
removing the token works as expected.
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Left some comments with the individual patches for improvements for v4.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method
2026-02-11 15:20 ` [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method Shan Shaji
@ 2026-02-13 13:20 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:20 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
Hi Shan,
thanks for the patch!
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> Inorder to allow deleting the generated token of PBS from PDM, add
> method inside the PbsClient to delete the admin token.
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>
> changes since v2: No changes
> changes since v1:
> - Revert the dropping of '/' from the comment.
> - Remove unnecessary colon.
>
> server/src/pbs_client.rs | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/server/src/pbs_client.rs b/server/src/pbs_client.rs
> index f4f1f82..31befdd 100644
> --- a/server/src/pbs_client.rs
> +++ b/server/src/pbs_client.rs
> @@ -260,6 +260,13 @@ impl PbsClient {
> Ok(token)
> }
>
> + /// Delete API-Token from the PBS remote.
tiny nit: I'd spell it 'API token'
> + pub async fn delete_admin_token(&self, userid: &Userid, tokenid: &str) -> Result<(), Error> {
This function should take &TokenameRef, I think. After all, it's what
you have at the callsite before you you turn it into a &str.
Also, I think the function should just be called `delete_token`, since
nothing of it is specific to the token being an admin token (it can
delete *any* token, not just an admin one). That being said, I
understand why you named it this way, it's the symmetry with
`create_admin_token`. The difference is that `create_admin_token` does
indeed create a new token *and* also assigns admin permissions to it.
> + let path = format!("/api2/extjs/access/users/{userid}/token/{tokenid}");
Technically, the userid parameter should be percent-encoded - the @ sign
in "root@pam" would usually be reserved to separate credentials and the
host in a URL, see [1]. Apparently its not an issue with the
`create_admin_token` function so far, but still a good practice, even if
we don't really have issues with it now.
[1] https://docs.mapp.com/docs/url-encoding-and-what-characters-are-valid-in-a-uri
> + self.0.delete(&path).await?.nodata()?;
> + Ok(())
> + }
> +
> /// Return the status the Proxmox Backup Server instance
> pub async fn node_status(&self) -> Result<pbs_api_types::NodeStatus, Error> {
> let path = "/api2/extjs/nodes/localhost/status";
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote
2026-02-11 15:20 ` [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote Shan Shaji
@ 2026-02-13 13:20 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:20 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
Hi Shan, thanks for the patch!
Some notes inline.
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> Previously, when removing a remote, the token was still present in the
> remote configuration. When users tried to add the remote again, they
> received an error because a token with the same name already existed.
> To support deleting the token from the remote, add an optional
> parameter to the API endpoint.
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>
> changes since v2: No changes.
> changes since v1:
> - nit: inlined the id argument using the format string.
> - used `get` instead of `get_mut` inorder to access remote.
> - removed unnecessary `&` operator use.
>
> server/src/api/remotes.rs | 46 +++++++++++++++++++++++++++++++++++++--
> 1 file changed, 44 insertions(+), 2 deletions(-)
>
> diff --git a/server/src/api/remotes.rs b/server/src/api/remotes.rs
> index 298ad13..82b8469 100644
> --- a/server/src/api/remotes.rs
> +++ b/server/src/api/remotes.rs
> @@ -27,6 +27,7 @@ use crate::api::remote_updates;
> use crate::metric_collection;
> use crate::{connection, pbs_client};
>
> +use super::pbs;
> use super::pve;
> use super::rrd_common;
> use super::rrd_common::DataPoint;
> @@ -292,16 +293,57 @@ pub fn update_remote(
> input: {
> properties: {
> id: { schema: REMOTE_ID_SCHEMA },
> + "delete-token": {
> + type: bool,
> + description: "Optional boolean value to delete the token from remote.",
> + optional: true,
You can set 'default: false' and also remove 'type: bool' (since the
type is already clear from the handler function signature).
Also, I'd slightly rephrase the description to something like:
"Remove the API token used by Proxmox Datacenter Manager from the remote"
Both, the fact that the value is optional and that it is a bool should
be evident from the API schema, so there is no need to mention it again
in the description.
> + }
> },
> },
> access: {
> permission: &Permission::Privilege(&["resource"], PRIV_RESOURCE_MODIFY, false),
> },
> )]
> -/// List all the remotes this instance is managing.
> -pub fn remove_remote(id: String) -> Result<(), Error> {
> +/// Remove a remote that this instance is managing.
> +pub async fn remove_remote(id: String, delete_token: Option<bool>) -> Result<(), Error> {
With 'default: false', the parameter just becomes a `bool` instead of
`Option<bool>`
> + let _lock = pdm_config::remotes::lock_config()?;
> let (mut remotes, _) = pdm_config::remotes::config()?;
>
> + if delete_token.unwrap_or(false) {
... and you can remove this `.unwrap_or(false)`
The benefit of setting the default via the schema is that then it is
also automatically documented in the API viewer.
> + let remote = remotes
> + .get(&id)
> + .ok_or_else(|| http_err!(NOT_FOUND, "no such remote {id:?}"))?;
> +
> + let user = remote.authid.user();
> +
> + let short_delete_err = |err: proxmox_client::Error| {
> + format_err!("error deleting token: {}", err.source().unwrap_or(&err))
> + };
Since you copied this helper from `add_remote`, maybe also copy the doc
comment from there? Since it somewhat explains why this helper exists in
the first place.
> +
> + let token_name = remote
> + .authid
> + .tokenname()
> + .ok_or_else(|| format_err!("Unable to find the token for the remote {id:?}"))?;
> +
> + // connect to remote and delete the already existing token.
> + match remote.ty {
> + RemoteType::Pve => {
> + let client = pve::connect_or_login(remote).await?;
I don't think there is a benefit of using the `_or_login` variant here.
It's really only used when initially adding the remote, when one only
provides username/password in the wizard.
When removing the remote, we should have a token anyways (that we are
about to remove) - so rather use `connection::make_{pve,pbs}_client(remote)` here.
(unless I'm missing something)
> + client
> + .delete_token(user.as_str(), token_name.as_str())
> + .await
> + .map_err(short_delete_err)?
> + }
> + RemoteType::Pbs => {
> + let client = pbs::connect_or_login(remote).await?;
> + client
> + .delete_admin_token(user, token_name.as_str())
> + .await
> + .map_err(short_delete_err)?
> + }
> + };
> + }
> +
> if remotes.remove(&id).is_none() {
> http_bail!(NOT_FOUND, "no such entry {id:?}");
> }
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token
2026-02-11 15:20 ` [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token Shan Shaji
@ 2026-02-13 13:20 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:20 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>
> changes since v2: No changes.
> changes since v1:
> - reformated using `rustfmt`.
> - added doc comment.
>
> lib/pdm-client/src/lib.rs | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
> index 01ee6f7..ef534cc 100644
> --- a/lib/pdm-client/src/lib.rs
> +++ b/lib/pdm-client/src/lib.rs
> @@ -136,8 +136,15 @@ impl<T: HttpApiClient> PdmClient<T> {
> Ok(())
> }
>
> - pub async fn delete_remote(&self, remote: &str) -> Result<(), Error> {
> - let path = format!("/api2/extjs/remotes/remote/{remote}");
> + /// Deletes a remote, with optional support to also delete the associated token.
> + pub async fn delete_remote(
> + &self,
> + remote: &str,
> + delete_token: &Option<bool>,
This can just be `Option<bool>`.
In general, passing &Option<T> is often a bit of an antipattern, instead
it's more idiomatic to pass Option<&T>. If the caller has a &Option<T>,
they can always call Option::as_ref to get Option<&T> [1].
In this concrete case here, since `bool` is Copy [2], its best to just use
Option<bool>.
[1] https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref
[2] https://doc.rust-lang.org/std/marker/trait.Copy.html
> + ) -> Result<(), Error> {
> + let path = ApiPathBuilder::new(format!("/api2/extjs/remotes/remote/{remote}"))
> + .maybe_arg("delete-token", delete_token)
> + .build();
> self.0.delete(&path).await?.nodata()?;
> Ok(())
> }
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote
2026-02-11 15:20 ` [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote Shan Shaji
@ 2026-02-13 13:21 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:21 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
Hi,
some notes inline.
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>
> **note:** No changes since v2
>
> cli/client/src/remotes.rs | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/cli/client/src/remotes.rs b/cli/client/src/remotes.rs
> index 4145dac..0b4df3c 100644
> --- a/cli/client/src/remotes.rs
> +++ b/cli/client/src/remotes.rs
> @@ -116,12 +116,17 @@ async fn update_remote(id: String, updater: RemoteUpdater) -> Result<(), Error>
> input: {
> properties: {
> id: { schema: REMOTE_ID_SCHEMA },
> + "delete-token": {
> + type: bool,
> + optional: true,
> + description: "Remove the API-Token from remote."
Since this is the text shown in the help text in the CLI, it could be
nice to phrase more explicitly what exactly this flag is doing, for
instance:
"Remove the API token used by Proxmox Datacenter Manager from the remote"
Also, same here as in the other patch, you can drop the `type` and use
`default: false` ...
> + }
> }
> }
> )]
> -/// Add a new remote.
> -async fn delete_remote(id: String) -> Result<(), Error> {
> - client()?.delete_remote(&id).await?;
> +/// Delete a remote.
> +async fn delete_remote(id: String, delete_token: Option<bool>) -> Result<(), Error> {
... and then just have `delete_token: bool` here ...
> + client()?.delete_remote(&id, &delete_token).await?;
... and Some(&delete_token) here.
> Ok(())
> }
>
adding the default to the schema has the big benefit that these are
shown in the help text of the CLI tool:
Optional parameters:
--delete-token <boolean> (default=false)
Remove the API-Token from remote.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion
2026-02-11 15:20 ` [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion Shan Shaji
@ 2026-02-13 13:21 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:21 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
Hi Shan,
thanks for the patch.
In general, make sure to include the reference to the bugzilla entry in
the commit subject as well, as this is the source of truth that will be
used to assemble the changelog later. As far as I can tell, the "fix
#6914" should probably included in the UI commits as well as the ones
adding it to the CLI and API.
Some further notes inside.
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> diff --git a/ui/src/remotes/remove_remote.rs b/ui/src/remotes/remove_remote.rs
> new file mode 100644
> index 0000000..63b55ee
> --- /dev/null
> +++ b/ui/src/remotes/remove_remote.rs
> @@ -0,0 +1,117 @@
> +use std::rc::Rc;
> +
> +use yew::html::IntoEventCallback;
> +use yew::prelude::*;
> +use yew::virtual_dom::{VComp, VNode};
> +
> +use pwt::css::{AlignItems, FontColor, JustifyContent};
> +use pwt::prelude::*;
> +use pwt::widget::form::Checkbox;
> +use pwt::widget::{Button, Column, Container, Dialog, Fa, Row};
> +
> +use pwt_macros::builder;
> +
> +#[derive(PartialEq, Properties)]
> +#[builder]
> +pub struct RemoveRemote {
> + /// A callback for an action that needs to be confirmed by the user.
> + #[prop_or_default]
> + #[builder_cb(IntoEventCallback, into_event_callback, bool)]
> + pub on_confirm: Option<Callback<bool>>,
> +
> + /// A callback that will trigger if the user dismisses the dialog.
> + #[prop_or_default]
> + #[builder_cb(IntoEventCallback, into_event_callback, ())]
> + pub on_dismiss: Option<Callback<()>>,
> +}
> +
> +impl RemoveRemote {
> + pub fn new() -> Self {
> + yew::props!(Self {})
> + }
> +}
> +
> +pub enum Msg {
> + SelectCheckBox(bool),
> +}
> +
> +pub struct PdmRemoveRemote {
> + delete_token: bool,
> +}
as far as I can tell, neither Msg nor PdmRemoveRemote need to be `pub`
> +
> +impl Component for PdmRemoveRemote {
> + type Message = Msg;
> +
> + type Properties = RemoveRemote;
> +
> + fn create(_ctx: &Context<Self>) -> Self {
> + Self {
> + delete_token: false,
> + }
> + }
> +
> + fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
> + match msg {
> + Msg::SelectCheckBox(v) => {
> + self.delete_token = v;
> + true
> + }
> + }
> + }
> +
> + fn view(&self, ctx: &Context<Self>) -> Html {
> + let props = ctx.props();
> + let delete_token = self.delete_token;
> +
> + let on_confirm = props.on_confirm.clone();
> + let on_dismiss = props.on_dismiss.clone();
> +
> + Dialog::new(tr!("Confirm"))
> + .on_close(on_dismiss.clone())
> + .min_height(100)
> + .with_child(
> + Column::new()
> + .padding(4)
> + .gap(2)
> + .with_child(
> + Row::new()
> + .gap(2)
> + .class(AlignItems::Center)
> + .with_child(Container::new().class("pwt-message-sign").with_child(
> + Fa::new("exclamation-triangle").class(FontColor::Error),
> + ))
> + .with_child(tr!("Are you sure you want to remove this remote?")),
> + )
> + .with_child(
> + Checkbox::new()
> + .default(false)
> + .box_label(tr!("Delete API token from remote"))
> + .checked(self.delete_token)
> + .on_change(ctx.link().callback(|v| Msg::SelectCheckBox(v))),
as already discussed off-list, the alignment of the checkbox/text looks
a bit off. I suggested to align it the same way as the "Remove
Datastore" confirmation in PBS, there the checkbox's left border is
aligned with the start of the text above.
> + )
> + .with_child(
> + Row::new()
> + .gap(2)
> + .class(JustifyContent::Center)
> + .with_child(Button::new(tr!("Yes")).on_activate(move |_| {
> + if let Some(on_confirm) = &on_confirm {
> + on_confirm.emit(delete_token);
> + }
> + }))
> + .with_child(Button::new(tr!("No")).on_activate(move |_| {
> + if let Some(on_dismiss) = &on_dismiss {
> + on_dismiss.emit(());
> + }
> + })),
> + ),
> + )
> + .into()
> + }
> +}
> +
> +impl From<RemoveRemote> for VNode {
> + fn from(val: RemoveRemote) -> Self {
> + let comp = VComp::new::<PdmRemoveRemote>(Rc::new(val), None);
> + VNode::from(comp)
> + }
> +}
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote
2026-02-11 15:20 ` [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote Shan Shaji
@ 2026-02-13 13:21 ` Lukas Wagner
0 siblings, 0 replies; 15+ messages in thread
From: Lukas Wagner @ 2026-02-13 13:21 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
Hi Shan,
thanks for the patch. Some notes inline.
On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote:
> Inorder to allow deleting the remote API token from PDM, added optional
> boolean flag.
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>
> **note**: No changes since v2. This was not included in v1.
>
> cli/admin/src/remotes.rs | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/cli/admin/src/remotes.rs b/cli/admin/src/remotes.rs
> index edd3fd8..6702667 100644
> --- a/cli/admin/src/remotes.rs
> +++ b/cli/admin/src/remotes.rs
> @@ -217,16 +217,28 @@ fn update_remote(
> input: {
> properties: {
> id: { schema: REMOTE_ID_SCHEMA },
> + "delete-token": {
> + type: bool,
> + optional: true,
> + description: "Remove the API-Token from remote."
Same thing here that I already elaborated on in the client CLI tool:
- type
- default
- description
> + }
> }
> }
> )]
> -/// Add a new remote.
> -fn remove_remote(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> {
> - let param = json!({ "id": id });
> +/// Remove a new remote.
> +async fn remove_remote(
> + id: String,
> + delete_token: Option<bool>,
> + rpcenv: &mut dyn RpcEnvironment,
> +) -> Result<(), Error> {
> + let mut param = json!({ "id": id });
> + if delete_token.is_some() {
> + param["delete-token"] = delete_token.into();
> + }
>
> let info = &dc_api::remotes::API_METHOD_REMOVE_REMOTE;
> match info.handler {
> - ApiHandler::Sync(handler) => (handler)(param, info, rpcenv).map(drop),
> + ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await.map(drop),
> _ => unreachable!(),
> }
> }
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-02-13 13:21 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-11 15:20 [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Shan Shaji
2026-02-11 15:20 ` [PATCH datacenter-manager v3 1/6] server: pbs-client: add delete admin token method Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 2/6] server: api: add support to optionally delete token from remote Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 3/6] pdm-client: accept `delete-token` argument for deleting api token Shan Shaji
2026-02-13 13:20 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 4/6] cli: client: add `delete-token` option to delete token from remote Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH datacenter-manager v3 6/6] cli: admin: add `delete-token` option to delete token from remote Shan Shaji
2026-02-13 13:21 ` Lukas Wagner
2026-02-11 15:20 ` [PATCH proxmox v3 1/1] pve-api-types: generate missing `delete_token` method Shan Shaji
2026-02-13 13:19 ` [PATCH datacenter-manager/proxmox v3 0/7] fix #6914: add option to remove already existing token Lukas Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox