----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/75276/#review227061 -----------------------------------------------------------
agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java Lines 172 (patched) <https://reviews.apache.org/r/75276/#comment315351> - GDS_VALIDATION_ERR_SHARED_RESOURCE_NULL_VALUES => GDS_VALIDATION_ERR_SHARED_RESOURCE_MISSING_VALUE - I suggest changing the message to: Invalid resource: empty or no value provided for {0} - Madhan Neethiraj On Nov. 15, 2024, 8:03 p.m., Radhika Kundam wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/75276/ > ----------------------------------------------------------- > > (Updated Nov. 15, 2024, 8:03 p.m.) > > > Review request for ranger, Madhan Neethiraj and Ramesh Mani. > > > Bugs: RANGER-4998 > https://issues.apache.org/jira/browse/RANGER-4998 > > > Repository: ranger > > > Description > ------- > > Validations for resource values were implemented on the UI level. However, > when creating a GDS resource via API, the resource creation succeeded even > when resource values were empty. > > With the addition of server-side validations for resource values, API > requests now properly validate input, ensuring data integrity. The following > scenarios will trigger a validation error: > > 1. No values property provided: The values field is missing entirely from the > request. > 2. Empty values list: The values field is present but contains no elements. > 3. Blank values entries: The values list includes blank or null elements. > > Validation Response: Requests failing these validations will return a 400 Bad > Request with the following error format: > > { > "statusCode": 1, > "msgDesc": "[Validation failure: error code[4133], reason[No values or > empty values provided for resource: <resource-name>. Please ensure valid > values are specified to proceed.], field[null], subfield[null], type[]]", > "messageList": [ > { > "name": "INVALID_INPUT_DATA", > "rbKey": "xa.validation.invalid_input_data", > "message": "Invalid input data" > } > ] > } > This enhancement ensures consistency across UI and API interactions, > improving data reliability and user experience. > > > Diffs > ----- > > > agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java > 00855458d > > security-admin/src/main/java/org/apache/ranger/validation/RangerGdsValidator.java > 3632f9de4 > > > Diff: https://reviews.apache.org/r/75276/diff/1/ > > > Testing > ------- > > Tested locally. > > > Thanks, > > Radhika Kundam > >