Keystone Authentication

* Inserted Keystone middleware into Paste Deploy pipeline when
  running an HTTP transport instance.

Change-Id: I8d206747878b1013f668f116fdfc1d76204aef1c
This commit is contained in:
Bryan Davidson 2013-03-14 14:38:24 -04:00
parent fa66bcd3f8
commit 24ab9e0b4c
6 changed files with 47 additions and 5 deletions

2
.gitignore vendored
View File

@ -16,7 +16,5 @@ venv
.testrepository
versioninfo
var/*
etc/*.conf
etc/*.ini
ChangeLog
AUTHORS

View File

@ -1,7 +1,8 @@
[drivers]
;transport = wsgi, zmq
transport = wsgi
storage = mongodb
;transport = marconi.transport.wsgi, marconi.transport.zmq
transport = marconi.transport.wsgi
;storage = marconi.storage.mongodb, marconi.storage.sqlite
storage = marconi.storage.mongodb
[drivers:transport:wsgi]
port = 8888

15
etc/paste.ini-sample Normal file
View File

@ -0,0 +1,15 @@
[pipeline:main]
pipeline = authtoken marconi
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = https
admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%
[app:marconi]
paste.app_factory = lib.marconi_paste:WSGI.app_factory
config_file = marconi.conf-sample

0
lib/__init__.py Normal file
View File

25
lib/marconi_paste.py Normal file
View File

@ -0,0 +1,25 @@
# Copyright (c) 2013 Rackspace, Inc.
#
# 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 marconi
class WSGI(object):
@staticmethod
def app_factory(global_config, **local_config):
bootstrap = marconi.Bootstrap(global_config['here'] + '/' +
local_config['config_file'])
return bootstrap.transport.app

View File

@ -1,4 +1,7 @@
cliff
falcon
oslo.config>=1.1.0
PasteDeploy
pymongo
python-keystoneclient
WebOb