Lockset Vault Provider
This crate provides the foundational traits and types for integrating external secret management vaults with the Lockset Vault system. It defines a common interface that allows Lockset Vault to retrieve secrets from various providers, such as HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault.
Core Concepts
The crate is built around a few key traits and structs:
-
VaultProvider: This trait defines the contract for a connection to an external vault. It has a single method,get_secret, which retrieves a secret by name. -
VaultProviderFactory: This trait is responsible for creating and validating instances ofVaultProvider. It ensures that the configuration for a provider is valid and that a connection to the external vault can be established. -
ProviderSecret: This struct represents a secret retrieved from a provider. It includes the secret's value (which is wrapped inzeroize::Zeroizingto securely erase it from memory when it goes out of scope) and an optional version identifier. -
ProviderError: This enum defines the possible errors that can occur when interacting with a vault provider.
Usage
To create a custom vault provider, you need to implement the VaultProvider and VaultProviderFactory traits. Here is a basic example of how you might implement a simple in-memory provider:
use async_trait;
use ;
use HashMap;
use Zeroizing;
// 1. Define a struct for your provider
// 2. Define a factory for your provider
;
License
This project is licensed under the MIT License. See the LICENSE file for details.