diff options
| author | Jamie Lennox <jamielennox@redhat.com> | 2014-04-28 12:20:46 +1000 |
|---|---|---|
| committer | Jamie Lennox <jamielennox@redhat.com> | 2014-09-16 10:41:55 +1000 |
| commit | ec57b35bc8edb933fe259db2b96c393874166dc0 (patch) | |
| tree | 13d73119da90341a28ab2b340b0de3e95e3a1624 /keystoneclient/auth | |
| parent | 3305c7be4b726de4dcc889006d0be30eb46d3ad9 (diff) | |
| download | python-keystoneclient-ec57b35bc8edb933fe259db2b96c393874166dc0.tar.gz | |
Versioned Endpoint hack for Sessions
To maintain compatibility we must allow people to specify a versioned
URL in the service catalog but allow the plugins to return a different
URL to users.
We need this to be a general approach as other services will likely have
a similar problem with their catalog.
The expectation here is that a client will register the catalog hack at
import time rather than for every request.
Closes-Bug: #1335726
Change-Id: I244f0ec3acca39fd1b2a2c5883abc06ec10eddc7
Diffstat (limited to 'keystoneclient/auth')
| -rw-r--r-- | keystoneclient/auth/identity/base.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/keystoneclient/auth/identity/base.py b/keystoneclient/auth/identity/base.py index 8069e5c..10a9fe8 100644 --- a/keystoneclient/auth/identity/base.py +++ b/keystoneclient/auth/identity/base.py @@ -201,8 +201,15 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): # defaulting to the most recent version. return url + # NOTE(jamielennox): For backwards compatibility people might have a + # versioned endpoint in their catalog even though they want to use + # other endpoint versions. So we support a list of client defined + # situations where we can strip the version component from a URL before + # doing discovery. + hacked_url = _discover.get_catalog_discover_hack(service_type, url) + try: - disc = self.get_discovery(session, url, authenticated=False) + disc = self.get_discovery(session, hacked_url, authenticated=False) except (exceptions.DiscoveryFailure, exceptions.HTTPError, exceptions.ConnectionError): |
