Thales CipherTrust SDK RestAPI
Project description
ciphertrust-sdk
Thales CipherTrust API
Installation
>>> python -m pip install ciphertrust-sdk
Usage
This is a baseline SDK that allows you to pass the url path and parmeters for each action:
- GET
- POST
- DELETE
- PATCH
Please see the CipherTrust Manager Playground to see full url_paths. This will only pass the authorization and return the results as described within the documentation. It can be leveraged to handle authorization and return the work for orchestration.
Creating API Authentication:
from ciphertrust.api import API
import json
# User based credentials
username = "username"
passwd = "secretpassword"
host = "thales-host01.example.com"
api = API(username=username,password=passwd,hostname=host,verify="/path/to/certificate.pem")
response = api.get.call(url_path="vault/keys2/")
print(json.dumps(response, indent=2))
Sample Output:
{
"skip": 0,
"limit": 10,
"total": 100,
"resources": [
{
"id": "",
"uri": "",
"account": "",
"application": "",
"devAccount": "",
"createdAt": "",
"name": "",
"updatedAt": "",
"activationDate": "",
"state": "",
"usageMask": 0,
"meta": null,
"objectType": "",
"sha1Fingerprint": "",
"sha256Fingerprint": "",
"defaultIV": "",
"version": 0,
"algorithm": "",
"size": 0,
"muid": ""
}
]
}
Version
Version | Build | Changes |
---|---|---|
0.0.1 | final | Test Relese; basic functionality |
1.0.1 | final | Available Release with API and Auth functionality |
1.0.2 | a1 | Removed print |
1.0.2 | a2 | Added metrics in calls and additional awaits to call on mutliple calls |
1.0.2 | final | See notes below |
1.0.3 | final | See notes below |
1.0.4 | final | See notes below |
Known Bugs/Futue Features
TODO:
- ☑ Create a metrics fucntion to return
- ☑ Delete all private aand passwords being printed
- ☐ Add logging or streaming or none
- ☐ Add own metrics
- ☐ Generic metrics wrapper
- ☐ Logging metrics wrapper
- ☑ Create an average, mean, total time depending on calls being made for when you want to do a full list of keys
- ☑ Missing delete https action
- ☑ Create a download method to handle downlaoding files
Release Notes
v1.0.4
- Updated standard download log file to include hostname in filename.
TODO:
- Need to build additional async requests when calling multiple items.
- Build out ability to send multiple requests and hold the type of requests to make it easier to use the SDK.
v1.0.3
- Fixed bug with headers returning a requests.exceptions.JSONDecodeError due to the way headers are formated.
- Added more timeing metrics for quanitfying calls.
- Added ability to request a download when stream=True is passed in call.
v1.0.2
- Added Generic Metrics to each call with additional statistics that can be used.
- Added async to handle multle requests; still need to take advantage of it.
- Removed disclosure of secrets in debug prints.
Known Bugs:
- Too many calls cause crash or non-responsive requests leading to time out.
v1.0.1
Initial usable release
- Allows ability to run get functions in a wrapper.
- Supply all changes and updates with the standard get request using the api.get() call.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ciphertrust-sdk-1.0.4.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for ciphertrust_sdk-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20afcc4d4a4e5a1007c70ffc89d1352d837e5d321303ea405a120830da0b9eb9 |
|
MD5 | d633ea862b7a0038282e72d53b013f39 |
|
BLAKE2b-256 | 2cdfd53f59f58d70c2c9c4d78ec7d8f8aefffa764300f4193c7dc876bcc4ab45 |