ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower" <tbeerbo...@hortonworks.com>
Subject Re: Review Request 24114: Add Cluster Privilege Resource
Date Thu, 31 Jul 2014 13:38:29 GMT

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

(Updated July 31, 2014, 1:38 p.m.)


Review request for Ambari, Jonathan Hurley and Nate Cole.


Changes
-------

Updated patch to use CascadeType.ALL for resource relationships.
Updated patch to include clusters schema change in upgrade class.


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


Repository: ambari


Description
-------

Add a cluster privilege resource provider so that privileges may be assigned to cluster instances.
 See BUG-18967 for view instance privileges.
TODO :
#  Add resource_id column to clusters
#  Add resource entity relationship to ClusterEntity
#  Insert associated resource row in DB  when cluster is created.
#  Update existing cluster rows in DB with associated resource relationship.
#  Add cluster privilege service for API framework.
#  Add cluster privilege resource provider.
#  Adjust unit tests.

API:

To grant privileges to access the cluster we can create a privilege sub-resource for the cluster
instance.  The following API will grant CLUSTER.READ permission to the user 'bob' for the
cluster instance 'c1'.

{code}

    POST http://<server>/api/v1/clusters/c1
   
    [
      {
        "PrivilegeInfo" : {
          "permission_name" : "CLUSTER.READ",
          "principal_name" : "bob",
          "principal_type" : "USER"
        }
      }
    ]
{code}


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
86fc247 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterPrivilegeService.java
PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java b7da169

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java 906cba4

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterPrivilegeResourceProvider.java
PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
88e4296 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java
d04345b 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ResourceDAO.java 99c3f92 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ResourceTypeDAO.java a0373c6

  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java 16134c5

  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ResourceEntity.java 7a8eab4

  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java
efb3815 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java 023d530

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 5f67a30

  ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 7b7d9a4 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 3777b75 
  ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 1db44bc 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1c5629e 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql c2c29b1 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/ClusterResourceDefinitionTest.java
c5721a5 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java
PRE-CREATION 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterPrivilegeResourceProviderTest.java
PRE-CREATION 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ViewPrivilegeResourceProviderTest.java
33adbf8 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java f3a0b0f 
  ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java 35ed02c 
  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ConfigGroupDAOTest.java 2dc1385

  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/RequestScheduleDAOTest.java
50b4086 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
a52c909 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.2.3.sql 6c2c44d 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.2.4.sql 23001f1 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.2.5.sql 17a917e 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.4.0.sql a29578f 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.4.1.sql d60ba1f 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.4.2.sql 3c630c8 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.4.3.sql 7fbaebe 
  ambari-server/src/test/resources/ddl-scripts/Ambari-DDL-Derby-1.4.4.sql 012f7be 

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


Testing
-------

Manual testing.

Added new unit tests.  All existing tests pass.

Results :

Tests run: 1850, Failures: 0, Errors: 0, Skipped: 13
...

INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39:50.407s
[INFO] Finished at: Wed Jul 30 17:05:51 EDT 2014
[INFO] Final Memory: 30M/123M
[INFO] ------------------------------------------------------------------------


Thanks,

Tom Beerbower


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message