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 527461FF16E
	for <inbox@lore.proxmox.com>; Mon, 17 Mar 2025 13:13:29 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id E3085193F;
	Mon, 17 Mar 2025 13:13:18 +0100 (CET)
Date: Mon, 17 Mar 2025 13:12:42 +0100
From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20250208054209.598307-1-thomas@atskinner.net>
 <20250208054209.598307-4-thomas@atskinner.net>
 <88535a55-62b4-4bc9-ad8b-9e147fb5371a@proxmox.com>
In-Reply-To: <88535a55-62b4-4bc9-ad8b-9e147fb5371a@proxmox.com>
MIME-Version: 1.0
User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid)
Message-Id: <1742213518.eiu0heftg2.astroid@yuna.none>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.044 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. [openid.pm]
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>
Cc: Thomas Skinner <thomas@atskinner.net>
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 March 6, 2025 4:20 pm, Mira Limbeck wrote:
> 
> 
> 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`.

that probably makes sense..

@Thomas - would you mind rebasing this and incorporating this last bit
of feedback, I think this is otherwise ready to be applied :)


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel