You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Pradeep Agrawal <pr...@gmail.com> on 2022/06/24 12:32:34 UTC

Review Request 74040: RANGER-3807: getUserRoles API gives 200 for non existing user passed to this API

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

Review request for ranger, bhavik patel, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

**Problem statement:** When we make a request to the API /roles/roles/user/{user} with any random string or not existing users it return empty list with response code 200. it should throw an error if provided user does not exist in ranger db.

**Proposed solution:** Check the user exist or not, if user does not exist then throw the error.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java e00767643 


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


Testing
-------

Tested with patch.

Request:
curl -X GET --header "text/json" -H "Content-Type: text/json" -u admin:Ranger@1234 "http://localhost:6080/service/roles/roles/user/randomuser"

Response:
{"statusCode":1,"msgDesc":"randomuser is Not Found","messageList":[{"name":"DATA_NOT_FOUND","rbKey":"xa.error.data_not_found","message":"Data not found"}]}


Thanks,

Pradeep Agrawal


Re: Review Request 74040: RANGER-3807: getUserRoles API gives 200 for non existing user passed to this API

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74040/#review224532
-----------------------------------------------------------


Ship it!




Ship It!

- bhavik patel


On June 24, 2022, 12:32 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74040/
> -----------------------------------------------------------
> 
> (Updated June 24, 2022, 12:32 p.m.)
> 
> 
> Review request for ranger, bhavik patel, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3807
>     https://issues.apache.org/jira/browse/RANGER-3807
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem statement:** When we make a request to the API /roles/roles/user/{user} with any random string or not existing users it return empty list with response code 200. it should throw an error if provided user does not exist in ranger db.
> 
> **Proposed solution:** Check the user exist or not, if user does not exist then throw the error.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java e00767643 
> 
> 
> Diff: https://reviews.apache.org/r/74040/diff/1/
> 
> 
> Testing
> -------
> 
> Tested with patch.
> 
> Request:
> curl -X GET --header "text/json" -H "Content-Type: text/json" -u admin:Ranger@1234 "http://localhost:6080/service/roles/roles/user/randomuser"
> 
> Response:
> {"statusCode":1,"msgDesc":"randomuser is Not Found","messageList":[{"name":"DATA_NOT_FOUND","rbKey":"xa.error.data_not_found","message":"Data not found"}]}
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>