[jira] [Created] (RANGER-4654) [Ranger React UI] Handle Dataset and Datashare creation errors gracefully

2024-01-12 Thread Abhishek (Jira)
Abhishek created RANGER-4654:


 Summary: [Ranger React UI] Handle Dataset and Datashare creation 
errors gracefully
 Key: RANGER-4654
 URL: https://issues.apache.org/jira/browse/RANGER-4654
 Project: Ranger
  Issue Type: Sub-task
  Components: admin
Reporter: Abhishek


Whenever a datashare or a dataset is being created/updated with a name which is 
already present,
then the UI shows "Data not found" message and shows options to return to home 
page.
The error has to be handled gracefully.
Ideally, in such scenarios, the user should be able to modify the dataset / 
datashare creation form by changing the name and submit the same form with 
other existing details (This is the behavior with policy / service 
creation/update form).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (RANGER-4653) [Ranger React UI] Add inline assertions for displayName length in service creation / update form

2024-01-12 Thread Abhishek (Jira)
Abhishek created RANGER-4653:


 Summary: [Ranger React UI] Add inline assertions for displayName 
length in service creation / update form
 Key: RANGER-4653
 URL: https://issues.apache.org/jira/browse/RANGER-4653
 Project: Ranger
  Issue Type: Bug
  Components: admin
Reporter: Abhishek
Assignee: Abhishek


In the service create / update form, an inline assertion has to be added for 
displayName validation (length and preventing use of special characters).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: Review Request 74836: RANGER-4651 : Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On Jan. 12, 2024, 12:23 p.m., Prashant Satam wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74836/
> ---
> 
> (Updated Jan. 12, 2024, 12:23 p.m.)
> 
> 
> Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan 
> Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita 
> Ubale.
> 
> 
> Bugs: RANGER-4651
> https://issues.apache.org/jira/browse/RANGER-4651
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Currently if any principal i.e user/group/role stored in ranger is deleted 
> the GdsObject ACLs still have this principals they dont  get removed from the 
> ACL we need to remove this principals from gdsObject ACLs
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java 
> a69647948 
>   security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java 
> abf2b0c8c 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java d961bc50c 
>   security-admin/src/main/java/org/apache/ranger/db/XXGdsDataShareDao.java 
> 8acca8f89 
>   security-admin/src/main/java/org/apache/ranger/db/XXGdsDatasetDao.java 
> 5743ad702 
>   security-admin/src/main/java/org/apache/ranger/db/XXGdsProjectDao.java 
> 76bab8611 
>   security-admin/src/main/resources/META-INF/jpa_named_queries.xml 52ecf8a3e 
> 
> 
> Diff: https://reviews.apache.org/r/74836/diff/1/
> 
> 
> Testing
> ---
> 
> Steps to check 
> 1)create a user/group/role in ranger 
> 2)create a dataset and add the above created user/group/role in dataset ACL 
> 3)Delete the user/group/role from ranger 
> 4)The user/group/role will also be removed from ACL of the dataset as well
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>



Re: Review Request 74835: RANGER-4648: Return proper error message if GDS entities name is longer than 512 characters and assertions in the UI form as well

2024-01-12 Thread Madhan Neethiraj

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




security-admin/src/main/java/org/apache/ranger/validation/RangerGdsValidator.java
Lines 76 (patched)


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.


- Madhan Neethiraj


