OpenStack Dashboard (Horizon)
Go to file
Mathieu Gagné 8851866aad Fix django.contrib.auth.middleware monkey patching
The "request" attribute is not available in
openstack_auth.backend.KeystoneBackend.get_user when session data is restored
and it's the first request to happen after a server restart.

As stated by the function document, the "request" attribute needs to be
monkey-patched by openstack_auth.utils.patch_middleware_get_user
for this function to work properly.

This should happen in openstack_auth.urls at import time. But there is nowhere
in Horizon where this module is imported at startup. It's only introspected
by openstack_dashboard.urls due to AUTHENTICATION_URLS setting.

Without this monkey-patching, the whole authentication mechanism falls back
to "AnonymousUser" and you will get redirected to the login page due
to horizon.exceptions.NotAuthenticated being raised by
horizon.decorators.require_auth as request.user.is_authenticated will be False.

But if a user requests a page under auth/, it will have the side-effect of
monkey-patching django.contrib.auth.middleware as expected. This means that
once this request is completed, all following requests to pages other than
the ones under auth/ will have there sessions properly restored and
you will be properly authenticated.

Therefore this change introduces a dummy middleware which sole purpose is
to perform this monkey-patching as early as possible.

There is also some cleanup to get rid of the previous attempts at
monkeypatching.

Closes-bug: #1764622

Conflicts:
	openstack_dashboard/settings.py
	openstack_dashboard/test/helpers.py

Change-Id: Ib9912090a87b716e7f5710f6f360b0df168ec2e3
(cherry picked from commit 0d16361326)
2018-11-20 21:24:04 +09:00
doc Imported Translations from Zanata 2018-11-08 08:00:20 +00:00
horizon Fix django.contrib.auth.middleware monkey patching 2018-11-20 21:24:04 +09:00
openstack_auth Fix django.contrib.auth.middleware monkey patching 2018-11-20 21:24:04 +09:00
openstack_dashboard Fix django.contrib.auth.middleware monkey patching 2018-11-20 21:24:04 +09:00
playbooks/horizon-selenium-headless Fix selenuim-headless tests 2018-06-08 12:22:10 +00:00
releasenotes support WEBSSO_KEYSTONE_URL 2018-10-29 13:27:11 -07:00
roles/setup-selenium-tests Fix selenuim-headless tests 2018-06-08 12:22:10 +00:00
tools Use default Django test runner instead of nose 2018-06-08 15:21:12 +03:00
.eslintignore bump eslint version to 1.10.3 2016-03-31 14:06:45 +00:00
.eslintrc Disabling warnings of 'quote-props' 2016-05-18 15:04:00 -06:00
.gitignore Create new wsgi.py file and deprecate old file 2018-05-15 01:41:01 +00:00
.gitreview Update .gitreview for stable/rocky 2018-08-09 12:21:21 +00:00
.mailmap Update my mailmap 2013-10-25 14:49:23 +08:00
.pylintrc updating run_tests.sh to mimic other openstack projects, pep8, pylint, coverage 2011-08-31 14:41:36 -07:00
.zuul.yaml import zuul job settings from project-config 2018-08-21 16:57:31 +09:00
CONTRIBUTING.rst Update the documentation link for doc migration 2017-08-04 18:38:25 +00:00
HACKING.rst Update the documentation link for doc migration 2017-08-04 18:38:25 +00:00
LICENSE Initial commit 2011-01-12 13:43:31 -08:00
MANIFEST.in Drop Makefile 2017-11-13 10:14:05 +00:00
README.rst Add release notes link in README 2018-07-10 14:45:26 +07:00
babel-django.cfg Added a django extract for .csv files 2015-09-15 21:57:42 +00:00
babel-djangojs.cfg Angular translation via babel (singular only) 2015-07-02 11:13:45 +10:00
bindep.txt Fix selenuim-headless tests 2018-06-08 12:22:10 +00:00
lower-constraints.txt Delete profiler object when request completes 2018-07-24 12:33:31 +01:00
manage.py hacking: noqa cleanup in horizon 2017-03-17 19:38:47 +00:00
package.json Refactor tox & update docs 2016-11-30 20:38:59 +00:00
requirements.txt Merge "Delete profiler object when request completes" 2018-07-31 19:34:49 +00:00
setup.cfg Follow the new PTI for document build 2018-03-25 02:14:40 +09:00
setup.py Updated from global requirements 2017-05-30 13:34:43 +00:00
test-requirements.txt Add Bandit non-voting job 2018-06-22 13:11:43 +03:00
test-shim.js Add Apache 2.0 license to source file 2016-12-02 17:40:28 +07:00
tox.ini Update UPPER_CONSTRAINTS_FILE for stable/rocky 2018-08-09 12:21:25 +00:00

README.rst

Horizon (OpenStack Dashboard)

Horizon is a Django-based project aimed at providing a complete OpenStack Dashboard along with an extensible framework for building new dashboards from reusable components. The openstack_dashboard module is a reference implementation of a Django site that uses the horizon app to provide web-based interactions with the various OpenStack projects.

image

Using Horizon

See doc/source/install/index.rst about how to install Horizon in your OpenStack setup. It describes the example steps and has pointers for more detailed settings and configurations.

It is also available at Installation Guide.

Getting Started for Developers

doc/source/quickstart.rst or Quickstart Guide describes how to setup Horizon development environment and start development.

Building Contributor Documentation

This documentation is written by contributors, for contributors.

The source is maintained in the doc/source directory using reStructuredText and built by Sphinx

To build the docs, use:

$ tox -e docs

Results are in the doc/build/html directory