You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Robert Levas <rl...@hortonworks.com> on 2015/11/21 20:00:46 UTC

Review Request 40577: Fix translation of different view resource type entities to all be of type VIEW

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

Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Bugs: AMBARI-14005
    https://issues.apache.org/jira/browse/AMBARI-14005


Repository: ambari


Description
-------

Fix translation of different view resource type entities to all be of type VIEW. 

When an Ambari view is added to Ambari, a new resource type ({{adminresourcetype}}) is added.  Each of these types need to resolve to represent a _view_  resource ({{org.apache.ambari.server.security.authorization.ResourceType#VIEW}} so that authorization checks can be performed properly. 

For example:
```
 resource_type_id |    resource_type_name
------------------+---------------------------
                1 | AMBARI
                2 | CLUSTER
                3 | VIEW
                5 | ADMIN_VIEW{2.1.2}
                6 | FILES{1.0.0}
                7 | PIG{1.0.0}
                8 | CAPACITY-SCHEDULER{1.0.0}
                9 | TEZ{0.7.0.2.3.2.0-377}
               10 | SLIDER{2.0.0}
               11 | HIVE{1.0.0}
               55 | ADMIN_VIEW{2.2.0.0}
               56 | TEZ{0.7.0.2.3.2.0-3539}
```

The translation needs to be be:

```
AMBARI                    | ResourceType.AMBARI
CLUSTER                   | ResourceType.CLUSTER
VIEW                      | ResourceType.VIEW
ADMIN_VIEW{2.1.2}         | ResourceType.VIEW
FILES{1.0.0}              | ResourceType.VIEW
PIG{1.0.0}                | ResourceType.VIEW
CAPACITY-SCHEDULER{1.0.0} | ResourceType.VIEW
TEZ{0.7.0.2.3.2.0-377}    | ResourceType.VIEW
SLIDER{2.0.0}             | ResourceType.VIEW
HIVE{1.0.0}               | ResourceType.VIEW
ADMIN_VIEW{2.2.0.0}       | ResourceType.VIEW
TEZ{0.7.0.2.3.2.0-3539}   | ResourceType.VIEW
```


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java 9c1a888 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java aabd14f 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java fdb4876 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/ResourceType.java bd107ea 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java 75beec5 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql f7d6927 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java bca167c 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java da85502 
  ambari-server/src/test/java/org/apache/ambari/server/security/authorization/ResourceTypeTest.java PRE-CREATION 
  ambari-server/src/test/java/org/apache/ambari/server/security/authorization/RoleAuthorizationTest.java PRE-CREATION 

Diff: https://reviews.apache.org/r/40577/diff/


Testing
-------

Manual test

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas


Re: Review Request 40577: Fix translation of different view resource type entities to all be of type VIEW

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40577/
-----------------------------------------------------------

(Updated Nov. 22, 2015, 10:23 a.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Bugs: AMBARI-14005
    https://issues.apache.org/jira/browse/AMBARI-14005


Repository: ambari


Description
-------

Fix translation of different view resource type entities to all be of type VIEW. 

When an Ambari view is added to Ambari, a new resource type ({{adminresourcetype}}) is added.  Each of these types need to resolve to represent a _view_  resource ({{org.apache.ambari.server.security.authorization.ResourceType#VIEW}} so that authorization checks can be performed properly. 

For example:
```
 resource_type_id |    resource_type_name
------------------+---------------------------
                1 | AMBARI
                2 | CLUSTER
                3 | VIEW
                5 | ADMIN_VIEW{2.1.2}
                6 | FILES{1.0.0}
                7 | PIG{1.0.0}
                8 | CAPACITY-SCHEDULER{1.0.0}
                9 | TEZ{0.7.0.2.3.2.0-377}
               10 | SLIDER{2.0.0}
               11 | HIVE{1.0.0}
               55 | ADMIN_VIEW{2.2.0.0}
               56 | TEZ{0.7.0.2.3.2.0-3539}
```

The translation needs to be be:

```
AMBARI                    | ResourceType.AMBARI
CLUSTER                   | ResourceType.CLUSTER
VIEW                      | ResourceType.VIEW
ADMIN_VIEW{2.1.2}         | ResourceType.VIEW
FILES{1.0.0}              | ResourceType.VIEW
PIG{1.0.0}                | ResourceType.VIEW
CAPACITY-SCHEDULER{1.0.0} | ResourceType.VIEW
TEZ{0.7.0.2.3.2.0-377}    | ResourceType.VIEW
SLIDER{2.0.0}             | ResourceType.VIEW
HIVE{1.0.0}               | ResourceType.VIEW
ADMIN_VIEW{2.2.0.0}       | ResourceType.VIEW
TEZ{0.7.0.2.3.2.0-3539}   | ResourceType.VIEW
```


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java 9c1a888 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java aabd14f 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java fdb4876 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/ResourceType.java bd107ea 
  ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java 75beec5 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql f7d6927 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java bca167c 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java da85502 
  ambari-server/src/test/java/org/apache/ambari/server/security/authorization/ResourceTypeTest.java PRE-CREATION 
  ambari-server/src/test/java/org/apache/ambari/server/security/authorization/RoleAuthorizationTest.java PRE-CREATION 

Diff: https://reviews.apache.org/r/40577/diff/


Testing
-------

Manual test

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas


Re: Review Request 40577: Fix translation of different view resource type entities to all be of type VIEW

Posted by Robert Nettleton <rn...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40577/#review107504
-----------------------------------------------------------

Ship it!


Patch looks good to me.  Just a minor javadoc issue listed below.


ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java (line 101)
<https://reviews.apache.org/r/40577/#comment166647>

    Minor issue: 
    
    Is this an authentication id or an authorization id?  the javadoc is a little confusing there, maybe just a typo?


- Robert Nettleton


On Nov. 21, 2015, 7 p.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40577/
> -----------------------------------------------------------
> 
> (Updated Nov. 21, 2015, 7 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14005
>     https://issues.apache.org/jira/browse/AMBARI-14005
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Fix translation of different view resource type entities to all be of type VIEW. 
> 
> When an Ambari view is added to Ambari, a new resource type ({{adminresourcetype}}) is added.  Each of these types need to resolve to represent a _view_  resource ({{org.apache.ambari.server.security.authorization.ResourceType#VIEW}} so that authorization checks can be performed properly. 
> 
> For example:
> ```
>  resource_type_id |    resource_type_name
> ------------------+---------------------------
>                 1 | AMBARI
>                 2 | CLUSTER
>                 3 | VIEW
>                 5 | ADMIN_VIEW{2.1.2}
>                 6 | FILES{1.0.0}
>                 7 | PIG{1.0.0}
>                 8 | CAPACITY-SCHEDULER{1.0.0}
>                 9 | TEZ{0.7.0.2.3.2.0-377}
>                10 | SLIDER{2.0.0}
>                11 | HIVE{1.0.0}
>                55 | ADMIN_VIEW{2.2.0.0}
>                56 | TEZ{0.7.0.2.3.2.0-3539}
> ```
> 
> The translation needs to be be:
> 
> ```
> AMBARI                    | ResourceType.AMBARI
> CLUSTER                   | ResourceType.CLUSTER
> VIEW                      | ResourceType.VIEW
> ADMIN_VIEW{2.1.2}         | ResourceType.VIEW
> FILES{1.0.0}              | ResourceType.VIEW
> PIG{1.0.0}                | ResourceType.VIEW
> CAPACITY-SCHEDULER{1.0.0} | ResourceType.VIEW
> TEZ{0.7.0.2.3.2.0-377}    | ResourceType.VIEW
> SLIDER{2.0.0}             | ResourceType.VIEW
> HIVE{1.0.0}               | ResourceType.VIEW
> ADMIN_VIEW{2.2.0.0}       | ResourceType.VIEW
> TEZ{0.7.0.2.3.2.0-3539}   | ResourceType.VIEW
> ```
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java 9c1a888 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java aabd14f 
>   ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java fdb4876 
>   ambari-server/src/main/java/org/apache/ambari/server/security/authorization/ResourceType.java bd107ea 
>   ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java 75beec5 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql f7d6927 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java bca167c 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java da85502 
>   ambari-server/src/test/java/org/apache/ambari/server/security/authorization/ResourceTypeTest.java PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/security/authorization/RoleAuthorizationTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/40577/diff/
> 
> 
> Testing
> -------
> 
> Manual test
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>