From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 3FD101FF16B for <inbox@lore.proxmox.com>; Thu, 6 Mar 2025 16:20:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E3990A443; Thu, 6 Mar 2025 16:20:35 +0100 (CET) Message-ID: <88535a55-62b4-4bc9-ad8b-9e147fb5371a@proxmox.com> Date: Thu, 6 Mar 2025 16:20:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: pve-devel@lists.proxmox.com References: <20250208054209.598307-1-thomas@atskinner.net> <20250208054209.598307-4-thomas@atskinner.net> Content-Language: en-US From: Mira Limbeck <m.limbeck@proxmox.com> In-Reply-To: <20250208054209.598307-4-thomas@atskinner.net> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.306 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 Subject: Re: [pve-devel] [PATCH access-control v3 1/1] fix #4234: add library functions for openid optional userinfo request X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> On 2/8/25 06:42, Thomas Skinner wrote: > Signed-off-by: Thomas Skinner <thomas@atskinner.net> > --- > src/PVE/API2/OpenId.pm | 6 +++++- > src/PVE/Auth/OpenId.pm | 7 +++++++ > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/API2/OpenId.pm b/src/PVE/API2/OpenId.pm > index 77410e6..456e96a 100644 > --- a/src/PVE/API2/OpenId.pm > +++ b/src/PVE/API2/OpenId.pm > @@ -170,7 +170,11 @@ __PACKAGE__->register_method ({ > > my ($config, $openid) = $lookup_openid_auth->($realm, $redirect_url); > > - my $info = $openid->verify_authorization_code($param->{code}, $private_auth_state); > + my $info = $openid->verify_authorization_code( > + $param->{code}, > + $private_auth_state, > + $config->{'disable-userinfo'} // 0, > + ); > my $subject = $info->{'sub'}; > > my $unique_name; > diff --git a/src/PVE/Auth/OpenId.pm b/src/PVE/Auth/OpenId.pm > index c8e4db9..6efa696 100755 > --- a/src/PVE/Auth/OpenId.pm > +++ b/src/PVE/Auth/OpenId.pm > @@ -63,6 +63,12 @@ sub properties { > pattern => '^[^\x00-\x1F\x7F <>#"]*$', # Prohibit characters not allowed in URI RFC 2396. > optional => 1, > }, > + "disable-userinfo" => { > + description => "Prevents querying the userinfo endpoint for claims values.", > + type => 'boolean', > + default => 0, > + optional => 1, > + }, I would prefer `query-userinfo` (or similar) and a default of `1` over `disable-userinfo` and a default of `0`. > }; > } > > @@ -78,6 +84,7 @@ sub options { > "acr-values" => { optional => 1 }, > default => { optional => 1 }, > comment => { optional => 1 }, > + "disable-userinfo" => { optional => 1 }, > }; > } > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel