Update Python API to support REST API v2 #4900
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
PKIClient
class has been added to replacePKIConnection
as the main access point to PKI services. By default it will use REST API v2, then fall back to v1 if it's not available. Optionally,PKIClient
can be configured to use a specific REST API version.The
InfoClient
,CertClient
,AccountClient
, andUserClient
classes have been added/updated to construct the proper REST URL according to the REST API version inPKIClient
.The
pki-healthcheck
has been updated to usePKIClient
. Some simple Python scripts have also been added to demonstrate how to usePKIClient
.New tests have been added to run these scripts against the current CA and KRA which support both REST API v1 and v2 and also against an older CA that only supports REST API v1.