Documentation ¶
Index ¶
- func AddCommand(input AddCommandInput, keyring keyring.Keyring, ...) error
- func ClearCommand(input ClearCommandInput, awsConfigFile *vault.ConfigFile, ...) error
- func ConfigureAddCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureClearCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureExecCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureListCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureLoginCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureProxyCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureRemoveCommand(app *kingpin.Application, a *AwsVault)
- func ConfigureRotateCommand(app *kingpin.Application, a *AwsVault)
- func ExecCommand(input ExecCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
- func ListCommand(input ListCommandInput, awsConfigFile *vault.ConfigFile, ...) (err error)
- func LoginCommand(input LoginCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
- func RemoveCommand(input RemoveCommandInput, keyring keyring.Keyring) error
- func RotateCommand(input RotateCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
- type AddCommandInput
- type AwsVault
- type ClearCommandInput
- type ExecCommandInput
- type ListCommandInput
- type LoginCommandInput
- type RemoveCommandInput
- type RotateCommandInput
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommand ¶
func AddCommand(input AddCommandInput, keyring keyring.Keyring, awsConfigFile *vault.ConfigFile) error
Example ¶
f, err := os.CreateTemp("", "aws-config") if err != nil { log.Fatal(err) } defer os.Remove(f.Name()) os.Setenv("AWS_CONFIG_FILE", f.Name()) os.Setenv("AWS_ACCESS_KEY_ID", "llamas") os.Setenv("AWS_SECRET_ACCESS_KEY", "rock") os.Setenv("AWS_VAULT_BACKEND", "file") os.Setenv("AWS_VAULT_FILE_PASSPHRASE", "password") defer os.Unsetenv("AWS_ACCESS_KEY_ID") defer os.Unsetenv("AWS_SECRET_ACCESS_KEY") defer os.Unsetenv("AWS_VAULT_BACKEND") defer os.Unsetenv("AWS_VAULT_FILE_PASSPHRASE") app := kingpin.New(`aws-vault`, ``) ConfigureAddCommand(app, ConfigureGlobals(app)) kingpin.MustParse(app.Parse([]string{"add", "--debug", "--env", "foo"}))
Output: Added credentials to profile "foo" in vault
func ClearCommand ¶
func ClearCommand(input ClearCommandInput, awsConfigFile *vault.ConfigFile, keyring keyring.Keyring) error
func ConfigureAddCommand ¶
func ConfigureAddCommand(app *kingpin.Application, a *AwsVault)
func ConfigureClearCommand ¶
func ConfigureClearCommand(app *kingpin.Application, a *AwsVault)
func ConfigureExecCommand ¶
func ConfigureExecCommand(app *kingpin.Application, a *AwsVault)
func ConfigureListCommand ¶
func ConfigureListCommand(app *kingpin.Application, a *AwsVault)
func ConfigureLoginCommand ¶
func ConfigureLoginCommand(app *kingpin.Application, a *AwsVault)
func ConfigureProxyCommand ¶
func ConfigureProxyCommand(app *kingpin.Application, a *AwsVault)
func ConfigureRemoveCommand ¶
func ConfigureRemoveCommand(app *kingpin.Application, a *AwsVault)
func ConfigureRotateCommand ¶
func ConfigureRotateCommand(app *kingpin.Application, a *AwsVault)
func ExecCommand ¶
func ExecCommand(input ExecCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
Example ¶
app := kingpin.New("aws-vault", "") awsVault := ConfigureGlobals(app) awsVault.keyringImpl = keyring.NewArrayKeyring([]keyring.Item{ {Key: "llamas", Data: []byte(`{"AccessKeyID":"ABC","SecretAccessKey":"XYZ"}`)}, }) ConfigureExecCommand(app, awsVault) kingpin.MustParse(app.Parse([]string{ "--debug", "exec", "--no-session", "llamas", "--", "sh", "-c", "echo $AWS_ACCESS_KEY_ID", }))
Output: ABC
func ListCommand ¶
func ListCommand(input ListCommandInput, awsConfigFile *vault.ConfigFile, keyring keyring.Keyring) (err error)
Example ¶
app := kingpin.New("aws-vault", "") awsVault := ConfigureGlobals(app) awsVault.keyringImpl = keyring.NewArrayKeyring([]keyring.Item{ {Key: "llamas", Data: []byte(`{"AccessKeyID":"ABC","SecretAccessKey":"XYZ"}`)}, }) ConfigureListCommand(app, awsVault) kingpin.MustParse(app.Parse([]string{ "list", "--credentials", }))
Output: llamas
func LoginCommand ¶
func LoginCommand(input LoginCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
func RemoveCommand ¶
func RemoveCommand(input RemoveCommandInput, keyring keyring.Keyring) error
func RotateCommand ¶
func RotateCommand(input RotateCommandInput, f *vault.ConfigFile, keyring keyring.Keyring) error
Types ¶
type AddCommandInput ¶
type AwsVault ¶
type AwsVault struct { Debug bool KeyringConfig keyring.Config KeyringBackend string PromptDriver string // contains filtered or unexported fields }
func ConfigureGlobals ¶
func ConfigureGlobals(app *kingpin.Application) *AwsVault
func (*AwsVault) AwsConfigFile ¶
func (a *AwsVault) AwsConfigFile() (*vault.ConfigFile, error)
func (*AwsVault) MustGetProfileNames ¶
type ClearCommandInput ¶
type ClearCommandInput struct {
ProfileName string
}
type ExecCommandInput ¶
type ListCommandInput ¶
type LoginCommandInput ¶
type RemoveCommandInput ¶
Click to show internal directories.
Click to hide internal directories.