Update keystonemiddleware to 4.18.0

Depends-on: I38cd025fe6e6a40dcfc443c2e0db83cf8a1e5acf
Change-Id: I9cf03fd37472e6a6e6d53504b1211f2c35fe50cd
This commit is contained in:
melissaml
2017-11-16 10:24:07 +08:00
committed by Dirk Mueller
parent 9628209286
commit 5da920886d
2 changed files with 1 additions and 70 deletions

View File

@@ -1,68 +0,0 @@
From 04735348de7e81e8190849fd676b04377a2a4e8c Mon Sep 17 00:00:00 2001
From: Tin Lam <tin@irrational.io>
Date: Fri, 15 Sep 2017 13:25:46 -0500
Subject: [PATCH] Fix gate error caused by mocked URLs
In keystoneauth a workaround was implemented for when the discovery
document has an invalid scheme and host for its URLs[1]. This broke
keystonemiddleware's tests, revealing that keystonemiddleware was, in
one case, validating the wrong URL, and in another mocking the wrong
one. This patch updates the tests so that they are more accurately
representing how keystoneauth works.
Why should we change it here instead of reverting the keystoneauth
change? The URLs in the discovery document aren't validated in real
life, so the only URLs that can be trusted are the ones the user has
accessed, such as the auth URL. Keystoneauth is right to fix the URLs,
and the bad mocks in keystonemiddleware are only evidence that the tests
were wrong, not that the mocked URLs would have worked in real life.
[1] https://review.openstack.org/#/c/494194
Closes-Bug: Closes-bug: #1718945
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
Change-Id: I94d6dd1839bd1f662e70c5fb739695685e839a82
---
.../tests/unit/auth_token/test_auth_token_middleware.py | 4 ++--
keystonemiddleware/tests/unit/client_fixtures.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
index 6c66aee..2a3a66d 100644
--- a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
+++ b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
@@ -2442,7 +2442,7 @@ class AuthProtocolLoadingTests(BaseAuthTokenMiddlewareTest):
s = admin_token.add_service('identity', name='keystone')
s.add_standard_endpoints(admin=self.KEYSTONE_URL)
- self.requests_mock.post(self.DISC_URL + '/v3/auth/tokens',
+ self.requests_mock.post('%s/v3/auth/tokens' % self.AUTH_URL,
json=admin_token,
headers={'X-Subject-Token': admin_token_id})
@@ -2454,7 +2454,7 @@ class AuthProtocolLoadingTests(BaseAuthTokenMiddlewareTest):
request_headers = {'X-Subject-Token': user_token_id,
'X-Auth-Token': admin_token_id}
- self.requests_mock.get(self.CRUD_URL + '/v3/auth/tokens',
+ self.requests_mock.get('%s/v3/auth/tokens' % self.KEYSTONE_BASE_URL,
request_headers=request_headers,
json=user_token,
headers={'X-Subject-Token': uuid.uuid4().hex})
diff --git a/keystonemiddleware/tests/unit/client_fixtures.py b/keystonemiddleware/tests/unit/client_fixtures.py
index 528b418..fe199fc 100644
--- a/keystonemiddleware/tests/unit/client_fixtures.py
+++ b/keystonemiddleware/tests/unit/client_fixtures.py
@@ -252,7 +252,7 @@ class Examples(fixtures.Fixture):
SERVICE_ROLE_NAME2 = 'service_role2'
self.SERVICE_TYPE = 'identity'
- self.UNVERSIONED_SERVICE_URL = 'http://keystone.server:5000/'
+ self.UNVERSIONED_SERVICE_URL = 'https://keystone.example.com:1234/'
self.SERVICE_URL = self.UNVERSIONED_SERVICE_URL + 'v2.0'
# Old Tokens
--
2.14.2

View File

@@ -1,13 +1,12 @@
%global sname keystonemiddleware
Name: {{ py2name('keystonemiddleware') }}
Version: 4.17.0
Version: 4.18.0
Release: 0
Summary: Middleware for OpenStack Identity
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://launchpad.net/%{sname}
Source0: https://files.pythonhosted.org/packages/source/k/%{sname}/%{sname}-%{version}.tar.gz
Patch1: 0001-Fix-gate-error-caused-by-mocked-URLs.patch
BuildRequires: openstack-macros
BuildRequires: {{ py2pkg('WebOb') }}
BuildRequires: {{ py2pkg('WebTest') }}