> On Jan. 18, 2024, 8:52 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
> > Line 767 (original), 767 (patched)
> > <https://reviews.apache.org/r/74844/diff/1/?file=2284871#file2284871line767>
> >
> >     This would skip creation of specified tag service 
> > (service.getTagService()) as well. This doesn't look correct. Consider 
> > updating the logic that derives tag service name from resource service name 
> > - to use service.getTagService() when it is not blank.

Madhan, this case will not happen. If the specified tag service 
(service.getTagService()) is not created, then validator will throw Exception. 
Hence, at this point, the service.getTagService() is already going to be 
present in database.

validator call in ServiceREST.java
https://github.com/apache/ranger/blob/master/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java#L734C1-L735C1

Contition in RangerServiceValidator.java
https://github.com/apache/ranger/blob/master/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java#L308C1-L309C1


- Siddhesh


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


On Jan. 18, 2024, 5:21 p.m., Siddhesh Phatak wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74844/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2024, 5:21 p.m.)
> 
> 
> Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, 
> Monika Kachhadiya, Prashant Satam, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4663
>     https://issues.apache.org/jira/browse/RANGER-4663
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> If a tag service is selected while creating a resource service, a new tag 
> service should not be created for this resource service. This has been fixed 
> by adding the condition to check if user has selected tag service or not.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> f9fd4941e 
> 
> 
> Diff: https://reviews.apache.org/r/74844/diff/1/
> 
> 
> Testing
> -------
> 
> Following cases have been tested and working as expected.
> Case 1: 
> 1) Create a service in ranger
> 2) Do not select tag service.
> 3) A resource service will be created, a new tag service will also get 
> created and it will be linked to the resource service.
> 
> Case 2: 
> 1) Create a resource service in ranger.
> 2) Select a tag service for it.
> 3) A resource service will get created, a new tag service will not get 
> created and the selected tag service will be linked to the resource service.
> 
> 
> Thanks,
> 
> Siddhesh Phatak
> 
>

Reply via email to