Documentation ¶
Index ¶
- Constants
- func AccountIdToInt64(a string) (int64, error)
- func AccountIdToString(a int64) (string, error)
- func DiffBytes(aBytes, bBytes []byte, aName, bName string) string
- func EnsureDirExists(filename string) error
- func GenerateSource(fileTemplate string, vars interface{}) ([]byte, error)
- func GetHomePath(path string) string
- func GetLogger() *logrus.Logger
- func IsRemoteHost() bool
- func MakeRoleARN(account int64, name string) string
- func MakeRoleARNs(account, name string) string
- func MakeUserARN(account int64, name string) string
- func ParseRoleARN(arn string) (int64, string, error)
- func ParseTimeString(t string) (int64, error)
- func ParseUserARN(arn string) (int64, string, error)
- func SetLogger(l *logrus.Logger)
- func StrListContains(str string, list []string) bool
- func TimeRemain(expires int64, space bool) (string, error)
- type BellSkipper
- type FileEdit
Constants ¶
const ( DEFAULT_SSO_NAME = "Default" // DefaultSSO per cmd/aws-sso/main.go CONFIG_PREFIX = "# BEGIN_AWS_SSO_CLI" CONFIG_SUFFIX = "# END_AWS_SSO_CLI" FILE_TEMPLATE = "%s\n%s\n%s\n" )
const MAX_AWS_ACCOUNTID = 999999999999
Variables ¶
This section is empty.
Functions ¶
func AccountIdToInt64 ¶
AccountIdToInt64 returns an int64 version of AWS AccountID in base10
func AccountIdToString ¶
AccountIdToString returns a string version of AWS AccountID
func EnsureDirExists ¶
ensures the given directory exists for the filename used by JsonStore and InsecureStore
func GenerateSource ¶ added in v1.15.0
GenerateSource returns the byte array of a template
func GetHomePath ¶
GetHomePath returns the absolute path of the provided path with the first ~ replaced with the location of the users home directory and the path rewritten for the host operating system
func IsRemoteHost ¶ added in v1.17.0
func IsRemoteHost() bool
IsRemoteHost returns if we are running on a remote host or not
func MakeRoleARN ¶
MakeRoleARN create an IAM Role ARN using an int64 for the account
func MakeRoleARNs ¶
MakeRoleARNs creates an IAM Role ARN using a string for the account and role
func MakeUserARN ¶
MakeUserARN create an IAM User ARN using an int64 for the account
func ParseRoleARN ¶
ParseRoleARN parses an ARN representing a role in long or short format
func ParseTimeString ¶
ParseTimeString converts a standard time string to Unix Epoch
func ParseUserARN ¶
ParseUserARN parses an ARN representing a user in long or short format
func StrListContains ¶
StrListContains returns if `str` is in the `list`
Types ¶
type BellSkipper ¶
type BellSkipper struct{}
* BellSkipper implements an io.WriteCloser that skips the terminal bell * character (ASCII code 7), and writes the rest to os.Stderr. It is used to * replace readline.Stdout, that is the package used by promptui to display the * prompts. * * This is a workaround for the bell issue documented in * https://github.com/manifoldco/promptui/issues/49#issuecomment-573814976
func (*BellSkipper) Close ¶
func (bs *BellSkipper) Close() error
Close implements an io.WriterCloser over os.Stderr.
type FileEdit ¶
type FileEdit struct { Prefix string Suffix string Template *template.Template InputVars interface{} }
func NewFileEdit ¶
NewFileEdit creates a new FileEdit object
func (*FileEdit) GenerateNewFile ¶
GenerateNewFile generates the contents of a new config file
func (*FileEdit) UpdateConfig ¶
UpdateConfig does all the heavy lifting of updating (or creating) the file and optionally providing a diff for user to approve/view. Returns true if changes were made (and the diff), false if no changes were made, or an error if something happened