You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add the ability to specify global and specific parameters through the config ini file (#24)
* fix: add more tests
rework how the config file is passed in
perform merges from config.specific sections to the global config
+semver: feature
+semver: FEATURE
Copy file name to clipboardExpand all lines: cmd/awscliauth.go
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -20,21 +20,21 @@ type Root struct {
20
20
// ChannelOut io.Writer
21
21
// ChannelErr io.Writer
22
22
// viperConf *viper.Viper
23
-
rootFlags*rootCmdFlags
23
+
rootFlags*RootCmdFlags
24
24
Datadirstring
25
25
}
26
26
27
-
typerootCmdFlagsstruct {
28
-
cfgSectionNamestring
29
-
storeInProfilebool
30
-
killHangingProcessbool
31
-
roleChain[]string
32
-
verbosebool
33
-
durationint
27
+
typeRootCmdFlagsstruct {
28
+
CfgSectionNamestring
29
+
StoreInProfilebool
30
+
RoleChain []string
31
+
Verbosebool
32
+
Durationint
33
+
CustomIniLocationstring
34
34
}
35
35
36
36
funcNew() *Root {
37
-
rf:=&rootCmdFlags{}
37
+
rf:=&RootCmdFlags{}
38
38
r:=&Root{
39
39
rootFlags: rf,
40
40
Cmd: &cobra.Command{
@@ -49,15 +49,17 @@ Stores them under the $HOME/.aws/credentials file under a specified path or retu
49
49
},
50
50
}
51
51
52
-
r.Cmd.PersistentFlags().StringSliceVarP(&rf.roleChain, "role-chain", "", []string{}, "If specified it will assume the roles from the base credentials, in order they are specified in")
53
-
r.Cmd.PersistentFlags().BoolVarP(&rf.storeInProfile, "store-profile", "s", false, `By default the credentials are returned to stdout to be used by the credential_process.
52
+
r.Cmd.PersistentFlags().StringSliceVarP(&rf.RoleChain, "role-chain", "", []string{}, "If specified it will assume the roles from the base credentials, in order they are specified in")
53
+
r.Cmd.PersistentFlags().BoolVarP(&rf.StoreInProfile, "store-profile", "s", false, `By default the credentials are returned to stdout to be used by the credential_process.
54
54
Set this flag to instead store the credentials under a named profile section. You can then reference that profile name via the CLI or for use in an SDK`)
55
-
r.Cmd.PersistentFlags().StringVarP(&rf.cfgSectionName, "cfg-section", "", "", "Config section name in the default AWS credentials file. To enable priofi")
55
+
r.Cmd.PersistentFlags().StringVarP(&rf.CfgSectionName, "cfg-section", "", "", "Config section name to use in the look up of the config ini file (~/.aws-cli-auth.ini) and in the AWS credentials file")
56
56
// When specifying store in profile the config section name must be provided
r.Cmd.PersistentFlags().IntVarP(&rf.duration, "max-duration", "d", 900, `Override default max session duration, in seconds, of the role session [900-43200].
58
+
r.Cmd.PersistentFlags().IntVarP(&rf.Duration, "max-duration", "d", 900, `Override default max session duration, in seconds, of the role session [900-43200].
59
59
NB: This cannot be higher than the 3600 as the API does not allow for AssumeRole for sessions longer than an hour`)
If for any reason the local ini file and the secret store on your OS (keyring on GNU, keychain MacOS, windows secret store) are out of sync and the secrets cannot be retrieved by name but still exists,
65
67
you might want to use CLI or GUI interface to the secret backing store on your OS and search for a secret prefixed with aws-cli-* and delete manually
0 commit comments