Skip to content

Commit

Permalink
Merge pull request #33 from dfci/fix-curate
Browse files Browse the repository at this point in the history
Allow disabling OnCore auth
  • Loading branch information
jasonhansel authored Dec 5, 2023
2 parents 38c7dff + 3b63595 commit b3f70c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion matchminer/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from urllib.parse import urlparse
from bson import ObjectId

from onelogin.saml2.auth import OneLogin_Saml2_Auth
import simplejson as json
import oncotreenx
from requests import post, get
Expand Down Expand Up @@ -653,6 +652,7 @@ def init_saml_auth(req):
json_data_file.close()

# create auth object with required settings.
from onelogin.saml2.auth import OneLogin_Saml2_Auth
auth = OneLogin_Saml2_Auth(req, settings_data)

# return it
Expand Down
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 b3f70c7

Please sign in to comment.