@@ -19,19 +19,17 @@ import (
1919)
2020
2121const (
22- instanceIdFlag = "instance-id"
23- descriptionFlag = "description"
24- writeFlag = "write"
25- hidePasswordFlag = "hide-password"
22+ instanceIdFlag = "instance-id"
23+ descriptionFlag = "description"
24+ writeFlag = "write"
2625)
2726
2827type inputModel struct {
2928 * globalflags.GlobalFlagModel
3029
31- InstanceId string
32- Description * string
33- Write * bool
34- HidePassword bool
30+ InstanceId string
31+ Description * string
32+ Write * bool
3533}
3634
3735func NewCmd () * cobra.Command {
@@ -40,16 +38,13 @@ func NewCmd() *cobra.Command {
4038 Short : "Creates a Secrets Manager user" ,
4139 Long : fmt .Sprintf ("%s\n %s\n %s" ,
4240 "Creates a Secrets Manager user." ,
43- "The username and password are auto-generated and provided upon creation." ,
41+ "The username and password are auto-generated and provided upon creation. The password cannot be retrieved later. " ,
4442 "A description can be provided to identify a user." ,
4543 ),
4644 Example : examples .Build (
4745 examples .NewExample (
4846 `Create a Secrets Manager user for instance with ID "xxx" and description "yyy"` ,
4947 "$ stackit secrets-manager user create --instance-id xxx --description yyy" ),
50- examples .NewExample (
51- `Create a Secrets Manager user for instance with ID "xxx" and hides the generated password` ,
52- "$ stackit secrets-manager user create --instance-id xxx --hide-password" ),
5348 examples .NewExample (
5449 `Create a Secrets Manager user for instance with ID "xxx" with write access to the secrets engine` ,
5550 "$ stackit secrets-manager user create --instance-id xxx --write" ),
@@ -90,11 +85,7 @@ func NewCmd() *cobra.Command {
9085
9186 cmd .Printf ("Created user for instance %q. User ID: %s\n \n " , instanceLabel , * resp .Id )
9287 cmd .Printf ("Username: %s\n " , * resp .Username )
93- if model .HidePassword {
94- cmd .Printf ("Password: <hidden>\n " )
95- } else {
96- cmd .Printf ("Password: %s\n " , * resp .Password )
97- }
88+ cmd .Printf ("Password: %s\n " , * resp .Password )
9889 cmd .Printf ("Description: %s\n " , * resp .Description )
9990 cmd .Printf ("Write Access: %t\n " , * resp .Write )
10091
@@ -110,7 +101,6 @@ func configureFlags(cmd *cobra.Command) {
110101 cmd .Flags ().Var (flags .UUIDFlag (), instanceIdFlag , "ID of the instance" )
111102 cmd .Flags ().String (descriptionFlag , "" , "A user chosen description to differentiate between multiple users" )
112103 cmd .Flags ().Bool (writeFlag , false , "User write access to the secrets engine. If unset, user is read-only" )
113- cmd .Flags ().Bool (hidePasswordFlag , false , "Hide password in output" )
114104
115105 err := flags .MarkFlagsRequired (cmd , instanceIdFlag )
116106 cobra .CheckErr (err )
@@ -127,7 +117,6 @@ func parseInput(cmd *cobra.Command) (*inputModel, error) {
127117 InstanceId : flags .FlagToStringValue (cmd , instanceIdFlag ),
128118 Description : utils .Ptr (flags .FlagToStringValue (cmd , descriptionFlag )),
129119 Write : utils .Ptr (flags .FlagToBoolValue (cmd , writeFlag )),
130- HidePassword : flags .FlagToBoolValue (cmd , hidePasswordFlag ),
131120 }, nil
132121}
133122
0 commit comments