diff options
author | Ruan HE <ruan.he@orange.com> | 2016-06-09 08:12:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-06-09 08:12:34 +0000 |
commit | 4bc079a2664f9a407e332291f34d174625a9d5ea (patch) | |
tree | 7481cd5d0a9b3ce37c44c797a1e0d39881221cbe /keystone-moon/keystone/server/wsgi.py | |
parent | 2f179c5790fbbf6144205d3c6e5089e6eb5f048a (diff) | |
parent | 2e7b4f2027a1147ca28301e4f88adf8274b39a1f (diff) |
Merge "Update Keystone core to Mitaka."
Diffstat (limited to 'keystone-moon/keystone/server/wsgi.py')
-rw-r--r-- | keystone-moon/keystone/server/wsgi.py | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/keystone-moon/keystone/server/wsgi.py b/keystone-moon/keystone/server/wsgi.py index ae24c48e..a62a8460 100644 --- a/keystone-moon/keystone/server/wsgi.py +++ b/keystone-moon/keystone/server/wsgi.py @@ -16,7 +16,6 @@ import logging from oslo_config import cfg import oslo_i18n -import oslo_middleware.cors as cors # NOTE(dstanek): i18n.enable_lazy() must be called before @@ -26,28 +25,16 @@ import oslo_middleware.cors as cors oslo_i18n.enable_lazy() +from keystone.common import config from keystone.common import environment -from keystone import config -import keystone.middleware.core as middleware_core from keystone.server import common -from keystone import service as keystone_service +from keystone.version import service as keystone_service CONF = cfg.CONF -KEYSTONE_HEADERS = [ - middleware_core.AUTH_TOKEN_HEADER, - middleware_core.SUBJECT_TOKEN_HEADER, - 'X-Project-Id', - 'X-Project-Name', - 'X-Project-Domain-Id', - 'X-Project-Domain-Name', - 'X-Domain-Id', - 'X-Domain-Name' -] - -def initialize_application(name): +def initialize_application(name, post_log_configured_function=lambda: None): common.configure() # Log the options used when starting if we're in debug mode... @@ -56,21 +43,14 @@ def initialize_application(name): environment.use_stdlib() + post_log_configured_function() + def loadapp(): return keystone_service.loadapp( 'config:%s' % config.find_paste_config(), name) _unused, application = common.setup_backends( startup_application_fn=loadapp) - - # Create a CORS wrapper, and attach keystone-specific defaults that must be - # included in all CORS responses - application = cors.CORS(application, CONF) - application.set_latent( - allow_headers=KEYSTONE_HEADERS, - allow_methods=['GET', 'PUT', 'POST', 'DELETE', 'PATCH'], - expose_headers=KEYSTONE_HEADERS - ) return application |