(users)
- get_encryption_certificate - Retrieve the user's public key for encryption.
- store_secret - Store an encrypted secret
Retrieve a short lived certificate with the public key for encrypting secrets.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.users.get_encryption_certificate(request={})
assert res.encryption_certificate_response is not None
# Handle response
print(res.encryption_certificate_response)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetEncryptionCertificateRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
server_url |
Optional[str] | ➖ | An optional server URL to use. |
operations.GetEncryptionCertificateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
After encrypting a secret locally, store it and get back a reference id.
from unstructured_client import UnstructuredClient
with UnstructuredClient() as uc_client:
res = uc_client.users.store_secret(request={
"encrypted_secret": {
"encrypted_value": "<value>",
},
})
assert res.secret_reference is not None
# Handle response
print(res.secret_reference)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.StoreSecretRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
server_url |
Optional[str] | ➖ | An optional server URL to use. |
operations.StoreSecretResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |