From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 59EC11FF174 for ; Mon, 2 Sep 2024 10:05:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D268A36895; Mon, 2 Sep 2024 10:05:48 +0200 (CEST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725061337; x=1725666137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k6vzw1Mbd6+whaX/9YB6L4OSCGEYxjiy3NetOuybzvE=; b=gh3m+hipc99ZlxZZwUDvsOiBUgacHlxEOdecofQRGJeO7efgClB1G1/UB2CRAghW8k zG1LBzZ0ZZe0cFDJC/QJ1zCObE65o7HkptYpsgoIGKlHKYHqb9wKtohjgTnAdPvxXR1S PtqI/vAebw7aORxP1SHvfNNy9NNKxOtQ0TFxFkmh0APkp4B/3xTuLIE/3gJtgSInfcUb BoAFuCb0jdsP+BZnO/maLJcSvj/ucjUNp/dy9GO2igqFy/w5gh5Weqtk+9IojqaUg3Y6 3OfVutRe3XZtMkLK03pkPH9I43+XsJAJ3ScPJzeWElfU1l7ZQ311K8ecVb/CSbwGZ4RI nzJw== X-Gm-Message-State: AOJu0Yy6KgB9f3LGL44jmWV2c3caujFa59dv6MpJ2IWyBFhKqqVn+Xi4 geZOERQY/05CZ5BQ2YLULpRY32C+lSq5qzyiK7C1tISX1B0d3rv6QdcrGg== X-Google-Smtp-Source: AGHT+IEjGNQpbCOGTy6gNUq2a5WPYuGfZAJdSAFz0m+QkyM9+GYbXxJjResJQo3tKyrtPFXK6OJiYA== X-Received: by 2002:a05:690c:6384:b0:664:4b9c:3de with SMTP id 00721157ae682-6d40de67fbdmr39877037b3.13.1725057301849; Fri, 30 Aug 2024 15:35:01 -0700 (PDT) From: Thomas Skinner To: pve-devel@lists.proxmox.com Date: Fri, 30 Aug 2024 17:34:30 -0500 Message-Id: <20240830223430.237913-2-thomas@atskinner.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240830223430.237913-1-thomas@atskinner.net> References: <20240830223430.237913-1-thomas@atskinner.net> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.002 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 FREEMAIL_FORGED_FROMDOMAIN 0.001 2nd level domains in From and EnvelopeFrom freemail headers are different FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider HEADER_FROM_DIFFERENT_DOMAINS 0.25 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust RCVD_IN_MSPIKE_H3 0.001 Good reputation (+3) RCVD_IN_MSPIKE_WL 0.001 Mailspike good senders 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs] X-Mailman-Approved-At: Mon, 02 Sep 2024 10:05:47 +0200 Subject: [pve-devel] [PATCH openid 1/1] fix #4234: openid: make userinfo request optional 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 Cc: Thomas Skinner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Thomas Skinner --- proxmox-openid/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proxmox-openid/src/lib.rs b/proxmox-openid/src/lib.rs index fe65fded..7cef06e0 100644 --- a/proxmox-openid/src/lib.rs +++ b/proxmox-openid/src/lib.rs @@ -195,7 +195,7 @@ impl OpenIdAuthenticator { &self, code: &str, private_auth_state: &PrivateAuthState, - ) -> Result<(CoreIdTokenClaims, GenericUserInfoClaims), Error> { + ) -> Result<(CoreIdTokenClaims, Option), Error> { let code = AuthorizationCode::new(code.to_string()); // Exchange the code with a token. let token_response = self @@ -213,11 +213,14 @@ impl OpenIdAuthenticator { .claims(&id_token_verifier, &private_auth_state.nonce) .map_err(|err| format_err!("Failed to verify ID token: {}", err))?; - let userinfo_claims: GenericUserInfoClaims = self + let userinfo_claims: Option = match self .client .user_info(token_response.access_token().to_owned(), None)? .request(http_client) - .map_err(|err| format_err!("Failed to contact userinfo endpoint: {}", err))?; + { + Ok(claims) => Some(claims), + Err(..) => None, + }; Ok((id_token_claims.clone(), userinfo_claims)) } -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel