pub struct Config {
pub default_secret: Option<String>,
pub default_algorithm: Option<String>,
pub default_wordlist: Option<PathBuf>,
pub default_private_key: Option<PathBuf>,
}Expand description
Configuration structure for jwt-hack
Fields§
§default_secret: Option<String>Default secret key for HMAC algorithms
default_algorithm: Option<String>Default algorithm to use
default_wordlist: Option<PathBuf>Default wordlist path for cracking
default_private_key: Option<PathBuf>Default private key path
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a specific file path
Sourcepub fn default_config_dir() -> Option<PathBuf>
pub fn default_config_dir() -> Option<PathBuf>
Get the default config directory path using XDG specification
Sourcepub fn default_config_file() -> Option<PathBuf>
pub fn default_config_file() -> Option<PathBuf>
Get the default config file path
Sourcepub fn load(config_path: Option<&Path>) -> Result<Self>
pub fn load(config_path: Option<&Path>) -> Result<Self>
Load configuration with fallback logic
- Use provided config file path if given
- Try default config file location
- Return default config if no file exists
Sourcepub fn ensure_config_dir() -> Result<Option<PathBuf>>
pub fn ensure_config_dir() -> Result<Option<PathBuf>>
Create default config directory if it doesn’t exist
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more