summaryrefslogtreecommitdiff
path: root/keystoneclient/httpclient.py
diff options
context:
space:
mode:
authorDr. Jens Harbott <harbott@osism.tech>2021-11-05 22:16:34 +0100
committerDr. Jens Harbott <harbott@osism.tech>2021-11-05 22:37:50 +0100
commitea6fe1da5d980e0f329c8b3abfa19d25400f366c (patch)
tree298cffee2580c2a665a405e0ae42857399982af5 /keystoneclient/httpclient.py
parentd5cb761763988217cdd00a7981a62e2083fd381f (diff)
downloadpython-keystoneclient-ea6fe1da5d980e0f329c8b3abfa19d25400f366c.tar.gz
Stop using an admin endpoint by default
With V3 of the identity API, we no longer need to have a dedicated admin endpoint, so stop requesting one by default, allowing deployments to actually work without one. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: I96cc9c14008bcc59992d06c89f8f50895390f11e
Diffstat (limited to 'keystoneclient/httpclient.py')
-rw-r--r--keystoneclient/httpclient.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py
index 8d157ce..1e94dab 100644
--- a/keystoneclient/httpclient.py
+++ b/keystoneclient/httpclient.py
@@ -221,7 +221,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
:param string service_name: The default service_name for URL discovery.
default: None (optional)
:param string interface: The default interface for URL discovery.
- default: admin (optional)
+ default: admin (v2), public (v3). (optional)
:param string endpoint_override: Always use this endpoint URL for requests
for this client. (optional)
:param auth: An auth plugin to use instead of the session one. (optional)
@@ -248,7 +248,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
domain_name=None, project_id=None, project_name=None,
project_domain_id=None, project_domain_name=None,
trust_id=None, session=None, service_name=None,
- interface='admin', endpoint_override=None, auth=None,
+ interface='default', endpoint_override=None, auth=None,
user_agent=USER_AGENT, connect_retries=None, **kwargs):
# set baseline defaults
self.user_id = None
@@ -372,12 +372,21 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
self.session = session
self.domain = ''
- # NOTE(jamielennox): unfortunately we can't just use **kwargs here as
- # it would incompatibly limit the kwargs that can be passed to __init__
- # try and keep this list in sync with adapter.Adapter.__init__
version = (
_discover.normalize_version_number(self.version) if self.version
else None)
+
+ # NOTE(frickler): If we know we have v3, use the public interface as
+ # default, otherwise keep the historic default of admin
+ if interface == 'default':
+ if version == (3, 0):
+ interface = 'public'
+ else:
+ interface = 'admin'
+
+ # NOTE(jamielennox): unfortunately we can't just use **kwargs here as
+ # it would incompatibly limit the kwargs that can be passed to __init__
+ # try and keep this list in sync with adapter.Adapter.__init__
self._adapter = _KeystoneAdapter(session,
service_type='identity',
service_name=service_name,