From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 550731FF17A for ; Tue, 9 Dec 2025 10:37:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ADB2A20D23; Tue, 9 Dec 2025 10:37:51 +0100 (CET) Mime-Version: 1.0 Date: Tue, 09 Dec 2025 10:37:18 +0100 Message-Id: To: "Shan Shaji" X-Mailer: aerc 0.20.0 References: <20251205180447.441371-1-s.shaji@proxmox.com> <20251205180447.441371-7-s.shaji@proxmox.com> In-Reply-To: <20251205180447.441371-7-s.shaji@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765273032869 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.091 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH proxmox 1/1] pve-api-types: generate missing `delete_token` method X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Cc: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" other than the nits in-line, consider this: Reviewed-by: Shannon Sterz note i didn't test this, but other then the nits the code looks ok to me. On Fri Dec 5, 2025 at 7:04 PM CET, Shan Shaji wrote: > 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 > --- > pve-api-types/generate.pl | 1 + > pve-api-types/src/generated/code.rs | 11 +++++++++++ > 2 files changed, 12 insertions(+) > > diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl > index 3cebe321..ee02d91b 100755 > --- a/pve-api-types/generate.pl > +++ b/pve-api-types/generate.pl > @@ -359,6 +359,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 f364f9cd..3de2e554 100644 > --- a/pve-api-types/src/generated/code.rs > +++ b/pve-api-types/src/generated/code.rs > @@ -450,6 +450,11 @@ pub trait PveClient { > Err(Error::Other("get_apt_repositories not implemented")) > } > > + /// 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 package changelogs. > async fn get_package_changelog( > &self, > @@ -1089,6 +1094,12 @@ where > Ok(self.0.get(url).await?.expect_json()?.data) > } > > + /// 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/{userid}/token/{tokenid}"); > + self.0.delete(url).await?.nodata() > + } > + > /// Get package changelogs. > async fn get_package_changelog( > &self, _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel