From 21804121795cff1bd25c0ef1263ebc5ab892d960 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:23:50 +0100 Subject: [PATCH] DAQ: authenticate for super users added --- daq/src/aaredaq/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daq/src/aaredaq/auth.py b/daq/src/aaredaq/auth.py index 7690ff63..e293f9ae 100644 --- a/daq/src/aaredaq/auth.py +++ b/daq/src/aaredaq/auth.py @@ -21,7 +21,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60 * 7 # 1 week SESSION_EXPIRE_SECONDS = 60 * 10 STAFF_GROUP = "unx-MXgroup" - +SUPER_USERS = ["e10019", "e11206", "e18147"] class TokenData(BaseModel): sub: str # Username @@ -42,9 +42,9 @@ def authenticate_user(cfg: BeamlineConfig, form_data: OAuth2PasswordRequestForm) groups = os.getgrouplist(user_info.pw_name, user_info.pw_gid) supplementary_groups = [grp.getgrgid(g).gr_name.lower() for g in groups] - + super_user = form_data.username in SUPER_USERS pgroups = [group for group in supplementary_groups if group.startswith('p')] - staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups + staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups or super_user token = TokenData(sub=form_data.username, pgroups=pgroups, staff=staff,