SshAuthHandler

Trait SshAuthHandler 

Source
pub trait SshAuthHandler {
    // Required methods
    fn on_authenticate<'life0, 'async_trait>(
        &'life0 self,
        event: SshAuthEvent,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_verify_host<'life0, 'life1, 'async_trait>(
        &'life0 self,
        host: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn on_banner<'life0, 'life1, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn on_error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Interface to handle various events during ssh authentication

Required Methods§

Source

fn on_authenticate<'life0, 'async_trait>( &'life0 self, event: SshAuthEvent, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Invoked whenever a series of authentication prompts need to be displayed and responded to, receiving one event at a time and returning a collection of answers matching the total prompts provided in the event

Source

fn on_verify_host<'life0, 'life1, 'async_trait>( &'life0 self, host: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invoked when the host is unknown for a new ssh connection, receiving the host as a str and returning true if the host is acceptable or false if the host (and thereby ssh client) should be declined

Source

fn on_banner<'life0, 'life1, 'async_trait>( &'life0 self, text: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invoked when receiving a banner from the ssh server, receiving the banner as a str, useful to display to the user

Source

fn on_error<'life0, 'life1, 'async_trait>( &'life0 self, text: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invoked when an error is encountered, receiving the error as a str

Implementors§