credentials

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	credentials.Value
	Expires time.Time
	Profile string
}

Credentials encapsulates cacheable credentials that can convert to actual session and can be used to aquire further credential

func Load

func Load(profile string) (*Credentials, error)

Load loads cached credentials

func NewLongTerm

func NewLongTerm(profile, accessKeyID, secretAccessKey string) *Credentials

NewLongTerm is a constructor for long term credentials

func NewShortTerm

func NewShortTerm(profile, accessKeyID, secretAccessKey, sessionToken string, expires time.Time) *Credentials

NewShortTerm is a constructor for short term credentials with expiry

func (*Credentials) Exec

func (c *Credentials) Exec(app string, args []string) error

Exec sets an appropriate runtime environment and execs the passed in app

func (*Credentials) IsValid

func (c *Credentials) IsValid() bool

IsValid indicates if a loaded credential is (still) valid

func (*Credentials) NewSession

func (c *Credentials) NewSession() *session.Session

NewSession creates a new session with these credentials

func (*Credentials) Save

func (c *Credentials) Save() error

Save saves (caches) credentials

func (*Credentials) String

func (c *Credentials) String() string

String returns a string representation of these credentials, suitable for eval()

func (*Credentials) UpdateSession

func (c *Credentials) UpdateSession(sess *session.Session) *session.Session

UpdateSession updates a given session with this credentials

Jump to

Keyboard shortcuts

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