assume

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeCommand

func AssumeCommand(c *cli.Context) error

func Completion added in v0.2.1

func Completion(ctx *cli.Context)

If there are more than 2 args and the last argument is a "-" then provide completion for the flags.

Else, provide completion for the aws profiles.

You can use `assume -c ` + tab to get profile names or `assume -` + tab to get flags

func EnvKeys added in v0.1.13

func EnvKeys(creds aws.Credentials, region string) []string

EnvKeys is used to set the env for the "exec" flag

func GetCliApp

func GetCliApp() *cli.App

func GlobalFlags added in v0.1.4

func GlobalFlags() []cli.Flag

Prevent issues where these flags are initialised in some part of the program then used by another part For our use case, we need fresh copies of these flags in the app and in the assume command we use this to allow flags to be set on either side of the profile arg e.g `assume -c profile-name -r ap-southeast-2`

func MakeGrantedOutput added in v0.1.13

func MakeGrantedOutput(s string) string

MakeGrantedOutput formats a string to match the requirements of granted output in the shell script Currently in windows, the grantedoutput is handled differently, as linux and mac support the exec cli flag whereas windows does not yet have support this method may be changed in future if we implement support for "--exec" in windows

func PrepareStringsForShellScript added in v0.1.6

func PrepareStringsForShellScript(in []string) []interface{}

PrepareCredentialsForShellScript will set empty values to "None", this is required by the shell script to identify which variables to unset it is also required to ensure that the return values are correctly split, e.g if sessionToken is "" then profile name will be used to set the session token environment variable

func RunExecCommandWithCreds added in v0.1.13

func RunExecCommandWithCreds(cmd string, creds aws.Credentials, region string) error

RunExecCommandWithCreds takes in a command, which may be a program and arguments sperated by spaces it splits these then runs the command with teh credentials as the environment. The output of this is returned via the assume script to stdout so it may be processed further by piping

func UnsetAction added in v0.1.8

func UnsetAction(c *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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