Skip to content
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

Batch retrieval endpoint doesn't fail when only a subset of secrets can't be retrieved #2071

Open
izgeri opened this issue Mar 17, 2021 · 0 comments

Comments

@izgeri
Copy link
Contributor

izgeri commented Mar 17, 2021

Is your feature request related to a problem? Please describe.

At current, if any secret in the list of secrets I send in a batch secrets retrieval request doesn't exist, doesn't have the correct permissions, or doesn't have a value, the whole request gets a 404 response.

You can see this in the cucumber tests here:

Scenario: Fails with 404 if a resource doesn't exist
When I GET "/secrets?variable_ids=cucumber:variable:secret1,cucumber:variable:not-a-secret"
Then the HTTP response status code is 404
Scenario: Fails with 404 if a resource doesn't have a value
Given I create a new "variable" resource called "secret-no-value"
When I GET "/secrets?variable_ids=cucumber:variable:secret1,cucumber:variable:secret-no-value"
Then the HTTP response status code is 404

Describe the solution you would like

Rather than failing the whole request if a subset of variables aren't available, the UX would be better if the response included a list of all of the variables requested and their individual response codes.

An example design for how this might work is here; please note that @rafis3 had feedback that:

  • I am not in favor of using POST for an API that doesn't change the state of the server.
  • I would challenge the returned structure of a variable. I would return an array of list. A list contains a list of items that would be generic to any bulk API we provide, which will contain a structure that holds the error message, return code and the requested resource itself. The requested resource object would be a secret in this case, that would contain its id and value

Describe alternatives you have considered

n/a

Additional context

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant