Secrets¶
API¶
Infisical Secrets Resource API.
SecretsV3
¶
Bases: InfisicalAPI
Infisical Secrets v3 API.
Attributes:
| Name | Type | Description |
|---|---|---|
base_uri |
str
|
|
Source code in src/infisical/resources/secrets/api.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
__init__
¶
Initialize the Infisical Secrets Resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
SyncOrAsyncClient
|
An initialized InfisicalClient or InfisicalAsyncClient. |
required |
Source code in src/infisical/resources/secrets/api.py
create
¶
create(request: CreateSecretRequest) -> Secret
Create a new secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CreateSecretRequest
|
The request object containing secret details. |
required |
Source code in src/infisical/resources/secrets/api.py
delete
¶
delete(request: DeleteSecretRequest) -> Secret
Delete a secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
DeleteSecretRequest
|
The request object containing secret ID or name. |
required |
Source code in src/infisical/resources/secrets/api.py
list
¶
list(**params: Unpack[ListSecretsQueryParams]) -> SecretsList
List all secrets.
This method lists all secrets in the provided workspaceId and environment, which are required parameters.
The secretPath parameter is optional and can be used to filter the secrets by a specific path. If recursive
is not set to true, which the default is false, the list of secrets will be only those in the secretPath.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
Unpack[ListSecretsQueryParams]
|
(ListSecretsQueryParams): The query parameters for the request. |
{}
|
Note
The viewSecretValue param is permanently set to false to avoid exposing secret values when listing.
This is by design and is not configurable. If you need to get a secret value, use the retrieve method.
Source code in src/infisical/resources/secrets/api.py
retrieve
¶
retrieve(*, name: str, **params: Unpack[RetrieveSecretQueryParams]) -> Secret
Retrieve a secret by Name.
This method retrieves a secret from the secretPath by its name in the provided workspaceId and
environment, which are required parameters. If the secret is not found in the secretPath, it will return a
404 error.
Source code in src/infisical/resources/secrets/api.py
update
¶
update(request: UpdateSecretRequest) -> Secret
Update a secret.
Source code in src/infisical/resources/secrets/api.py
Secrets
¶
Infisical Secrets Resource.
Attributes:
| Name | Type | Description |
|---|---|---|
v3 |
SecretsV3
|
The Infisical Secrets v3 API. |
Source code in src/infisical/resources/secrets/api.py
__init__
¶
Initialize the Infisical Secrets Resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
SyncOrAsyncClient
|
An initialized InfisicalClient or InfisicalAsyncClient. |
required |
Source code in src/infisical/resources/secrets/api.py
Models¶
Infisical Secrets Resource Models.
ListSecretsQueryParams
¶
Bases: TypedDict
Query parameters for listing secrets.
Other Parameters:
| Name | Type | Description |
|---|---|---|
environment |
str
|
The environment name. REQUIRED |
expandSecretReferences |
str
|
Whether to expand secret references. |
offset |
int
|
The offset for pagination. |
recursive |
str
|
Whether to list secrets recursively. |
secretPath |
str
|
The path to the secret. |
viewSecretValue |
str
|
Whether to view the secret value. |
workspaceId |
str
|
The ID of the workspace. REQUIRED |
workspaceSlug |
str
|
The slug of the workspace. |
Source code in src/infisical/resources/secrets/models.py
RetrieveSecretQueryParams
¶
Bases: TypedDict
Query parameters for retrieving a secret.
Other Parameters:
| Name | Type | Description |
|---|---|---|
environment |
str
|
The environment name. REQUIRED |
expandSecretReferences |
str
|
Whether to expand secret references. |
include_imports |
str
|
Whether to include imports. |
secretPath |
str
|
The path to the secret. |
type |
SecretType
|
The type of the secret. |
version |
int
|
The version of the secret. |
viewSecretValue |
str
|
Whether to view the secret value. |
workspaceId |
str
|
The ID of the workspace. REQUIRED |
workspaceSlug |
str
|
The slug of the workspace. |
Source code in src/infisical/resources/secrets/models.py
Metadata
¶
Tags
¶
Secret
¶
Bases: BaseModel
Secret model.
Attributes:
| Name | Type | Description |
|---|---|---|
_secret_id |
str
|
The ID of the secret. |
created_at |
datetime
|
The creation date of the secret. |
environment |
str
|
The environment name. |
folder_id |
str
|
The ID of the folder. |
is_rotated_secret |
bool | None
|
Whether the secret is rotated. |
rotation_id |
str | None
|
The ID of the rotation. |
secret_comment |
str
|
The comment for the secret. |
secret_id |
str
|
The ID of the secret. |
secret_key |
str
|
The key of the secret. |
secret_metadata |
list[Metadata] | None
|
The metadata of the secret. |
secret_path |
str
|
The path to the secret. |
secret_reminder_note |
str | None
|
The reminder note for the secret. |
secret_reminder_repeat_days |
int | None
|
The number of days to repeat the reminder. |
secret_type |
SecretType
|
The type of the secret. |
secret_value_hidden |
bool | None
|
Whether the secret value is hidden. |
secret_value |
str
|
The value of the secret. |
skip_multiline_encoding |
bool | None
|
Whether to skip multiline encoding. |
tags |
list[Tags]
|
The tags associated with the secret. |
updated_at |
datetime
|
The last updated date of the secret. |
user_id |
str | None
|
The ID of the user who created or updated the secret. |
version |
int
|
The version of the secret. |
workspace |
str
|
The workspace name. |
Source code in src/infisical/resources/secrets/models.py
SecretsList
¶
CreateSecretRequest
¶
Bases: InfisicalResourceRequest
Create secret request model.
Attributes:
| Name | Type | Description |
|---|---|---|
metadata |
dict[str, str] | None
|
The metadata of the secret. |
name |
str
|
The name of the secret. |
secret_comment |
str
|
The comment for the secret. |
secret_metadata |
list[Metadata] | None
|
The metadata of the secret. |
secret_path |
str
|
The path to the secret. |
secret_reminder_note |
str | None
|
The reminder note for the secret. |
secret_reminder_repeat_days |
int | None
|
The number of days to repeat the reminder. |
secret_type |
SecretType
|
The type of the secret. |
secret_value |
str
|
The value of the secret. |
skip_multiline_encoding |
bool | None
|
Whether to skip multiline encoding. |
tag_ids |
list[str] | None
|
The IDs of the tags associated with the secret. |
workspace_id |
str
|
The ID of the workspace. |
environment |
str
|
The environment name. |
Source code in src/infisical/resources/secrets/models.py
UpdateSecretRequest
¶
Bases: InfisicalResourceRequest
Update secret request model.
Attributes:
| Name | Type | Description |
|---|---|---|
metadata |
dict[str, str] | None
|
The metadata of the secret. |
name |
str
|
The name of the secret. |
new_secret_name |
str | None
|
The new name of the secret. |
secret_comment |
str | None
|
The comment for the secret. |
secret_metadata |
list[Metadata] | None
|
The metadata of the secret. |
secret_path |
str
|
The path to the secret. |
secret_reminder_note |
str | None
|
The reminder note for the secret. |
secret_reminder_recipients |
list[str] | None
|
The recipients of the reminder. |
secret_reminder_repeat_days |
int | None
|
The number of days to repeat the reminder. |
secret_type |
SecretType
|
The type of the secret. |
secret_value |
str | None
|
The value of the secret. |
skip_multiline_encoding |
bool | None
|
Whether to skip multiline encoding. |
tag_ids |
list[str] | None
|
The IDs of the tags associated with the secret. |
workspace_id |
str
|
The ID of the workspace. |
environment |
str
|
The environment name. |
Source code in src/infisical/resources/secrets/models.py
DeleteSecretRequest
¶
Bases: InfisicalResourceRequest
Create secret request model.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the secret. |
secret_path |
str
|
The path to the secret. |
secret_type |
SecretType
|
The type of the secret. |
workspace_id |
str
|
The ID of the workspace. |
environment |
str
|
The environment name. |
Source code in src/infisical/resources/secrets/models.py
SecretApprovalResponse
¶
Bases: BaseModel
Secret approval response model.
Attributes:
| Name | Type | Description |
|---|---|---|
approval_id |
str
|
The ID of the approval. |
bypass_reason |
str | None
|
The reason for bypassing the approval. |
committer_user_id |
str
|
The ID of the user who committed the change. |
conflicts |
Any
|
The conflicts associated with the approval. |
created_at |
datetime
|
The creation date of the approval. |
folder_id |
str
|
The ID of the folder. |
has_merged |
bool
|
Whether the approval has been merged. |
is_replicated |
bool | None
|
Whether the approval is replicated. |
policy_id |
str
|
The ID of the policy. |
slug |
str
|
The slug of the approval. |
status_changed_by_user_id |
str | None
|
The ID of the user who changed the status. |
status |
str
|
The status of the approval. |
updated_at |
datetime
|
The last updated date of the approval. |