-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74846/
-----------------------------------------------------------
Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika
Kachhadiya, Prashant Satam, and Siddhesh Phatak.
Bugs: RANGER-4664
https://issues.apache.org/jira/browse/RANGER-4664
Repository: ranger
Description
-------
If the resource value is null in the POST or PUT /gds/resource APIs request
body, SQL expcetion is thrown to the client about resource being null. We need
to add validation check for resource being null and throw HTTP Status 400 in
these cases.
Diffs
-----
agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java
dccd8f4f5
security-admin/src/main/java/org/apache/ranger/validation/RangerGdsValidator.java
6efe9f420
Diff: https://reviews.apache.org/r/74846/diff/1/
Testing
-------
Validated POST and PUT /gds/resource APIs with resource as null in the request.
In these case 400 is being thrown and following message is returned:
{
"statusCode": 1,
"msgDesc": "[ Validation failure: error code[4132], reason[Resource value
in SharedResource [SHR1] is null], field[resource], subfield[null], type[]]",
"messageList": [
{
"name": "INVALID_INPUT_DATA",
"rbKey": "xa.validation.invalid_input_data",
"message": "Invalid input data"
}
]
}
Thanks,
Subhrat Chaudhary