-
Notifications
You must be signed in to change notification settings - Fork 343
Hardens input validation for resource sharing APIs #5831
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
base: main
Are you sure you want to change the base?
Hardens input validation for resource sharing APIs #5831
Conversation
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
|
@DarshitChanpura can you please fix the typos? |
Signed-off-by: Darshit Chanpura <[email protected]>
src/main/java/org/opensearch/security/resources/utils/InputValidation.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5831 +/- ##
==========================================
- Coverage 73.66% 73.53% -0.13%
==========================================
Files 438 438
Lines 26642 26882 +240
Branches 3937 3983 +46
==========================================
+ Hits 19626 19768 +142
- Misses 5147 5210 +63
- Partials 1869 1904 +35
🚀 New features to boost your workflow:
|
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
| final HttpResponse updateMutlitenancyToDisabled = nonSslRestHelper().executePutRequest( | ||
| "/_plugins/_security/api/tenancy/config", | ||
| "{\"multitenancy_enabled\": \"false\"}", | ||
| "{\"multitenancy_enabled\": false}", |
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.
these tests were supplying a string type but the multi-tenancy api validator expected a boolean type. my changes fixed it by introducing an additional case for handling BOOLEANs and hence this test failed for string type. CHanging it to boolean fixed it, which is correct way for this param.
Signed-off-by: Darshit Chanpura <[email protected]>
Description
Prior to this change users could input practically infinite value in strings of input parameters in resource-sharing related REST APIs. This PR hardens those inputs by introducing limits on those parameters.
Testing
integration testing
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.