Skip to content

Commit 807da32

Browse files
authored
Merge pull request #32 from Infisical/daniel/secret-caching
feat: secrets caching support
2 parents 441a32d + bf80556 commit 807da32

21 files changed

+1158
-552
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ target/
6767

6868
# IDEs
6969
.idea
70+
71+
.env

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,29 @@ client.auth.universal_auth.login(
4545
secrets = client.secrets.list_secrets(project_id="<project-id>", environment_slug="dev", secret_path="/")
4646
```
4747

48+
## InfisicalSDKClient Parameters
49+
50+
The `InfisicalSDKClient` takes the following parameters, which are used as a global configuration for the lifetime of the SDK instance.
51+
52+
- **host** (`str`, _Optional_): The host URL for your Infisical instance. Defaults to `https://app.infisical.com`.
53+
- **token** (`str`, _Optional_): Specify an authentication token to use for all requests. If provided, you will not need to call any of the `auth` methods. Defaults to `None`
54+
- **cache_ttl** (`int`, _Optional_): The SDK has built-in client-side caching for secrets, greatly improving response times. By default, secrets are cached for 1 minute (60 seconds). You can disable caching by setting `cache_ttl` to `None`, or adjust the duration in seconds as needed.
55+
56+
```python
57+
client = InfisicalSDKClient(
58+
host="https://app.infisical.com", # Defaults to https://app.infisical.com
59+
token="<optional-auth-token>", # If not set, use the client.auth() methods.
60+
cache_ttl = 300 # `None` to disable caching
61+
)
62+
```
63+
4864
## Core Methods
4965

5066
The SDK methods are organized into the following high-level categories:
5167

5268
1. `auth`: Handles authentication methods.
5369
2. `secrets`: Manages CRUD operations for secrets.
70+
3. `kms`: Perform cryptographic operations with Infisical KMS.
5471

5572
### `auth`
5673

example.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

infisical_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .client import InfisicalSDKClient # noqa
22
from .infisical_requests import InfisicalError # noqa
3-
from .api_types import SingleSecretResponse, ListSecretsResponse, BaseSecret # noqa
3+
from .api_types import SingleSecretResponse, ListSecretsResponse, BaseSecret, SymmetricEncryption # noqa

0 commit comments

Comments
 (0)