moved authentication_disabled to config_spec
This commit is contained in:
parent
5101c469d7
commit
54ef2c408b
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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):
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user