From 3b635953fb1fabf3406e2b3025ee021ea6338018 Mon Sep 17 00:00:00 2001 From: Jason Hansel Date: Tue, 5 Dec 2023 12:30:44 -0500 Subject: [PATCH] Allow disabling OnCore auth --- matchminer/security.py | 6 +++++- matchminer/settings.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/matchminer/security.py b/matchminer/security.py index 169d55b..f5905c8 100644 --- a/matchminer/security.py +++ b/matchminer/security.py @@ -19,7 +19,7 @@ from bson.objectid import ObjectId from matchminer import database -from matchminer.settings import ONCORE_CURATION_AUTH_TOKEN +from matchminer.settings import ONCORE_CURATION_AUTH_TOKEN, DISABLE_ONCORE_AUTH logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s', ) @@ -129,6 +129,10 @@ def authorize_oncore_curation(request): :return: {bool} True if user is not authenticated. False if user is authenticated """ + if DISABLE_ONCORE_AUTH: + logging.info("Curation UI auth disabled") + return False + user_id = request.cookies.get('user_id') if user_id is None: return True diff --git a/matchminer/settings.py b/matchminer/settings.py index 5c96bb2..146a25e 100644 --- a/matchminer/settings.py +++ b/matchminer/settings.py @@ -21,6 +21,7 @@ SLS_URL = "" SAML_SETTINGS = "" NO_AUTH = "" +DISABLE_ONCORE_AUTH = False WELCOME_EMAIL = "" API_PORT = "" API_TOKEN = ""