You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Subhrat Chaudhary via Review Board <no...@reviews.apache.org> on 2023/10/03 18:26:17 UTC

Review Request 74639: RANGER-4447: Add GET API to get security-zone summary for current user

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

Review request for ranger and Madhan Neethiraj.


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


Repository: ranger


Description
-------

We need a new API to get security-zone summary, to show zone details on dashboard.


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java 47f8041b7 
  security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java a2c4e30ca 
  security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 7c1e01053 


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


Testing
-------

Validated on lcoal with zones. API response for one SZ:
{
            "id": 3,
            "isEnabled": true,
            "createdBy": "Admin",
            "updatedBy": "Admin",
            "createTime": 1696354856720,
            "updateTime": 1696354856725,
            "name": "zone2",
            "totalResourceCount": 3,
            "adminCount": {
                "ROLE": 0,
                "GROUP": 0,
                "USER": 4
            },
            "auditorCount": {
                "ROLE": 0,
                "GROUP": 0,
                "USER": 4
            },
            "tagServices": [
                "tag1"
            ],
            "services": [
                {
                    "id": 1,
                    "name": "hive1",
                    "type": "hive",
                    "resourceCount": 2
                },
                {
                    "id": 15740,
                    "name": "hive2",
                    "type": "hive",
                    "resourceCount": 1
                }
            ]
        }


Thanks,

Subhrat Chaudhary


