From d3b3ed3691628dced318f65f0f172bbc90decbfa Mon Sep 17 00:00:00 2001 From: Mikko Nieminen Date: Fri, 5 Jan 2024 11:42:22 +0100 Subject: [PATCH] temporarily disable saml support (#597, #880) --- config/settings/base.py | 6 ++- config/urls.py | 95 ++++++++++++++++++++++------------------- projectroles/models.py | 2 +- requirements/base.txt | 5 ++- 4 files changed, 60 insertions(+), 48 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 4210ab1b..00ed6d5e 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -65,7 +65,7 @@ 'dal', # For user search combo box 'dal_select2', 'dj_iconify.apps.DjIconifyConfig', # Iconify for SVG icons - 'django_saml2_auth', # SAML2 support + # 'django_saml2_auth', # SAML2 support, temp disabled (see #597, #880) ] # Project apps @@ -433,7 +433,9 @@ # ------------------------------------------------------------------------------ -ENABLE_SAML = env.bool('ENABLE_SAML', False) +# SAML support temporarily disabled (see #597, #880) +ENABLE_SAML = False # env.bool('ENABLE_SAML', False) + SAML2_AUTH = { # Required setting # Pysaml2 Saml client settings diff --git a/config/urls.py b/config/urls.py index 6a66b18a..dc07fb4d 100644 --- a/config/urls.py +++ b/config/urls.py @@ -7,53 +7,59 @@ from django.urls import path from django.views import defaults as default_views -import django_saml2_auth.views +# SAML support temporarily disabled (see #597, #880) +# import django_saml2_auth.views # Projectroles dependency from projectroles.views import HomeView -urlpatterns = [ - path(route='', view=HomeView.as_view(), name='home'), - # Django Admin, use {% url 'admin:index' %} - path(settings.ADMIN_URL, admin.site.urls), - # Login and logout - path( - route='login/', - view=auth_views.LoginView.as_view(template_name='users/login.html'), - name='login', - ), - path(route='logout/', view=auth_views.logout_then_login, name='logout'), - # Auth - path('api/auth/', include('knox.urls')), - # Iconify SVG icons - path('icons/', include('dj_iconify.urls')), - # Projectroles URLs - path('project/', include('projectroles.urls')), - # Admin Alerts URLs - path('alerts/adm/', include('adminalerts.urls')), - # App Alerts URLs - path('alerts/app/', include('appalerts.urls')), - # Background Jobs URLs - path('bgjobs/', include('bgjobs.urls')), - # Filesfolders URLs - path('files/', include('filesfolders.urls')), - # django-db-file-storage URLs (obfuscated for users) - path('DJANGO-DB-FILE-STORAGE-CHANGE-ME/', include('db_file_storage.urls')), - # Site Info URLs - path('siteinfo/', include('siteinfo.urls')), - # SODAR Cache app - path('cache/', include('sodarcache.urls')), - # Timeline URLs - path('timeline/', include('timeline.urls')), - # API Tokens URLs - path('tokens/', include('tokens.urls')), - # User Profile URLs - path('user/', include('userprofile.urls')), - # Example project app URLs - path('examples/project/', include('example_project_app.urls')), - # Example site app URLs - path('examples/site/', include('example_site_app.urls')), +urlpatterns = ( + [ + path(route='', view=HomeView.as_view(), name='home'), + # Django Admin, use {% url 'admin:index' %} + path(settings.ADMIN_URL, admin.site.urls), + # Login and logout + path( + route='login/', + view=auth_views.LoginView.as_view(template_name='users/login.html'), + name='login', + ), + path(route='logout/', view=auth_views.logout_then_login, name='logout'), + # Auth + path('api/auth/', include('knox.urls')), + # Iconify SVG icons + path('icons/', include('dj_iconify.urls')), + # Projectroles URLs + path('project/', include('projectroles.urls')), + # Admin Alerts URLs + path('alerts/adm/', include('adminalerts.urls')), + # App Alerts URLs + path('alerts/app/', include('appalerts.urls')), + # Background Jobs URLs + path('bgjobs/', include('bgjobs.urls')), + # Filesfolders URLs + path('files/', include('filesfolders.urls')), + # django-db-file-storage URLs (obfuscated for users) + path( + 'DJANGO-DB-FILE-STORAGE-CHANGE-ME/', include('db_file_storage.urls') + ), + # Site Info URLs + path('siteinfo/', include('siteinfo.urls')), + # SODAR Cache app + path('cache/', include('sodarcache.urls')), + # Timeline URLs + path('timeline/', include('timeline.urls')), + # API Tokens URLs + path('tokens/', include('tokens.urls')), + # User Profile URLs + path('user/', include('userprofile.urls')), + # Example project app URLs + path('examples/project/', include('example_project_app.urls')), + # Example site app URLs + path('examples/site/', include('example_site_app.urls')), + # SAML support temporarily disabled (see #597, #880) + ''' # These are the SAML2 related URLs. You can change "^saml2_auth/" regex to # any path you want, like "^sso_auth/", "^sso_login/", etc. (required) path('saml2_auth/', include('django_saml2_auth.urls')), @@ -69,7 +75,10 @@ path('sso/logout/', django_saml2_auth.views.signout), # The following line will replace the default admin user logout with the signout page (optional) path('sso/admin/logout/', django_saml2_auth.views.signout), -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + ''', + ] + + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +) if settings.DEBUG: diff --git a/projectroles/models.py b/projectroles/models.py index 290e4342..3ec8678f 100644 --- a/projectroles/models.py +++ b/projectroles/models.py @@ -12,7 +12,7 @@ from django.db import models from django.db.models import Q from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from djangoplugins.models import Plugin from markupfield.fields import MarkupField diff --git a/requirements/base.txt b/requirements/base.txt index 45ac4705..398a03bd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,7 +8,7 @@ setuptools>=67.6.0, <67.7 packaging>=23.0, <24.0 # Django -django>=3.2.23, <3.3 +django==4.0.10 # Configuration django-environ>=0.10.0, <0.11 @@ -49,7 +49,8 @@ versioneer==0.28 ###################### # Django-plugins (with Django v3.0+ support) -django-plugins-bihealth==0.4.0 +# django-plugins-bihealth==0.4.0 +-e git+https://github.com/bihealth/django-plugins.git@46537f5d10e385b64e576b077dce8c541556e6ba#egg=django-plugins-bihealth # Rules for permissions rules>=3.3, <3.4