From a2904d3adead85d6d4223a9f22c47ca45ff8f78c Mon Sep 17 00:00:00 2001
From: Jens Langhammer
Date: Fri, 16 Nov 2018 10:08:15 +0100
Subject: [PATCH] more cleanup, remove supervisr imports
---
passbook/core/requirements.txt | 3 +-
passbook/core/settings.py | 2 +
passbook/core/templates/login/base.html | 1 -
passbook/ldap/settings.py | 6 +-
passbook/ldap/templates/ldap/settings.html | 2 +-
passbook/lib/config.py | 2 +-
passbook/lib/default.yml | 19 ++++++-
passbook/lib/templatetags/reflection.py | 2 +-
passbook/lib/templatetags/utils.py | 7 ++-
passbook/lib/utils/template.py | 14 +++++
passbook/oauth_client/apps.py | 2 +-
passbook/oauth_client/errors.py | 12 +---
.../templates/account/dyn_extra/10_pre.html | 2 +-
.../account/dyn_extra/11_facebook.html | 4 +-
.../account/dyn_extra/12_twitter.html | 4 +-
.../account/dyn_extra/13_google.html | 4 +-
.../account/dyn_extra/15_github.html | 4 +-
.../account/dyn_extra/16_discord.html | 4 +-
.../account/dyn_extra/17_reddit.html | 4 +-
.../templates/account/dyn_extra/19_post.html | 2 +-
.../mod/auth/oauth/client/settings.html | 6 +-
passbook/oauth_client/urls.py | 33 -----------
passbook/saml_idp/apps.py | 17 +++++-
passbook/saml_idp/base.py | 12 ++--
passbook/saml_idp/processors/demo.py | 32 -----------
passbook/saml_idp/processors/generic.py | 10 +---
passbook/saml_idp/processors/gitlab.py | 10 +---
passbook/saml_idp/processors/nextcloud.py | 10 +---
passbook/saml_idp/processors/salesforce.py | 12 ++--
.../processors/{shib.py => shibboleth.py} | 14 ++---
.../saml_idp/processors/wordpress_orange.py | 10 +---
passbook/saml_idp/settings.py | 57 -------------------
.../saml_idp/templates/saml/idp/login.html | 6 +-
.../saml_idp/templates/saml/idp/settings.html | 4 +-
passbook/saml_idp/urls.py | 2 +-
passbook/saml_idp/xml_render.py | 2 +-
passbook/saml_idp/xml_signing.py | 8 +--
passbook/tfa/forms.py | 2 +-
passbook/tfa/templates/tfa/user_settings.html | 6 +-
.../templates/tfa/wizard_setup_static.html | 2 +-
passbook/tfa/tests/test_middleware.py | 16 ++----
requirements-dev.txt | 4 +-
42 files changed, 130 insertions(+), 245 deletions(-)
create mode 100644 passbook/lib/utils/template.py
delete mode 100644 passbook/saml_idp/processors/demo.py
rename passbook/saml_idp/processors/{shib.py => shibboleth.py} (50%)
delete mode 100644 passbook/saml_idp/settings.py
diff --git a/passbook/core/requirements.txt b/passbook/core/requirements.txt
index 9c4eab3b7..0c22aad72 100644
--- a/passbook/core/requirements.txt
+++ b/passbook/core/requirements.txt
@@ -4,4 +4,5 @@ PyYAML
raven
djangorestframework
markdown
-django-model-utils
\ No newline at end of file
+django-model-utils
+colorlog
\ No newline at end of file
diff --git a/passbook/core/settings.py b/passbook/core/settings.py
index b83168d3e..f788ea706 100644
--- a/passbook/core/settings.py
+++ b/passbook/core/settings.py
@@ -60,6 +60,8 @@ INSTALLED_APPS = [
'passbook.ldap',
'passbook.oauth_client',
'passbook.oauth_provider',
+ 'passbook.saml_idp',
+ 'passbook.tfa',
]
REST_FRAMEWORK = {
diff --git a/passbook/core/templates/login/base.html b/passbook/core/templates/login/base.html
index 902fc6fc6..2ea0cf597 100644
--- a/passbook/core/templates/login/base.html
+++ b/passbook/core/templates/login/base.html
@@ -20,7 +20,6 @@
{% block card %}
{% endblock %}
-
{% if not state %}
- {% trans "Enable 2FA" %}
+ {% trans "Enable 2FA" %}
{% else %}
- {% trans "Disable 2FA" %}
+ {% trans "Disable 2FA" %}
{% endif %}
diff --git a/passbook/tfa/templates/tfa/wizard_setup_static.html b/passbook/tfa/templates/tfa/wizard_setup_static.html
index fb239cd1a..19ab8efae 100644
--- a/passbook/tfa/templates/tfa/wizard_setup_static.html
+++ b/passbook/tfa/templates/tfa/wizard_setup_static.html
@@ -1,6 +1,6 @@
{% extends "generic/wizard.html" %}
-{% load supervisr_utils %}
+{% load utils %}
{% block title %}
{% title "Setup" %}
diff --git a/passbook/tfa/tests/test_middleware.py b/passbook/tfa/tests/test_middleware.py
index 309edec44..d1b03a36d 100644
--- a/passbook/tfa/tests/test_middleware.py
+++ b/passbook/tfa/tests/test_middleware.py
@@ -1,6 +1,4 @@
-"""
-Supervisr Mod 2FA Middleware Test
-"""
+"""passbook Mod 2FA Middleware Test"""
import os
@@ -8,23 +6,19 @@ from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory, TestCase
from django.urls import reverse
-from supervisr.core.views import common
-from supervisr.mod.tfa.middleware import tfa_force_verify
+from passbook.core.views import common
+from passbook.tfa.middleware import tfa_force_verify
class TestMiddleware(TestCase):
- """
- Supervisr 2FA Middleware Test
- """
+ """passbook 2FA Middleware Test"""
def setUp(self):
os.environ['RECAPTCHA_TESTING'] = 'True'
self.factory = RequestFactory()
def test_tfa_force_verify_anon(self):
- """
- Test Anonymous TFA Force
- """
+ """Test Anonymous TFA Force"""
request = self.factory.get(reverse('common-index'))
request.user = AnonymousUser()
response = tfa_force_verify(common.IndexView.as_view())(request)
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 4282169bb..8c8566211 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,4 +1,6 @@
pylint
+pylint-django
isort
autopep8
-django-debug-toolbar
\ No newline at end of file
+django-debug-toolbar
+-r requirements.txt
\ No newline at end of file