Skip to content

[FEATURE REQUEST] Secret Store Entry error messages could be improved #1507

@joeshaw

Description

@joeshaw

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

  1. The description of the secret-store-entry create command should probably be: Create (or replace) a secret within specified store.
  2. The error message you get back if you forget to provide --recreate should 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:

  • --recreate becomes --replace
  • --recreate-allow becomes --replace-or-create

Another option that would simplify the flags would be:

  • --recreate goes away
  • --recreate-allow becomes --replace

You'd lose the error-if-secret-doesn't-exist behavior, but I'm not sure how important that is.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions