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 A74DE1FF15C for ; Wed, 19 Feb 2025 15:15:39 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B1C1B2AE7F; Wed, 19 Feb 2025 15:15:33 +0100 (CET) Message-ID: <3ad05689-153f-4976-9eac-83bc2886abdb@proxmox.com> Date: Wed, 19 Feb 2025 15:14:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Markus Frank References: <20250122100901.74830-1-m.frank@proxmox.com> <20250122100901.74830-9-m.frank@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20250122100901.74830-9-m.frank@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.045 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. [dir.pm, proxmox.com] Subject: Re: [pve-devel] [PATCH manager v13 08/12] api: add resource map api endpoints for directories X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 22.01.25 um 11:08 schrieb Markus Frank: > Signed-off-by: Markus Frank Some minor nits, but otherwise: Reviewed-by: Fiona Ebner > diff --git a/PVE/API2/Cluster/Mapping/Dir.pm b/PVE/API2/Cluster/Mapping/Dir.pm > new file mode 100644 > index 00000000..5218241f > --- /dev/null > +++ b/PVE/API2/Cluster/Mapping/Dir.pm > @@ -0,0 +1,307 @@ > +package PVE::API2::Cluster::Mapping::Dir; > + > +use strict; > +use warnings; > + > +use Storable qw(dclone); > + > +use PVE::INotify; > +use PVE::JSONSchema qw(get_standard_option parse_property_string); Nit: parse_property_string is not used. > +use PVE::Mapping::Dir (); > +use PVE::RPCEnvironment; Missing use PVE::SectionConfig; because of PVE::SectionConfig::delete_from_config() below > +use PVE::Tools qw(extract_param); > + > +use base qw(PVE::RESTHandler); > + > +__PACKAGE__->register_method ({ > + name => 'index', > + path => '', > + method => 'GET', > + # only proxy if we give the 'check-node' parameter > + proxyto_callback => sub { > + my ($rpcenv, $proxyto, $param) = @_; > + return $param->{'check-node'} // 'localhost'; > + }, > + description => "List directory mapping", > + permissions => { > + description => "Only lists entries where you have 'Mapping.Modify', 'Mapping.Use' or". > + " 'Mapping.Audit' permissions on '/mapping/dir/'.", I know these are copied, but while we're at it: Style nit: dot should be on this line https://pve.proxmox.com/wiki/Perl_Style_Guide#Wrapping_Strings > + user => 'all', > + }, > + parameters => { > + additionalProperties => 0, > + properties => { > + 'check-node' => get_standard_option('pve-node', { > + description => "If given, checks the configurations on the given node for ". > + "correctness, and adds relevant diagnostics for the directory to the response.", Style nit: dot and space should be on this line _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel