summaryrefslogtreecommitdiff
path: root/keystoneclient/middleware/auth_token.py
diff options
context:
space:
mode:
authorwanghong <w.wanghong@huawei.com>2014-03-21 16:53:20 +0800
committerwanghong <w.wanghong@huawei.com>2014-03-21 17:06:21 +0800
commit645e5bacf2c4c8bd9ee37f84af9a9c6aa3cf284a (patch)
treecdc68d333930c8d48b257f7a6c3b40020735b77e /keystoneclient/middleware/auth_token.py
parentb63bd9c3d8c1f47a9354242eaee196713edde01f (diff)
downloadpython-keystoneclient-645e5bacf2c4c8bd9ee37f84af9a9c6aa3cf284a.tar.gz
use v3 api to get certificates
Let Token signing and ca certificates can be accessible at /v3/OS-SIMPLE-CERT/{ca,certificates}. Change-Id: I6c82d1f78ba1ff2ab110474623982542610b4d2d Closes-Bug: #1206345
Diffstat (limited to 'keystoneclient/middleware/auth_token.py')
-rw-r--r--keystoneclient/middleware/auth_token.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/keystoneclient/middleware/auth_token.py b/keystoneclient/middleware/auth_token.py
index 7bed4fe..aeb647e 100644
--- a/keystoneclient/middleware/auth_token.py
+++ b/keystoneclient/middleware/auth_token.py
@@ -1361,7 +1361,15 @@ class AuthProtocol(object):
return self.cms_verify(data['signed'])
def _fetch_cert_file(self, cert_file_name, cert_type):
- path = '/v2.0/certificates/' + cert_type
+ if not self.auth_version:
+ self.auth_version = self._choose_api_version()
+
+ if self.auth_version == 'v3.0':
+ if cert_type == 'signing':
+ cert_type = 'certificates'
+ path = '/v3/OS-SIMPLE-CERT/' + cert_type
+ else:
+ path = '/v2.0/certificates/' + cert_type
response = self._http_request('GET', path)
if response.status_code != 200:
raise exceptions.CertificateConfigError(response.text)