utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthWithSTS

func AuthWithSTS(roleArn, externalID string) (*sts.AssumeRoleOutput, error)

AuthWithSTS uses a role ARN and the session with the default creds to assume a role.

func GetAWSSession

func GetAWSSession(options session.Options) *session.Session

GetAWSSession returns a session that uses the currently configured AWS CLI credentials

func GetLoginURL

func GetLoginURL(signinToken, issuerURL, destinationURL string) url.URL

GetLoginURL builds the console login URL after all of the federation is done and returns the URL object

func GetSessionName

func GetSessionName(roleArn string) (string, error)

GetSessionName returns a session name appropriate for use as the AssumeRole role session name parameter

func GetSessionString

func GetSessionString(creds *sts.AssumeRoleOutput) string

GetSessionString returns a JSON.stringified representation of the session object

func GetSigninToken

func GetSigninToken(signinURL url.URL) (string, error)

GetSigninToken uses the signin URL and calls it to get the user a signin token

func GetSigninTokenURL

func GetSigninTokenURL(creds *sts.AssumeRoleOutput) url.URL

GetSigninTokenURL builds a url.URL object using the particulars from the session string and the federation URL

func PrintCredsFromSTSOutput

func PrintCredsFromSTSOutput(out *sts.AssumeRoleOutput, outputJSON bool)

PrintCredsFromSTSOutput prints out the credentials we got from the STS output in a way that the user can export them in to the shell as well as the expiration information about the session

func PrintLoginURLDetails

func PrintLoginURLDetails(out *sts.AssumeRoleOutput, loginURL string, outputJSON bool)

PrintLoginURLDetails prints out the login URL as well as the expiration date of the session

Types

This section is empty.

Jump to

Keyboard shortcuts

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