host

package
v0.13.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AdminSockExt = ".sock"
)

Variables

This section is empty.

Functions

func AdminClient

func AdminClient(socket string) (api.AdminServiceClient, error)

func AdminSocketFile

func AdminSocketFile(sessionID string) string

func NewPromptingHostKeyCallback

func NewPromptingHostKeyCallback(stdin io.Reader, stdout io.Writer, knownHostsFilename string) (ssh.HostKeyCallback, error)

func Signers

func Signers(privateKeys []string) ([]ssh.Signer, func(), error)

Signers return signers based on the folllowing conditions: If SSH agent is running and has keys, it returns signers from SSH agent, otherwise return signers from private keys; If neither works, it generates a signer on the fly.

func SignersFromFiles

func SignersFromFiles(privateKeys []string) ([]ssh.Signer, error)

Types

type AuthorizedKey added in v0.13.0

type AuthorizedKey struct {
	PublicKeys []ssh.PublicKey
	Comment    string
}

func AuthorizedKeysFromFile added in v0.13.0

func AuthorizedKeysFromFile(file string) (*AuthorizedKey, error)

func GitHubUserAuthorizedKeys added in v0.13.0

func GitHubUserAuthorizedKeys(usernames []string, logger *logrus.Logger) ([]*AuthorizedKey, error)

func GitLabUserAuthorizedKeys added in v0.13.0

func GitLabUserAuthorizedKeys(usernames []string) ([]*AuthorizedKey, error)

func SourceHutUserAuthorizedKeys added in v0.13.0

func SourceHutUserAuthorizedKeys(usernames []string) ([]*AuthorizedKey, error)

type Host

type Host struct {
	Host                   string
	KeepAliveDuration      time.Duration
	Command                []string
	ForceCommand           []string
	Signers                []ssh.Signer
	HostKeyCallback        ssh.HostKeyCallback
	AuthorizedKeys         []*AuthorizedKey
	AdminSocketFile        string
	SessionCreatedCallback func(*api.GetSessionResponse) error
	ClientJoinedCallback   func(*api.Client)
	ClientLeftCallback     func(*api.Client)
	Logger                 log.FieldLogger
	Stdin                  *os.File
	Stdout                 *os.File
	ReadOnly               bool
}

func (*Host) Run

func (c *Host) Run(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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