-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74835/
-----------------------------------------------------------
(Updated Jan. 14, 2024, 9:39 a.m.)
Review request for ranger, Brijesh Bhalala, Dhaval Rajpara, Madhan Neethiraj,
Mehul Parikh, Mugdha Varadkar, and Ramesh Mani.
Changes
-------
Added the error in ValidationErrorCode.java file
Bugs: RANGER-4648
https://issues.apache.org/jira/browse/RANGER-4648
Repository: ranger
Description
-------
The max length for the Datashare/Dataset/Project names is 512.
Currently, there are no assertions to check if the name is longer than 512
characters or not.
In such scenarios, when the request was made with a long name, the error
message was not descriptive as the error message was coming from the database
due to data insertion failing.
This patch addresses the issue by adding validations at :-
1. UI level
Display an error message if the name is longer than 512 characters and prevent
the form submission
2. Server Side
Check if the name length is greater than 512 characters, if yes, return a
proper error message
Diffs (updated)
-----
agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java
38b302ee9
security-admin/src/main/java/org/apache/ranger/validation/RangerGdsValidator.java
27e7cc143
security-admin/src/main/webapp/react-webapp/src/views/GovernedData/Dataset/AddDatasetView.jsx
6f15af0b4
security-admin/src/main/webapp/react-webapp/src/views/GovernedData/Dataset/DatasetDetailLayout.jsx
cba038c8b
security-admin/src/main/webapp/react-webapp/src/views/GovernedData/Datashare/AddDatashareView.jsx
4306864cb
security-admin/src/main/webapp/react-webapp/src/views/GovernedData/Datashare/DatashareDetailLayout.jsx
dfa3d4027
Diff: https://reviews.apache.org/r/74835/diff/2/
Changes: https://reviews.apache.org/r/74835/diff/1-2/
Testing
-------
1. Tried creating a datashare/dataset with name length less than 512
characters, creation was successful.
2. Tried creating a datashare/dataset with name length greater than 512
characters via UI, creation failed (as expected), and error message was shown
in the form.
3. Tried creating a datashare/dataset with name length greater than 512
characters via API, creation failed (as expected), and a proper error message
was returned.
4. Tried to update a datashare/dataset with name length greater than 512
characters, proper error message was shown on the UI and also in the API
response.
Thanks,
Abhishek Patil