From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id CB0231FF0C0 for ; Wed, 18 Nov 2026 10:44:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 10729216A5; Wed, 18 Nov 2026 10:44:00 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox v2 06/63] notify: matcher: drop unused field matcher verifiers Date: Wed, 18 Nov 2026 10:42:50 +0100 Message-ID: <20261118094348.273646-7-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118094348.273646-1-l.wagner@proxmox.com> References: <20261118094348.273646-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794995035547 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.201 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: JNOOGTUS6U4TUTGSETVOTDP7VTXNTQR5 X-Message-ID-Hash: JNOOGTUS6U4TUTGSETVOTDP7VTXNTQR5 X-MailFrom: l.wagner@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: These were never used, so they can be dropped. The schema is enforced during deserialization using a regex, and when serializing, the value is constructed from Rust types, so it is bound to be valid. This change also lets us drop the anyhow dependency completely. Signed-off-by: Lukas Wagner --- proxmox-notify/Cargo.toml | 1 - proxmox-notify/src/matcher/field.rs | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml index 8968a14f8..2c085ae68 100644 --- a/proxmox-notify/Cargo.toml +++ b/proxmox-notify/Cargo.toml @@ -12,7 +12,6 @@ repository.workspace = true rust-version.workspace = true [dependencies] -anyhow.workspace = true const_format.workspace = true handlebars = { workspace = true } http = { workspace = true, optional = true } diff --git a/proxmox-notify/src/matcher/field.rs b/proxmox-notify/src/matcher/field.rs index 0e145f81b..f609421ce 100644 --- a/proxmox-notify/src/matcher/field.rs +++ b/proxmox-notify/src/matcher/field.rs @@ -88,9 +88,7 @@ pub mod inline { use const_format::concatcp; - use proxmox_schema::{ - ApiStringFormat, Schema, StringSchema, api_types::SAFE_ID_REGEX_STR, const_regex, - }; + use proxmox_schema::{api_types::SAFE_ID_REGEX_STR, const_regex}; use super::*; @@ -98,20 +96,6 @@ pub mod inline { pub MATCH_FIELD_ENTRY_REGEX = concatcp!(r"^(?:(exact|regex):)?(", SAFE_ID_REGEX_STR, r")=(.*)$"); } - pub const MATCH_FIELD_ENTRY_FORMAT: ApiStringFormat = - ApiStringFormat::VerifyFn(verify_inline_field_matcher); - - fn verify_inline_field_matcher(s: &str) -> Result<(), anyhow::Error> { - let _: InlineFieldMatcher = s.parse()?; - Ok(()) - } - - pub const MATCH_FIELD_ENTRY_SCHEMA: Schema = StringSchema::new("Match metadata field.") - .format(&MATCH_FIELD_ENTRY_FORMAT) - .min_length(1) - .max_length(1024) - .schema(); - /// Check if the notification metadata fields match /// This is a wrapper that serializes into an inline format that can be used /// in a section config key-value pair. -- 2.47.3