diff options
author | Alvaro Lopez Garcia <aloga@ifca.unican.es> | 2012-10-29 15:33:59 +0100 |
---|---|---|
committer | Alvaro Lopez Garcia <aloga@ifca.unican.es> | 2012-10-29 15:45:00 +0100 |
commit | 9602284c5d5aa25a70aedf91b80828726bbd48c2 (patch) | |
tree | 4b86b5cbbc528aba79acf18925d7184d36797499 | |
parent | fcab54b67a2221b66bb48da522a3d6fa9f6ec39e (diff) | |
download | keystone-9602284c5d5aa25a70aedf91b80828726bbd48c2.tar.gz keystone-9602284c5d5aa25a70aedf91b80828726bbd48c2.tar.xz keystone-9602284c5d5aa25a70aedf91b80828726bbd48c2.zip |
Move 'opentack.context' and 'openstack.params' definitions to keystone.common.wsgi
Change-Id: Idc4f6765cba20e7baadb61e355076695f36d66ea
-rw-r--r-- | keystone/common/wsgi.py | 11 | ||||
-rw-r--r-- | keystone/middleware/core.py | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py index 53279c1a..9b42491d 100644 --- a/keystone/common/wsgi.py +++ b/keystone/common/wsgi.py @@ -36,6 +36,13 @@ from keystone.openstack.common import jsonutils LOG = logging.getLogger(__name__) +# Environment variable used to pass the request context +CONTEXT_ENV = 'openstack.context' + + +# Environment variable used to pass the request params +PARAMS_ENV = 'openstack.params' + class WritableLogger(object): """A thin wrapper that responds to `write` and logs.""" @@ -189,9 +196,9 @@ class Application(BaseApplication): LOG.debug('arg_dict: %s', arg_dict) # allow middleware up the stack to provide context & params - context = req.environ.get('openstack.context', {}) + context = req.environ.get(CONTEXT_ENV, {}) context['query_string'] = dict(req.params.iteritems()) - params = req.environ.get('openstack.params', {}) + params = req.environ.get(PARAMS_ENV, {}) params.update(arg_dict) # TODO(termie): do some basic normalization on methods diff --git a/keystone/middleware/core.py b/keystone/middleware/core.py index f6b13f71..6f8abff2 100644 --- a/keystone/middleware/core.py +++ b/keystone/middleware/core.py @@ -29,11 +29,11 @@ AUTH_TOKEN_HEADER = 'X-Auth-Token' # Environment variable used to pass the request context -CONTEXT_ENV = 'openstack.context' +CONTEXT_ENV = wsgi.CONTEXT_ENV # Environment variable used to pass the request params -PARAMS_ENV = 'openstack.params' +PARAMS_ENV = wsgi.PARAMS_ENV class TokenAuthMiddleware(wsgi.Middleware): |