From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 0D01A1FF16B for ; Fri, 26 Sep 2025 11:13:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F3B09BC45; Fri, 26 Sep 2025 11:14:24 +0200 (CEST) Date: Fri, 26 Sep 2025 11:14:18 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Datacenter Manager development discussion References: <20250924145137.407070-1-s.sterz@proxmox.com> <20250924145137.407070-3-s.sterz@proxmox.com> In-Reply-To: <20250924145137.407070-3-s.sterz@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1758876889.gqto42cvpv.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758878046862 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [types.rs, proxmox.com] Subject: Re: [pdm-devel] [PATCH proxmox 2/3] access-control: move `ApiTokenSecret` to types module 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On September 24, 2025 4:51 pm, Shannon Sterz wrote: > this is technically a breaking change, but so far this type has no > users > > Signed-off-by: Shannon Sterz > --- > proxmox-access-control/src/token_shadow.rs | 9 --------- > proxmox-access-control/src/types.rs | 12 +++++++++++- > 2 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/proxmox-access-control/src/token_shadow.rs b/proxmox-access-control/src/token_shadow.rs > index 60b71ac9..46397edb 100644 > --- a/proxmox-access-control/src/token_shadow.rs > +++ b/proxmox-access-control/src/token_shadow.rs > @@ -1,7 +1,6 @@ > use std::collections::HashMap; > > use anyhow::{bail, format_err, Error}; > -use serde::{Deserialize, Serialize}; > use serde_json::{from_value, Value}; > > use proxmox_auth_api::types::Authid; > @@ -9,14 +8,6 @@ use proxmox_product_config::{open_api_lockfile, replace_config, ApiLockGuard}; > > use crate::init::{token_shadow, token_shadow_lock}; > > -#[derive(Serialize, Deserialize)] > -#[serde(rename_all = "kebab-case")] > -/// ApiToken id / secret pair > -pub struct ApiTokenSecret { > - pub tokenid: Authid, > - pub secret: String, > -} > - > // Get exclusive lock > fn lock_config() -> Result { > open_api_lockfile(token_shadow_lock(), None, true) > diff --git a/proxmox-access-control/src/types.rs b/proxmox-access-control/src/types.rs > index ea64d333..a146700d 100644 > --- a/proxmox-access-control/src/types.rs > +++ b/proxmox-access-control/src/types.rs > @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; > > use const_format::concatcp; > > -use proxmox_auth_api::types::{Authid, Userid, PROXMOX_TOKEN_ID_SCHEMA}; > +use proxmox_auth_api::types::{Authid, Tokenname, Userid, PROXMOX_TOKEN_ID_SCHEMA}; > use proxmox_schema::{ > api, > api_types::{COMMENT_SCHEMA, SAFE_ID_REGEX_STR, SINGLE_LINE_COMMENT_FORMAT}, > @@ -147,6 +147,16 @@ impl ApiToken { > } > } > > +#[api] > +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] > +#[serde(rename_all = "kebab-case")] > +/// ApiToken id / secret pair > +pub struct ApiTokenSecret { > + pub tokenid: Authid, > + /// The secret associated with the token. > + pub secret: String, > +} > + almost missed the hunk that makes the serialization consistent with PBS and old PDM, since it comes in a later patch ;) > #[api( > properties: { > userid: { > -- > 2.47.3 > > > > _______________________________________________ > pdm-devel mailing list > pdm-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel > > > _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel