aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediagoblin.ini4
-rw-r--r--mediagoblin/auth/tools.py6
-rw-r--r--mediagoblin/config_spec.ini4
-rw-r--r--mediagoblin/tests/appconfig_plugin_specs.ini4
-rw-r--r--mediagoblin/tests/auth_configs/no_auth_plugin_appconfig.ini1
-rw-r--r--mediagoblin/tests/test_auth.py1
-rw-r--r--mediagoblin/tests/test_mgoblin_app.ini1
7 files changed, 7 insertions, 14 deletions
diff --git a/mediagoblin.ini b/mediagoblin.ini
index d1fe4fd1..057084ae 100644
--- a/mediagoblin.ini
+++ b/mediagoblin.ini
@@ -33,10 +33,6 @@ allow_registration = true
## install other themes.
# theme = airy
-# Set to true to run an instance with no authentication plugins enabled.
-# You will not be able to login or register
-authentication_disabled = false
-
[storage:queuestore]
base_dir = %(here)s/user_dev/media/queue
diff --git a/mediagoblin/auth/tools.py b/mediagoblin/auth/tools.py
index 29b0ac76..f69d35ad 100644
--- a/mediagoblin/auth/tools.py
+++ b/mediagoblin/auth/tools.py
@@ -181,7 +181,7 @@ def check_login_simple(username, password):
class AuthError(Exception):
def __init__(self):
self.value = 'No Authentication Plugin is enabled and' \
- ' authentication_disabled = false in config!'
+ ' authentication_disabled = False in config!'
def __str__(self):
return repr(self.value)
@@ -191,10 +191,10 @@ def check_auth_enabled():
authentication_disabled = mg_globals.app_config['authentication_disabled']
auth_plugin = hook_handle('authentication')
- if authentication_disabled == 'false' and not auth_plugin:
+ if authentication_disabled is False and not auth_plugin:
raise AuthError
- if authentication_disabled == 'true':
+ if authentication_disabled:
_log.warning('No authentication is enabled')
return False
else:
diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini
index b213970d..4eb69da8 100644
--- a/mediagoblin/config_spec.ini
+++ b/mediagoblin/config_spec.ini
@@ -31,6 +31,10 @@ email_smtp_pass = string(default=None)
# Set to false to disable registrations
allow_registration = boolean(default=True)
+# Set to true to run an instance with no authentication plugins enabled.
+# You will not be able to login or register
+authentication_disabled = boolean(default=False)
+
# tag parsing
tags_max_length = integer(default=255)
diff --git a/mediagoblin/tests/appconfig_plugin_specs.ini b/mediagoblin/tests/appconfig_plugin_specs.ini
index 68649257..5511cd97 100644
--- a/mediagoblin/tests/appconfig_plugin_specs.ini
+++ b/mediagoblin/tests/appconfig_plugin_specs.ini
@@ -12,10 +12,6 @@ email_debug_mode = true
# Set to false to disable registrations
allow_registration = true
-# Set to true to run an instance with no authentication plugins enabled.
-# You will not be able to login or register
-authentication_disabled = false
-
[plugins]
[[mediagoblin.tests.testplugins.pluginspec]]
some_string = "not blork"
diff --git a/mediagoblin/tests/auth_configs/no_auth_plugin_appconfig.ini b/mediagoblin/tests/auth_configs/no_auth_plugin_appconfig.ini
index 87b3aab0..a64e9e40 100644
--- a/mediagoblin/tests/auth_configs/no_auth_plugin_appconfig.ini
+++ b/mediagoblin/tests/auth_configs/no_auth_plugin_appconfig.ini
@@ -2,7 +2,6 @@
direct_remote_path = /test_static/
email_sender_address = "notice@mediagoblin.example.org"
email_debug_mode = true
-authentication_disabled = false
# TODO: Switch to using an in-memory database
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py
index 9630305a..83e71580 100644
--- a/mediagoblin/tests/test_auth.py
+++ b/mediagoblin/tests/test_auth.py
@@ -24,7 +24,6 @@ from mediagoblin.tests.tools import get_app, fixture_add_user
from mediagoblin.tools import template, mail
from mediagoblin.auth.tools import AuthError
from mediagoblin.auth import tools as auth_tools
-from mediagoblin import auth
def test_register_views(test_app):
diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini
index 6bd32b69..5b060d36 100644
--- a/mediagoblin/tests/test_mgoblin_app.ini
+++ b/mediagoblin/tests/test_mgoblin_app.ini
@@ -2,7 +2,6 @@
direct_remote_path = /test_static/
email_sender_address = "notice@mediagoblin.example.org"
email_debug_mode = true
-authentication_disabled = false
# TODO: Switch to using an in-memory database
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"