auth

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSessionTtlSec = 900
	DefaultMfaSource     = "prompt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mixin

type Mixin struct {
	Ctx context.Context

	CacheDir  string
	CacheSkip bool   `usage:"Skip reading from cache (but still write after success)"`
	MfaSerial string `usage:"MFA serial ARN"`
	MfaSource string `usage:"MFA source (to read from an environment variable, provide the variable's name)"`

	// Normally this would live in the cli/handler/mixin/aws/auth/role mixin, but it's
	// needed earlier than the Provider.Get call for the cache read (key).
	RoleChain string `usage:"Comma-separated aliases, e.g. \"instance\" or ARNs (role auth mode only)"`

	SessionTtlSec int `usage:"Session length in seconds"`

	// RoleChainFlag is the CLI flag for the RoleChain field.
	//
	// It defaults to "role".
	RoleChainFlag string
}

func (*Mixin) BindCobraFlags

func (m *Mixin) BindCobraFlags(cmd *cobra.Command) []string

Implements cage/cli/handler.Mixin

func (*Mixin) Credentials

func (m *Mixin) Credentials(provider Provider) (*credentials.Credentials, error)

func (*Mixin) Name

func (m *Mixin) Name() string

Implements cage/cli/handler.Mixin

func (*Mixin) PreRun

func (m *Mixin) PreRun(ctx context.Context, args []string) error

Implements cage/cli/handler.PreRun

type Provider

type Provider interface {
	Get(ProviderInput) (*credentials.Credentials, error)
}

type ProviderInput

type ProviderInput struct {
	Ctx           context.Context
	MfaSerial     string
	MfaCode       string
	RoleChain     string
	SessionTtlSec int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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