pub enum AuthMode {
Prompt,
PasswordlessOnly,
Interactive,
}Expand description
What: Authentication strategy for privilege escalation.
Inputs: None (enum variant selection).
Output: Controls how Pacsea handles authentication before privileged operations.
Details:
Prompt(default): Pacsea shows its own password modal/prompt and uses stdin password piping (sudo -S) for stdin-capable tools. For tools without stdin support (doas), resolver logic coerces this mode toInteractive.PasswordlessOnly: Skip password prompt only when{tool} -n truesucceeds; fall back toPromptotherwise.Interactive: Skip Pacsea’s password capture entirely and let the privilege tool handle authentication directly (fingerprint via PAM, terminal password, etc.). Works with both sudo and doas when PAM is configured.
Variants§
Prompt
Pacsea captures the password for stdin-capable tools; non-stdin tools are coerced to interactive.
PasswordlessOnly
Skip password prompt only when passwordless escalation is available.
Interactive
Let the privilege tool handle authentication interactively (PAM fingerprint, etc.).
Implementations§
Source§impl AuthMode
impl AuthMode
Sourcepub fn from_config_key(val: &str) -> Option<Self>
pub fn from_config_key(val: &str) -> Option<Self>
What: Parse a config file value into an AuthMode.
Inputs:
val: Raw config string (e.g."prompt","passwordless_only","interactive").
Output: Some(mode) on recognized value, None otherwise.
Details: Case-insensitive matching after trim; accepts underscores and hyphens.
Sourcepub const fn as_config_key(self) -> &'static str
pub const fn as_config_key(self) -> &'static str
What: Return the canonical config key string for this mode.
Inputs: None.
Output: "prompt", "passwordless_only", or "interactive".
Details: Inverse of from_config_key.
Sourcepub const fn always_skips_password_modal(self) -> bool
pub const fn always_skips_password_modal(self) -> bool
What: Whether this mode skips Pacsea’s password modal entirely.
Inputs: None.
Output: true for Interactive, false for Prompt and PasswordlessOnly.
Details:
PasswordlessOnlydoes not unconditionally skip — it still needs a runtime{tool} -n truecheck before skipping.Interactivealways skips the modal because the tool handles auth directly.
Trait Implementations§
impl Copy for AuthMode
impl Eq for AuthMode
impl StructuralPartialEq for AuthMode
Auto Trait Implementations§
impl Freeze for AuthMode
impl RefUnwindSafe for AuthMode
impl Send for AuthMode
impl Sync for AuthMode
impl Unpin for AuthMode
impl UnsafeUnpin for AuthMode
impl UnwindSafe for AuthMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.