1.0.3
and above.
The 1.0.3 version comes with a few key changes that may change how you’re using the SDK.
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.
BaseSecret
, are all exported from the Infisical SDK.
secret_key
property on the get_secret_by_name()
method, that has been renamed to secretKey
.
1.0.3
or above.
You can refer to our legacy documentation if need be.
InfisicalSDKClient
takes the following parameters, which are used as a global configuration for the lifetime of the SDK instance.
str
, Optional): The host URL for your Infisical instance. Defaults to https://app.infisical.com
.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
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.auth
: Handles authentication methods.secrets
: Manages CRUD operations for secrets.kms
: Perform cryptographic operations with Infisical KMS.auth
Auth
component provides methods for authentication:
identity_id
(str): The ID of the OIDC identity configuration in Infisical.jwt
(str): The OIDC JWT token obtained from your identity provider.secrets
project_id
(str): The ID of your project.project_slug
(str): The slug of your project.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.project_id
or project_slug
is required. If both are provided, project_id
takes precedence.
Returns:
ListSecretsResponse
: The response containing the list of secrets.secret_name
(str): The name of the secret.project_id
(str): The ID of your project.project_slug
(str): The slug of your project.secret_path
(str): The path to the secret.environment_slug
(str): The environment in which to create the secret.secret_value
(str): The value of the secret.secret_comment
(str, optional): A comment associated with the secret.skip_multiline_encoding
(bool, optional): Whether to skip encoding for multiline secrets.secret_reminder_repeat_days
(Union[float, int], optional): Number of days after which to repeat secret reminders.secret_reminder_note
(str, optional): A note for the secret reminder.secret_metadata
(List[Dict[str, Any]], optional): Metadata associated with the secret.tags_ids
(List[str], optional): IDs of tags to associate with the secret.project_id
or project_slug
is required. If both are provided, project_id
takes precedence.
Returns:
BaseSecret
: The response after creating the secret.current_secret_name
(str): The current name of the secret.project_id
(str): The ID of your project.project_slug
(str): The slug of your project.secret_path
(str): The path to the secret.environment_slug
(str): The environment in which to update the secret.secret_value
(str, optional): The new value of the secret.secret_comment
(str, optional): An updated comment associated with the secret.skip_multiline_encoding
(bool, optional): Whether to skip encoding for multiline secrets.secret_reminder_repeat_days
(Union[float, int], optional): Updated number of days after which to repeat secret reminders.secret_reminder_note
(str, optional): An updated note for the secret reminder.new_secret_name
(str, optional): A new name for the secret.secret_metadata
(List[Dict[str, Any]], optional): Metadata associated with the secret.tags_ids
(List[str], optional): IDs of tags to associate with the secret.project_id
or project_slug
is required. If both are provided, project_id
takes precedence.
Returns:
BaseSecret
: The response after updating the secret.secret_name
(str): The name of the secret.project_id
(str): The ID of your project.project_slug
(str): The slug of your project.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.project_id
or project_slug
is required. If both are provided, project_id
takes precedence.
Returns:
BaseSecret
: The response containing the secret.secret_name
(str): The name of the secret to delete.project_id
(str): The ID of your project.project_slug
(str): The slug of your project.environment_slug
(str): The environment in which to delete the secret.secret_path
(str): The path to the secret.project_id
or project_slug
is required. If both are provided, project_id
takes precedence.
Returns:
BaseSecret
: The response after deleting the secret.kms
project_id
(str): The ID of your project.offset
(int, optional): The offset to paginate from.limit
(int, optional): The page size for paginating.order_by
(KmsKeysOrderBy, optional): The key property to order the list response by.order_direction
(OrderDirection, optional): The direction to order the list response in.search
(str, optional): The text value to filter key names by.ListKmsKeysResponse
: The response containing the list of KMS keys.key_id
(str): The ID of the key to retrieve.KmsKey
: The specified key.key_name
(str): The name of the key to retrieve.project_id
(str): The ID of your project.KmsKey
: The specified key.name
(str): The name of the key (must be slug-friendly).project_id
(str): The ID of your project.encryption_algorithm
(SymmetricEncryption): The encryption algorithm this key should use.description
(str, optional): A description of your key.KmsKey
: The newly created key.key_id
(str): The ID of the key to be updated.name
(str, optional): The updated name of the key (must be slug-friendly).description
(str): The updated description of the key.is_disabled
(str): The flag to disable operations with this key.KmsKey
: The updated key.key_id
(str): The ID of the key to be deleted.KmsKey
: The deleted key.key_id
(str): The ID of the key to encrypt the data with.base64EncodedPlaintext
(str): The plaintext data to encrypt (must be base64 encoded).str
: The encrypted ciphertext.key_id
(str): The ID of the key to decrypt the data with.ciphertext
(str): The ciphertext returned from the encrypt operation.str
: The base64 encoded plaintext.