> On Feb. 8, 2025, 7:42 p.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java > > Lines 692 (patched) > > <https://reviews.apache.org/r/75359/diff/1/?file=2297627#file2297627line692> > > > > Consider providing following API to delete policies based on filters > > specified in the context, and return deleted policy details: > > > > @DELETE > > @Path("/api/policies/bulk") > > public List<RangerPolicyHeader> deletePolicies(@Context > > HttpServletRequest request) { > > List<RangerPolicy> policies = > > serviceREST.getPolicies(request).getPolicies(); > > > > ... > > } > > Guru Thejus Arveti wrote: > You meant a new API apart from this one ? As per the jira, it is only to > bulk delete policies basing on regex policyname instead of the current one > which is just by the policy name. Line number 683 above. But filters are not > used in the existing one as well, the request is just passed but is not used. > Please let me know.
Instead of an API to delete policies based on partial-name match, I suggest providing a general API where the caller can specify different criteira to select policies to delete. - Madhan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/75359/#review227234 ----------------------------------------------------------- On Feb. 8, 2025, 9:06 a.m., Guru Thejus Arveti wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/75359/ > ----------------------------------------------------------- > > (Updated Feb. 8, 2025, 9:06 a.m.) > > > Review request for ranger. > > > Repository: ranger > > > Description > ------- > > API to delete multiple policies using a wildcard > > > Diffs > ----- > > security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java > 7beef34c7 > security-admin/src/main/java/org/apache/ranger/db/XXPolicyDao.java > e8ea726cb > security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java > 7b1eb7fe7 > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java > f7c521111 > > security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java > 193face94 > security-admin/src/main/resources/META-INF/jpa_named_queries.xml 56eefba40 > security-admin/src/test/java/org/apache/ranger/biz/TestServiceDBStore.java > 7747e327a > > > Diff: https://reviews.apache.org/r/75359/diff/1/ > > > Testing > ------- > > Locally tested using docker by bulk creating ~10k policies and deleting them > by using the API. Time to execution ~25-30sec > > > Thanks, > > Guru Thejus Arveti > >