From 57d1635845df4a8b045805b66e8fbec5010ce97f Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Tue, 23 Jun 2020 21:17:14 +0000 Subject: Revert "Enable OpenID" This reverts commit 596664b37c17b31f2b5faa0d5144e4317179e0ba. Reason for revert: seems to break things when keys aren't defined on fresh container build Change-Id: I4ef788062c8a6967afad4eb3695af85bc3a4718b Signed-off-by: Sawyer Bergeron --- config.env.sample | 8 -------- requirements.txt | 1 - src/account/views.py | 15 --------------- src/laas_dashboard/settings.py | 17 +---------------- src/laas_dashboard/urls.py | 3 +-- src/templates/akraino/base.html | 20 -------------------- src/templates/akraino/dashboard/landing.html | 7 ------- src/templates/base/base.html | 2 -- src/templates/base/dashboard/landing.html | 2 -- 9 files changed, 2 insertions(+), 73 deletions(-) diff --git a/config.env.sample b/config.env.sample index 137ecb0..fadf0ed 100644 --- a/config.env.sample +++ b/config.env.sample @@ -35,14 +35,6 @@ JIRA_URL=sample_url JIRA_USER_NAME=sample_jira_user JIRA_USER_PASSWORD=sample_jira_pass -# LFID -OIDC_CLIENT_ID=sample_id -OIDC_CLIENT_SECRET=sample_secret - -OIDC_AUTHORIZATION_ENDPOINT=https://linuxfoundation-test.auth0.com/authorize -OIDC_TOKEN_ENDPOINT=https://linuxfoundation-test.auth0.com/oauth/token -OIDC_USER_ENDPOINT=https://linuxfoundation-test.auth0.com/userinfo - # Rabbitmq RABBITMQ_DEFAULT_USER=opnfv RABBITMQ_DEFAULT_PASS=opnfvopnfv diff --git a/requirements.txt b/requirements.txt index b34dd1e..7e2fbd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,3 @@ requests==2.22.0 django-fernet-fields==0.6 pyyaml==3.13 pytz==2018.5 -mozilla-django-oidc==1.2.3 diff --git a/src/account/views.py b/src/account/views.py index f883338..d1cc813 100644 --- a/src/account/views.py +++ b/src/account/views.py @@ -28,7 +28,6 @@ from django.views.generic import RedirectView, TemplateView, UpdateView from django.shortcuts import render from jira import JIRA from rest_framework.authtoken.models import Token -from mozilla_django_oidc.auth import OIDCAuthenticationBackend from account.forms import AccountSettingsForm @@ -59,20 +58,6 @@ class AccountSettingsView(UpdateView): return context -class MyOIDCAB(OIDCAuthenticationBackend): - def filter_users_by_claims(self, claims): - email = claims.get(email=email) - if not email: - return self.UserModel.objects.none() - - try: - profile = Profile.objects.get(email=email) - return profile.user - - except Profile.DoesNotExist: - return self.UserModel.objects.none() - - class JiraLoginView(RedirectView): def get_redirect_url(self, *args, **kwargs): consumer = oauth.Consumer(settings.OAUTH_CONSUMER_KEY, settings.OAUTH_CONSUMER_SECRET) diff --git a/src/laas_dashboard/settings.py b/src/laas_dashboard/settings.py index 0b23960..62fc9ec 100644 --- a/src/laas_dashboard/settings.py +++ b/src/laas_dashboard/settings.py @@ -30,7 +30,6 @@ INSTALLED_APPS = [ 'api', 'django.contrib.admin', 'django.contrib.auth', - 'mozilla_django_oidc', # needs to be defined after auth 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', @@ -38,7 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.humanize', 'bootstrap4', 'rest_framework', - 'rest_framework.authtoken', + 'rest_framework.authtoken' ] MIDDLEWARE = [ @@ -52,20 +51,6 @@ MIDDLEWARE = [ 'account.middleware.TimezoneMiddleware', ] -AUTHENTICATION_BACKENDS = ['account.views.MyOIDCAB'] - - -# OpenID Authentications -OIDC_RP_CLIENT_ID = os.environ['OIDC_CLIENT_ID'] -OIDC_RP_CLIENT_SECRET = os.environ['OIDC_CLIENT_SECRET'] - -OIDC_OP_AUTHORIZATION_ENDPOINT = os.environ['OIDC_AUTHORIZATION_ENDPOINT'] -OIDC_OP_TOKEN_ENDPOINT = os.environ['OIDC_TOKEN_ENDPOINT'] -OIDC_OP_USER_ENDPOINT = os.environ['OIDC_USER_ENDPOINT'] - -LOGIN_REDIRECT_URL = os.environ['DASHBOARD_URL'] -LOGOUT_REDIRECT_URL = os.environ['DASHBOARD_URL'] - ROOT_URLCONF = 'laas_dashboard.urls' TEMPLATE_OVERRIDE = os.environ.get("TEMPLATE_OVERRIDE_DIR", "") # the user's custom template dir diff --git a/src/laas_dashboard/urls.py b/src/laas_dashboard/urls.py index 7a37d7e..17cbe84 100644 --- a/src/laas_dashboard/urls.py +++ b/src/laas_dashboard/urls.py @@ -41,8 +41,7 @@ urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^api/', include('api.urls')), - url(r'^messages/', include('notifier.urls', namespace='notifier')), - url(r'^oidc/', include('mozilla_django_oidc.urls')), + url(r'^messages/', include('notifier.urls', namespace='notifier')) ] if settings.DEBUG is True: diff --git a/src/templates/akraino/base.html b/src/templates/akraino/base.html index b93dcd2..1368476 100644 --- a/src/templates/akraino/base.html +++ b/src/templates/akraino/base.html @@ -22,23 +22,3 @@ {% endblock logo %} {% block dropDown %} {% endblock dropDown %} - -{% block login %} - -{% endblock login %} \ No newline at end of file diff --git a/src/templates/akraino/dashboard/landing.html b/src/templates/akraino/dashboard/landing.html index 39eebb6..d7f434b 100644 --- a/src/templates/akraino/dashboard/landing.html +++ b/src/templates/akraino/dashboard/landing.html @@ -18,12 +18,5 @@

To get started, book a pod below:

Book a Pod {% endblock btnGrp %} - -{% block biglogin %} -

- To get started, please log in with Linux Foundation ID -

-{% endblock biglogin %} - {% block returningUsers %} {% endblock returningUsers %} diff --git a/src/templates/base/base.html b/src/templates/base/base.html index f86cff8..cc6d38d 100644 --- a/src/templates/base/base.html +++ b/src/templates/base/base.html @@ -44,7 +44,6 @@ {% endif %} - {% block login %} - {% endblock login %} diff --git a/src/templates/base/dashboard/landing.html b/src/templates/base/dashboard/landing.html index c46b0fa..dd09dc4 100644 --- a/src/templates/base/dashboard/landing.html +++ b/src/templates/base/dashboard/landing.html @@ -28,11 +28,9 @@

Get Started

{% if request.user.is_anonymous %} - {% block biglogin %}

To get started, please log in with your Linux Foundation Jira account

- {% endblock biglogin %} {% else %} {% block btnGrp %}

To get started, book a server below:

-- cgit 1.2.3-korg