Expand description
XJP Secret Store SDK for Rust
A comprehensive SDK for interacting with the XJP Secret Store service, providing secure storage and retrieval of secrets, configuration values, and sensitive data.
§Features
- Async/await support with tokio runtime
- Automatic retries with exponential backoff
- Built-in caching with ETag/304 support
- Multiple authentication methods (Bearer, API Key, XJP Key)
- Batch operations with transactional support
- Environment export in multiple formats
- Version management and rollback
- Comprehensive error handling
- Secure value handling with zeroization
§Example
use secret_store_sdk::{Client, ClientBuilder, Auth};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ClientBuilder::new("https://secret.example.com")
.auth(Auth::bearer("your-api-key"))
.build()?;
let secret = client.get_secret("production", "database-url", Default::default()).await?;
println!("Secret version: {}", secret.version);
Ok(())
}Structs§
- ApiKey
Info - API Key information
- Audit
Entry - Audit log entry
- Audit
Query - Audit query parameters
- Audit
Result - Audit log results
- Batch
GetJson Result - Batch get result in JSON format
- BatchOp
- Batch operation
- Batch
Operate Result - Result of batch operations
- Batch
Operation Result - Individual operation result in batch
- Batch
Result Summary - Batch results summary
- Build
Info - Build information
- Bulk
Delete Failure - Failure details for bulk delete
- Bulk
Delete Opts - Options for bulk delete across namespaces
- Bulk
Delete Result - Result of bulk delete operation
- Cache
Config - Cache configuration
- Cache
Stats - Cache statistics
- Client
- XJP Secret Store client
- Client
Builder - Builder for creating a configured Client
- Client
Config - Client configuration
- Create
ApiKey Request - API Key creation request
- Create
Namespace Request - Request for creating a namespace
- Create
Namespace Result - Result of namespace creation
- Delete
Namespace Result - Result of namespace deletion
- Delete
Result - Result of delete operation
- Discovery
- Service discovery information
- Endpoint
Info - Endpoint information
- EnvJson
Export - Environment export in JSON format
- Export
EnvOpts - Options for environment export
- GetOpts
- Options for getting a secret
- Health
Check Result - Individual health check result
- Health
Status - Health check result
- Init
Namespace Result - Result of namespace initialization
- List
ApiKeys Result - List API keys result
- List
Namespaces Result - List of namespaces
- List
Opts - Options for listing secrets
- List
Secrets Result - Result of list operation
- Namespace
Info - Namespace detailed information
- Namespace
List Item - Namespace list item
- Namespace
Template - Namespace template for initialization
- PutOpts
- Options for putting a secret
- PutResult
- Result of put operation
- Revoke
ApiKey Result - Revoke API key result
- Rollback
Result - Result of rollback operation
- Search
Match - A single search match result
- Search
Secrets Opts - Options for cross-namespace secret search
- Search
Secrets Result - Result of cross-namespace search
- Secret
- A secret value with metadata
- Secret
KeyInfo - Secret key info in list responses
- Version
Info - Version information
- Version
List - List of secret versions
Enums§
- Auth
- Authentication method for the secret store API
- Batch
GetResult - Result of batch get operation
- Batch
Keys - Keys for batch get operation
- EnvExport
- Environment export result
- Error
- Main error type for the SDK
- Error
Kind - Error categories returned by the server
- Export
Format - Export format for batch operations
- Search
Mode - Search mode for cross-namespace search
Constants§
- DEFAULT_
CACHE_ MAX_ ENTRIES - Maximum cache entries
- DEFAULT_
CACHE_ TTL_ SECS - Default cache TTL in seconds
- DEFAULT_
RETRIES - Default number of retries
- DEFAULT_
TIMEOUT_ MS - Default timeout in milliseconds
- VERSION
- SDK version, matches Cargo.toml version
Traits§
- Token
Provider - Trait for providing dynamic tokens that can be refreshed
Type Aliases§
- Result
- Result type alias for the SDK
- Secret
String - Secret strings