-
Notifications
You must be signed in to change notification settings - Fork 281
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 validation for null array DataType #1157
Conversation
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...t/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/RolesMappingApiTest.java
Outdated
Show resolved
Hide resolved
The failure in the unit tests was related to the bug in my code, I fixed the bug in my last commit and now all the tests passed. |
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...t/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/ActionGroupsApiTest.java
Outdated
Show resolved
Hide resolved
src/test/resources/restapi/rolesmapping_null_array_element.json
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #1157 +/- ##
=========================================
Coverage 64.74% 64.74%
- Complexity 3195 3203 +8
=========================================
Files 247 247
Lines 17232 17252 +20
Branches 3046 3053 +7
=========================================
+ Hits 11156 11170 +14
- Misses 4526 4531 +5
- Partials 1550 1551 +1
Continue to review full report at Codecov.
|
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...t/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/ActionGroupsApiTest.java
Outdated
Show resolved
Hide resolved
9e8ed2b
to
81a5eea
Compare
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/test/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/RolesApiTest.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
...opendistroforelasticsearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/test/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/RolesApiTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/validation/AbstractConfigurationValidator.java
Outdated
Show resolved
Hide resolved
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
(cherry picked from commit 960d420)
opendistro-for-elasticsearch/security pull request intake form
Please provide as much details as possible to get feedback/acceptance on your PR quickly
Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Bug fix
Github Issue # or road-map entry, if available:
disallow using
null
inusers
list #1136Description of changes:
Add validation for all the API keys that have ARRAY DataType to make sure that there is no null value in the array.
Why these changes are required?
By adding this validation, we prevent ES being completely unoperational when there are null in the arrays.
What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)
It was possible to bring ES completely unoperational by using null in the array DataTypes in several APIs.
Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)
Unit test added to cover array DataType like users with null in their list.
TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)
Is it backport from main branch? (If yes, please add backport PR # and commits #)
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
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.