-
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
[Data Usage] add error handling and tests for privilege related errors #203006
Merged
neptunian
merged 10 commits into
elastic:main
from
neptunian:data-usage-error-handling-privilege
Dec 6, 2024
Merged
[Data Usage] add error handling and tests for privilege related errors #203006
neptunian
merged 10 commits into
elastic:main
from
neptunian:data-usage-error-handling-privilege
Dec 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neptunian
added
release_note:skip
Skip the PR/issue when compiling release notes
backport:prev-minor
Backport to (8.x) the previous minor version (i.e. one version back from main)
labels
Dec 4, 2024
ashokaditya
force-pushed
the
data-usage-error-handling-privilege
branch
from
December 5, 2024 10:44
28eb16b
to
ddf4307
Compare
…com/neptunian/kibana into data-usage-error-handling-privilege
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
Total ESLint disabled count
History
|
ashokaditya
approved these changes
Dec 6, 2024
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.
🚀
Starting backport for target branches: 8.x |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Dec 6, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 42348d4)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Dec 6, 2024
… errors (#203006) (#203252) # Backport This will backport the following commits from `main` to `8.x`: - [[Data Usage] add error handling and tests for privilege related errors (#203006)](#203006) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"neptunian@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-12-06T15:58:20Z","message":"[Data Usage] add error handling and tests for privilege related errors (#203006)\n\n- handling of 2 error cases to error handler\r\n- `security_exception` due to lack of privileges. Metering api will\r\nrespond when one of the following isn't available as a user privilege\r\n`monitor,view_index_metadata,manage,all`.\r\n- `index_not_found_exception`. Metering api will respond with this when\r\nno indices exist for the privileges it has access to or when no indices\r\nare found.\r\n- api integration tests for data_streams route for the following cases\r\n- returns no data streams when there are none it has access to and\r\nresponds with appropriate message\r\n- returns no data streams without necessary privileges and responds with\r\nappropriate message\r\n- returns data streams when user only has access to a subset of indices\r\nwith necessary privileges\r\n- functional tests for same as above. these remain skipped due to not\r\nbeing able to create data streams picked up by metering api since we\r\nimplemented filtering out zero storage size data streams, but useful for\r\nlocal testing with some code changes.\r\n\r\n\r\n### `security_exception` view\r\n<img width=\"1555\" alt=\"Screenshot 2024-12-04 at 1 14 10 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e\">\r\n\r\n### `index_not_found_exception` view\r\n<img width=\"1589\" alt=\"Screenshot 2024-12-04 at 1 13 13 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694\">\r\n\r\n---------\r\n\r\nCo-authored-by: Ashokaditya <ashokaditya@elastic.co>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"42348d41f43a2e69c93b0e7a6b2f372bc96fd059","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:build-serverless-image"],"title":"[Data Usage] add error handling and tests for privilege related errors","number":203006,"url":"https://github.com/elastic/kibana/pull/203006","mergeCommit":{"message":"[Data Usage] add error handling and tests for privilege related errors (#203006)\n\n- handling of 2 error cases to error handler\r\n- `security_exception` due to lack of privileges. Metering api will\r\nrespond when one of the following isn't available as a user privilege\r\n`monitor,view_index_metadata,manage,all`.\r\n- `index_not_found_exception`. Metering api will respond with this when\r\nno indices exist for the privileges it has access to or when no indices\r\nare found.\r\n- api integration tests for data_streams route for the following cases\r\n- returns no data streams when there are none it has access to and\r\nresponds with appropriate message\r\n- returns no data streams without necessary privileges and responds with\r\nappropriate message\r\n- returns data streams when user only has access to a subset of indices\r\nwith necessary privileges\r\n- functional tests for same as above. these remain skipped due to not\r\nbeing able to create data streams picked up by metering api since we\r\nimplemented filtering out zero storage size data streams, but useful for\r\nlocal testing with some code changes.\r\n\r\n\r\n### `security_exception` view\r\n<img width=\"1555\" alt=\"Screenshot 2024-12-04 at 1 14 10 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e\">\r\n\r\n### `index_not_found_exception` view\r\n<img width=\"1589\" alt=\"Screenshot 2024-12-04 at 1 13 13 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694\">\r\n\r\n---------\r\n\r\nCo-authored-by: Ashokaditya <ashokaditya@elastic.co>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"42348d41f43a2e69c93b0e7a6b2f372bc96fd059"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203006","number":203006,"mergeCommit":{"message":"[Data Usage] add error handling and tests for privilege related errors (#203006)\n\n- handling of 2 error cases to error handler\r\n- `security_exception` due to lack of privileges. Metering api will\r\nrespond when one of the following isn't available as a user privilege\r\n`monitor,view_index_metadata,manage,all`.\r\n- `index_not_found_exception`. Metering api will respond with this when\r\nno indices exist for the privileges it has access to or when no indices\r\nare found.\r\n- api integration tests for data_streams route for the following cases\r\n- returns no data streams when there are none it has access to and\r\nresponds with appropriate message\r\n- returns no data streams without necessary privileges and responds with\r\nappropriate message\r\n- returns data streams when user only has access to a subset of indices\r\nwith necessary privileges\r\n- functional tests for same as above. these remain skipped due to not\r\nbeing able to create data streams picked up by metering api since we\r\nimplemented filtering out zero storage size data streams, but useful for\r\nlocal testing with some code changes.\r\n\r\n\r\n### `security_exception` view\r\n<img width=\"1555\" alt=\"Screenshot 2024-12-04 at 1 14 10 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e\">\r\n\r\n### `index_not_found_exception` view\r\n<img width=\"1589\" alt=\"Screenshot 2024-12-04 at 1 13 13 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694\">\r\n\r\n---------\r\n\r\nCo-authored-by: Ashokaditya <ashokaditya@elastic.co>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"42348d41f43a2e69c93b0e7a6b2f372bc96fd059"}}]}] BACKPORT--> Co-authored-by: Sandra G <neptunian@users.noreply.github.com>
markov00
pushed a commit
to markov00/kibana
that referenced
this pull request
Dec 7, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
SoniaSanzV
pushed a commit
to SoniaSanzV/kibana
that referenced
this pull request
Dec 9, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
SoniaSanzV
pushed a commit
to SoniaSanzV/kibana
that referenced
this pull request
Dec 9, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Dec 9, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Samiul-TheSoccerFan
pushed a commit
to Samiul-TheSoccerFan/kibana
that referenced
this pull request
Dec 10, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mykolaharmash
pushed a commit
to mykolaharmash/kibana
that referenced
this pull request
Dec 11, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Dec 12, 2024
elastic#203006) - handling of 2 error cases to error handler - `security_exception` due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilege `monitor,view_index_metadata,manage,all`. - `index_not_found_exception`. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found. - api integration tests for data_streams route for the following cases - returns no data streams when there are none it has access to and responds with appropriate message - returns no data streams without necessary privileges and responds with appropriate message - returns data streams when user only has access to a subset of indices with necessary privileges - functional tests for same as above. these remain skipped due to not being able to create data streams picked up by metering api since we implemented filtering out zero storage size data streams, but useful for local testing with some code changes. ### `security_exception` view <img width="1555" alt="Screenshot 2024-12-04 at 1 14 10 PM" src="https://github.com/user-attachments/assets/241a2eb8-1c77-4592-ba18-b971512e712e"> ### `index_not_found_exception` view <img width="1589" alt="Screenshot 2024-12-04 at 1 13 13 PM" src="https://github.com/user-attachments/assets/12b68d66-9178-4957-b014-5765be348694"> --------- Co-authored-by: Ashokaditya <ashokaditya@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport:prev-minor
Backport to (8.x) the previous minor version (i.e. one version back from main)
ci:build-serverless-image
release_note:skip
Skip the PR/issue when compiling release notes
v8.18.0
v9.0.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
security_exception
due to lack of privileges. Metering api will respond when one of the following isn't available as a user privilegemonitor,view_index_metadata,manage,all
.index_not_found_exception
. Metering api will respond with this when no indices exist for the privileges it has access to or when no indices are found.security_exception
viewindex_not_found_exception
view