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

remove nil response to 404 translation for PatchOperation #13167

Merged
merged 2 commits into from Nov 23, 2021

Conversation

ccapurso
Copy link
Contributor

@ccapurso ccapurso commented Nov 16, 2021

PR #12687 included translation of a nil logical.Response for a PatchOperation request to a 404. After further review, there are cases where CreateOperation and UpdateOperation handlers return a nil response resulting in a 204. It is prudent to remain consistent for operations against the same endpoint. With that said, it makes sense to remove this global translation. Backends will need to call the logical.RespondWithStatusCode with http.StatusNotFound to embed a 404 Not Found as the http_status_code for the logical.Response.

The TestHandler_Patch_NotFound test has been removed as that was written specifically to ensure that the global nil -> 404 translation occurred.

PR #56 for vault-plugin-secrets-kv removes the implied 404 Not Found response by returning a nil logical.Response in favor of an explicit response.

@ccapurso ccapurso added this to the 1.9.1 milestone Nov 23, 2021
@vercel vercel bot temporarily deployed to Preview – vault-storybook November 23, 2021 17:19 Inactive
@vercel vercel bot temporarily deployed to Preview – vault November 23, 2021 17:19 Inactive
@ccapurso ccapurso merged commit 2c2b9b8 into main Nov 23, 2021
@ccapurso ccapurso deleted the remove-patch-operation-404-translation branch November 23, 2021 18:57
qk4l pushed a commit to qk4l/vault that referenced this pull request Feb 4, 2022
…13167)

* remove nil response to 404 translation for PatchOperation

* go get vault-plugin-secrets-kv@master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants