PKI 10.8 Python Changes

From Dogtag
Revision as of 16:34, 9 September 2019 by Edewata (talk | contribs)

Jump to: navigation, search

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