config

package
v0.0.0-...-8e8406b Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigFile            string        `mapstructure:"config-file"`
	Console               *Console      `mapstructure:"-"`
	Duration              time.Duration `mapstructure:"duration"`
	Generator             string        `mapstructure:"generator"`
	Grace                 time.Duration `mapstructure:"grace"`
	MFASerial             string        `mapstructure:"mfa-serial"`
	NoCache               bool          `mapstructure:"no-cache"`
	Profile               string        `mapstructure:"profile"`
	Profiles              Profiles      `mapstructure:"-"`
	Register              *Register     `mapstructure:"-"`
	SharedCredentialsFile string        `mapstructure:"shared-credentials-file"`
	Verbose               bool          `mapstructure:"verbose"`
}

Config is the central configuration struct of awsu

func (*Config) Init

func (c *Config) Init() error

Init will perform post config initializations and validations

type Console

type Console struct {
	Open bool
}

Console is the console command configuration for awsu

type Profile

type Profile struct {
	AccessKeyID     string `ini:"aws_access_key_id"`
	ExternalID      string `ini:"external_id"`
	MFASerial       string `ini:"mfa_serial"`
	Name            string
	Region          string `ini:"region"`
	RoleARN         string `ini:"role_arn"`
	SecretAccessKey string `ini:"aws_secret_access_key"`
	SourceProfile   string `ini:"source_profile"`
}

Profile is a long- or short-time credential profile managed in a shared config

func (*Profile) IsLongTerm

func (p *Profile) IsLongTerm() bool

IsLongTerm identifies a profile that does not assume a role using a source profile

func (*Profile) Value

func (p *Profile) Value() credentials.Value

Value returns the credentials associated with the profile (if any) - only long term profiles have credentials

type Profiles

type Profiles map[string]*Profile

Profiles is map of profile names to profiles

func Load

func Load(files ...string) (Profiles, error)

Load will load profiles from multiple files, merging definitions on the way

func (Profiles) Source

func (p Profiles) Source(profile string) *Profile

Source resolves a short-term credential source profile

type Register

type Register struct {
	Issuer string
	QR     bool
}

Register is the register command configuration for awsu

Jump to

Keyboard shortcuts

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