-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Is your feature request related to a problem? Please describe.
One of the quirks of the Secret Store is that there's no way to update a secret. In Secret Store, the ID of a secret is immutably tied to its plaintext. When you want to update a secret, what you actually have to do is recreate it -- a new secret with a new ID is made, the old one is deleted, and the name in the secret store points to the new one.
This creates some user confusion.
Describe the solution you'd like
- The description of the
secret-store-entry createcommand should probably be:Create (or replace) a secret within specified store. - The error message you get back if you forget to provide
--recreateshould be improved to suggest it.
Currently it's:
ERROR: the Fastly API returned 400 Bad Request: Bad Request (duplicate: name).
It could be something like:
ERROR: A secret store entry already exists with that name. You can provide the --recreate option to replace it
A nice-to-have but breaking change would be to replace the "recreate" terminology with "replace". I think this is more accurate since the old secret is being deleted. One way to do this would be:
--recreatebecomes--replace--recreate-allowbecomes--replace-or-create
Another option that would simplify the flags would be:
--recreategoes away--recreate-allowbecomes--replace
You'd lose the error-if-secret-doesn't-exist behavior, but I'm not sure how important that is.