On Jan. 12, 2024, 8:59 a.m., Abhishek Patil wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74835/
> ---
> 
> (Updated Jan. 12, 2024, 8:59 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
> -
> 
>   
> 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
> 
>



[jira] [Commented] (RANGER-4225) Possible Jackson serialization issue due to not comply with Java bean standards

2024-01-12 Thread Sercan Tekin (Jira)


[ 
https://issues.apache.org/jira/browse/RANGER-4225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17806104#comment-17806104
 ] 

Sercan Tekin commented on RANGER-4225:
--

[~bpatel], sure! Working on it, I will share the details and how I test the 
patch here

> Possible Jackson serialization issue due to not comply with Java bean 
> standards
> ---
>
> Key: RANGER-4225
> URL: https://issues.apache.org/jira/browse/RANGER-4225
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Affects Versions: 2.4.0
>Reporter: Sercan Tekin
>Assignee: Sercan Tekin
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: RANGER-4225.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> +*PROBLEM:*+
> Transitive Jackson-2 dependencies are included into Ranger's classpath in my 
> env and conflicted with Jackson-1 dependencies.
> Jackson-2 uses Javabean naming conventions to figure out the Json properties 
> in a Java class, and some of the Ranger's model classes don't comply with the 
> convention.
> For example, when the leading camelcase word is only one letter in length, 
> then deserialized response is broken. The following is what I observed in 
> Ranger v2.4.0;
> On Ranger UI side, this 
> [code-block|https://github.com/apache/ranger/blob/ranger-1.2/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js#L224-L229]
>  attempts to read vXStrings key in map, but the corresponding response has 
> vxstrings instead:
> {code:java}
> {
> "startIndex": 0,
> "pageSize": 200,
> "totalCount": 11,
> "resultSize": 11,
> "sortType": "asc",
> "sortBy": "id",
> "listSize": 11,
> "vxstrings": [< here! This has to be vXStrings
> {
> "value": "public",
> ... {code}
> And this difference causes below error while reading the property, therefore 
> the corresponding dropdown has no values as excepted;
> {code:java}
> PermissionList.js?ver=build.version:226 Uncaught TypeError: Cannot read 
> properties of undefined (reading 'map')
> at Object.results (PermissionList.js?ver=build.version:226:34)
> at Object.success (select2.js?ver=build.version:450:47)
> at u (jquery-3.3.1.min.js?ver=build.version:2:27457)
> at Object.fireWith [as resolveWith] 
> (jquery-3.3.1.min.js?ver=build.version:2:28202)
> at k (jquery-3.3.1.min.js?ver=build.version:2:77651)
> at XMLHttpRequest. 
> (jquery-3.3.1.min.js?ver=build.version:2:79907){code}
> +*REFERENCES:*+
> Please see this reference related to capital letters 
> [http://futuretask.blogspot.com/2005/01/java-tip-6-dont-capitalize-first-two.html]
> "Don't capitalize first two letters of a bean property name. This is in our 
> java standards. You should not create a java bean property name that begins 
> with a capital letter in the 1st two places."
> Also you can see the same issue is reported here 
> [https://stackoverflow.com/questions/30205006/why-does-jackson-2-not-recognize-the-first-capital-letter-if-the-leading-camel-c]
>  
> +*SOLUTION:*+
> {{@JsonProperty}} annotation needs to be added for mapping the properties 
> with their corresponding getter/setter methods. This will not effect Ranger's 
> functionality directly, but it will provide consistency even if Jackson-2 is 
> included into classpath.
> I have tested it locally after adding {{@JsonProperty}} and everything worked 
> well.
> The PR is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (RANGER-4536) Audit UI updates to support datasets and projects

2024-01-12 Thread Abhishek (Jira)


[ 
https://issues.apache.org/jira/browse/RANGER-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17806100#comment-17806100
 ] 

Abhishek commented on RANGER-4536:
--

UI changes are ready but this jira depends on RANGER-4652.
RANGER-4652 is WIP.

> Audit UI updates to support datasets and projects
> -
>
> Key: RANGER-4536
> URL: https://issues.apache.org/jira/browse/RANGER-4536
> Project: Ranger
>  Issue Type: Sub-task
>  Components: admin, audit
>Reporter: Madhan Neethiraj
>Assignee: Abhishek
>Priority: Major
>  Labels: ranger-react
>
> With RANGER-4282, Ranger audit logs were updated to store datasets and 
> projects. Audit UI should be updated to:
>  * add 2 columns in the table listing audit logs
>  * support filtering of audit logs based on dataset and projects
>  
> CC: [~Dhaval.Rajpara], [~brijesh.bhalala], [~anandNadar]  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (RANGER-4652) Value for datasets and projects field in the access audits must be JSON serializable

2024-01-12 Thread Abhishek (Jira)
Abhishek created RANGER-4652:


 Summary: Value for datasets and projects field in the access 
audits must be JSON serializable
 Key: RANGER-4652
 URL: https://issues.apache.org/jira/browse/RANGER-4652
 Project: Ranger
  Issue Type: Sub-task
  Components: Ranger
Reporter: Abhishek
Assignee: Abhishek


Currently, the value for the datasets and the projects is not JSON serializable.
For e.g, the datasets field value is :- "[test_dataset_1]".
If the value needs to be converted to a JSON obj for parsing, it will result in 
an error.
The value needs to be "[\"test_dataset_1\"]".
This change is required for RANGER-4536.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (RANGER-4651) Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Prashant Satam (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashant Satam reassigned RANGER-4651:
--

Assignee: Prashant Satam

Patch in review => [https://reviews.apache.org/r/74836/diff/1#index_header]

 

> Need to update Gds objects ACL if ranger principal is deleted
> -
>
> Key: RANGER-4651
> URL: https://issues.apache.org/jira/browse/RANGER-4651
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Prashant Satam
>Assignee: Prashant Satam
>Priority: Major
>
> Currently if any principal i.e user/group/role stored in ranger is deleted 
> the GdsObject ACLs still have this principals they dont  get removed from the 
> ACL we need to remove this principals from gdsObject ACLs 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Review Request 74836: RANGER-4651 : Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Prashant Satam

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

Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan 
Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita 
Ubale.


Bugs: RANGER-4651
https://issues.apache.org/jira/browse/RANGER-4651


Repository: ranger


Description
---

Currently if any principal i.e user/group/role stored in ranger is deleted the 
GdsObject ACLs still have this principals they dont  get removed from the ACL 
we need to remove this principals from gdsObject ACLs


Diffs
-

  security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java a69647948 
  security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java abf2b0c8c 
  security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java d961bc50c 
  security-admin/src/main/java/org/apache/ranger/db/XXGdsDataShareDao.java 
8acca8f89 
  security-admin/src/main/java/org/apache/ranger/db/XXGdsDatasetDao.java 
5743ad702 
  security-admin/src/main/java/org/apache/ranger/db/XXGdsProjectDao.java 
76bab8611 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 52ecf8a3e 


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


Testing
---

Steps to check 
1)create a user/group/role in ranger 
2)create a dataset and add the above created user/group/role in dataset ACL 
3)Delete the user/group/role from ranger 
4)The user/group/role will also be removed from ACL of the dataset as well


Thanks,

Prashant Satam



[jira] [Updated] (RANGER-4651) Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Prashant Satam (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashant Satam updated RANGER-4651:
---
Issue Type: Bug  (was: Improvement)

> Need to update Gds objects ACL if ranger principal is deleted
> -
>
> Key: RANGER-4651
> URL: https://issues.apache.org/jira/browse/RANGER-4651
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Prashant Satam
>Priority: Major
>
> Currently if any principal i.e user/group/role stored in ranger is deleted 
> the GdsObject ACLs still have this principals they dont  get removed from the 
> ACL we need to remove this principals from gdsObject ACLs 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4651) Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Prashant Satam (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashant Satam updated RANGER-4651:
---
Description: Currently if any principal i.e user/group/role stored in 
ranger is deleted the GdsObject ACLs still have this principals they dont  get 
removed from the ACL we need to remove this principals from gdsObject ACLs   
(was: Currently if any principal i.e user/group/role stored in ranger is )

> Need to update Gds objects ACL if ranger principal is deleted
> -
>
> Key: RANGER-4651
> URL: https://issues.apache.org/jira/browse/RANGER-4651
> Project: Ranger
>  Issue Type: Improvement
>  Components: Ranger
>Reporter: Prashant Satam
>Priority: Major
>
> Currently if any principal i.e user/group/role stored in ranger is deleted 
> the GdsObject ACLs still have this principals they dont  get removed from the 
> ACL we need to remove this principals from gdsObject ACLs 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4651) Need to update Gds objects ACL as per changes in Ranger principals

2024-01-12 Thread Prashant Satam (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashant Satam updated RANGER-4651:
---
Description: Currently if any principal i.e user/group/role stored in 
ranger is 

> Need to update Gds objects ACL as per changes in Ranger principals
> --
>
> Key: RANGER-4651
> URL: https://issues.apache.org/jira/browse/RANGER-4651
> Project: Ranger
>  Issue Type: Improvement
>  Components: Ranger
>Reporter: Prashant Satam
>Priority: Major
>
> Currently if any principal i.e user/group/role stored in ranger is 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4651) Need to update Gds objects ACL if ranger principal is deleted

2024-01-12 Thread Prashant Satam (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prashant Satam updated RANGER-4651:
---
Summary: Need to update Gds objects ACL if ranger principal is deleted  
(was: Need to update Gds objects ACL as per changes in Ranger principals)

> Need to update Gds objects ACL if ranger principal is deleted
> -
>
> Key: RANGER-4651
> URL: https://issues.apache.org/jira/browse/RANGER-4651
> Project: Ranger
>  Issue Type: Improvement
>  Components: Ranger
>Reporter: Prashant Satam
>Priority: Major
>
> Currently if any principal i.e user/group/role stored in ranger is 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (RANGER-4651) Need to update Gds objects ACL as per changes in Ranger principals

2024-01-12 Thread Prashant Satam (Jira)
Prashant Satam created RANGER-4651:
--

 Summary: Need to update Gds objects ACL as per changes in Ranger 
principals
 Key: RANGER-4651
 URL: https://issues.apache.org/jira/browse/RANGER-4651
 Project: Ranger
  Issue Type: Improvement
  Components: Ranger
Reporter: Prashant Satam






--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (RANGER-4648) Return proper error message if GDS entities name is longer than 512 characters and assertions in the UI form as well

2024-01-12 Thread Abhishek (Jira)


[ 
https://issues.apache.org/jira/browse/RANGER-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17805947#comment-17805947
 ] 

Abhishek commented on RANGER-4648:
--

Review request available at :- [https://reviews.apache.org/r/74835/]
Thank you

> Return proper error message if GDS entities name is longer than 512 
> characters and assertions in the UI form as well
> 
>
> Key: RANGER-4648
> URL: https://issues.apache.org/jira/browse/RANGER-4648
> Project: Ranger
>  Issue Type: Sub-task
>  Components: admin
>Reporter: Abhishek
>Assignee: Abhishek
>Priority: Major
>  Labels: ranger-react
>
> 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.
> Validations have to be performed at two levels:-
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4648) Return proper error message if GDS entities name is longer than 512 characters and assertions in the UI form as well

2024-01-12 Thread Abhishek (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Abhishek updated RANGER-4648:
-
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.
Validations have to be performed at two levels:-
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

  was:
Add assertions in the form to restrict the datashare / dataset name length.
If adding assertions is not possible, then a proper error message has to be 
displayed stating that the datashare / dataset name has to be limited (This 
behvaiour is already present in the policy creation form)


> Return proper error message if GDS entities name is longer than 512 
> characters and assertions in the UI form as well
> 
>
> Key: RANGER-4648
> URL: https://issues.apache.org/jira/browse/RANGER-4648
> Project: Ranger
>  Issue Type: Sub-task
>  Components: admin
>Reporter: Abhishek
>Assignee: Abhishek
>Priority: Major
>  Labels: ranger-react
>
> 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.
> Validations have to be performed at two levels:-
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4648) Return proper error message if GDS entities name is longer than 512 characters and assertions in the UI form as well

2024-01-12 Thread Abhishek (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Abhishek updated RANGER-4648:
-
Summary: Return proper error message if GDS entities name is longer than 
512 characters and assertions in the UI form as well  (was: [Ranger UI] Add 
assertions in the form to restrict the datashare / dataset name length)

> Return proper error message if GDS entities name is longer than 512 
> characters and assertions in the UI form as well
> 
>
> Key: RANGER-4648
> URL: https://issues.apache.org/jira/browse/RANGER-4648
> Project: Ranger
>  Issue Type: Sub-task
>  Components: admin
>Reporter: Abhishek
>Assignee: Abhishek
>Priority: Major
>  Labels: ranger-react
>
> Add assertions in the form to restrict the datashare / dataset name length.
> If adding assertions is not possible, then a proper error message has to be 
> displayed stating that the datashare / dataset name has to be limited (This 
> behvaiour is already present in the policy creation form)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Review Request 74835: RANGER-4648: Return proper error message if GDS entities name is longer than 512 characters and assertions in the UI form as well

2024-01-12 Thread Abhishek Patil

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