Allow specifying authentication URLs from settings

To allow us to have authentication mechanisms that live out of tree as
AUTHENTICATION_BACKENDS do we need to have a way to load the views that
service those backends.

Provide a means via settings that we can add new routes to the /auth
urls.

Closes-Bug: #1433358
Change-Id: I1ffc8a4e0bbfa58c7b50351432668d49d3a7dab1
This commit is contained in:
Jamie Lennox 2015-03-13 04:10:02 +00:00
parent 28b65ea91c
commit 06688a99ca
4 changed files with 26 additions and 1 deletions

View File

@ -280,6 +280,18 @@ Most of the following settings are defined in
``openstack_dashboard/local/local_settings.py``, which should be copied from
``openstack_dashboard/local/local_settings.py.example``.
``AUTHENTICATION_URLS``
-----------------------
.. versionadded:: 2015.1(Kilo)
Default: ``['openstack_auth.urls']``
A list of modules from which to collate authentication URLs from. The default
option adds URLs from the django-openstack-auth module however others will be
required for additional authentication mechanisms.
``API_RESULT_LIMIT``
--------------------

View File

@ -296,6 +296,13 @@ TIME_ZONE = "UTC"
# the password.
# ENFORCE_PASSWORD_CHECK = False
# Modules that provide /auth routes that can be used to handle different types
# of user authentication. Add auth plugins that require extra route handling to
# this list.
#AUTHENTICATION_URLS = [
# 'openstack_auth.urls',
#]
# The Horizon Policy Enforcement engine uses these values to load per service
# policy rule files. The content of these files should match the files the
# OpenStack services are using to determine role based access control in the

View File

@ -164,6 +164,7 @@ INSTALLED_APPS = [
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
AUTHENTICATION_BACKENDS = ('openstack_auth.backend.KeystoneBackend',)
AUTHENTICATION_URLS = ['openstack_auth.urls']
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'

View File

@ -32,11 +32,16 @@ import horizon
urlpatterns = patterns(
'',
url(r'^$', 'openstack_dashboard.views.splash', name='splash'),
url(r'^auth/', include('openstack_auth.urls')),
url(r'^api/', include('openstack_dashboard.api.rest.urls')),
url(r'', include(horizon.urls)),
)
for u in getattr(settings, 'AUTHENTICATION_URLS', ['openstack_auth.urls']):
urlpatterns += patterns(
'',
url(r'^auth/', include(u))
)
# Development static app and project media serving using the staticfiles app.
urlpatterns += staticfiles_urlpatterns()