Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ secrets = client.secrets.list_secrets(
project_id="<project-id>",
environment_slug="dev",
secret_path="/",
expand_secret_references=True,
recursive=False,
include_imports=True,
tag_filters=[]
expand_secret_references=True, # Optional
view_secret_value=True, # Optional
recursive=False, # Optional
include_imports=True, # Optional
tag_filters=[] # Optional
)
```

Expand All @@ -94,6 +95,7 @@ secrets = client.secrets.list_secrets(
- `environment_slug` (str): The environment in which to list secrets (e.g., "dev").
- `secret_path` (str): The path to the secrets.
- `expand_secret_references` (bool): Whether to expand secret references.
- `view_secret_value` (bool): Whether or not to include the secret value in the response. If set to false, the `secretValue` will be masked with `<hidden-by-infisical>`. Defaults to true.
- `recursive` (bool): Whether to list secrets recursively.
- `include_imports` (bool): Whether to include imported secrets.
- `tag_filters` (List[str]): Tags to filter secrets.
Expand Down Expand Up @@ -171,9 +173,10 @@ secret = client.secrets.get_secret_by_name(
project_id="<project-id>",
environment_slug="dev",
secret_path="/",
expand_secret_references=True,
include_imports=True,
version=None # Optional
expand_secret_references=True, # Optional
view_secret_value=True, # Optional
include_imports=True, # Optional
version=None # Optional
)
```

Expand All @@ -183,6 +186,7 @@ secret = client.secrets.get_secret_by_name(
- `environment_slug` (str): The environment in which to retrieve the secret.
- `secret_path` (str): The path to the secret.
- `expand_secret_references` (bool): Whether to expand secret references.
- `view_secret_value` (bool): Whether or not to include the secret value in the response. If set to false, the `secretValue` will be masked with `<hidden-by-infisical>`. Defaults to true.
- `include_imports` (bool): Whether to include imported secrets.
- `version` (str, optional): The version of the secret to retrieve. Fetches the latest by default.

Expand Down
1 change: 1 addition & 0 deletions infisical_sdk/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class BaseSecret(BaseModel):
createdAt: str
updatedAt: str
secretMetadata: Optional[Dict[str, Any]] = None
secretValueHidden: Optional[bool] = False
secretReminderNote: Optional[str] = None
secretReminderRepeatDays: Optional[int] = None
skipMultilineEncoding: Optional[bool] = False
Expand Down
4 changes: 4 additions & 0 deletions infisical_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def list_secrets(
environment_slug: str,
secret_path: str,
expand_secret_references: bool = True,
view_secret_value: bool = True,
recursive: bool = False,
include_imports: bool = True,
tag_filters: List[str] = []) -> ListSecretsResponse:
Expand All @@ -217,6 +218,7 @@ def list_secrets(
"workspaceId": project_id,
"environment": environment_slug,
"secretPath": secret_path,
"viewSecretValue": str(view_secret_value).lower(),
"expandSecretReferences": str(expand_secret_references).lower(),
"recursive": str(recursive).lower(),
"include_imports": str(include_imports).lower(),
Expand All @@ -241,10 +243,12 @@ def get_secret_by_name(
secret_path: str,
expand_secret_references: bool = True,
include_imports: bool = True,
view_secret_value: bool = True,
version: str = None) -> BaseSecret:

params = {
"workspaceId": project_id,
"viewSecretValue": str(view_secret_value).lower(),
"environment": environment_slug,
"secretPath": secret_path,
"expandSecretReferences": str(expand_secret_references).lower(),
Expand Down