summaryrefslogtreecommitdiff
path: root/keystoneclient/client.py
diff options
context:
space:
mode:
authorJamie Lennox <jlennox@redhat.com>2013-07-18 15:54:41 +1000
committerJamie Lennox <jlennox@redhat.com>2013-07-23 17:44:54 +1000
commitf2b4e91410ae185a2f412a22a3f41ae3c3649a5e (patch)
tree71d05f1d61b481b389ce0dd85e511c89cddf7513 /keystoneclient/client.py
parentfd8f05350b7bf07d8505100d400ca77892236ed9 (diff)
downloadpython-keystoneclient-f2b4e91410ae185a2f412a22a3f41ae3c3649a5e.tar.gz
Client V3 shouldn't inherit V2
Client V3 is a completely different implementation of the API, if we want to intermix the V2 and V3 APIs then we don't need to version our client at all. Change-Id: I80579cd41df73ccfc6c8feb76843772829afac4e
Diffstat (limited to 'keystoneclient/client.py')
-rw-r--r--keystoneclient/client.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/keystoneclient/client.py b/keystoneclient/client.py
index f017bc8..56fc4e7 100644
--- a/keystoneclient/client.py
+++ b/keystoneclient/client.py
@@ -428,8 +428,29 @@ class HTTPClient(object):
def process_token(self):
"""Extract and process information from the new auth_ref.
+ And set the relevant authentication information.
"""
- raise NotImplementedError
+ # if we got a response without a service catalog, set the local
+ # list of tenants for introspection, and leave to client user
+ # to determine what to do. Otherwise, load up the service catalog
+ if self.auth_ref.project_scoped:
+ if not self.auth_ref.tenant_id:
+ raise exceptions.AuthorizationFailure(
+ "Token didn't provide tenant_id")
+ if self.management_url is None and self.auth_ref.management_url:
+ self.management_url = self.auth_ref.management_url[0]
+ self.project_name = self.auth_ref.tenant_name
+ self.project_id = self.auth_ref.tenant_id
+
+ if not self.auth_ref.user_id:
+ raise exceptions.AuthorizationFailure(
+ "Token didn't provide user_id")
+
+ self.user_id = self.auth_ref.user_id
+
+ self.auth_domain_id = self.auth_ref.domain_id
+ self.auth_tenant_id = self.auth_ref.tenant_id
+ self.auth_user_id = self.auth_ref.user_id
def get_raw_token_from_identity_service(self, auth_url, username=None,
password=None, tenant_name=None,