strategy

package
v0.0.0-...-a1e2317 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GenManual is the "manual" (type-OTP-in) generator
	GenManual = "manual"

	// GenYubikey is the native Yubikey generator
	GenYubikey = "yubikey"
)

Variables

This section is empty.

Functions

func Apply

func Apply(cfg *config.Config) (*credentials.Credentials, error)

Apply applies all configured strategy, depending on the given Config

Types

type AssumeRole

type AssumeRole struct {
	Duration time.Duration
	Grace    time.Duration
	Profiles []*config.Profile
}

AssumeRole is a strategy that assumes IAM roles

func (*AssumeRole) Credentials

func (a *AssumeRole) Credentials(sess *session.Session) (*credentials.Credentials, error)

Credentials aquires actual credentials

func (*AssumeRole) IsCacheable

func (a *AssumeRole) IsCacheable() bool

IsCacheable indicates the output of this strategy can be cached (always true)

func (*AssumeRole) Name

func (a *AssumeRole) Name() string

Name returns the name of this strategy

func (*AssumeRole) Profile

func (a *AssumeRole) Profile() *config.Profile

Profile returns the name of the profile used (if applicable, otherwise nil)

type LongTerm

type LongTerm struct {
	Profiles []*config.Profile
}

LongTerm is a strategy that uses long-term credentials (IAM user keypairs)

func (*LongTerm) Credentials

func (l *LongTerm) Credentials(sess *session.Session) (*credentials.Credentials, error)

Credentials aquires actual credentials

func (*LongTerm) IsCacheable

func (l *LongTerm) IsCacheable() bool

IsCacheable indicates the output of this strategy can be cached (always false)

func (*LongTerm) Name

func (l *LongTerm) Name() string

Name returns the name of this strategy

func (*LongTerm) Profile

func (l *LongTerm) Profile() *config.Profile

Profile returns the name of the profile used (if applicable, otherwise nil)

type SessionToken

type SessionToken struct {
	Duration  time.Duration
	Generator string
	Grace     time.Duration
	MFASerial string
	Profiles  []*config.Profile
	// contains filtered or unexported fields
}

SessionToken is a strategy that gets session tokens using long-term credentials

func (*SessionToken) Credentials

func (s *SessionToken) Credentials(sess *session.Session) (*credentials.Credentials, error)

Credentials aquires actual credentials

func (*SessionToken) IsCacheable

func (s *SessionToken) IsCacheable() bool

IsCacheable indicates the output of this strategy can be cached (always true)

func (*SessionToken) Name

func (s *SessionToken) Name() string

Name returns the name of this strategy

func (*SessionToken) Profile

func (s *SessionToken) Profile() *config.Profile

Profile returns the name of the profile used (if applicable, otherwise nil)

type Strategy

type Strategy interface {

	// Credentials acquires actual credentials
	Credentials(*session.Session) (*credentials.Credentials, error)

	// IsCacheable indicates the output of this strategy can be cached
	IsCacheable() bool

	// Name returns the name of this strategy
	Name() string

	// Profile returns the name of the profile used (if applicable, otherwise nil)
	Profile() *config.Profile
}

Strategy identifies a way of aquiring short-term, cacheable credentials

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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