1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! SecretSpec - A declarative secrets manager for development workflows
//!
//! This library provides a type-safe, declarative way to manage secrets and environment
//! variables across different environments and storage backends.
//!
//! # Features
//!
//! - **Declarative Configuration**: Define secrets in `secretspec.toml`
//! - **Multiple Providers**: Keyring, dotenv, environment variables, OnePassword, LastPass
//! - **Profile Support**: Different configurations for development, staging, production
//! - **Type Safety**: Optional compile-time code generation for strongly-typed access
//! - **Validation**: Ensure all required secrets are present before running applications
//!
//! # Example
//!
//! ```ignore
//! // Generate typed structs from secretspec.toml
//! secretspec_derive::declare_secrets!("secretspec.toml");
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Load secrets and configure provider/profile
//! let mut spec = Secrets::load()?;
//! spec.set_provider("keyring"); // Can use provider name or URI like "dotenv:/path/to/.env"
//! spec.set_profile("development");
//!
//! // Validate and get secrets
//! let secrets = match spec.validate()? {
//! Ok(validated) => validated,
//! Err(errors) => return Err(format!("Missing secrets: {}", errors).into()),
//! };
//!
//! // Access secrets (field names are lowercased)
//! println!("Database: {}", secrets.resolved.secrets.get("DATABASE_URL").unwrap());
//!
//! // Access profile and provider information
//! println!("Using profile: {}", secrets.resolved.profile);
//! println!("Using provider: {}", secrets.resolved.provider);
//!
//! Ok(())
//! }
//! ```
// Internal modules
pub
pub
// CLI module (feature-gated)
// Re-export only the types needed by users and generated code
pub use Resolved;
// Re-export config types for CLI usage only - these are marked #[doc(hidden)]
pub use ;
// Re-export Secret and generation types for secretspec-derive
pub use ;
// Public API exports
pub use ;
pub use Provider;
pub use Secrets;
pub use ValidatedSecrets;