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

Add size validation for Search Model API #352

Conversation

naveentatikonda
Copy link
Member

Signed-off-by: Naveen Tatikonda [email protected]

Description

As per the security recommendation, adding a validation check on size parameter(1 to 1000) in search model API.

Check List

  • Commits are signed as 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.

@naveentatikonda naveentatikonda requested a review from a team April 5, 2022 00:28
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2022

Codecov Report

Merging #352 (a939755) into main (d9a9f59) will decrease coverage by 0.11%.
The diff coverage is 33.33%.

@@             Coverage Diff              @@
##               main     #352      +/-   ##
============================================
- Coverage     83.99%   83.87%   -0.12%     
- Complexity      900      901       +1     
============================================
  Files           130      130              
  Lines          3854     3863       +9     
  Branches        353      355       +2     
============================================
+ Hits           3237     3240       +3     
- Misses          457      462       +5     
- Partials        160      161       +1     
Impacted Files Coverage Δ
...search/knn/plugin/rest/RestSearchModelHandler.java 81.25% <33.33%> (-18.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9a9f59...a939755. Read the comment docs.

Copy link
Member

@martin-gaievski martin-gaievski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a unit test for new validation?

@naveentatikonda naveentatikonda force-pushed the size_validation_search_model_API branch 2 times, most recently from a1d56de to b359511 Compare April 5, 2022 18:48
@naveentatikonda naveentatikonda force-pushed the size_validation_search_model_API branch 2 times, most recently from cd027cf to f863623 Compare April 5, 2022 20:12
@naveentatikonda naveentatikonda requested a review from VijayanB April 5, 2022 20:13
@naveentatikonda naveentatikonda force-pushed the size_validation_search_model_API branch from f863623 to 0a3f3d9 Compare April 6, 2022 00:36
@naveentatikonda naveentatikonda requested a review from VijayanB April 6, 2022 00:38
@naveentatikonda naveentatikonda merged commit a8774ac into opensearch-project:main Apr 7, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.x failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-352-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a8774ac1b72292b6c45144a0612c2f86b4220a53
# Push it to GitHub
git push --set-upstream origin backport/backport-352-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-352-to-1.x.

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.

5 participants