pub struct AppConfig {
pub backend_type: String,
pub verbose: bool,
pub pass: PassBackendConfig,
pub local: LocalBackendConfig,
pub security: SecurityConfig,
pub pin: PinConfig,
}Expand description
Main application configuration Note: Cannot derive Clone/Debug because it has #[clap_serde] fields
Fields§
§backend_type: StringStorage backend type: pass, tpm (experimental), or local (for testing)
verbose: boolEnable verbose logging
pass: PassBackendConfigPass backend configuration
local: LocalBackendConfigLocal backend configuration
security: SecurityConfigSecurity hardening configuration
pin: PinConfigPIN configuration
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn field_docs() -> &'static [(&'static str, &'static str)]
pub fn field_docs() -> &'static [(&'static str, &'static str)]
Get documentation for all fields Returns an array of (field_name, documentation) tuples
Sourcepub fn struct_doc() -> &'static str
pub fn struct_doc() -> &'static str
Get struct-level documentation
Source§impl AppConfig
impl AppConfig
Sourcepub fn to_toml_with_comments(&self) -> String
pub fn to_toml_with_comments(&self) -> String
Generate TOML configuration with comments extracted from doc comments
Source§impl AppConfig
impl AppConfig
Sourcepub fn config_file_path(args: &Args) -> Option<PathBuf>
pub fn config_file_path(args: &Args) -> Option<PathBuf>
The configuration file Self::load reads: --config/PASSLESS_CONFIG, else the default
~/.config/passless/config.toml, if it exists.
Sourcepub fn load(args: &mut Args) -> Result<Self>
pub fn load(args: &mut Args) -> Result<Self>
Load configuration with precedence: CLI > config file > defaults
Sourcepub fn backend(&self) -> Result<BackendConfig>
pub fn backend(&self) -> Result<BackendConfig>
Get the backend configuration based on the backend_type
Sourcepub fn apply_security_hardening(&self) -> Result<(), Box<dyn Error>>
pub fn apply_security_hardening(&self) -> Result<(), Box<dyn Error>>
Apply security hardening measures
Sourcepub fn security_config(&self) -> SecurityConfig
pub fn security_config(&self) -> SecurityConfig
Get security configuration
Sourcepub fn pin_config(&self) -> PinConfig
pub fn pin_config(&self) -> PinConfig
Get PIN configuration