Client::builder()
provides several configuration options:
.base_url(url)
: Optional method to set the Infisical instance URL. Defaults to https://app.infisical.com
for Infisical Cloud. Use https://eu.infisical.com
for EU and http://localhost:8080
for local development.Client::builder()
: The main entry point for creating a client.client.login()
: Allows client to make authenticated requests to the API.client.secrets()
: Provides access to all CRUD operations for secrets.client.kms()
: Provides access to all KMS (Key Management Service) operations.encode_base64(data: &str) -> String
: Encodes a string as base64decode_base64(data: &str) -> Result<String, InfisicalError>
: Decodes a base64 stringsecrets
client.secrets()
. Each operation has a dedicated request builder.
secret_name
, secret_value
, project_id
, environment
: Required parameters passed to the builder()
function..path(path)
: Optional method to set the secret’s path (defaults to /
)..secret_comment(comment)
: Optional method to add a comment..skip_multiline_encoding(bool)
: Optional method to control multiline encoding (defaults to false
)..r#type(type)
: Optional method to set the secret type (shared
or personal
), defaults to shared
.secret_name
, project_id
, environment
: Required parameters passed to the builder()
function..path(path)
: Optional method to set the secret’s path (defaults to /
)..expand_secret_references(bool)
: Optional method to control secret reference expansion (defaults to true
)..r#type(type)
: Optional method to set the secret type (shared
or personal
), defaults to shared
.project_id
, environment
: Required parameters passed to the builder()
function..path(path)
: Optional method to set the path from which to list secrets (defaults to /
)..expand_secret_references(bool)
: Optional method to control secret reference expansion (defaults to true
)..recursive(bool)
: Optional method to recursively list secrets from sub-folders (defaults to false
)..attach_to_process_env(bool)
: Optional method to attach fetched secrets to the current process’s environment variables (defaults to false
).secret_name
, project_id
, environment
: Required parameters passed to the builder()
function..new_secret_name(name)
: Optional method to rename the secret..secret_value(value)
: Optional method to set a new value for the secret..path(path)
: Optional method to set the secret’s path..secret_comment(comment)
: Optional method to add or change the comment..skip_multiline_encoding(bool)
: Optional method to control multiline encoding..r#type(type)
: Optional method to set the secret type (shared
or personal
).secret_name
, project_id
, environment
: Required parameters passed to the builder()
function..path(path)
: Optional method to set the secret’s path (defaults to /
)..r#type(type)
: Optional method to set the secret type (shared
or personal
), defaults to shared
.kms
client.kms()
. Each operation has a dedicated request builder.
project_id
: Required parameter passed to the builder()
function.key_id
: Required parameter passed to the builder()
function.key_name
: Required parameter passed to the builder()
function.project_id
, name
: Required parameters passed to the builder()
function..description(description)
: Optional method to set the key description..key_usage(usage)
: Optional method to set the key usage using the KeyUsage
enum (defaults to KeyUsage::EncryptDecrypt
)..encryption_algorithm(algorithm)
: Optional method to set the encryption algorithm using the EncryptionAlgorithm
enum (defaults to EncryptionAlgorithm::Aes256Gcm
).key_id
: Required parameter passed to the builder()
function..name(name)
: Optional method to rename the key..description(description)
: Optional method to update the key description..is_disabled(disabled)
: Optional method to enable or disable the key.key_id
: Required parameter passed to the builder()
function.key_id
, plaintext
: Required parameters passed to the builder()
function.key_id
, ciphertext
: Required parameters passed to the builder()
function.key_id
, data
: Required parameters passed to the builder()
function..signing_algorithm(algorithm)
: Optional method to set the signing algorithm using the SigningAlgorithm
enum (defaults to SigningAlgorithm::RsassaPkcs1V15Sha256
)..is_digest(is_digest)
: Optional method to indicate if the data is a digest (defaults to false
).key_id
, data
, signature
: Required parameters passed to the builder()
function..signing_algorithm(algorithm)
: Optional method to set the signing algorithm using the SigningAlgorithm
enum (defaults to SigningAlgorithm::RsassaPkcs1V15Sha256
)..is_digest(is_digest)
: Optional method to indicate if the data is a digest (defaults to false
).key_id
: The ID of the key to get the public key for.key_id
: The ID of the key to get signing algorithms for..env
file in your project root:
#[ignore]
and need valid credentials: