-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Support doppler secrets set --visibility #454
Conversation
Thanks for this recommendation and implementation, @aisrael! We'll take a look and provide any necessary feedback. |
This is looking good from my testing! Setting secrets with diff --git a/pkg/cmd/secrets.go b/pkg/cmd/secrets.go
index 342fa8c..3a04d16 100644
--- a/pkg/cmd/secrets.go
+++ b/pkg/cmd/secrets.go
@@ -237,6 +237,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
canPromptUser := !utils.GetBoolFlag(cmd, "no-interactive")
localConfig := configuration.LocalConfig(cmd)
visibility := cmd.Flag("visibility").Value.String()
+ visibilityModified := visibility != ""
utils.RequireValue("token", localConfig.Token.Value)
@@ -314,7 +315,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
Name: key,
Value: &value,
}
- if visibility != "" {
+ if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
@@ -327,7 +328,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
Name: key,
Value: &value,
}
- if visibility != "" {
+ if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
@@ -347,7 +348,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
} else {
changeRequest.Value = &secretArr[1]
}
- if visibility != "" {
+ if visibilityModified {
changeRequest.Visibility = &visibility
}
changeRequests = append(changeRequests, changeRequest)
@@ -360,7 +361,7 @@ func setSecrets(cmd *cobra.Command, args []string) {
}
if !utils.Silent {
- printer.Secrets(response, keys, jsonFlag, false, raw, false, false)
+ printer.Secrets(response, keys, jsonFlag, false, raw, false, visibilityModified)
}
} This will make it so if the visibility is adjusted the table that gets printed afterward will include the visibility values as well. |
@watsonian Made the changes as suggested. |
@aisrael Awesome! We'll need another engineer on our CLI team to review before approving for merge, but it's looking good! |
@aisrael This is looking great! It looks like we had a failing test as a result of an earlier change. Would you mind rebasing your branch on |
@nmanoogian Just updated my fork/branch from |
So... should I just push a 'dummy' commit in my fork branch with |
@aisrael I believe all Nic is looking for is a |
Got it, ok will try |
edc7616
to
8c844d3
Compare
Why was this pull request opened?
Submitting this as a proof-of-concept and potential implementation for [FEATURE] Set secret visibility #453
What was changed?
model.ChangeRequest
instead of using amap[string]interface{}
model.ChangeRequest
to add all fields in the secrets-update APIHow to test?