OpenStack Dashboard (Horizon)
Go to file
Mathieu Gagné 0d16361326 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
Change-Id: Ib9912090a87b716e7f5710f6f360b0df168ec2e3
2018-11-06 21:36:45 +00:00
doc Imported Translations from Zanata 2018-10-12 07:34:15 +00:00
horizon Fix django.contrib.auth.middleware monkey patching 2018-11-06 21:36:45 +00:00
openstack_auth Fix django.contrib.auth.middleware monkey patching 2018-11-06 21:36:45 +00:00
openstack_dashboard Fix django.contrib.auth.middleware monkey patching 2018-11-06 21:36:45 +00:00
playbooks/horizon-selenium-headless Fix selenuim-headless tests 2018-06-08 12:22:10 +00:00
releasenotes Imported Translations from Zanata 2018-10-29 07:05:13 +00: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 Remove nose references from Horizon 2018-09-22 20:11:30 +03:00
.gitreview Add .gitreview and rfc.sh. 2011-10-28 09:50:35 -04: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 switch documentation job to new PTI 2018-08-27 08:24:21 +00: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
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
lower-constraints.txt Remove nose references from Horizon 2018-09-22 20:11:30 +03:00
manage.py hacking: noqa cleanup in horizon 2017-03-17 19:38:47 +00:00
MANIFEST.in Drop Makefile 2017-11-13 10:14:05 +00:00
package.json Refactor tox & update docs 2016-11-30 20:38:59 +00:00
README.rst Add release notes link in README 2018-07-10 14:45:26 +07:00
requirements.txt Merge "Add django-debreach to horizon" 2018-08-30 06:29:18 +00:00
setup.cfg Remove nose references from Horizon 2018-09-22 20:11:30 +03:00
setup.py Updated from global requirements 2017-05-30 13:34:43 +00:00
test-requirements.txt Move requests to requirements.txt 2018-08-26 03:49:36 +09:00
test-shim.js Add Apache 2.0 license to source file 2016-12-02 17:40:28 +07:00
tox.ini Remove setup.py check from pep8 job 2018-10-30 16:18:44 +00:00

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