> On Jan. 12, 2024, 6 p.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/validation/RangerGdsValidator.java > > Lines 76 (patched) > > <https://reviews.apache.org/r/74835/diff/1/?file=2284784#file2284784line76> > > > > Instead of throwing error here, I suggest adding error code > > ValidationErrorCode.GDS_DATASET_NAME_TOO_LONG to result - similar to #72 > > above. This error code needs to be added in ValidationErrorCode.java. > > > > Same updates in validation of project and dataShare names.
The suggested changes have been implemented in the latest patch. Thanks - Abhishek ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74835/#review226132 ----------------------------------------------------------- On Jan. 14, 2024, 9:39 a.m., Abhishek Patil wrote: > > ----------------------------------------------------------- > 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. > > > 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 > ----- > > > 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/ > > > 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 > >