config

package
v0.0.0-...-9758eb9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConnectorName = errors.New("invalid connector name")

Functions

func FetchFromSSM

func FetchFromSSM(svc ssmiface.SSMAPI, param string) (*ssm.GetParameterOutput, error)

func SetupSSMField

func SetupSSMField(svc ssmiface.SSMAPI, key string) string

func StartSSMSession

func StartSSMSession(cfg *Config) (ssmiface.SSMAPI, error)

Types

type Config

type Config struct {
	Credentials   Credentials
	Sockets       SocketParams
	Connector     Connector
	AwsGroups     []ConnectorGroups `mapstructure:"aws_groups"`
	EcsPlugin     []EcsPlugin       `mapstructure:"aws_ecs_ssm"`
	DockerPlugin  []ConnectorGroups `mapstructure:"docker_plugin"`
	NetworkPlugin []NetworkPlugin   `mapstructure:"network_plugin"`
	K8Plugin      []K8Plugin        `mapstructure:"k8_plugin"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type ConfigParser

type ConfigParser struct {
}

func NewConfigParser

func NewConfigParser() *ConfigParser

func (*ConfigParser) LoadSSMInConfig

func (c *ConfigParser) LoadSSMInConfig(ssmAPI ssmiface.SSMAPI, cfg *Config) error

func (*ConfigParser) Parse

func (c *ConfigParser) Parse(configPath string) (*Config, error)

type Connector

type Connector struct {
	Name                string
	AwsRegion           string `mapstructure:"aws-region"`
	SSMAwsRegion        string `mapstructure:"ssm-aws-region"`
	AwsProfile          string `mapstructure:"aws-profile"`
	ProviderRegion      string `mapstructure:"provider-region"`
	ProviderEnv         string `mapstructure:"provider-enviroment"`
	ProviderEnvironment string `mapstructure:"provider-environment"`
	ProviderType        string `mapstructure:"provider-type"`
}

func (*Connector) GetProviderEnvironment

func (c *Connector) GetProviderEnvironment() string

type ConnectorGroups

type ConnectorGroups struct {
	Group                          string
	AllowedEmailAddresses          []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains            []string `mapstructure:"allowed_email_domains"`
	ConnectorAuthenticationEnabled bool     `mapstructure:"connector_authentication"`
	Policies                       []string `mapstructure:"policies"`
	AwsSsmEnabled                  bool     `mapstructure:"aws_ssm_enabled"`
	AwsEC2InstanceConnectEnabled   bool     `mapstructure:"aws_ec2_instance_connect"`
	UpstreamUsername               string   `mapstructure:"upstream_username"`
	UpstreamPassword               string   `mapstructure:"upstream_password"`
	UpstreamIdentifyFile           string   `mapstructure:"upstream_identity_file"`
}

type Credentials

type Credentials struct {
	Username string
	User     string
	Password string
	Token    string
}

func (Credentials) GetUsername

func (c Credentials) GetUsername() string

type EcsPlugin

type EcsPlugin struct {
	Group                          string
	ConnectorAuthenticationEnabled bool     `mapstructure:"connector_authentication"`
	Policies                       []string `mapstructure:"policies"`
	TaskFilter                     []string `mapstructure:"aws_ecs_tasks"`
	ServiceFilter                  []string `mapstructure:"aws_ecs_services"`
	ContainerFilter                []string `mapstructure:"aws_ecs_containers"`
}

type K8Plugin

type K8Plugin struct {
	Group                          string
	Namespace                      string
	AllowedEmailAddresses          []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains            []string `mapstructure:"allowed_email_domains"`
	ConnectorAuthenticationEnabled bool     `mapstructure:"connector_authentication"`
	Policies                       []string `mapstructure:"policies"`
	UpstreamUsername               string   `mapstructure:"upstream_username"`
	UpstreamPassword               string   `mapstructure:"upstream_password"`
	UpstreamIdentifyFile           string   `mapstructure:"upstream_identity_file"`
}

type NetworkPlugin

type NetworkPlugin struct {
	Scan_interval                  int64                           `mapstructure:"scan_interval"`
	Group                          string                          `mapstructure:"group"`
	AllowedEmailAddresses          []string                        `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains            []string                        `mapstructure:"allowed_email_domains"`
	Networks                       map[string]NetworkPluginNetwork `mapstructure:"networks"`
	Policies                       []string                        `mapstructure:"policies"`
	ConnectorAuthenticationEnabled bool                            `mapstructure:"connector_authentication"`
}

type NetworkPluginNetwork

type NetworkPluginNetwork struct {
	Interfaces []string `mapstructure:"interfaces"`
	Subnets    []string `mapstructure:"subnets"`
	Ports      []uint16 `mapstructure:"ports"`
}

type SocketConfig

type SocketConfig struct {
	Host                           string
	Port                           int
	Name                           string
	Type                           string
	Description                    string
	AllowedEmailAddresses          []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains            []string `mapstructure:"allowed_email_domains"`
	UpstreamUserDeprecated         string   `mapstructure:"upstream_user"`
	UpstreamUser                   string   `mapstructure:"upstream_username"`
	UpstreamPassword               string   `mapstructure:"upstream_password"`
	UpstreamType                   string   `mapstructure:"upstream_type"`
	DatabaseCredentials            string   `mapstructure:"database_credentials"`
	UpstreamHttpHostname           string   `mapstructure:"upstream_http_hostname"`
	ConnectorAuthenticationEnabled bool     `mapstructure:"connector_authentication"`
	Policies                       []string `mapstructure:"policies"`

	UpstreamCertFile             string   `mapstructure:"upstream_certificate_file"`
	UpstreamKeyFile              string   `mapstructure:"upstream_key_file"`
	UpstreamCACertFile           string   `mapstructure:"upstream_ca_file"`
	UpstreamIdentifyFile         string   `mapstructure:"upstream_identity_file"`
	UpstreamTLS                  *bool    `mapstructure:"upstream_tls,omitempty"`
	RdsIAMAuth                   bool     `mapstructure:"rds_iam_auth"`
	AWSRegion                    string   `mapstructure:"aws_region"`
	AWSEC2InstanceConnectEnabled bool     `mapstructure:"aws_ec2_instance_connect"`
	AWSEC2InstanceId             string   `mapstructure:"aws_ec2_instance_id"`
	CloudSQLConnector            bool     `mapstructure:"cloudsql_connector"`
	CloudSQLIAMAuth              bool     `mapstructure:"cloudsql_iam_auth"`
	CloudSQLInstance             string   `mapstructure:"cloudsql_instance"`
	GoogleCredentialsFile        string   `mapstructure:"google_credentials_file"`
	SSHServer                    bool     `mapstructure:"sshserver"`
	AWSECSCluster                string   `mapstructure:"aws_ecs_cluster"`
	TaskFilter                   []string `mapstructure:"aws_ecs_tasks"`
	ServiceFilter                []string `mapstructure:"aws_ecs_services"`
	ContainerFilter              []string `mapstructure:"aws_ecs_containers"`
}

type SocketParams

type SocketParams []map[string]SocketConfig

Jump to

Keyboard shortcuts

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