Don't provide CONF to the AuthProtocol middleware

The conf value that is passed to the AuthProtocol middleware is a
dictionary that is expected to be passed from paste. They are overrides
of oslo.conf not the conf object itself. If we don't pass anything it
will use the standard CONF object.

Closes-Bug: #1398524
Change-Id: Ia53a90f9b632b54a79906f07610c7a1ae1c70218
This commit is contained in:
Jamie Lennox 2014-12-02 10:22:21 +10:00
parent 8e7f7e9d65
commit a4d0926628
3 changed files with 4 additions and 12 deletions

View File

@ -18,16 +18,11 @@
import functools
from keystonemiddleware import auth_token
from oslo.config import cfg
from sahara import context
from sahara import exceptions
from sahara.openstack.common import policy
CONF = cfg.CONF
AUTH_OPT_GROUP_NAME = 'keystone_authtoken'
ENFORCER = None
@ -51,8 +46,6 @@ def enforce(rule):
return decorator
def wrap(app, conf):
def wrap(app):
"""Wrap wsgi application with ACL check."""
auth_cfg = dict(conf.get(AUTH_OPT_GROUP_NAME))
return auth_token.AuthProtocol(app, conf=auth_cfg)
return auth_token.AuthProtocol(app, {})

View File

@ -49,11 +49,10 @@ from sahara.service import ops
def main():
server.setup_common(possible_topdir, 'engine')
from oslo.config import cfg
# NOTE(apavlov): acl.wrap is called here to set up auth_uri value
# in context by using keystone functionality (mostly to avoid
# code duplication).
acl.wrap(None, cfg.CONF)
acl.wrap(None)
server.setup_sahara_engine()

View File

@ -156,7 +156,7 @@ def make_app():
app.wsgi_app = log_exchange.LogExchange.factory(CONF)(app.wsgi_app)
app.wsgi_app = auth_valid.wrap(app.wsgi_app)
app.wsgi_app = acl.wrap(app.wsgi_app, CONF)
app.wsgi_app = acl.wrap(app.wsgi_app)
return app