You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Prashant Satam <pr...@gmail.com> on 2024/01/18 06:51:52 UTC

Review Request 74841: RANGER-4662 : GdsVersion should update after deleting user, group

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

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


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


Repository: ranger


Description
-------

Currently when we delete user,group which is referenced in gds policy then GdsVersion (can check by GET API /service/gds/download/{serviceName})is not updated after the action it needs to be updated.

Steps :

1)create a user and resource service 

2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE

3)create a GDS policy for the dataset

4)Update dataset policy and add created user to it for this actions the GdsVersion is updated we can check by (GET API /service/gds/download/{serviceName})

5)but when we delete the created user which is in Gds dataset policy then the GdsVersion is not updated we need to update it


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java 287400259 
  security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java ce48c8279 


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


Testing
-------

Steps to check :
1)create a user and resource service 

2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE

3)create a GDS policy for the dataset

4)Update dataset policy and add created user to it 

5)when we delete the created user then the GdsVersion is updated


Thanks,

Prashant Satam


Re: Review Request 74841: RANGER-4662 : GdsVersion should update after deleting user, group

Posted by Monika Kachhadiya via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74841/#review226153
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
Lines 2430 (patched)
<https://reviews.apache.org/r/74841/#comment314434>

    Same block of should be extracted to a method


- Monika Kachhadiya


On Jan. 18, 2024, 6:51 a.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74841/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2024, 6:51 a.m.)
> 
> 
> Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4662
>     https://issues.apache.org/jira/browse/RANGER-4662
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently when we delete user,group which is referenced in gds policy then GdsVersion (can check by GET API /service/gds/download/{serviceName})is not updated after the action it needs to be updated.
> 
> Steps :
> 
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it for this actions the GdsVersion is updated we can check by (GET API /service/gds/download/{serviceName})
> 
> 5)but when we delete the created user which is in Gds dataset policy then the GdsVersion is not updated we need to update it
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java 287400259 
>   security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java ce48c8279 
> 
> 
> Diff: https://reviews.apache.org/r/74841/diff/1/
> 
> 
> Testing
> -------
> 
> Steps to check :
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it 
> 
> 5)when we delete the created user then the GdsVersion is updated
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>


Re: Review Request 74841: RANGER-4662 : GdsVersion should update after deleting user, group

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74841/#review226167
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Jan. 18, 2024, 6:51 a.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74841/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2024, 6:51 a.m.)
> 
> 
> Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4662
>     https://issues.apache.org/jira/browse/RANGER-4662
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently when we delete user,group which is referenced in gds policy then GdsVersion (can check by GET API /service/gds/download/{serviceName})is not updated after the action it needs to be updated.
> 
> Steps :
> 
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it for this actions the GdsVersion is updated we can check by (GET API /service/gds/download/{serviceName})
> 
> 5)but when we delete the created user which is in Gds dataset policy then the GdsVersion is not updated we need to update it
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java 287400259 
>   security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java ce48c8279 
> 
> 
> Diff: https://reviews.apache.org/r/74841/diff/1/
> 
> 
> Testing
> -------
> 
> Steps to check :
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it 
> 
> 5)when we delete the created user then the GdsVersion is updated
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>


Re: Review Request 74841: RANGER-4662 : GdsVersion should update after deleting user, group

Posted by Prashant Satam <pr...@gmail.com>.

> On Jan. 19, 2024, 6:10 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
> > Lines 2173 (patched)
> > <https://reviews.apache.org/r/74841/diff/1/?file=2284865#file2284865line2173>
> >
> >     updateDatasetPolicy()/updateProjectPolicy() can fail if the caller is not have admin or dataset/project admin privilege.
> >     
> >     Consider handling this inside ServiceDBStore.updatePolicy(), to call updateGdsVersionForDataset()/ updateGdsVersionForProject() for GDS service policies.

For deletion of user/group it is only allowed if incomming user is ranger ADMIN if not the flow is blocked , and for update of Gds Policy we would need to call prepareDatasetPolicy() in GdsDBStore so we cannot directly go by ServiceDBStore.updatePolicy() method also the GdsDBStore.updateDatasetPolicy() internally calls  ServiceDBStore.updatePolicy() method


- Prashant


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


On Jan. 18, 2024, 6:51 a.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74841/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2024, 6:51 a.m.)
> 
> 
> Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4662
>     https://issues.apache.org/jira/browse/RANGER-4662
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently when we delete user,group which is referenced in gds policy then GdsVersion (can check by GET API /service/gds/download/{serviceName})is not updated after the action it needs to be updated.
> 
> Steps :
> 
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it for this actions the GdsVersion is updated we can check by (GET API /service/gds/download/{serviceName})
> 
> 5)but when we delete the created user which is in Gds dataset policy then the GdsVersion is not updated we need to update it
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java 287400259 
>   security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java ce48c8279 
> 
> 
> Diff: https://reviews.apache.org/r/74841/diff/1/
> 
> 
> Testing
> -------
> 
> Steps to check :
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it 
> 
> 5)when we delete the created user then the GdsVersion is updated
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>


Re: Review Request 74841: RANGER-4662 : GdsVersion should update after deleting user, group

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74841/#review226156
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
Lines 2173 (patched)
<https://reviews.apache.org/r/74841/#comment314435>

    updateDatasetPolicy()/updateProjectPolicy() can fail if the caller is not have admin or dataset/project admin privilege.
    
    Consider handling this inside ServiceDBStore.updatePolicy(), to call updateGdsVersionForDataset()/ updateGdsVersionForProject() for GDS service policies.


- Madhan Neethiraj


On Jan. 18, 2024, 6:51 a.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74841/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2024, 6:51 a.m.)
> 
> 
> Review request for ranger, Akshay Tupe, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Siddhesh Phatak, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4662
>     https://issues.apache.org/jira/browse/RANGER-4662
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently when we delete user,group which is referenced in gds policy then GdsVersion (can check by GET API /service/gds/download/{serviceName})is not updated after the action it needs to be updated.
> 
> Steps :
> 
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it for this actions the GdsVersion is updated we can check by (GET API /service/gds/download/{serviceName})
> 
> 5)but when we delete the created user which is in Gds dataset policy then the GdsVersion is not updated we need to update it
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java 287400259 
>   security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java ce48c8279 
> 
> 
> Diff: https://reviews.apache.org/r/74841/diff/1/
> 
> 
> Testing
> -------
> 
> Steps to check :
> 1)create a user and resource service 
> 
> 2)create a dataset , and dataShare (with the resource service),and a sharedResource (with dataShare),also create mapping of dataset with dataShare as ACTIVE
> 
> 3)create a GDS policy for the dataset
> 
> 4)Update dataset policy and add created user to it 
> 
> 5)when we delete the created user then the GdsVersion is updated
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>