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 734A31FF183 for ; Wed, 22 Oct 2025 15:11:06 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C9F661889E; Wed, 22 Oct 2025 15:11:32 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Date: Wed, 22 Oct 2025 15:11:22 +0200 Message-ID: <20251022131126.358790-7-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251022131126.358790-1-s.sterz@proxmox.com> References: <20251022131126.358790-1-s.sterz@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761138682005 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.056 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 Subject: [pdm-devel] [PATCH yew-comp v2 2/2] http_helpers: reload LocalAclTree when logging in or refreshing a ticket X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" so the ui renders ui elements appropriatelly for a newly authenticated user or if the user's permissions have changed since the last ticket refresh. Signed-off-by: Shannon Sterz --- src/http_helpers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/http_helpers.rs b/src/http_helpers.rs index 94cc078..ed6671f 100644 --- a/src/http_helpers.rs +++ b/src/http_helpers.rs @@ -15,6 +15,7 @@ use proxmox_client::HttpApiClient; use proxmox_login::{ticket::Validity, Authentication, TicketResult}; use yew::Callback; +use crate::acl_context::LocalAclTree; use crate::{json_object_to_query, ExistingProduct, HttpClientWasm, ProjectInfo}; static LAST_NOTIFY_EPOCH: AtomicU32 = AtomicU32::new(0); @@ -129,6 +130,7 @@ async fn ticket_refresh_loop() { Ok(TicketResult::Full(auth)) | Ok(TicketResult::HttpOnly(auth)) => { log::info!("ticket_refresh_loop: Got ticket update."); client.set_auth(auth.clone()); + LocalAclTree::load().await; } _ => { /* do nothing */ } } @@ -189,11 +191,13 @@ pub async fn http_login( TicketResult::Full(auth) => { client.set_auth(auth.clone()); update_global_client(client); + LocalAclTree::load().await; Ok(TicketResult::Full(auth)) } TicketResult::HttpOnly(auth) => { client.set_auth(auth.clone()); update_global_client(client); + LocalAclTree::load().await; Ok(TicketResult::HttpOnly(auth)) } challenge => Ok(challenge), @@ -209,6 +213,7 @@ pub async fn http_login_tfa( let auth = client.login_tfa(challenge, request).await?; client.set_auth(auth.clone()); update_global_client(client); + LocalAclTree::load().await; Ok(auth) } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel