-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74835/
-----------------------------------------------------------

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
-----

  
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/Datashare/AddDatashareView.jsx
 4306864cb 


Diff: https://reviews.apache.org/r/74835/diff/1/


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

Reply via email to