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
2018-10-12 07:34:15 +00:00
2016-03-31 14:06:45 +00:00
2016-05-18 15:04:00 -06:00
2018-09-22 20:11:30 +03:00
2011-10-28 09:50:35 -04:00
2013-10-25 14:49:23 +08:00
2018-08-27 08:24:21 +00:00
2018-06-08 12:22:10 +00:00
2011-01-12 13:43:31 -08:00
2017-03-17 19:38:47 +00:00
2017-11-13 10:14:05 +00:00
2016-11-30 20:38:59 +00:00
2018-07-10 14:45:26 +07:00
2018-09-22 20:11:30 +03:00
2017-05-30 13:34:43 +00:00
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

Description
OpenStack Dashboard (Horizon)
Readme 336 MiB
Languages
Python 63.3%
JavaScript 28.6%
HTML 6.6%
SCSS 1.5%