Difference between revisions of "PKI 10.8 Python Changes"

From Dogtag
Jump to: navigation, search
m (pki.client.PKIConnection)
m
Line 1: Line 1:
 
= Changes in PKIConnection =
 
= Changes in PKIConnection =
  
Previously the subsystem name had to be specified when creating the connection object,
+
Previously PKIConnection object has to be created for a specific subsystem, limiting its use to that subsystem only.
limiting the use of the connection object to a specific subsystem only. For example:
+
Also, the URL path for get(), post(), put(), delete() has to be a relative path.
 +
For example:
  
 
<pre>
 
<pre>
 
ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
 
ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
 +
certs = ca_connection.get('/rest/certs')
 
cert_client = CertClient(ca_connection)
 
cert_client = CertClient(ca_connection)
certs = ca_connection.get('/rest/certs')
 
  
 
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
 
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
 +
keys = kra_connection.get('/rest/keys')
 
key_client = KeyClient(kra_connection)
 
key_client = KeyClient(kra_connection)
keys = kra_connection.get('/rest/keys')
 
 
</pre>
 
</pre>
  
Since PKI 10.8 the subsystem should be specified when creating the objects instead,
+
Since PKI 10.8 the subsystem should be specified when creating the objects.
allowing the connection object to be used with various subsystems. For example:
+
The URL path for get(), post(), put(), delete() has to be an absolute path.
 +
This allows the connection object to be used with various subsystems.
 +
For example:
  
 
<pre>
 
<pre>
 
connection = PKIConnection(hostname='localhost', port='8080')
 
connection = PKIConnection(hostname='localhost', port='8080')
  
cert_client = CertClient(connection, subsystem='ca')
 
 
certs = connection.get('/ca/rest/certs')
 
certs = connection.get('/ca/rest/certs')
 +
keys = connection.get('/kra/rest/keys')
  
key_client = KeyClient(kra_connection, subsystem='kra')
+
cert_client = CertClient(connection, subsystem='ca')
keys = connection.get('/kra/rest/keys')
+
key_client = KeyClient(connection, subsystem='kra')
 
</pre>
 
</pre>
  

Revision as of 16:34, 9 September 2019

Changes in PKIConnection

Previously PKIConnection object has to be created for a specific subsystem, limiting its use to that subsystem only. Also, the URL path for get(), post(), put(), delete() has to be a relative path. For example:

ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
certs = ca_connection.get('/rest/certs')
cert_client = CertClient(ca_connection)

kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
keys = kra_connection.get('/rest/keys')
key_client = KeyClient(kra_connection)

Since PKI 10.8 the subsystem should be specified when creating the objects. The URL path for get(), post(), put(), delete() has to be an absolute path. This allows the connection object to be used with various subsystems. For example:

connection = PKIConnection(hostname='localhost', port='8080')

certs = connection.get('/ca/rest/certs')
keys = connection.get('/kra/rest/keys')

cert_client = CertClient(connection, subsystem='ca')
key_client = KeyClient(connection, subsystem='kra')

See Also