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 481921FF09B for ; Mon, 14 Sep 2026 14:32:49 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C2233214DE; Mon, 14 Sep 2026 14:32:48 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox v3 0/2] check privilege paths during compilation Date: Mon, 14 Sep 2026 14:30:43 +0200 Message-ID: <20260914123243.3216993-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.318 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) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes 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: XE7GU3TW547RUDBDU3IER2SEQPXP75NE X-Message-ID-Hash: XE7GU3TW547RUDBDU3IER2SEQPXP75NE X-MailFrom: d.csapak@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 Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This adds a check in proxmox-router to check the used parameter interpolations in the privilege paths of api calls for existence. changes from v2: * rebase on master * drop applied patch * correctly check strings that are smaller than 3 characters * also check UserParam and WithParam parameter for existence * factor out byte slice compare check from proxmox-schema and use that * add more tests changes from rfc/v1: * rebase on master * require Resource.Audit on /resource/{remote} for each remote, filter out where this isn't the case instead of requiring it on /resource Dominik Csapak (2): add proxmox-const-utils crate, factor out checks from proxmox-schema router: compile time check privilege path parameters for existence Cargo.toml | 2 + proxmox-const-utils/Cargo.toml | 13 ++ proxmox-const-utils/debian/changelog | 5 + proxmox-const-utils/debian/control | 30 +++ proxmox-const-utils/debian/copyright | 18 ++ proxmox-const-utils/debian/debcargo.toml | 7 + proxmox-const-utils/src/lib.rs | 66 +++++++ proxmox-router/Cargo.toml | 1 + proxmox-router/src/router.rs | 235 ++++++++++++++++++++++- proxmox-schema/Cargo.toml | 1 + proxmox-schema/src/const_test_utils.rs | 25 --- proxmox-schema/src/lib.rs | 2 - proxmox-schema/src/schema.rs | 10 +- 13 files changed, 382 insertions(+), 33 deletions(-) create mode 100644 proxmox-const-utils/Cargo.toml create mode 100644 proxmox-const-utils/debian/changelog create mode 100644 proxmox-const-utils/debian/control create mode 100644 proxmox-const-utils/debian/copyright create mode 100644 proxmox-const-utils/debian/debcargo.toml create mode 100644 proxmox-const-utils/src/lib.rs delete mode 100644 proxmox-schema/src/const_test_utils.rs -- 2.47.3