agent

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SIGSTRING = map[syscall.Signal]string{
	syscall.SIGABRT: "ABRT",
	syscall.SIGALRM: "ALRM",
	syscall.SIGFPE:  "FPE",
	syscall.SIGHUP:  "HUP",
	syscall.SIGILL:  "ILL",
	syscall.SIGINT:  "INT",
	syscall.SIGKILL: "KILL",
	syscall.SIGPIPE: "PIPE",
	syscall.SIGQUIT: "QUIT",
	syscall.SIGSEGV: "SEGV",
	syscall.SIGTERM: "TERM",
	syscall.SIGUSR1: "USR1",
	syscall.SIGUSR2: "USR2",
}

Based on what's handled in https://github.com/golang/crypto/blob/master/ssh/session.go#L21

Functions

func ConfigureSSHClient

func ConfigureSSHClient(privateKeyPath string) (*ssh.ClientConfig, error)

func ConfigureSSHServer

func ConfigureSSHServer(hostKeyPath string, authorizedKeys []ssh.PublicKey) (*ssh.ServerConfig, error)

func LoadAuthorizedKeys

func LoadAuthorizedKeys(path string) ([]ssh.PublicKey, error)

Types

type Agent

type Agent struct {
	PluginPaths []string

	Listen net.Listener
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent() *Agent

func (*Agent) ReadConfig

func (agent *Agent) ReadConfig(path string) error

func (*Agent) ResolveBinary

func (agent *Agent) ResolveBinary(name string) (string, error)

func (*Agent) Run

func (agent *Agent) Run()

func (*Agent) ServeOne

func (agent *Agent) ServeOne(l net.Listener, async bool)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *ssh.ClientConfig) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Dial

func (c *Client) Dial(endpoint string) error

func (*Client) Run

func (c *Client) Run(out chan string, command string) error

type Config

type Config struct {
	AuthorizedKeysFile string   `yaml:"authorized_keys_file"`
	HostKeyFile        string   `yaml:"host_key_file"`
	ListenAddress      string   `yaml:"listen_address"`
	PluginPaths        []string `yaml:"plugin_paths"`
}

type Request

type Request struct {
	JSON           string
	Operation      string `json:"operation"`
	TargetPlugin   string `json:"target_plugin"`
	TargetEndpoint string `json:"target_endpoint"`
	StorePlugin    string `json:"store_plugin"`
	StoreEndpoint  string `json:"store_endpoint"`
	RestoreKey     string `json:"restore_key"`
}

func ParseRequest

func ParseRequest(req *ssh.Request) (*Request, error)

func ParseRequestValue

func ParseRequestValue(value []byte) (*Request, error)

func (*Request) ResolvePaths

func (r *Request) ResolvePaths(agent *Agent) error

func (*Request) Run

func (req *Request) Run(output chan string) error

Jump to

Keyboard shortcuts

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