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.
|
## install other themes.
|
||||||
# theme = airy
|
# 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]
|
[storage:queuestore]
|
||||||
base_dir = %(here)s/user_dev/media/queue
|
base_dir = %(here)s/user_dev/media/queue
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ def check_login_simple(username, password):
|
|||||||
class AuthError(Exception):
|
class AuthError(Exception):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.value = 'No Authentication Plugin is enabled and' \
|
self.value = 'No Authentication Plugin is enabled and' \
|
||||||
' authentication_disabled = false in config!'
|
' authentication_disabled = False in config!'
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return repr(self.value)
|
return repr(self.value)
|
||||||
@ -191,10 +191,10 @@ def check_auth_enabled():
|
|||||||
authentication_disabled = mg_globals.app_config['authentication_disabled']
|
authentication_disabled = mg_globals.app_config['authentication_disabled']
|
||||||
auth_plugin = hook_handle('authentication')
|
auth_plugin = hook_handle('authentication')
|
||||||
|
|
||||||
if authentication_disabled == 'false' and not auth_plugin:
|
if authentication_disabled is False and not auth_plugin:
|
||||||
raise AuthError
|
raise AuthError
|
||||||
|
|
||||||
if authentication_disabled == 'true':
|
if authentication_disabled:
|
||||||
_log.warning('No authentication is enabled')
|
_log.warning('No authentication is enabled')
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
@ -31,6 +31,10 @@ email_smtp_pass = string(default=None)
|
|||||||
# Set to false to disable registrations
|
# Set to false to disable registrations
|
||||||
allow_registration = boolean(default=True)
|
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
|
# tag parsing
|
||||||
tags_max_length = integer(default=255)
|
tags_max_length = integer(default=255)
|
||||||
|
|
||||||
|
@ -12,10 +12,6 @@ email_debug_mode = true
|
|||||||
# Set to false to disable registrations
|
# Set to false to disable registrations
|
||||||
allow_registration = true
|
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]
|
[plugins]
|
||||||
[[mediagoblin.tests.testplugins.pluginspec]]
|
[[mediagoblin.tests.testplugins.pluginspec]]
|
||||||
some_string = "not blork"
|
some_string = "not blork"
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
direct_remote_path = /test_static/
|
direct_remote_path = /test_static/
|
||||||
email_sender_address = "notice@mediagoblin.example.org"
|
email_sender_address = "notice@mediagoblin.example.org"
|
||||||
email_debug_mode = true
|
email_debug_mode = true
|
||||||
authentication_disabled = false
|
|
||||||
|
|
||||||
# TODO: Switch to using an in-memory database
|
# TODO: Switch to using an in-memory database
|
||||||
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
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.tools import template, mail
|
||||||
from mediagoblin.auth.tools import AuthError
|
from mediagoblin.auth.tools import AuthError
|
||||||
from mediagoblin.auth import tools as auth_tools
|
from mediagoblin.auth import tools as auth_tools
|
||||||
from mediagoblin import auth
|
|
||||||
|
|
||||||
|
|
||||||
def test_register_views(test_app):
|
def test_register_views(test_app):
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
direct_remote_path = /test_static/
|
direct_remote_path = /test_static/
|
||||||
email_sender_address = "notice@mediagoblin.example.org"
|
email_sender_address = "notice@mediagoblin.example.org"
|
||||||
email_debug_mode = true
|
email_debug_mode = true
|
||||||
authentication_disabled = false
|
|
||||||
|
|
||||||
# TODO: Switch to using an in-memory database
|
# TODO: Switch to using an in-memory database
|
||||||
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user