infisicalsdk 1.0.8__tar.gz → 1.0.9__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.

Files changed (23) hide show
  1. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/PKG-INFO +1 -1
  2. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/README.md +24 -0
  3. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/secrets.py +48 -14
  4. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisicalsdk.egg-info/PKG-INFO +1 -1
  5. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/setup.py +1 -1
  6. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/__init__.py +0 -0
  7. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/api_types.py +0 -0
  8. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/client.py +0 -0
  9. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/infisical_requests.py +0 -0
  10. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/__init__.py +0 -0
  11. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/auth.py +0 -0
  12. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/auth_methods/__init__.py +0 -0
  13. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/auth_methods/aws_auth.py +0 -0
  14. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/auth_methods/universal_auth.py +0 -0
  15. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/resources/kms.py +0 -0
  16. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/util/__init__.py +0 -0
  17. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisical_sdk/util/secrets_cache.py +0 -0
  18. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisicalsdk.egg-info/SOURCES.txt +0 -0
  19. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisicalsdk.egg-info/dependency_links.txt +0 -0
  20. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisicalsdk.egg-info/requires.txt +0 -0
  21. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/infisicalsdk.egg-info/top_level.txt +0 -0
  22. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/pyproject.toml +0 -0
  23. {infisicalsdk-1.0.8 → infisicalsdk-1.0.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: infisicalsdk
3
- Version: 1.0.8
3
+ Version: 1.0.9
4
4
  Summary: Infisical API Client
5
5
  Home-page: https://github.com/Infisical/python-sdk-official
6
6
  Author: Infisical
@@ -109,6 +109,7 @@ secrets = client.secrets.list_secrets(
109
109
 
110
110
  **Parameters:**
111
111
  - `project_id` (str): The ID of your project.
112
+ - `project_slug` (str): The slug of your project.
112
113
  - `environment_slug` (str): The environment in which to list secrets (e.g., "dev").
113
114
  - `secret_path` (str): The path to the secrets.
114
115
  - `expand_secret_references` (bool): Whether to expand secret references.
@@ -117,6 +118,8 @@ secrets = client.secrets.list_secrets(
117
118
  - `include_imports` (bool): Whether to include imported secrets.
118
119
  - `tag_filters` (List[str]): Tags to filter secrets.
119
120
 
121
+ **Note:** Exactly one of `project_id` or `project_slug` is required. If both are provided, `project_id` takes precedence.
122
+
120
123
  **Returns:**
121
124
  - `ListSecretsResponse`: The response containing the list of secrets.
122
125
 
@@ -133,12 +136,15 @@ new_secret = client.secrets.create_secret_by_name(
133
136
  skip_multiline_encoding=False,
134
137
  secret_reminder_repeat_days=30, # Optional
135
138
  secret_reminder_note="Remember to update this secret" # Optional
139
+ secret_metadata=[{"key": "metadata_key", "value": "metadata_value"}], # Optional
140
+ tags_ids=["tag_id_1", "tag_id_2"] # Optional
136
141
  )
137
142
  ```
138
143
 
139
144
  **Parameters:**
140
145
  - `secret_name` (str): The name of the secret.
141
146
  - `project_id` (str): The ID of your project.
147
+ - `project_slug` (str): The slug of your project.
142
148
  - `secret_path` (str): The path to the secret.
143
149
  - `environment_slug` (str): The environment in which to create the secret.
144
150
  - `secret_value` (str): The value of the secret.
@@ -146,6 +152,10 @@ new_secret = client.secrets.create_secret_by_name(
146
152
  - `skip_multiline_encoding` (bool, optional): Whether to skip encoding for multiline secrets.
147
153
  - `secret_reminder_repeat_days` (Union[float, int], optional): Number of days after which to repeat secret reminders.
148
154
  - `secret_reminder_note` (str, optional): A note for the secret reminder.
155
+ - `secret_metadata` (List[Dict[str, Any]], optional): Metadata associated with the secret.
156
+ - `tags_ids` (List[str], optional): IDs of tags to associate with the secret.
157
+
158
+ **Note:** Exactly one of `project_id` or `project_slug` is required. If both are provided, `project_id` takes precedence.
149
159
 
150
160
  **Returns:**
151
161
  - `BaseSecret`: The response after creating the secret.
@@ -156,6 +166,7 @@ new_secret = client.secrets.create_secret_by_name(
156
166
  updated_secret = client.secrets.update_secret_by_name(
157
167
  current_secret_name="EXISTING_SECRET",
158
168
  project_id="<project-id>",
169
+ project_slug="<project-slug>",
159
170
  secret_path="/",
160
171
  environment_slug="dev",
161
172
  secret_value="new_secret_value",
@@ -164,12 +175,15 @@ updated_secret = client.secrets.update_secret_by_name(
164
175
  secret_reminder_repeat_days=30, # Optional
165
176
  secret_reminder_note="Updated reminder note", # Optional
166
177
  new_secret_name="NEW_NAME" # Optional
178
+ secret_metadata=[{"key": "metadata_key", "value": "metadata_value"}], # Optional
179
+ tags_ids=["tag_id_1", "tag_id_2"] # Optional
167
180
  )
168
181
  ```
169
182
 
170
183
  **Parameters:**
171
184
  - `current_secret_name` (str): The current name of the secret.
172
185
  - `project_id` (str): The ID of your project.
186
+ - `project_slug` (str): The slug of your project.
173
187
  - `secret_path` (str): The path to the secret.
174
188
  - `environment_slug` (str): The environment in which to update the secret.
175
189
  - `secret_value` (str, optional): The new value of the secret.
@@ -178,6 +192,10 @@ updated_secret = client.secrets.update_secret_by_name(
178
192
  - `secret_reminder_repeat_days` (Union[float, int], optional): Updated number of days after which to repeat secret reminders.
179
193
  - `secret_reminder_note` (str, optional): An updated note for the secret reminder.
180
194
  - `new_secret_name` (str, optional): A new name for the secret.
195
+ - `secret_metadata` (List[Dict[str, Any]], optional): Metadata associated with the secret.
196
+ - `tags_ids` (List[str], optional): IDs of tags to associate with the secret.
197
+
198
+ **Note:** Exactly one of `project_id` or `project_slug` is required. If both are provided, `project_id` takes precedence.
181
199
 
182
200
  **Returns:**
183
201
  - `BaseSecret`: The response after updating the secret.
@@ -200,6 +218,7 @@ secret = client.secrets.get_secret_by_name(
200
218
  **Parameters:**
201
219
  - `secret_name` (str): The name of the secret.
202
220
  - `project_id` (str): The ID of your project.
221
+ - `project_slug` (str): The slug of your project.
203
222
  - `environment_slug` (str): The environment in which to retrieve the secret.
204
223
  - `secret_path` (str): The path to the secret.
205
224
  - `expand_secret_references` (bool): Whether to expand secret references.
@@ -207,6 +226,8 @@ secret = client.secrets.get_secret_by_name(
207
226
  - `include_imports` (bool): Whether to include imported secrets.
208
227
  - `version` (str, optional): The version of the secret to retrieve. Fetches the latest by default.
209
228
 
229
+ **Note:** Exactly one of `project_id` or `project_slug` is required. If both are provided, `project_id` takes precedence.
230
+
210
231
  **Returns:**
211
232
  - `BaseSecret`: The response containing the secret.
212
233
 
@@ -224,9 +245,12 @@ deleted_secret = client.secrets.delete_secret_by_name(
224
245
  **Parameters:**
225
246
  - `secret_name` (str): The name of the secret to delete.
226
247
  - `project_id` (str): The ID of your project.
248
+ - `project_slug` (str): The slug of your project.
227
249
  - `environment_slug` (str): The environment in which to delete the secret.
228
250
  - `secret_path` (str): The path to the secret.
229
251
 
252
+ **Note:** Exactly one of `project_id` or `project_slug` is required. If both are provided, `project_id` takes precedence.
253
+
230
254
  **Returns:**
231
255
  - `BaseSecret`: The response after deleting the secret.
232
256
 
@@ -1,4 +1,4 @@
1
- from typing import List, Union
1
+ from typing import List, Union, Optional, Dict, Any
2
2
 
3
3
  from infisical_sdk.infisical_requests import InfisicalRequests
4
4
  from infisical_sdk.api_types import ListSecretsResponse, SingleSecretResponse, BaseSecret
@@ -14,14 +14,15 @@ class V3RawSecrets:
14
14
 
15
15
  def list_secrets(
16
16
  self,
17
- project_id: str,
18
17
  environment_slug: str,
19
18
  secret_path: str,
19
+ project_id: str = None,
20
20
  expand_secret_references: bool = True,
21
21
  view_secret_value: bool = True,
22
22
  recursive: bool = False,
23
23
  include_imports: bool = True,
24
- tag_filters: List[str] = []) -> ListSecretsResponse:
24
+ tag_filters: List[str] = [],
25
+ project_slug: str = None) -> ListSecretsResponse:
25
26
 
26
27
  params = {
27
28
  "workspaceId": project_id,
@@ -31,8 +32,12 @@ class V3RawSecrets:
31
32
  "expandSecretReferences": str(expand_secret_references).lower(),
32
33
  "recursive": str(recursive).lower(),
33
34
  "include_imports": str(include_imports).lower(),
35
+ "workspaceSlug": project_slug
34
36
  }
35
37
 
38
+ if project_slug is None and project_id is None:
39
+ raise ValueError("project_slug or project_id must be provided")
40
+
36
41
  if tag_filters:
37
42
  params["tagSlugs"] = ",".join(tag_filters)
38
43
 
@@ -58,9 +63,10 @@ class V3RawSecrets:
58
63
  def get_secret_by_name(
59
64
  self,
60
65
  secret_name: str,
61
- project_id: str,
62
66
  environment_slug: str,
63
67
  secret_path: str,
68
+ project_id: str = None,
69
+ project_slug: str = None,
64
70
  expand_secret_references: bool = True,
65
71
  include_imports: bool = True,
66
72
  view_secret_value: bool = True,
@@ -68,6 +74,7 @@ class V3RawSecrets:
68
74
 
69
75
  params = {
70
76
  "workspaceId": project_id,
77
+ "workspaceSlug": project_slug,
71
78
  "viewSecretValue": str(view_secret_value).lower(),
72
79
  "environment": environment_slug,
73
80
  "secretPath": secret_path,
@@ -76,6 +83,9 @@ class V3RawSecrets:
76
83
  "version": version
77
84
  }
78
85
 
86
+ if project_slug is None and project_id is None:
87
+ raise ValueError("project_slug or project_id must be provided")
88
+
79
89
  cache_params = {
80
90
  "project_id": project_id,
81
91
  "environment_slug": environment_slug,
@@ -105,27 +115,37 @@ class V3RawSecrets:
105
115
  def create_secret_by_name(
106
116
  self,
107
117
  secret_name: str,
108
- project_id: str,
109
118
  secret_path: str,
110
119
  environment_slug: str,
120
+ project_id: str = None,
111
121
  secret_value: str = None,
112
122
  secret_comment: str = None,
113
123
  skip_multiline_encoding: bool = False,
114
124
  secret_reminder_repeat_days: Union[float, int] = None,
115
- secret_reminder_note: str = None) -> BaseSecret:
125
+ secret_reminder_note: str = None,
126
+ project_slug: str = None,
127
+ secret_metadata: Optional[List[Dict[str, Any]]] = None,
128
+ tags_ids: Optional[List[str]] = None,
129
+ ) -> BaseSecret:
116
130
 
117
131
  requestBody = {
118
132
  "workspaceId": project_id,
133
+ "projectSlug": project_slug,
119
134
  "environment": environment_slug,
120
135
  "secretPath": secret_path,
121
136
  "secretValue": secret_value,
122
137
  "secretComment": secret_comment,
123
- "tagIds": None,
138
+ "tagIds": tags_ids,
124
139
  "skipMultilineEncoding": skip_multiline_encoding,
125
140
  "type": "shared",
126
141
  "secretReminderRepeatDays": secret_reminder_repeat_days,
127
- "secretReminderNote": secret_reminder_note
142
+ "secretReminderNote": secret_reminder_note,
143
+ "secretMetadata": secret_metadata,
128
144
  }
145
+
146
+ if project_slug is None and project_id is None:
147
+ raise ValueError("project_slug or project_id must be provided")
148
+
129
149
  result = self.requests.post(
130
150
  path=f"/api/v3/secrets/raw/{secret_name}",
131
151
  json=requestBody,
@@ -152,30 +172,39 @@ class V3RawSecrets:
152
172
  def update_secret_by_name(
153
173
  self,
154
174
  current_secret_name: str,
155
- project_id: str,
156
175
  secret_path: str,
157
176
  environment_slug: str,
177
+ project_id: str = None,
158
178
  secret_value: str = None,
159
179
  secret_comment: str = None,
160
180
  skip_multiline_encoding: bool = False,
161
181
  secret_reminder_repeat_days: Union[float, int] = None,
162
182
  secret_reminder_note: str = None,
163
- new_secret_name: str = None) -> BaseSecret:
183
+ new_secret_name: str = None,
184
+ project_slug: str = None,
185
+ secret_metadata: Optional[List[Dict[str, Any]]] = None,
186
+ tags_ids: Optional[List[str]] = None,
187
+ ) -> BaseSecret:
164
188
 
165
189
  requestBody = {
166
190
  "workspaceId": project_id,
191
+ "projectSlug": project_slug,
167
192
  "environment": environment_slug,
168
193
  "secretPath": secret_path,
169
194
  "secretValue": secret_value,
170
195
  "secretComment": secret_comment,
171
196
  "newSecretName": new_secret_name,
172
- "tagIds": None,
197
+ "tagIds": tags_ids,
173
198
  "skipMultilineEncoding": skip_multiline_encoding,
174
199
  "type": "shared",
175
200
  "secretReminderRepeatDays": secret_reminder_repeat_days,
176
- "secretReminderNote": secret_reminder_note
201
+ "secretReminderNote": secret_reminder_note,
202
+ "secretMetadata": secret_metadata,
177
203
  }
178
204
 
205
+ if project_slug is None and project_id is None:
206
+ raise ValueError("project_slug or project_id must be provided")
207
+
179
208
  result = self.requests.patch(
180
209
  path=f"/api/v3/secrets/raw/{current_secret_name}",
181
210
  json=requestBody,
@@ -201,12 +230,17 @@ class V3RawSecrets:
201
230
  def delete_secret_by_name(
202
231
  self,
203
232
  secret_name: str,
204
- project_id: str,
205
233
  secret_path: str,
206
- environment_slug: str) -> BaseSecret:
234
+ environment_slug: str,
235
+ project_id: str = None,
236
+ project_slug: str = None) -> BaseSecret:
237
+
238
+ if project_slug is None and project_id is None:
239
+ raise ValueError("project_slug or project_id must be provided")
207
240
 
208
241
  requestBody = {
209
242
  "workspaceId": project_id,
243
+ "projectSlug": project_slug,
210
244
  "environment": environment_slug,
211
245
  "secretPath": secret_path,
212
246
  "type": "shared",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: infisicalsdk
3
- Version: 1.0.8
3
+ Version: 1.0.9
4
4
  Summary: Infisical API Client
5
5
  Home-page: https://github.com/Infisical/python-sdk-official
6
6
  Author: Infisical
@@ -15,7 +15,7 @@ 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 = "1.0.8"
18
+ VERSION = "1.0.9"
19
19
  PYTHON_REQUIRES = ">=3.8"
20
20
  REQUIRES = [
21
21
  "python-dateutil",
File without changes