infisicalsdk 0.1.4__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of infisicalsdk might be problematic. Click here for more details.
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/PKG-INFO +1 -1
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/README.md +14 -20
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisical_sdk/api_types.py +2 -6
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisical_sdk/client.py +1 -1
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisical_sdk/infisical_requests.py +5 -5
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisicalsdk.egg-info/PKG-INFO +1 -1
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/setup.py +2 -2
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisical_sdk/__init__.py +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisicalsdk.egg-info/SOURCES.txt +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisicalsdk.egg-info/dependency_links.txt +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisicalsdk.egg-info/requires.txt +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/infisicalsdk.egg-info/top_level.txt +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/pyproject.toml +0 -0
- {infisicalsdk-0.1.4 → infisicalsdk-1.0.2}/setup.cfg +0 -0
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The Infisical SDK provides a convenient way to interact with the Infisical API.
|
|
4
4
|
|
|
5
|
-
### Migrating to version 1.0.
|
|
5
|
+
### Migrating to version 1.0.0 or above
|
|
6
6
|
|
|
7
|
-
We have recently rolled out our first stable version of the SDK, version `1.0.
|
|
7
|
+
We have recently rolled out our first stable version of the SDK, version `1.0.0` and above.
|
|
8
8
|
|
|
9
|
-
The 1.0.
|
|
9
|
+
The 1.0.0 version comes with a few key changes that may change how you're using the SDK.
|
|
10
10
|
1. **Removal of `rest`**: The SDK no longer exposes the entire Infisical API. This was nessecary as we have moved away from using an OpenAPI generator approach. We aim to add support for more API resources in the near future. If you have any specific requests, please [open an issue](https://github.com/Infisical/python-sdk-official/issues).
|
|
11
11
|
|
|
12
|
-
2. **New response types**: The 1.0.
|
|
12
|
+
2. **New response types**: The 1.0.0 release uses return types that differ from the older versions. The new return types such as `BaseSecret`, are all exported from the Infisical SDK.
|
|
13
13
|
|
|
14
14
|
3. **Property renaming**: Some properties on the responses have been slightly renamed. An example of this would be that the `secret_key` property on the `get_secret_by_name()` method, that has been renamed to `secretKey`.
|
|
15
15
|
|
|
16
|
-
With this in mind, you're ready to upgrade your SDK version to `1.0.
|
|
16
|
+
With this in mind, you're ready to upgrade your SDK version to `1.0.0` or above.
|
|
17
17
|
|
|
18
18
|
You can refer to our [legacy documentation](https://github.com/Infisical/python-sdk-official/tree/9b0403938ee5ae599d42c5f1fdf9158671a15606?tab=readme-ov-file#infisical-python-sdk) if need be.
|
|
19
19
|
|
|
@@ -36,13 +36,10 @@ from infisical_sdk import InfisicalSDKClient
|
|
|
36
36
|
client = InfisicalSDKClient(host="https://app.infisical.com")
|
|
37
37
|
|
|
38
38
|
# Authenticate (example using Universal Auth)
|
|
39
|
-
client.auth.universal_auth.login(
|
|
40
|
-
client_id="<machine-identity-client-id>",
|
|
41
|
-
client_secret="<machine-identity-client-secret>"
|
|
42
|
-
)
|
|
39
|
+
client.auth.universal_auth.login(client_id="your_client_id", client_secret="your_client_secret")
|
|
43
40
|
|
|
44
41
|
# Use the SDK to interact with Infisical
|
|
45
|
-
secrets = client.secrets.list_secrets(project_id="
|
|
42
|
+
secrets = client.secrets.list_secrets(project_id="your_project_id", environment_slug="dev", secret_path="/")
|
|
46
43
|
```
|
|
47
44
|
|
|
48
45
|
## Core Methods
|
|
@@ -59,16 +56,13 @@ The `Auth` component provides methods for authentication:
|
|
|
59
56
|
#### Universal Auth
|
|
60
57
|
|
|
61
58
|
```python
|
|
62
|
-
response = client.auth.universal_auth.login(
|
|
63
|
-
client_id="<machine-identity-client-id>",
|
|
64
|
-
client_secret="<machine-identity-client-secret>"
|
|
65
|
-
)
|
|
59
|
+
response = client.auth.universal_auth.login(client_id="your_client_id", client_secret="your_client_secret")
|
|
66
60
|
```
|
|
67
61
|
|
|
68
62
|
#### AWS Auth
|
|
69
63
|
|
|
70
64
|
```python
|
|
71
|
-
response = client.auth.aws_auth.login(identity_id="
|
|
65
|
+
response = client.auth.aws_auth.login(identity_id="your_identity_id")
|
|
72
66
|
```
|
|
73
67
|
|
|
74
68
|
### `secrets`
|
|
@@ -79,7 +73,7 @@ This sub-class handles operations related to secrets:
|
|
|
79
73
|
|
|
80
74
|
```python
|
|
81
75
|
secrets = client.secrets.list_secrets(
|
|
82
|
-
project_id="
|
|
76
|
+
project_id="your_project_id",
|
|
83
77
|
environment_slug="dev",
|
|
84
78
|
secret_path="/",
|
|
85
79
|
expand_secret_references=True,
|
|
@@ -106,7 +100,7 @@ secrets = client.secrets.list_secrets(
|
|
|
106
100
|
```python
|
|
107
101
|
new_secret = client.secrets.create_secret_by_name(
|
|
108
102
|
secret_name="NEW_SECRET",
|
|
109
|
-
project_id="
|
|
103
|
+
project_id="your_project_id",
|
|
110
104
|
secret_path="/",
|
|
111
105
|
environment_slug="dev",
|
|
112
106
|
secret_value="secret_value",
|
|
@@ -136,7 +130,7 @@ new_secret = client.secrets.create_secret_by_name(
|
|
|
136
130
|
```python
|
|
137
131
|
updated_secret = client.secrets.update_secret_by_name(
|
|
138
132
|
current_secret_name="EXISTING_SECRET",
|
|
139
|
-
project_id="
|
|
133
|
+
project_id="your_project_id",
|
|
140
134
|
secret_path="/",
|
|
141
135
|
environment_slug="dev",
|
|
142
136
|
secret_value="new_secret_value",
|
|
@@ -168,7 +162,7 @@ updated_secret = client.secrets.update_secret_by_name(
|
|
|
168
162
|
```python
|
|
169
163
|
secret = client.secrets.get_secret_by_name(
|
|
170
164
|
secret_name="EXISTING_SECRET",
|
|
171
|
-
project_id="
|
|
165
|
+
project_id="your_project_id",
|
|
172
166
|
environment_slug="dev",
|
|
173
167
|
secret_path="/",
|
|
174
168
|
expand_secret_references=True,
|
|
@@ -194,7 +188,7 @@ secret = client.secrets.get_secret_by_name(
|
|
|
194
188
|
```python
|
|
195
189
|
deleted_secret = client.secrets.delete_secret_by_name(
|
|
196
190
|
secret_name="EXISTING_SECRET",
|
|
197
|
-
project_id="
|
|
191
|
+
project_id="your_project_id",
|
|
198
192
|
environment_slug="dev",
|
|
199
193
|
secret_path="/"
|
|
200
194
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from dataclasses import dataclass, field
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
2
|
from typing import Optional, List, Any, Dict
|
|
3
3
|
from enum import Enum
|
|
4
4
|
import json
|
|
@@ -34,10 +34,7 @@ class BaseModel:
|
|
|
34
34
|
@classmethod
|
|
35
35
|
def from_dict(cls, data: Dict) -> 'BaseModel':
|
|
36
36
|
"""Create model from dictionary"""
|
|
37
|
-
|
|
38
|
-
valid_fields = {f.name for f in fields(cls)}
|
|
39
|
-
filtered_data = {k: v for k, v in data.items() if k in valid_fields}
|
|
40
|
-
return cls(**filtered_data)
|
|
37
|
+
return cls(**data)
|
|
41
38
|
|
|
42
39
|
def to_json(self) -> str:
|
|
43
40
|
"""Convert model to JSON string"""
|
|
@@ -73,7 +70,6 @@ class BaseSecret(BaseModel):
|
|
|
73
70
|
secretComment: str
|
|
74
71
|
createdAt: str
|
|
75
72
|
updatedAt: str
|
|
76
|
-
secretMetadata: Optional[Dict[str, Any]] = None
|
|
77
73
|
secretReminderNote: Optional[str] = None
|
|
78
74
|
secretReminderRepeatDays: Optional[int] = None
|
|
79
75
|
skipMultilineEncoding: Optional[bool] = False
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Dict, Generic, Optional, TypeVar
|
|
1
|
+
from typing import Any, Dict, Generic, Optional, TypeVar
|
|
2
2
|
from urllib.parse import urljoin
|
|
3
3
|
import requests
|
|
4
4
|
from dataclasses import dataclass
|
|
@@ -90,7 +90,7 @@ class InfisicalRequests:
|
|
|
90
90
|
def get(
|
|
91
91
|
self,
|
|
92
92
|
path: str,
|
|
93
|
-
model:
|
|
93
|
+
model: type[T],
|
|
94
94
|
params: Optional[Dict[str, Any]] = None
|
|
95
95
|
) -> APIResponse[T]:
|
|
96
96
|
|
|
@@ -116,7 +116,7 @@ class InfisicalRequests:
|
|
|
116
116
|
def post(
|
|
117
117
|
self,
|
|
118
118
|
path: str,
|
|
119
|
-
model:
|
|
119
|
+
model: type[T],
|
|
120
120
|
json: Optional[Dict[str, Any]] = None
|
|
121
121
|
) -> APIResponse[T]:
|
|
122
122
|
|
|
@@ -140,7 +140,7 @@ class InfisicalRequests:
|
|
|
140
140
|
def patch(
|
|
141
141
|
self,
|
|
142
142
|
path: str,
|
|
143
|
-
model:
|
|
143
|
+
model: type[T],
|
|
144
144
|
json: Optional[Dict[str, Any]] = None
|
|
145
145
|
) -> APIResponse[T]:
|
|
146
146
|
|
|
@@ -164,7 +164,7 @@ class InfisicalRequests:
|
|
|
164
164
|
def delete(
|
|
165
165
|
self,
|
|
166
166
|
path: str,
|
|
167
|
-
model:
|
|
167
|
+
model: type[T],
|
|
168
168
|
json: Optional[Dict[str, Any]] = None
|
|
169
169
|
) -> APIResponse[T]:
|
|
170
170
|
|
|
@@ -15,8 +15,8 @@ from setuptools import setup, find_packages # noqa: H301
|
|
|
15
15
|
# prerequisite: setuptools
|
|
16
16
|
# http://pypi.python.org/pypi/setuptools
|
|
17
17
|
NAME = "infisicalsdk"
|
|
18
|
-
VERSION = "0.
|
|
19
|
-
PYTHON_REQUIRES = ">=3.
|
|
18
|
+
VERSION = "1.0.2"
|
|
19
|
+
PYTHON_REQUIRES = ">=3.7"
|
|
20
20
|
REQUIRES = [
|
|
21
21
|
"urllib3 >= 1.25.3, < 2.1.0",
|
|
22
22
|
"python-dateutil",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|