Skip to content

Commit

Permalink
allow c3hub users to appear in no-limit list
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 24, 2024
1 parent 37e154e commit 803cab1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/sso/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conf import CONFIG
from util.sso.c3hub import get_c3hub_userid, get_c3hub_username
from util.sso.c3hub import check_c3hub_no_limit, get_c3hub_userid, get_c3hub_username
from util.sso.c3voc import (
check_c3voc_allowed_login,
check_c3voc_is_admin,
Expand All @@ -26,7 +26,7 @@
"functions": {
"is_admin": lambda json: False,
"login_allowed": lambda json: True,
"no_limit": lambda json: False,
"no_limit": check_c3hub_no_limit,
"userid": get_c3hub_userid,
"username": get_c3hub_username,
},
Expand Down
4 changes: 4 additions & 0 deletions util/sso/c3hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ def get_c3hub_userid(userinfo_json):

def get_c3hub_username(userinfo_json):
return "{} (38C3)".format(userinfo_json["username"])


def check_c3hub_no_limit(userinfo_json):
return f"c3hub:{userinfo_json['username'].lower()}" in CONFIG["NO_LIMIT_USERS"]

0 comments on commit 803cab1

Please sign in to comment.