session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attempt

type Attempt struct {
	Username string
	Key      JSONKey
	Password string
}

Attempt holds an ssh attempt, either through a public key or through username and password

type ID

type ID []byte

ID wraps an ssh.SessionID for better ecoding

func (ID) MarshalJSON

func (s ID) MarshalJSON() ([]byte, error)

MarshalJSON turns it into a hex string

func (ID) String

func (s ID) String() string

String satisties the stringer type

type JSONKey

type JSONKey struct {
	ssh.PublicKey
}

JSONKey is a wrapper around an ssh key that is more json friendly

func (JSONKey) MarshalJSON

func (j JSONKey) MarshalJSON() ([]byte, error)

MarshalJSON turns the key into something usable

type SlosshSession

type SlosshSession struct {
	SessionID     ID
	IP            net.IP
	ClientVersion string
	Attempts      []Attempt
	Start         time.Time
	Finish        time.Time
	// contains filtered or unexported fields
}

SlosshSession captures information about a session

func NewSession

func NewSession(l zerolog.Logger, key ssh.Signer) *SlosshSession

NewSession initializes a session

func (*SlosshSession) Close

func (s *SlosshSession) Close()

Close completes the session

func (*SlosshSession) Config

func (s *SlosshSession) Config() *ssh.ServerConfig

Config returns an ssh config that will feed information into the session

Jump to

Keyboard shortcuts

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