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
log.Fatalf("Unsupported backend: %s. Valid backends are 'github' or 'aws'.", backend)
66
+
exitWithError(nil, "Unsupported backend. Valid backends are 'github' or 'aws'.")
67
+
return
64
68
}
65
69
},
66
70
}
@@ -70,16 +74,8 @@ func main() {
70
74
Use: "get",
71
75
Short: "Retrieve a secret from AWS Secrets Manager",
72
76
Run: func(cmd*cobra.Command, args []string) {
73
-
ifstrings.ToLower(backend) !="aws" {
74
-
log.Fatalf("The 'get' command only supports the AWS backend.")
75
-
}
76
-
77
-
ifsecretID=="" {
78
-
log.Fatalf("You must specify a secret ID using the --secret-id flag.")
79
-
}
80
-
81
77
iferr:=getAWSSecret(secretID, decode); err!=nil {
82
-
log.Fatalf("Failed to retrieve AWS secret: %s", err)
78
+
exitWithError(err, "Failed to retrieve AWS secret")
83
79
}
84
80
},
85
81
}
@@ -98,12 +94,13 @@ func main() {
98
94
setCmd.PersistentFlags().StringSliceVar(&sharedWith, "shared-with", []string{}, "Comma-separated list of IAM ARNs to share the secret with")
99
95
100
96
getCmd.PersistentFlags().StringVarP(&secretID, "secret-id", "s", "", "ID of the secret to retrieve")
101
-
getCmd.PersistentFlags().StringVarP(&backend, "backend", "b", "aws", "Backend to use for retrieving secrets. Only 'aws' is supported for this command.")
102
97
getCmd.PersistentFlags().BoolVarP(&decode, "decode", "d", false, "Decode the Base64-encoded secret value")
103
98
99
+
// Make secretID a required flag for the set command
0 commit comments