Re: Review Request 74639: RANGER-4447: Add GET API to get security-zone summary for current user

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74639/#review225822
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Oct. 4, 2023, 6:28 p.m., Subhrat Chaudhary wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74639/
> -----------------------------------------------------------
> 
> (Updated Oct. 4, 2023, 6:28 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: https://issues.apache.org/jira/browse/RANGER-4447
>     https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/RANGER-4447
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We need a new API to get security-zone summary, to show zone details on dashboard.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java 47f8041b7 
>   security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java a2c4e30ca 
>   security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 7c1e01053 
> 
> 
> Diff: https://reviews.apache.org/r/74639/diff/2/
> 
> 
> Testing
> -------
> 
> Validated on lcoal with zones. API response for one SZ:
> {
>             "id": 3,
>             "isEnabled": true,
>             "createdBy": "Admin",
>             "updatedBy": "Admin",
>             "createTime": 1696354856720,
>             "updateTime": 1696354856725,
>             "name": "zone2",
>             "totalResourceCount": 3,
>             "adminCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "auditorCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "tagServices": [
>                 "tag1"
>             ],
>             "services": [
>                 {
>                     "id": 1,
>                     "name": "hive1",
>                     "type": "hive",
>                     "resourceCount": 2
>                 },
>                 {
>                     "id": 15740,
>                     "name": "hive2",
>                     "type": "hive",
>                     "resourceCount": 1
>                 }
>             ]
>         }
> 
> 
> Thanks,
> 
> Subhrat Chaudhary
> 
>


Re: Review Request 74639: RANGER-4447: Add GET API to get security-zone summary for current user

Posted by Subhrat Chaudhary via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74639/
-----------------------------------------------------------

(Updated Oct. 4, 2023, 11:58 p.m.)


Review request for ranger and Madhan Neethiraj.


Changes
-------

Addressed review comments


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


Repository: ranger


Description
-------

We need a new API to get security-zone summary, to show zone details on dashboard.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java 47f8041b7 
  security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java a2c4e30ca 
  security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 7c1e01053 


Diff: https://reviews.apache.org/r/74639/diff/2/

Changes: https://reviews.apache.org/r/74639/diff/1-2/


Testing
-------

Validated on lcoal with zones. API response for one SZ:
{
            "id": 3,
            "isEnabled": true,
            "createdBy": "Admin",
            "updatedBy": "Admin",
            "createTime": 1696354856720,
            "updateTime": 1696354856725,
            "name": "zone2",
            "totalResourceCount": 3,
            "adminCount": {
                "ROLE": 0,
                "GROUP": 0,
                "USER": 4
            },
            "auditorCount": {
                "ROLE": 0,
                "GROUP": 0,
                "USER": 4
            },
            "tagServices": [
                "tag1"
            ],
            "services": [
                {
                    "id": 1,
                    "name": "hive1",
                    "type": "hive",
                    "resourceCount": 2
                },
                {
                    "id": 15740,
                    "name": "hive2",
                    "type": "hive",
                    "resourceCount": 1
                }
            ]
        }


Thanks,

Subhrat Chaudhary


Re: Review Request 74639: RANGER-4447: Add GET API to get security-zone summary for current user

Posted by Subhrat Chaudhary via Review Board <no...@reviews.apache.org>.

> On Oct. 4, 2023, 11:01 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java
> > Lines 261 (patched)
> > <https://reviews.apache.org/r/74639/diff/1/?file=2280903#file2280903line261>
> >
> >     Since zones could be filtered in-memory (lines #265 - #267), shouldn't filter.startIndex and filter.maxRows be updated here before calling getSecurityZones(filter)? Please review.

Resetting filter.startIndex and filter.maxRows before calling getSecurityZones(filter).


- Subhrat


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


On Oct. 4, 2023, 11:58 p.m., Subhrat Chaudhary wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74639/
> -----------------------------------------------------------
> 
> (Updated Oct. 4, 2023, 11:58 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: https://issues.apache.org/jira/browse/RANGER-4447
>     https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/RANGER-4447
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We need a new API to get security-zone summary, to show zone details on dashboard.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java 47f8041b7 
>   security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java a2c4e30ca 
>   security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 7c1e01053 
> 
> 
> Diff: https://reviews.apache.org/r/74639/diff/2/
> 
> 
> Testing
> -------
> 
> Validated on lcoal with zones. API response for one SZ:
> {
>             "id": 3,
>             "isEnabled": true,
>             "createdBy": "Admin",
>             "updatedBy": "Admin",
>             "createTime": 1696354856720,
>             "updateTime": 1696354856725,
>             "name": "zone2",
>             "totalResourceCount": 3,
>             "adminCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "auditorCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "tagServices": [
>                 "tag1"
>             ],
>             "services": [
>                 {
>                     "id": 1,
>                     "name": "hive1",
>                     "type": "hive",
>                     "resourceCount": 2
>                 },
>                 {
>                     "id": 15740,
>                     "name": "hive2",
>                     "type": "hive",
>                     "resourceCount": 1
>                 }
>             ]
>         }
> 
> 
> Thanks,
> 
> Subhrat Chaudhary
> 
>


Re: Review Request 74639: RANGER-4447: Add GET API to get security-zone summary for current user

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74639/#review225819
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java
Lines 261 (patched)
<https://reviews.apache.org/r/74639/#comment314254>

    Since zones could be filtered in-memory (lines #265 - #267), shouldn't filter.startIndex and filter.maxRows be updated here before calling getSecurityZones(filter)? Please review.


- Madhan Neethiraj


On Oct. 3, 2023, 6:26 p.m., Subhrat Chaudhary wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74639/
> -----------------------------------------------------------
> 
> (Updated Oct. 3, 2023, 6:26 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: https://issues.apache.org/jira/browse/RANGER-4447
>     https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/RANGER-4447
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We need a new API to get security-zone summary, to show zone details on dashboard.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java 47f8041b7 
>   security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneDBStore.java a2c4e30ca 
>   security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 7c1e01053 
> 
> 
> Diff: https://reviews.apache.org/r/74639/diff/1/
> 
> 
> Testing
> -------
> 
> Validated on lcoal with zones. API response for one SZ:
> {
>             "id": 3,
>             "isEnabled": true,
>             "createdBy": "Admin",
>             "updatedBy": "Admin",
>             "createTime": 1696354856720,
>             "updateTime": 1696354856725,
>             "name": "zone2",
>             "totalResourceCount": 3,
>             "adminCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "auditorCount": {
>                 "ROLE": 0,
>                 "GROUP": 0,
>                 "USER": 4
>             },
>             "tagServices": [
>                 "tag1"
>             ],
>             "services": [
>                 {
>                     "id": 1,
>                     "name": "hive1",
>                     "type": "hive",
>                     "resourceCount": 2
>                 },
>                 {
>                     "id": 15740,
>                     "name": "hive2",
>                     "type": "hive",
>                     "resourceCount": 1
>                 }
>             ]
>         }
> 
> 
> Thanks,
> 
> Subhrat Chaudhary
> 
>