summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-22 03:33:22 +0000
committerGerrit Code Review <review@openstack.org>2018-10-22 03:33:22 +0000
commit5814da527ba4224aed9f14ad09c0eb684c22ef46 (patch)
tree5bed0ef4b0f65f31cffdf3fd3313d377b1c64caf
parentc45bc100bc682310f4b14b8fb888db530a8777e4 (diff)
parent595967bba6c19b709743c2991545662fce9f6da7 (diff)
Merge "Move AuthContextMiddleware"HEADmaster
-rw-r--r--keystone/middleware/__init__.py15
-rw-r--r--keystone/server/flask/core.py4
-rw-r--r--keystone/server/flask/request_processing/middleware/auth_context.py (renamed from keystone/middleware/auth.py)0
-rw-r--r--keystone/tests/unit/test_middleware.py4
-rw-r--r--keystone/tests/unit/test_v3.py4
5 files changed, 6 insertions, 21 deletions
diff --git a/keystone/middleware/__init__.py b/keystone/middleware/__init__.py
deleted file mode 100644
index f239db9..0000000
--- a/keystone/middleware/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
1# Copyright 2012 OpenStack Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15from keystone.middleware.auth import * # noqa
diff --git a/keystone/server/flask/core.py b/keystone/server/flask/core.py
index d5c4506..a7dc47a 100644
--- a/keystone/server/flask/core.py
+++ b/keystone/server/flask/core.py
@@ -27,9 +27,9 @@ oslo_i18n.enable_lazy()
27 27
28from keystone.common import profiler 28from keystone.common import profiler
29import keystone.conf 29import keystone.conf
30import keystone.middleware
31import keystone.server 30import keystone.server
32from keystone.server.flask import application 31from keystone.server.flask import application
32from keystone.server.flask.request_processing.middleware import auth_context
33from keystone.server.flask.request_processing.middleware import url_normalize 33from keystone.server.flask.request_processing.middleware import url_normalize
34 34
35# NOTE(morgan): Middleware Named Tuple with the following values: 35# NOTE(morgan): Middleware Named Tuple with the following values:
@@ -69,7 +69,7 @@ _APP_MIDDLEWARE = (
69# be the last element here as long as it is an actual Middleware. 69# be the last element here as long as it is an actual Middleware.
70_KEYSTONE_MIDDLEWARE = ( 70_KEYSTONE_MIDDLEWARE = (
71 url_normalize.URLNormalizingMiddleware, 71 url_normalize.URLNormalizingMiddleware,
72 keystone.middleware.AuthContextMiddleware, 72 auth_context.AuthContextMiddleware,
73) 73)
74 74
75 75
diff --git a/keystone/middleware/auth.py b/keystone/server/flask/request_processing/middleware/auth_context.py
index ccd0325..ccd0325 100644
--- a/keystone/middleware/auth.py
+++ b/keystone/server/flask/request_processing/middleware/auth_context.py
diff --git a/keystone/tests/unit/test_middleware.py b/keystone/tests/unit/test_middleware.py
index d1a21a4..1927ec4 100644
--- a/keystone/tests/unit/test_middleware.py
+++ b/keystone/tests/unit/test_middleware.py
@@ -27,7 +27,7 @@ from keystone.common import wsgi
27import keystone.conf 27import keystone.conf
28from keystone import exception 28from keystone import exception
29from keystone.federation import constants as federation_constants 29from keystone.federation import constants as federation_constants
30from keystone import middleware 30from keystone.server.flask.request_processing.middleware import auth_context
31from keystone.tests import unit 31from keystone.tests import unit
32from keystone.tests.unit import mapping_fixtures 32from keystone.tests.unit import mapping_fixtures
33from keystone.tests.unit import test_backend_sql 33from keystone.tests.unit import test_backend_sql
@@ -106,7 +106,7 @@ class MiddlewareRequestTestBase(unit.TestCase):
106class AuthContextMiddlewareTest(test_backend_sql.SqlTests, 106class AuthContextMiddlewareTest(test_backend_sql.SqlTests,
107 MiddlewareRequestTestBase): 107 MiddlewareRequestTestBase):
108 108
109 MIDDLEWARE_CLASS = middleware.AuthContextMiddleware 109 MIDDLEWARE_CLASS = auth_context.AuthContextMiddleware
110 110
111 def setUp(self): 111 def setUp(self):
112 super(AuthContextMiddlewareTest, self).setUp() 112 super(AuthContextMiddlewareTest, self).setUp()
diff --git a/keystone/tests/unit/test_v3.py b/keystone/tests/unit/test_v3.py
index 9ba0c12..2ba8336 100644
--- a/keystone/tests/unit/test_v3.py
+++ b/keystone/tests/unit/test_v3.py
@@ -26,8 +26,8 @@ from keystone.common import cache
26from keystone.common import provider_api 26from keystone.common import provider_api
27from keystone.common.validation import validators 27from keystone.common.validation import validators
28from keystone import exception 28from keystone import exception
29from keystone import middleware
30from keystone.resource.backends import base as resource_base 29from keystone.resource.backends import base as resource_base
30from keystone.server.flask.request_processing.middleware import auth_context
31from keystone.tests.common import auth as common_auth 31from keystone.tests.common import auth as common_auth
32from keystone.tests import unit 32from keystone.tests import unit
33from keystone.tests.unit import rest 33from keystone.tests.unit import rest
@@ -1265,7 +1265,7 @@ class AuthContextMiddlewareTestCase(RestfulTestCase):
1265 start_response('200 OK', headers) 1265 start_response('200 OK', headers)
1266 return [body] 1266 return [body]
1267 1267
1268 app = webtest.TestApp(middleware.AuthContextMiddleware(application), 1268 app = webtest.TestApp(auth_context.AuthContextMiddleware(application),
1269 extra_environ=extra_environ) 1269 extra_environ=extra_environ)
1270 resp = app.get('/', headers={authorization.AUTH_TOKEN_HEADER: token}) 1270 resp = app.get('/', headers={authorization.AUTH_TOKEN_HEADER: token})
1271 self.assertEqual(b'body', resp.body) # just to make sure it worked 1271 self.assertEqual(b'body', resp.body) # just to make sure it worked