delete all files in the repo

the project was barely maintained and will be retired. deleting all the
file in the repo (with the exception of the README) is the next step to
retiring the project completely.

For the full guide on retiring a repo:
  http://docs.openstack.org/infra/manual/drivers.html#retiring-a-project

Related-Bug: 1584432

Depends-On: I25c5d6f50b72d924ec95f88b9c31145e6e38b071
Change-Id: I4d1922702b64d30a702d1e4a3c63952029581978
This commit is contained in:
Steve Martinelli 2016-11-18 10:28:59 -05:00
parent 517d3ff3bb
commit 22f2889fd9
32 changed files with 8 additions and 1044 deletions

View File

@ -1,7 +0,0 @@
[run]
branch = True
source = replace with the name of the package under oslo
omit = replace with the name of the package under oslo/tests/*,replace with the name of the package under oslo/openstack/*
[report]
ignore-errors = True

54
.gitignore vendored
View File

@ -1,54 +0,0 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.testrepository
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
doc/build
# pbr generates these
AUTHORS
ChangeLog
# Editors
*~
.*.swp
doc/source/api
doc/source/modules.rst

View File

@ -1,4 +0,0 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/django-openstack-auth-kerberos.git

View File

@ -1,3 +0,0 @@
# Format is:
# <preferred e-mail> <other e-mail 1>
# <preferred e-mail> <other e-mail 2>

View File

@ -1,7 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ./openstack_auth_kerberos $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,16 +0,0 @@
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
http://docs.openstack.org/infra/manual/developers.html
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
http://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/django-openstack-auth-kerberos

View File

@ -1,4 +0,0 @@
django-openstack-auth-kerberos Style Commandments
======================================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

175
LICENSE
View File

@ -1,175 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

View File

@ -1,6 +0,0 @@
include AUTHORS
include ChangeLog
exclude .gitignore
exclude .gitreview
global-exclude *.pyc

View File

@ -1,15 +1,10 @@
==============================
django-openstack-auth-kerberos
==============================
This project is no longer mantained.
django-openstack-auth-kerberos provides a way to extend `django-openstack-auth
<https://github.com/openstack/django_openstack_auth>`_ to allow kerberos login
via S4U2 Proxy. It separates the code and additional dependencies required so
that they are not required as part of the base DOA requirements.
The contents of this repository are still available in the Git
source code management system. To see the contents of this
repository before it reached its end of life, please check out the
previous commit with "git checkout HEAD^1".
For installation instructions please consult the docs.
* Free software: Apache license
* Documentation: http://docs.openstack.org/developer/django-openstack-auth-kerberos
* Source: http://git.openstack.org/cgit/openstack/django-openstack-auth-kerberos
* Bugs: http://bugs.launchpad.net/django-openstack-auth-kerberos
For any further questions, please email
openstack-dev@lists.openstack.org or join #openstack-dev on
Freenode.

View File

@ -1 +0,0 @@
[python: **.py]

View File

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url=/auth/login">
<script type="text/javascript">
window.location.href = "/auth/login"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow the <a href="/auth/login">link to the login page</a>.
</body>
</html>

View File

View File

@ -1,48 +0,0 @@
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# NOTE(blk-u): Uncomment the [pbr] section in setup.cfg and remove this
# Sphinx extension when https://launchpad.net/bugs/1260495 is fixed.
import os.path as path
from sphinx import apidoc
# NOTE(blk-u): pbr will run Sphinx multiple times when it generates
# documentation. Once for each builder. To run this extension we use the
# 'builder-inited' hook that fires at the beginning of a Sphinx build.
# We use ``run_already`` to make sure apidocs are only generated once
# even if Sphinx is run multiple times.
run_already = False
def run_apidoc(app):
global run_already
if run_already:
return
run_already = True
package_dir = path.abspath(path.join(app.srcdir, '..', '..',
'openstack_auth_kerberos'))
source_dir = path.join(app.srcdir, 'api')
ignore_dir = path.join(package_dir, 'tests')
apidoc.main(['apidoc', package_dir, '-f',
'-H', 'Django Openstack Auth (Kerberos) Modules',
'-o', source_dir,
ignore_dir])
def setup(app):
app.connect('builder-inited', run_apidoc)

View File

@ -1,83 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_auth_kerberos.tests.settings'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..')) # NOTE(dstanek): path for our
# Sphinx extension
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
#'sphinx.ext.intersphinx',
'oslosphinx',
'ext.apidoc',
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'django-openstack-auth-kerberos'
copyright = u'2014, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."]
# html_theme = '_theme'
# html_static_path = ['static']
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}

View File

@ -1,5 +0,0 @@
==============
Contributing
==============
.. include:: ../../CONTRIBUTING.rst

View File

@ -1 +0,0 @@
.. include:: ../../ChangeLog

View File

@ -1,29 +0,0 @@
======================================================
django-openstack-auth-kerberos
======================================================
Kerberos login to the OpenStack dashboard
Contents
========
.. toctree::
:maxdepth: 2
installation
contributing
history
Code Documentation
==================
.. toctree::
:maxdepth: 1
api/modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -1,159 +0,0 @@
==============
Installation
==============
Installation of the module can be done using pip on the command line::
$ pip install django-openstack-auth-kerberos
=============
Configuration
=============
The configuration process for kerberos authentication is somewhat complex as it
relies on coordination between settings in HTTPd, horizon, and site specific
customizations.
Kerberos authentication relies upon the server supporting S4U2 proxying. The
configuration of which is beyond this guide however for a introduction you can
use `this tutorial`_.
.. _this tutorial: http://www.jamielennox.net/blog/2015/02/27/setting-up-s4u2proxy/
Configuring Keystone
--------------------
Currently kerberos authentication is designed to support having keystone
mounted at a path that is protected by kerberos. A guide to setting up
keystone in this manner with a special kerberos path `can be found here`_.
.. _can be found here: http://www.jamielennox.net/blog/2015/02/12/step-by-step-kerberized-keystone/
Configuring Horizon
-------------------
There are two parts to configuring horizon, we must install the kerberos
authentication backend and add new views that will trigger these backends.
We create the additional `/auth/kerberos` route by adding
:py:mod:`openstack_auth_kerberos.urls` to `AUTHENTICATION_URLS`_. Remember to
include the default password backend as we are overriding this value::
AUTHENTICATION_URLS = ('openstack_auth.urls',
'openstack_auth_kerberos.urls')
We install the additional :py:class:`~openstack_auth_kerberos.plugin.Kerberos`
handlers that will be triggered by the `/auth/kerberos` route by installing the
kerberos authentication plugin. Again remember to include the standard
username/password authentication plugin::
AUTHENTICATION_PLUGINS = ('openstack_auth.plugin.password.PasswordPlugin',
'openstack_auth_kerberos.plugin.Kerberos')
Configuring Plugin
------------------
Because kerberized keystone is mounted on a path other than the
`OPENSTACK_KEYSTONE_URL`_ we need to indicate the kerberized auth path to the
plugin with the `KERBEROS_AUTH_URL` setting::
KERBEROS_AUTH_URL = 'http://%s:5000/krb/v3' % OPENSTACK_HOST
Configuring Apache
------------------
Apache should be configured as a S4U2 proxy on the `/auth/kerberos` location.
Beyond this there are a couple of extra configuration points.
Kerberos Fallback
+++++++++++++++++
If kerberos authentication fails then we would like the server to present the
standard horizon login page. To do this we define an `ErrorDocument`_. This
document is rendered and returned as the body of the initial 401 Unauthorized
response which is a standard part of SPNEGO/kerberos negotiation.
It is a limitation of the way httpd and django work that we cannot redirect the
`ErrorDocument`_ to a generated URL. We therefore specify a static HTML page
which will be used as a bouncing page to send users to the standard login page
when kerberos authentication fails.
The default bouncing page is:
.. literalinclude:: ../../data/login-redirect.html
:language: html
This page provides a javascript redirect to the `/auth/login` path (the horizon
default login) which will be triggered if the kerberos handler is not present.
If your `LOGIN_URL` is defined as something other that `/auth/login` you should
update this snippet accordingly.
The easiest way to deploy this is to copy the html file to the `STATIC_ROOT`_
of your deployment and set the `ErrorDocument`_ to the publicly accessible URL::
<Location /auth/kerberos>
...
ErrorDocument 401 "/media/login-redirect.html"
</Location>
Sample Config
+++++++++++++
An example of a full `/etc/httpd/conf.d/horizon.conf` file::
<VirtualHost *:80>
WSGIScriptAlias / /opt/horizon/openstack_dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=apache group=apache processes=3 threads=10 home=/opt/horizon display-name=apached
WSGIApplicationGroup %{GLOBAL}
SetEnv APACHE_RUN_USER apached
SetEnv APACHE_RUN_GROUP apache
WSGIProcessGroup horizon
DocumentRoot /opt/horizon/.blackhole/
Alias /media /opt/horizon/openstack_dashboard/static
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/horizon/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
<Location "/auth/krb/">
AuthType Kerberos
AuthName "Kerberos Login"
KrbMethodNegotiate on
KrbMethodK5Passwd off
KrbServiceName HTTP
KrbAuthRealms MY.REALM.ORG
Krb5KeyTab /etc/httpd/conf/httpd.keytab
KrbSaveCredentials on
KrbLocalUserMapping on
Require valid-user
KrbConstrainedDelegation on
ErrorDocument 401 "/media/login-redirect.html"
</Location>
ErrorLog /var/log/httpd/horizon_error.log
CustomLog /var/log/httpd/horizon_access.log combined
</VirtualHost>
WSGISocketPrefix /var/run/httpd
.. _AUTHENTICATION_URLS: http://docs.openstack.org/developer/horizon/topics/settings.html#authentication-urls
.. _OPENSTACK_KEYSTONE_URL: http://docs.openstack.org/developer/horizon/topics/settings.html#openstack-keystone-url
.. _STATIC_ROOT: https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-STATIC_ROOT
.. _ErrorDocument: https://httpd.apache.org/docs/2.4/custom-error.html

View File

@ -1,7 +0,0 @@
[DEFAULT]
# The list of modules to copy from oslo-incubator.git
script =
# The base module to hold the copy of openstack.common
base=django-openstack-auth-kerberos

View File

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import warnings
warnings.warn(
"The openstack_auth_kerberos package is deprecated in favor of "
"authenticating with kerberos through federation, this library will "
"no longer be supported.",
DeprecationWarning)

View File

@ -1,81 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging
import os
from django.conf import settings
from keystoneauth1.extras import kerberos
from keystoneauth1 import plugin as ksa_plugin
from openstack_auth import plugin
ENV_NAME = 'KRB5CCNAME'
AUTH_SETTING_NAME = 'KERBEROS_AUTH_URL'
LOG = logging.getLogger(__name__)
class _HackedKerbAuth(kerberos.Kerberos):
def __init__(self, auth_url, original_auth_url, ticket):
super(_HackedKerbAuth, self).__init__(auth_url=auth_url)
self.original_auth_url = original_auth_url
self.ticket = ticket
def get_endpoint(self, session, **kwargs):
# NOTE(jamielennox): This is a hack to return the actual AUTH_URL
# rather than the one with the kerberos path, other wise project
# listing tries to work on the kerberized path and will fail.
if kwargs.get('interface') == ksa_plugin.AUTH_INTERFACE:
return self.original_auth_url
return super(_HackedKerbAuth, self).get_endpoint(session, **kwargs)
def get_auth_ref(self, *args, **kwargs):
# NOTE(jamielennox): The only way to specify a ticket is in the global
# environment. Whilst this shouldn't be an issue as has a process per
# worker we limit so that the ticket is only in ENV for the minimum
# time needed.
os.environ[ENV_NAME] = self.ticket
try:
return super(_HackedKerbAuth, self).get_auth_ref(*args, **kwargs)
finally:
os.environ.pop(ENV_NAME, None)
class Kerberos(plugin.BasePlugin):
def __init__(self, *args, **kwargs):
super(Kerberos, self).__init__(*args, **kwargs)
self.login_url = getattr(settings, AUTH_SETTING_NAME, None)
if not self.login_url:
LOG.warn('Kerberos authentication configured, but no '
'"%s" defined in settings.', AUTH_SETTING_NAME)
def get_plugin(self, request=None, auth_url=None, **kwargs):
if not (request and auth_url):
return None
if self.keystone_version < 3:
return None
if not self.login_url:
return None
ticket = request.environ.get(ENV_NAME)
if not ticket:
return None
return _HackedKerbAuth(self.login_url, auth_url, ticket)

View File

@ -1,67 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3'}}
INSTALLED_APPS = [
'django',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'openstack_auth',
'openstack_auth.tests'
]
MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware'
]
AUTHENTICATION_BACKENDS = ['openstack_auth.backend.KeystoneBackend']
AUTHENTICATION_URLS = ('openstack_auth.urls',
'openstack_auth_kerberos.urls')
AUTHENTICATION_PLUGINS = ('openstack_auth.plugin.password.PasswordPlugin',
'openstack_auth_kerberos.plugin.Kerberos')
OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v3"
ROOT_URLCONF = 'openstack_auth.tests.urls'
LOGIN_REDIRECT_URL = '/'
SECRET_KEY = 'badcafe'
OPENSTACK_API_VERSIONS = {
"identity": 3
}
USE_TZ = True
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'domain'
# NOTE(saschpe): The openstack_auth.user.Token object isn't
# JSON-serializable ATM
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
POLICY_FILES_PATH = os.path.join(TEST_DIR, "conf")
POLICY_FILES = {
'identity': 'keystone_policy.json',
'compute': 'nova_policy.json'
}

View File

@ -1,21 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslotest import base
class TestOpenstackAuthKerberos(base.BaseTestCase):
def test_something(self):
pass

View File

@ -1,21 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from django.conf.urls import patterns
from django.conf.urls import url
urlpatterns = patterns(
'openstack_auth_kerberos.views',
url(r'^kerberos/$', 'kerberos_login', name='kerberos_login'),
)

View File

@ -1,54 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import time
from django.conf import settings
from django.contrib import auth
from django import http as django_http
from django import shortcuts
from django.views.decorators.cache import never_cache # noqa
from django.views.decorators.csrf import csrf_exempt # noqa
from django.views.decorators.csrf import csrf_protect # noqa
from django.views.decorators.debug import sensitive_post_parameters # noqa
# This is historic and is added back in to not break older versions of
# Horizon, fix to Horizon to remove this requirement was committed in
# Juno
from openstack_auth import user as auth_user
LOG = logging.getLogger(__name__)
@sensitive_post_parameters()
@csrf_exempt
@never_cache
def kerberos_login(request):
"""Attempt to log a user in via kerberos credential."""
user = auth.authenticate(request=request)
if user and user.is_authenticated():
auth.login(request, user)
res = shortcuts.redirect(settings.LOGIN_REDIRECT_URL)
auth_user.set_session_from_user(request, user)
request.session['last_activity'] = int(time.time())
else:
# NOTE(jamielennox): If horizon is configured correctly this would
# imply that you got a kerberos ticket however you couldn't be logged
# into keystone. Not much we can do here, throw a 401 so that apache
# will trigger a redirect to form login.
res = django_http.HttpResponse('Unauthorized', status=401)
return res

View File

@ -1,9 +0,0 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
Babel>=0.9.6
Django>=1.4.2,<1.7
django_openstack_auth>=1.1.7,!=1.1.8
keystoneauth1[kerberos]>=2.1.0 # Apache-2.0

View File

@ -1,51 +0,0 @@
[metadata]
name = django-openstack-auth-kerberos
summary = Kerberos login to the OpenStack dashboard
description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = http://github.com/jamielennox/django-openstack-auth-kerberos
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
[files]
packages =
openstack_auth_kerberos
[pbr]
warnerrors = true
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = openstack_auth_kerberos/locale
domain = openstack_auth_kerberos
[update_catalog]
domain = openstack_auth_kerberos
output_dir = openstack_auth_kerberos/locale
input_file = openstack_auth_kerberos/locale/django-openstack-auth-kerberos.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = openstack_auth_kerberos/locale/openstack_auth_kerberos.pot
[wheel]
universal = true

View File

@ -1,30 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

View File

@ -1,10 +0,0 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.0
oslotest
# These are needed for docs generation
oslosphinx
sphinx>=1.1.2,!=1.2.0,<1.3

41
tox.ini
View File

@ -1,41 +0,0 @@
[tox]
minversion = 1.6
envlist = py34,py26,py27,pypy,pep8
# NOTE(dhellmann): We cannot set skipdist=True
# for oslo libraries because of the namespace package.
#skipsdist = True
[testenv]
# NOTE(dhellmann): We cannot set usedevelop=True
# for oslo libraries because of the namespace package.
#usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=openstack_auth_kerberos.tests.settings
commands = python setup.py build_sphinx
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[hacking]
import_exceptions =