This is an automated email from the ASF dual-hosted git repository.

arm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 58dfcad  #283: Make sure original admin ID is preserved across 
multiple masquerades
58dfcad is described below

commit 58dfcad9a0aad6c2ab94185bb7134f48e1f3b9a3
Author: Alastair McFarlane <[email protected]>
AuthorDate: Wed Feb 4 13:52:21 2026 +0000

    #283: Make sure original admin ID is preserved across multiple masquerades
---
 atr/admin/__init__.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/atr/admin/__init__.py b/atr/admin/__init__.py
index 8991711..278c9c7 100644
--- a/atr/admin/__init__.py
+++ b/atr/admin/__init__.py
@@ -146,6 +146,9 @@ async def browse_as_post(session: web.Committer, 
browse_form: BrowseAsUserForm)
     committee_data = await apache.get_active_committee_data()
     ldap_data = ldap_params.results_list[0]
     log.info(f"Current ASFQuart session data: {current_session}")
+    admin_id = current_session.uid
+    if "admin" in current_session.metadata:
+        admin_id = current_session.metadata["admin"]
     new_session_data = _session_data(
         ldap_data,
         new_uid,
@@ -154,10 +157,10 @@ async def browse_as_post(session: web.Committer, 
browse_form: BrowseAsUserForm)
         committee_data,
         bind_dn,
         bind_password,
-        {"admin": current_session.uid},
+        {"admin": admin_id},
     )
     log_safe_data = _log_safe_session_data(
-        ldap_data, new_uid, ldap_projects_data, committee_data, bind_dn, 
bind_password, {"admin": current_session.uid}
+        ldap_data, new_uid, ldap_projects_data, committee_data, bind_dn, 
bind_password, {"admin": admin_id}
     )
     log.info(f"New Quart cookie (not ASFQuart session) data: {log_safe_data}")
     asfquart.session.clear()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to