vaultarq
Rust SDK for Vaultarq - The developer-first, invisible secrets manager
This SDK provides a seamless integration with Vaultarq for Rust applications, automatically loading secrets from your Vaultarq vault into your application's environment variables.
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Requirements
- Vaultarq CLI installed and initialized
- Rust 1.56 or higher (for edition 2021)
Usage
Basic Usage
use init;
With Options
use ;
Checking Availability
use ;
With Actix Web
use ;
use init;
async
async
API
init() -> Result<(), Error>
Loads secrets from the Vaultarq vault into environment variables using default configuration.
init_with_config(config: &Config) -> Result<(), Error>
Loads secrets from the Vaultarq vault into environment variables using custom configuration.
is_available() -> bool
Checks if Vaultarq is installed and accessible.
Config
Configuration struct for customizing how secrets are loaded.
Methods
new() -> Config: Creates a new configuration with default valueswith_bin_path(path: &str) -> Self: Sets the path to the Vaultarq executablewith_throw_if_not_found(throw: bool) -> Self: Sets whether to throw an error if Vaultarq is not foundwith_environment(env: &str) -> Self: Sets the environment to load secrets fromwith_format(format: Format) -> Self: Sets the format to export secrets in
Format
Enum for specifying the export format:
Format::Bash(default): Export asexport KEY="VALUE"statementsFormat::Dotenv: Export asKEY=VALUEstatementsFormat::Json: Export as JSON object
License
MIT