-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Search] Return empty array when checking api keys for unauthorized user #173823
[Search] Return empty array when checking api keys for unauthorized user #173823
Conversation
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
// Unfortunately the error response is not structured enough for us to filter those | ||
// Always returning an empty array should also be fine, and deals with transient errors | ||
|
||
return response.ok({ body: { api_keys: [] } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a little misleading if they don't have permissions and are say, using API keys elsewhere. But I think it's an OK workaround for now. Thanks for fixing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's not ideal. Thankfully security is working on a few utilities we can lean on going forward.
…ser (elastic#173823) ## Summary Instead of returning an obnoxious error on every Search page when fetching an unauthorized user's API keys, we just return an empty array. (cherry picked from commit 1a0dcf6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…rized user (#173823) (#173836) # Backport This will backport the following commits from `main` to `8.12`: - [[Search] Return empty array when checking api keys for unauthorized user (#173823)](#173823) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sander Philipse","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-21T13:58:25Z","message":"[Search] Return empty array when checking api keys for unauthorized user (#173823)\n\n## Summary\r\n\r\nInstead of returning an obnoxious error on every Search page when\r\nfetching an unauthorized user's API keys, we just return an empty array.","sha":"1a0dcf60fc3f2a8d498ae68f92db53a8de7fd112","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.12.0","v8.13.0"],"number":173823,"url":"https://github.com/elastic/kibana/pull/173823","mergeCommit":{"message":"[Search] Return empty array when checking api keys for unauthorized user (#173823)\n\n## Summary\r\n\r\nInstead of returning an obnoxious error on every Search page when\r\nfetching an unauthorized user's API keys, we just return an empty array.","sha":"1a0dcf60fc3f2a8d498ae68f92db53a8de7fd112"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173823","number":173823,"mergeCommit":{"message":"[Search] Return empty array when checking api keys for unauthorized user (#173823)\n\n## Summary\r\n\r\nInstead of returning an obnoxious error on every Search page when\r\nfetching an unauthorized user's API keys, we just return an empty array.","sha":"1a0dcf60fc3f2a8d498ae68f92db53a8de7fd112"}}]}] BACKPORT--> Co-authored-by: Sander Philipse <[email protected]>
Summary
Instead of returning an obnoxious error on every Search page when fetching an unauthorized user's API keys, we just return an empty array.