diff options
author | Jamie Lennox <jamielennox@redhat.com> | 2014-09-03 12:51:26 +1000 |
---|---|---|
committer | Jamie Lennox <jamielennox@redhat.com> | 2015-01-05 09:56:40 +1000 |
commit | 4cc1631665ac3f6d778b2d7ff538f1156ae793e4 (patch) | |
tree | 21f48aacb80b10888617e7f7e86b6457dad0f60f /keystoneclient/httpclient.py | |
parent | 53a82232ff52b9f39a3cb22d1769c3f9134e7003 (diff) | |
download | python-keystoneclient-4cc1631665ac3f6d778b2d7ff538f1156ae793e4.tar.gz |
Allow fetching user_id/project_id from auth
This would ideally not be required however when building certain URLs
the current user_id is needed. And when communicating with certain
services we need to have access to the current project id. It seems
better to allow plugins to give up the information if they have it than
do various hacks to try and get it from them.
Change-Id: Ib61b0628702806268be623a9987a922a60b04165
Closes-Bug: #1364724
Diffstat (limited to 'keystoneclient/httpclient.py')
-rw-r--r-- | keystoneclient/httpclient.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py index 458745f..84b314e 100644 --- a/keystoneclient/httpclient.py +++ b/keystoneclient/httpclient.py @@ -362,6 +362,12 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin): else: return self.management_url + def get_user_id(self, session, **kwargs): + return self.auth_ref.user_id + + def get_project_id(self, session, **kwargs): + return self.auth_ref.project_id + @auth_token.setter def auth_token(self, value): """Override the auth_token. |