DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
221 stars 44 forks source link

Support setting notes on secrets #352

Closed Piccirello closed 1 year ago

Piccirello commented 1 year ago

This PR adds a new command for setting notes on a secret: doppler secrets notes set. A separate command was added as adding this to doppler secrets set would mean that a user wouldn't be able to set a secret note without also setting the secret value.

This is in draft pending the server PR.

Closes ENG-1669.

Kunamatata commented 1 year ago

Probably two possible other tickets:

nmanoogian commented 1 year ago
  • Do we want a delete endpoint for notes, or would you expect users to call ... notes set MY_SECRET "" ?

Great point. It looks like doppler secrets notes set MY_SECRET "" doesn't actually work:

$ doppler secrets notes set PRIVATE_KEY ""
Error: accepts 2 arg(s), received 1
Usage:
  doppler secrets notes set [secret] [note] [flags]
Kunamatata commented 1 year ago

@nmanoogian It does work for me:

image
nmanoogian commented 1 year ago

@nmanoogian It does work for me: image

Interesting! Can you try it with the built binary?

Piccirello commented 1 year ago

Interesting! Can you try it with the built binary?

I added support for this at some point in a force push, so you may be using an older binary.

Piccirello commented 1 year ago

Probably two possible other tickets:

* Do we want a delete endpoint for notes, or would you expect users to call `... notes set MY_SECRET ""` ?

* Do we want to allow users to see notes for a given secret via the CLI?

I don't think we need an explicit delete endpoint - users can set a blank note like you mentioned.

You can see notes for a specific secret using doppler secrets get, or for all secrets using doppler secrets. I don't think we need an explicit doppler secrets notes get command just yet, though we may add one in the future.

Kunamatata commented 1 year ago

@nmanoogian It also works with the binary when running go build it names it as cli so ./cli secrets note set MY_SECRET "" sets an empty note.

Kunamatata commented 1 year ago

@Piccirello quick follow up on this, https://github.com/DopplerHQ/cli/pull/352#discussion_r1052621458 you put a thumbs up, where do you stand?

EDIT: posted the comment right when you pushed! Nice

Piccirello commented 1 year ago

@Piccirello quick follow up on this, #352 (comment) you put a thumbs up, where do you stand?

EDIT: posted the comment right when you pushed! Nice

All fixed now. Should be good for a re-review.