modes

package
v0.15.2-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package mode defines the interfaces used by the server to determine how to handle authentication and sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// Password must be implemented to deal with password authentication.
	Password(ctx gliderssh.Context, user string, password string) bool
	// PublicKey must be implemented to deal with public key authentication.
	PublicKey(ctx gliderssh.Context, user string, key gliderssh.PublicKey) bool
}

Authenticator defines the authentication methods used by the SSH's server.

type Mode

type Mode interface {
	Authenticator
	Sessioner
}

Mode defines the SSH's server mode type.

type Sessioner

type Sessioner interface {
	Subsystemer
	// Shell must be implemented to deal with shell session.
	Shell(session gliderssh.Session) error
	// Heredoc must be implemented to deal with heredoc session.
	//
	// heredoc is special block of code that contains multi-line strings that will be redirected to a stdin of a shell.
	// It request a shell, but doesn't allocate a pty.
	//
	// An example of heredoc is:
	//  cat <<EOF
	//      test123
	//  EOF
	Heredoc(session gliderssh.Session) error
	// Exec must be implemented to deal with exec session.
	Exec(session gliderssh.Session) error
}

Sessioner defines the session methods used by the SSH's server to deal wihth determining the type of session.

type Subsystemer

type Subsystemer interface {
	// SFTP must be implemented to deal with SFTP session.
	SFTP(session gliderssh.Session) error
}

Subsystemer defines the subsystem methods used by the SSH's server to deal with determining the type of subsystem.

Subsystemer is a subset of the Sessioner interface.

Directories

Path Synopsis
Package connector defines methods for authentication and sessions handles to SSH when it is running in connector mode.
Package connector defines methods for authentication and sessions handles to SSH when it is running in connector mode.
Package host defines authentication and sessions handles to SSH when it is running in host mode.
Package host defines authentication and sessions handles to SSH when it is running in host mode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL