----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74141/ -----------------------------------------------------------
(Updated Nov. 28, 2022, 9:53 a.m.) Review request for ranger, Don Bosco Durai, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy. Summary (updated) ----------------- RANGER-3010 : To support roleName as part of Path parameter for addUsersAndGroups,removeUsersAndGroups,removeAdminFromUsersAndGroups REST API's (Both :RoleREST and PublicAPIsv2) Bugs: RANGER-3010 https://issues.apache.org/jira/browse/RANGER-3010 Repository: ranger Description ------- Added the new APIs which support for roleName instead of roleId . PublicAPIsv2: /api/roles/name/{name}/addUsersAndGroups /api/roles//name/{name}/removeUsersAndGroups /api/roles/name/{name}/removeAdminFromUsersAndGroups RoleREST: /roles/roles/name/{name}/addUsersAndGroups /roles/roles/name/{name}/removeUsersAndGroups /roles/roles/name/{name}/removeAdminFromUsersAndGroups As well as added the QueryParam annotation as part of the Rest API contract for the below API's PublicAPIsv2: /api/roles/name/{name}/addUsersAndGroups /api/roles/name/{name}/removeUsersAndGroups /api/roles/name/{name}/removeAdminFromUsersAndGroups /api/roles/{id}/addUsersAndGroups /api/roles/{id}/removeUsersAndGroups /api/roles/{id}/removeAdminFromUsersAndGroups RoleREST: /roles/roles/{id}/addUsersAndGroups /roles/roles/{id}/removeUsersAndGroups /roles/roles/{id}/removeAdminFromUsersAndGroups /roles/roles/name/{name}/addUsersAndGroups /roles/roles/name/{name}/removeUsersAndGroups /roles/roles/name/{name}/removeAdminFromUsersAndGroups Diffs ----- security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java 293107f24 security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java 4f0edd2b0 security-admin/src/test/java/org/apache/ranger/rest/TestPublicAPIsv2.java 1069f013d security-admin/src/test/java/org/apache/ranger/rest/TestRoleREST.java 217c1bba3 Diff: https://reviews.apache.org/r/74141/diff/2/ Testing ------- Tested the below Rest API's in the local and it works fine curl -u <adminUserName> -X PUT -H 'Content-Type:application/json' "http://<rangerHostName>:<port>/service/roles/roles/name/<roleName>/addUsersAndGroups?users=<users>&isAdmin=true&serviceName=<serviceName>&execUser=<execUser>&groups=<groups>" -v -k curl -u <adminUserName> -X PUT -H 'Content-Type:application/json' "http://<rangerHostName>:<port>/service/roles/api/roles/name/<roleName>/removeUsersAndGroups?users=<users>&serviceName=<serviceName>&execUser=<execUser>&groups=<groups>" -v -k curl -u <adminUserName> -X PUT -H 'Content-Type:application/json' "http://<rangerHostName>:<port>/service/roles/api/roles/name/<roleName>/removeUsersAndGroups?users=<users>&serviceName=<serviceName>&execUser=<execUser>&groups=<groups>" -v -k Thanks, Ramachandran Krishnan