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

Fixed response codes For Requests With security exception. #2033

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

vamsi-amazon
Copy link
Member

@vamsi-amazon vamsi-amazon commented Aug 28, 2023

Description

Testing

Before Changes:
POST _plugins/_ppl
{
"query" : "source=prometheus10.instance_cpu_time_ns"
}
Screenshot 2023-08-28 at 8 33 11 AM

After Changes:
POST _plugins/_ppl
{
"query" : "source=prometheus10.instance_cpu_time_ns"
}
Screenshot 2023-08-28 at 8 30 00 AM

Now the response code changes to 403.

Backlog

  • There are no existing unit tests for this RestPPLQueryAction.
  • The current framework for integration tests with security plugin doesn't allow custom users with custom permissions. Its hard to replicate the scenario.
    Created below backlog issue to handle this.

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

derek-ho
derek-ho previously approved these changes Aug 28, 2023
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #2033 (338fc45) into main (627189b) will decrease coverage by 0.02%.
The diff coverage is 84.61%.

@@             Coverage Diff              @@
##               main    #2033      +/-   ##
============================================
- Coverage     97.30%   97.28%   -0.02%     
- Complexity     4623     4624       +1     
============================================
  Files           407      409       +2     
  Lines         11934    11942       +8     
  Branches        828      828              
============================================
+ Hits          11612    11618       +6     
- Misses          315      317       +2     
  Partials          7        7              
Flag Coverage Δ
sql-engine 97.28% <84.61%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...asources/exceptions/DataSourceClientException.java 0.00% <0.00%> (ø)
...ch/sql/prometheus/client/PrometheusClientImpl.java 100.00% <100.00%> (ø)
...ometheus/exceptions/PrometheusClientException.java 100.00% <100.00%> (ø)
...equest/system/PrometheusDescribeMetricRequest.java 100.00% <100.00%> (ø)
...l/prometheus/storage/PrometheusStorageFactory.java 100.00% <100.00%> (ø)

rupal-bq
rupal-bq previously approved these changes Aug 29, 2023
derek-ho
derek-ho previously approved these changes Aug 29, 2023
rupal-bq
rupal-bq previously approved these changes Aug 29, 2023
@vamsi-amazon vamsi-amazon added the bug Something isn't working label Aug 29, 2023
@vamsi-amazon vamsi-amazon merged commit 56bc7d5 into opensearch-project:main Aug 30, 2023
18 of 21 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.9 2.9
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.9
# Create a new branch
git switch --create backport/backport-2033-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 56bc7d5e168d22f2874d07179824c1ba6f660d27
# Push it to GitHub
git push --set-upstream origin backport/backport-2033-to-2.9
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport/backport-2033-to-2.9.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 30, 2023
Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 56bc7d5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vamsi-amazon added a commit that referenced this pull request Aug 30, 2023
Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 56bc7d5)
vamsi-amazon added a commit that referenced this pull request Aug 30, 2023
Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 56bc7d5)
vamsi-amazon pushed a commit that referenced this pull request Aug 30, 2023
)

(cherry picked from commit 56bc7d5)

Signed-off-by: Vamsi Manohar <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vamsi-amazon added a commit that referenced this pull request Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.9 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants