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 C493E1FF2D9 for ; Wed, 10 Jul 2024 09:49:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BE50A3E86; Wed, 10 Jul 2024 09:49:25 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 10 Jul 2024 09:48:51 +0200 Message-Id: <20240710074856.27706-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs, pull.rs, proxmox.com, manifest.rs, helper.rs, mount.rs, datastore.rs, verify.rs, main.rs, diff.rs, restore.rs, catalog.rs] Subject: [pbs-devel] [PATCH v2 proxmox-backup 0/5] introduce dedcated archive name api type X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" There is currently no dedicated api type for the archive names, given as input parameters to several methods. This patches introduce a dedicated type for archive names, in order to collect the code for checks and eventual mappings into one location and reduce possible unintentional misuse by passing incorrect argument values to the functions and methods consuming the archive names. As a positive side effect, the mapping now allows also for the server archive type extensions to be optionally passed as input to several commands, e.g. ``` proxmox-backup-client restore .pxar.didx ``` is now valid, being equal to ``` proxmox-backup-client restore ``` Note that this patch series currently depends on this patch being applied beforehand: https://lists.proxmox.com/pipermail/pbs-devel/2024-July/010059.html Changes since version 1 (thanks @Gabriel): - Rebased onto current master - Added unit tests for archive name parsing - Added missing check for invalid archive names ending with '/' - Inlined variable names for format strings - Import implemented traits at top Christian Ebner (5): datastore: move `ArchiveType` to PBS api types crate api types: introduce `BackupArchiveName` type client/server: use dedicated api type for all archive names client: drop unused parse_archive_type helper api types: add unit tests for backup archive name parsing pbs-api-types/src/datastore.rs | 189 ++++++++++++++++++++++++++- pbs-client/src/backup_reader.rs | 14 +- pbs-client/src/backup_writer.rs | 24 ++-- pbs-client/src/tools/mod.rs | 24 ++-- pbs-datastore/src/datastore.rs | 6 +- pbs-datastore/src/manifest.rs | 50 +++---- pbs-datastore/src/snapshot_reader.rs | 4 +- proxmox-backup-client/src/catalog.rs | 25 ++-- proxmox-backup-client/src/helper.rs | 7 +- proxmox-backup-client/src/main.rs | 128 +++++++++--------- proxmox-backup-client/src/mount.rs | 33 ++--- proxmox-file-restore/src/main.rs | 20 ++- src/api2/admin/datastore.rs | 60 ++++----- src/api2/backup/mod.rs | 3 +- src/api2/reader/mod.rs | 7 +- src/api2/tape/restore.rs | 10 +- src/backup/verify.rs | 7 +- src/bin/proxmox_backup_debug/diff.rs | 16 +-- src/server/pull.rs | 20 +-- 19 files changed, 418 insertions(+), 229 deletions(-) -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel