[pdm-devel] [PATCH datacenter-manager v2 6/6] cli: admin: add `delete-token` option to delete token from remote
Shan Shaji
s.shaji at proxmox.com
Wed Dec 10 17:37:35 CET 2025
Inorder to allow deleting the remote API token from PDM, added optional
boolean flag.
Signed-off-by: Shan Shaji <s.shaji at proxmox.com>
---
**note**: This patch was not included in v1 and was never reviewed.
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 d1a3ede..b28bdd5 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
More information about the pdm-devel
mailing list