Skip to content

Commit

Permalink
Allow disabling OnCore auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonhansel committed Dec 5, 2023
1 parent 088b483 commit 3b63595
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion matchminer/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', )

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions matchminer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
SLS_URL = ""
SAML_SETTINGS = ""
NO_AUTH = ""
DISABLE_ONCORE_AUTH = False
WELCOME_EMAIL = ""
API_PORT = ""
API_TOKEN = ""
Expand Down

0 comments on commit 3b63595

Please sign in to comment.