Trait thrussh::server::Handler

source ·
pub trait Handler: Sized {
    type Error: Error + Send + Sync;
    type FutureAuth: Future<Item = (Self, Auth), Error = Self::Error> + Send;
    type FutureUnit: Future<Item = (Self, Session), Error = Self::Error> + Send;
    type FutureBool: Future<Item = (Self, Session, bool), Error = Self::Error> + Send;

Show 25 methods fn finished_auth(self, auth: Auth) -> Self::FutureAuth; fn finished_bool(self, session: Session, b: bool) -> Self::FutureBool; fn finished(self, session: Session) -> Self::FutureUnit; fn auth_none(self, user: &str) -> Self::FutureAuth { ... } fn auth_password(self, user: &str, password: &str) -> Self::FutureAuth { ... } fn auth_publickey(
        self,
        user: &str,
        public_key: &PublicKey
    ) -> Self::FutureAuth { ... } fn auth_keyboard_interactive(
        self,
        user: &str,
        submethods: &str,
        response: Option<Response<'_>>
    ) -> Self::FutureAuth { ... } fn channel_close(
        self,
        channel: ChannelId,
        session: Session
    ) -> Self::FutureUnit { ... } fn channel_eof(self, channel: ChannelId, session: Session) -> Self::FutureUnit { ... } fn channel_open_session(
        self,
        channel: ChannelId,
        session: Session
    ) -> Self::FutureUnit { ... } fn channel_open_x11(
        self,
        channel: ChannelId,
        originator_address: &str,
        originator_port: u32,
        session: Session
    ) -> Self::FutureUnit { ... } fn channel_open_direct_tcpip(
        self,
        channel: ChannelId,
        host_to_connect: &str,
        port_to_connect: u32,
        originator_address: &str,
        originator_port: u32,
        session: Session
    ) -> Self::FutureUnit { ... } fn data(
        self,
        channel: ChannelId,
        data: &[u8],
        session: Session
    ) -> Self::FutureUnit { ... } fn extended_data(
        self,
        channel: ChannelId,
        code: u32,
        data: &[u8],
        session: Session
    ) -> Self::FutureUnit { ... } fn window_adjusted(
        self,
        channel: ChannelId,
        new_window_size: usize,
        session: Session
    ) -> Self::FutureUnit { ... } fn pty_request(
        self,
        channel: ChannelId,
        term: &str,
        col_width: u32,
        row_height: u32,
        pix_width: u32,
        pix_height: u32,
        modes: &[(Pty, u32)],
        session: Session
    ) -> Self::FutureUnit { ... } fn x11_request(
        self,
        channel: ChannelId,
        single_connection: bool,
        x11_auth_protocol: &str,
        x11_auth_cookie: &str,
        x11_screen_number: u32,
        session: Session
    ) -> Self::FutureUnit { ... } fn env_request(
        self,
        channel: ChannelId,
        variable_name: &str,
        variable_value: &str,
        session: Session
    ) -> Self::FutureUnit { ... } fn shell_request(
        self,
        channel: ChannelId,
        session: Session
    ) -> Self::FutureUnit { ... } fn exec_request(
        self,
        channel: ChannelId,
        data: &[u8],
        session: Session
    ) -> Self::FutureUnit { ... } fn subsystem_request(
        self,
        channel: ChannelId,
        name: &str,
        session: Session
    ) -> Self::FutureUnit { ... } fn window_change_request(
        self,
        channel: ChannelId,
        col_width: u32,
        row_height: u32,
        pix_width: u32,
        pix_height: u32,
        session: Session
    ) -> Self::FutureUnit { ... } fn signal(
        self,
        channel: ChannelId,
        signal_name: Sig<'_>,
        session: Session
    ) -> Self::FutureUnit { ... } fn tcpip_forward(
        self,
        address: &str,
        port: u32,
        session: Session
    ) -> Self::FutureBool { ... } fn cancel_tcpip_forward(
        self,
        address: &str,
        port: u32,
        session: Session
    ) -> Self::FutureBool { ... }
}
Expand description

Server handler. Each client will have their own handler.

Required Associated Types

The type of errors returned by the futures.

The type of authentications, which can be a future ultimately resolving to

The type of units returned by some parts of this handler.

The type of future bools returned by some parts of this handler.

Required Methods

Convert an Auth to Self::FutureAuth. This is used to produce the default handlers.

Convert a bool to Self::FutureBool. This is used to produce the default handlers.

Produce a Self::FutureUnit. This is used to produce the default handlers.

Provided Methods

Check authentication using the “none” method. Thrussh makes sure rejection happens in time config.auth_rejection_time, except if this method takes more than that.

Check authentication using the “password” method. Thrussh makes sure rejection happens in time config.auth_rejection_time, except if this method takes more than that.

Check authentication using the “publickey” method. This method should just check whether the public key matches the authorized ones. Thrussh then checks the signature. If the key is unknown, or the signature is invalid, Thrussh guarantees that rejection happens in constant time config.auth_rejection_time, except if this method takes more time than that.

Check authentication using the “keyboard-interactive” method. Thrussh makes sure rejection happens in time config.auth_rejection_time, except if this method takes more than that.

Called when the client closes a channel.

Called when the client sends EOF to a channel.

Called when a new session channel is created.

Called when a new X11 channel is created.

Called when a new channel is created.

Called when a data packet is received. A response can be written to the response argument.

Called when an extended data packet is received. Code 1 means that this packet comes from stderr, other codes are not defined (see RFC4254).

Called when the network window is adjusted, meaning that we can send more bytes.

The client requests a pseudo-terminal with the given specifications.

The client requests an X11 connection.

The client wants to set the given environment variable. Check these carefully, as it is dangerous to allow any variable environment to be set.

The client requests a shell.

The client sends a command to execute, to be passed to a shell. Make sure to check the command before doing so.

The client asks to start the subsystem with the given name (such as sftp).

The client’s pseudo-terminal window size has changed.

The client is sending a signal (usually to pass to the currently running process).

Used for reverse-forwarding ports, see RFC4254.

Used to stop the reverse-forwarding of a port, see RFC4254.

Implementors