Debian Codegraph @

keystoneclient/v3/contrib/simple_cert.py

raw symbols SCIP
1 # Copyright 2014 IBM Corp.
2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
5 #
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
12 # under the License.
13
14 from keystoneclient import base
15
16
17 class SimpleCertManager(object):
18 """Manager for the OS-SIMPLE-CERT extension."""
19
20 def __init__(self, client):
21 self._client = client
22 self.mgr = base.Manager(self._client)
23
24 def get_ca_certificates(self):
25 """Get CA certificates.
26
27 :returns: PEM-formatted string.
28 :rtype: str
29
30 """
31 resp, body = self._client.get('/OS-SIMPLE-CERT/ca',
32 authenticated=False)
33 return self.mgr._prepare_return_value(resp, resp.text)
34
35 def get_certificates(self):
36 """Get signing certificates.
37
38 :returns: PEM-formatted string.
39 :rtype: str
40
41 """
42 resp, body = self._client.get('/OS-SIMPLE-CERT/certificates',
43 authenticated=False)
44 return self.mgr._prepare_return_value(resp, resp.text)