config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// ConfigVersion specifies the current config version
	ConfigVersion = 1

	// DefaultConfigFile is the default file where blessclient will look for its config
	DefaultConfigFile = "~/.blessclient/config.yml"
)

Variables

This section is empty.

Functions

func GetOrCreateConfigPath added in v0.7.0

func GetOrCreateConfigPath(configPath string) (string, error)

Types

type Bastion

type Bastion struct {
	Host `yaml:",inline"`

	Hosts          []Host          `yaml:"hosts"`
	IdentityFile   string          `yaml:"identity_file"`
	User           string          `yaml:"user"`
	SSHExecCommand *SSHExecCommand `yaml:"ssh_exec_command,omitempty"`
}

Bastion is an internet accessibly server used to "jump" to other servers

type ClientConfig

type ClientConfig struct {
	// The OIDC client_id
	OIDCClientID string `yaml:"oidc_client_id"`
	// Oidc issuer url: eg: foo.okta.com
	OIDCIssuerURL string `yaml:"oidc_issuer_url"`
	// RoleARN is the aws role arn to assume to invoke the CA lambda
	RoleARN string `yaml:"role_arn"`
}

type Config

type Config struct {
	// Version versions this config
	Version int `yaml:"version"`

	// ClientConfig has configuration related to blessclient
	ClientConfig ClientConfig `yaml:"client_config"`
	// LambdaConfig holds configuration around the bless lambda
	LambdaConfig LambdaConfig `yaml:"lambda_config"`
	// For convenience, you can bundle an ~/.ssh/config template here
	SSHConfig *SSHConfig `yaml:"ssh_config,omitempty"`
}

Config is a blessclient config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig generates a config with some defaults

func FromFile

func FromFile(confPath string) (*Config, error)

func (*Config) Persist

func (c *Config) Persist(configPath string) error

Persist persists a config to disk

type Host

type Host struct {
	Pattern string `yaml:"pattern"`
}

Host represents a Host block in an ssh config

type LambdaConfig

type LambdaConfig struct {
	// Bless lambda function name
	FunctionName string `yaml:"function_name"`
	// Bless lambda function version (lambda alias or version qualifier)
	FunctionVersion *string `yaml:"function_version,omitempty"`
	// bless lambda regions
	Regions []Region `yaml:"regions,omitempty"`
}

LambdaConfig is the lambda config

type Region

type Region struct {
	// name of the aws region (us-west-2)
	AWSRegion string `yaml:"aws_region"`
}

Region is an aws region that contains an aws lambda

type SSHConfig

type SSHConfig struct {
	Bastions []Bastion `yaml:"bastions"`
}

SSHConfig is an SSH config We make some assumptions here around the structure of the machines A bastion is internet accessible and can be used to reach other machines

func (*SSHConfig) String

func (s *SSHConfig) String() (string, error)

String generates the ssh config string

type SSHExecCommand added in v0.4.1

type SSHExecCommand string

SSHExecCommand is a command to execute on successful ssh match

func (*SSHExecCommand) String added in v0.4.1

func (ec *SSHExecCommand) String() string

String gets the value of this exec command

Jump to

Keyboard shortcuts

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