assumerolewithsaml

package
v2.0.0-rc1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSessionDuration = time.Hour * 24 * 90
	MinSessionDuration = time.Minute * 15

	DefaultSessionDuration = time.Hour * 4

	// this is the implied default for the API
	// https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html
	DefaultRegion = "us-east-1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumeRoleWithSAML

type AssumeRoleWithSAML struct {
	OktaClient oktaclient.Client

	AWSSAMLURL string

	// Use this to choose an AssumableRole from a list
	TargetRoleARNChooser RoleChooser

	// Opts must have had ApplyDefaults and Validate called
	Opts Opts
}

func (AssumeRoleWithSAML) Assume

func (a AssumeRoleWithSAML) Assume() (Creds, error)

TODO: needs testing

type Creds

type Creds struct {
	CredsMeta
	awsokta.AWSCreds
}

type CredsMeta

type CredsMeta struct {
	Region string
}

type ErrRoleNotFound

type ErrRoleNotFound struct {
	RoleARN string
}

func (*ErrRoleNotFound) Error

func (e *ErrRoleNotFound) Error() string

type ErrSessionDurationOOB

type ErrSessionDurationOOB struct {
	Min    time.Duration
	Max    time.Duration
	Actual time.Duration
}

func (*ErrSessionDurationOOB) Error

func (e *ErrSessionDurationOOB) Error() string

type Opts

type Opts struct {
	SessionDuration time.Duration

	// if unset, no session caching will be done
	SessionCache SessionCache

	Log *logrus.Logger

	// TODO: parse from SAML assertion?
	RoleSessionName string

	Region string
}

func (*Opts) ApplyDefaults

func (o *Opts) ApplyDefaults() *Opts

func (*Opts) Validate

func (o *Opts) Validate() error

type RoleChooser

type RoleChooser interface {
	Choose([]awsokta.AssumableRole) (awsokta.AssumableRole, error)
}

type SessionCache

type SessionCache interface {
	Get(sessionCacheKey) (Creds, error)
	Put(sessionCacheKey, Creds) error
}

type StaticChooser

type StaticChooser struct {
	RoleARN string
}

func (StaticChooser) Choose

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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