profile

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package profile provides functions accessing profiles in cu-sts config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Profiles

func Profiles() map[string]interface{}

Profiles returns all profiles from the loaded viper config file.

Types

type Profile

type Profile struct {
	Name       string
	Account    string `mapstructure:"account"`
	Role       string `mapstructure:"role"`
	IDProvider string `mapstructure:"id_provider"`
	Duration   int    `mapstructure:"duration"`
}

A Profile represents a single profile from the config file.

func New

func New() Profile

New returns an "empty" Profile with defailt IDProvider and Duration values.

func NewFromConfig

func NewFromConfig(name string) (Profile, error)

NewFromConfig returns a Profile with values set from default, config, or flags.

func (*Profile) Credentials

func (p *Profile) Credentials(samlAssertion string) (*sts.Credentials, error)

Credentials requires a base-64 SAMLAssertion and returns AWS sts.Credentials using the Profile's role, idprovider, etc.

func (*Profile) Validate

func (p *Profile) Validate() error

Validate ensures a Profile's Account and Role are set.

Jump to

Keyboard shortcuts

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