pub struct AuthAgent {
pub tx_cancel: Sender<()>,
pub rx_cancel: Receiver<()>,
pub tx_passphrase: Sender<String>,
pub rx_passphrase: Receiver<String>,
pub tx_username_password: Sender<(String, String)>,
pub rx_username_password: Receiver<(String, String)>,
pub psk_required: Arc<AtomicBool>,
pub private_key_passphrase_required: Arc<AtomicBool>,
pub password_required: Arc<AtomicBool>,
pub username_and_password_required: Arc<AtomicBool>,
pub event_sender: UnboundedSender<Event>,
}Expand description
Authentication agent for handling credential requests
In NetworkManager, unlike iwd, we don’t need to implement a D-Bus agent interface. Instead, credentials are collected from the user and passed to NetworkManager when creating/activating connections. This agent struct provides the coordination mechanism for the UI to collect and provide credentials.
Fields§
§tx_cancel: Sender<()>§rx_cancel: Receiver<()>§tx_passphrase: Sender<String>§rx_passphrase: Receiver<String>§tx_username_password: Sender<(String, String)>§rx_username_password: Receiver<(String, String)>§psk_required: Arc<AtomicBool>§private_key_passphrase_required: Arc<AtomicBool>§password_required: Arc<AtomicBool>§username_and_password_required: Arc<AtomicBool>§event_sender: UnboundedSender<Event>Implementations§
Source§impl AuthAgent
impl AuthAgent
pub fn new(sender: UnboundedSender<Event>) -> Self
Sourcepub fn request_passphrase(&self, network_name: String) -> Result<()>
pub fn request_passphrase(&self, network_name: String) -> Result<()>
Request PSK passphrase from user
Sourcepub fn request_private_key_passphrase(&self, network_name: String) -> Result<()>
pub fn request_private_key_passphrase(&self, network_name: String) -> Result<()>
Request private key passphrase from user
Sourcepub fn request_username_and_password(&self, network_name: String) -> Result<()>
pub fn request_username_and_password(&self, network_name: String) -> Result<()>
Request username and password from user
Sourcepub fn request_password(
&self,
network_name: String,
user_name: Option<String>,
) -> Result<()>
pub fn request_password( &self, network_name: String, user_name: Option<String>, ) -> Result<()>
Request password from user (with optional pre-filled username)
Sourcepub async fn wait_for_passphrase(&self) -> Option<String>
pub async fn wait_for_passphrase(&self) -> Option<String>
Wait for passphrase response with cancellation support
Sourcepub async fn wait_for_username_password(&self) -> Option<(String, String)>
pub async fn wait_for_username_password(&self) -> Option<(String, String)>
Wait for username/password response with cancellation support
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthAgent
impl RefUnwindSafe for AuthAgent
impl Send for AuthAgent
impl Sync for AuthAgent
impl !Unpin for AuthAgent
impl UnwindSafe for AuthAgent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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