Skip to content

Commit 9ce3112

Browse files
committed
fix: add better description
1 parent e8d693a commit 9ce3112

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,23 @@ Notice the missing `-s` | `--store-profile` flag
124124
### Use in CI
125125

126126

127+
128+
```
129+
Initiates a specific crednetial provider [WEB_ID]
130+
131+
Usage:
132+
aws-cli-auth specific <flags> [flags]
133+
134+
Flags:
135+
-h, --help help for specific
136+
-m, --method string If aws-cli-auth exited improprely in a previous run there is a chance that there could be hanging processes left over - this will clean them up forcefully
137+
138+
Global Flags:
139+
--cfg-section string config section name in the yaml config file
140+
-r, --role string Set the role you want to assume when SAML or OIDC process completes
141+
-s, --store-profile By default the credentials are returned to stdout to be used by the credential_process. Set this flag to instead store the credentials under a named profile section
142+
```
143+
127144
## Licence
128145
WFTPL
129146

cmd/specific.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ var (
1515
specificCmd = &cobra.Command{
1616
Use: "specific <flags>",
1717
Short: "Initiates a specific crednetial provider [WEB_ID]",
18-
Run: specific,
18+
Long: `Initiates a specific crednetial provider [WEB_ID] as opposed to relying on the defaultCredentialChain provider.
19+
This is useful in CI situations where various authentication forms maybe present from AWS_ACCESS_KEY as env vars to metadata of the node.
20+
Returns the same JSON object as the call to the AWS cli for any of the sts AssumeRole* commands`,
21+
Run: specific,
1922
}
2023
)
2124

2225
// var strategy map[string]func
2326

2427
func init() {
25-
specificCmd.PersistentFlags().StringVarP(&method, "method", "m", "", "If aws-cli-auth exited improprely in a previous run there is a chance that there could be hanging processes left over - this will clean them up forcefully")
28+
specificCmd.PersistentFlags().StringVarP(&method, "method", "m", "WEB_ID", "Runs a specific credentialProvider as opposed to rel")
2629
rootCmd.AddCommand(specificCmd)
2730
}
2831

@@ -32,7 +35,6 @@ func specific(cmd *cobra.Command, args []string) {
3235
if method != "" {
3336
switch method {
3437
case "WEB_ID":
35-
3638
awsCreds, err = auth.LoginAwsWebToken(os.Getenv("USER"))
3739
if err != nil {
3840
util.Exit(err)

0 commit comments

Comments
 (0)