> On Jan. 24, 2023, 9:06 p.m., Abhishek Kumar wrote: > > security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java > > Line 464 (original), 464 (patched) > > <https://reviews.apache.org/r/74251/diff/4/?file=2273896#file2273896line464> > > > > Client side code needs update: > > > > https://github.com/apache/ranger/blob/master/intg/src/main/java/org/apache/ranger/RangerClient.java#L283 > > > > Changes may be required here as well: > > > > ranger-examples/sample-client/src/main/java/org/apache/ranger/examples/sampleclient/SampleClient.java
Abhishek Kumar Added the code changes in SampleClient for the new API - Ramachandran ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74251/#review225128 ----------------------------------------------------------- On Jan. 25, 2023, 2:49 p.m., Ramachandran Krishnan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/74251/ > ----------------------------------------------------------- > > (Updated Jan. 25, 2023, 2:49 p.m.) > > > Review request for ranger, Don Bosco Durai, Kirby Zhou, Abhay Kulkarni, > Madhan Neethiraj, Mehul Parikh, Nikhil P, Pradeep Agrawal, Ramesh Mani, > Selvamohan Neethiraj, Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan > Periasamy. > > > Bugs: RANGER-4012 > https://issues.apache.org/jira/browse/RANGER-4012 > > > Repository: ranger > > > Description > ------- > > getPolicyByName searches policy by serviceName, policyName simply by traverse > all policies in RangerServicePoliciesCache. > > However, It takes more time to search for policies from the cache when there > are millions of policies > > As well as The above REST API sometimes gives stable data due to the deleted > element is present in the Cache > > We need to call the DB to fetch policy instead of calling > RangerServicePoliciesCache > > In PublicAPIsv2 we add the API's which are available in ServiceREST as an API > and the getPolicyByName is not available as an API in ServiceREST. > > getPolicyByName ---> (/api/service/{servicename}/policy/{policyname}) in > PublicAPIsv2 > > I guess we should add the below API in ServiceREST also for the same. > > getPolicyByName ---> (/policies/service/{serviceName}/policy/{policyName}) in > ServiceREST > > > Diffs > ----- > > intg/src/main/java/org/apache/ranger/RangerClient.java e4e3a57ad > > ranger-examples/sample-client/src/main/java/org/apache/ranger/examples/sampleclient/SampleClient.java > d0202e47e > security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java > d98910bee > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java > ec02f47f7 > security-admin/src/test/java/org/apache/ranger/rest/TestPublicAPIsv2.java > 7409883ab > security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java > 8fdcc43c8 > > > Diff: https://reviews.apache.org/r/74251/diff/5/ > > > Testing > ------- > > > Thanks, > > Ramachandran Krishnan > >