-
Notifications
You must be signed in to change notification settings - Fork 127
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
Add size validation for Search Model API #352
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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.
Can we also add a unit test for new validation?
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
a1d56de
to
b359511
Compare
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
cd027cf
to
f863623
Compare
src/test/java/org/opensearch/knn/plugin/action/RestSearchModelHandlerIT.java
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Naveen Tatikonda <[email protected]>
f863623
to
0a3f3d9
Compare
src/main/java/org/opensearch/knn/plugin/rest/RestSearchModelHandler.java
Show resolved
Hide resolved
The backport to
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 |
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
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.