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 E94CA1FF137 for ; Tue, 31 Mar 2026 13:16:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0D01019041; Tue, 31 Mar 2026 13:17:15 +0200 (CEST) Message-ID: Date: Tue, 31 Mar 2026 13:17:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox v4 2/8] pbs-api-types: move over NodeConfig and related api type from PBS To: Christian Ebner , pbs-devel@lists.proxmox.com References: <20260327121319.628881-1-c.ebner@proxmox.com> <20260327121319.628881-3-c.ebner@proxmox.com> Content-Language: en-US From: Hannes Laimer In-Reply-To: <20260327121319.628881-3-c.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774955776382 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.083 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 Message-ID-Hash: WTJ7KBUC22BBIVLC354YZKE4JM6NZTPL X-Message-ID-Hash: WTJ7KBUC22BBIVLC354YZKE4JM6NZTPL X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2026-03-27 13:12, Christian Ebner wrote: > In preparation for refactoring the node config in PBS. > > In order to move over the code, the previously used > proxmox_backup::tools::config::from_property_string() > helpers are replaced by analogous implementations by inlining the > serde_json::from_value() calls. > > Further, the NodeConfig::validate() was only used by the node's > save_config() implementation and has therefore been inlined on the > PBS side to avoid a dependency on openssl crate. > > Signed-off-by: Christian Ebner > Reviewed-by: Fabian Grünbichler > --- [..] > +impl Iterator for AcmeDomainIter<'_> { > + type Item = Result; > + > + fn next(&mut self) -> Option { > + let domain = loop { > + let index = self.index; > + self.index += 1; > + > + let domain = match index { > + 0 => self.config.acmedomain0.as_deref(), > + 1 => self.config.acmedomain1.as_deref(), > + 2 => self.config.acmedomain2.as_deref(), > + 3 => self.config.acmedomain3.as_deref(), > + 4 => self.config.acmedomain4.as_deref(), > + _ => return None, > + }; > + > + if let Some(domain) = domain { > + break domain; > + } > + }; > + > + Some( > + AcmeDomain::API_SCHEMA > + .parse_property_string(domain) > + .and_then(|domain| Ok(serde_json::from_value(domain)?)), the `?` is only for error conversion, an explicit ``` - .and_then(|domain| Ok(serde_json::from_value(domain)?)), + .and_then(|value| { + serde_json::from_value(value).map_err(|err| err.into()) + }), ``` might be better. either way, very nit and very minor > + ) > + } > +}