ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [2/6] incubator-ranger git commit: RANGER-586:Ranger plugins should not add dependent libraries to component's CLASSPATH
Date Wed, 28 Oct 2015 00:20:40 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/ranger-yarn-plugin-shim/src/main/java/org/apache/ranger/authorization/yarn/authorizer/RangerYarnAuthorizer.java
----------------------------------------------------------------------
diff --git a/ranger-yarn-plugin-shim/src/main/java/org/apache/ranger/authorization/yarn/authorizer/RangerYarnAuthorizer.java
b/ranger-yarn-plugin-shim/src/main/java/org/apache/ranger/authorization/yarn/authorizer/RangerYarnAuthorizer.java
new file mode 100644
index 0000000..289d1c0
--- /dev/null
+++ b/ranger-yarn-plugin-shim/src/main/java/org/apache/ranger/authorization/yarn/authorizer/RangerYarnAuthorizer.java
@@ -0,0 +1,205 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ranger.authorization.yarn.authorizer;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.authorize.AccessControlList;
+import org.apache.hadoop.yarn.security.AccessType;
+import org.apache.hadoop.yarn.security.PrivilegedEntity;
+import org.apache.hadoop.yarn.security.YarnAuthorizationProvider;
+import org.apache.ranger.plugin.classloader.RangerPluginClassLoader;
+
+
+
+public class RangerYarnAuthorizer extends YarnAuthorizationProvider {
+	private static final Log LOG  = LogFactory.getLog(RangerYarnAuthorizer.class);
+
+	private static final String   RANGER_PLUGIN_TYPE                      = "yarn";
+	private static final String[] RANGER_PLUGIN_LIB_DIR                   = new String[] {"lib/ranger-yarn-plugin"};
+	private static final String   RANGER_YARN_AUTHORIZER_IMPL_CLASSNAME   = "org.apache.ranger.authorization.yarn.authorizer.RangerYarnAuthorizer";
+
+	private YarnAuthorizationProvider 	 	yarnAuthorizationProviderImpl = null;
+	private static RangerPluginClassLoader  rangerPluginClassLoader  	  = null;
+	
+	public RangerYarnAuthorizer() {
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.RangerYarnAuthorizer()");
+		}
+
+		this.init();
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.RangerYarnAuthorizer()");
+		}
+	}
+
+	private void init(){
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.init()");
+		}
+
+		try {
+			
+			rangerPluginClassLoader = RangerPluginClassLoader.getInstance(RANGER_PLUGIN_TYPE, this.getClass());
+			
+			@SuppressWarnings("unchecked")
+			Class<YarnAuthorizationProvider> cls = (Class<YarnAuthorizationProvider>)
Class.forName(RANGER_YARN_AUTHORIZER_IMPL_CLASSNAME, true, rangerPluginClassLoader);
+
+			activatePluginClassLoader();
+
+			yarnAuthorizationProviderImpl = cls.newInstance();
+		} catch (Exception e) {
+			// check what need to be done
+			LOG.error("Error Enabling RangerYarnPluing", e);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.init()");
+		}
+	}
+
+	@Override
+	public void init(Configuration conf) {
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.init()");
+		}
+
+		try {
+			activatePluginClassLoader();
+
+			yarnAuthorizationProviderImpl.init(conf);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.start()");
+		}
+	}
+
+	@Override
+	public boolean checkPermission(AccessType accessType, PrivilegedEntity target, UserGroupInformation
user) {
+		
+		boolean ret = false;
+		
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.checkPermission()");
+		}
+
+		try {
+			activatePluginClassLoader();
+
+			ret = yarnAuthorizationProviderImpl.checkPermission(accessType, target, user);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.checkPermission()");
+		}
+		
+		return ret;
+	}
+
+	@Override
+	public void setPermission(PrivilegedEntity target,	Map<AccessType, AccessControlList>
acls, UserGroupInformation ugi) {
+		
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.setPermission()");
+		}
+
+		try {
+			activatePluginClassLoader();
+
+			yarnAuthorizationProviderImpl.setPermission(target, acls, ugi);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.setPermission()");
+		}
+	}
+
+	@Override
+	public void setAdmins(AccessControlList acls, UserGroupInformation ugi) {
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.setAdmins()");
+		}
+
+		try {
+			activatePluginClassLoader();
+
+			yarnAuthorizationProviderImpl.setAdmins(acls, ugi);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.setAdmins()");
+		}
+	}
+
+	@Override
+	public boolean isAdmin(UserGroupInformation ugi) {
+		
+		boolean ret = false;
+		
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> RangerYarnAuthorizer.setAdmins()");
+		}
+
+		try {
+			activatePluginClassLoader();
+
+			ret = yarnAuthorizationProviderImpl.isAdmin(ugi);
+		} finally {
+			deactivatePluginClassLoader();
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== RangerYarnAuthorizer.setAdmins()");
+		}
+		
+		return ret;
+	}
+	
+	private void activatePluginClassLoader() {
+		if(rangerPluginClassLoader != null) {
+			rangerPluginClassLoader.activate();
+		}
+	}
+
+	private void deactivatePluginClassLoader() {
+		if(rangerPluginClassLoader != null) {
+			rangerPluginClassLoader.deactivate();
+		}
+	}
+
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/hbase-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/hbase-agent.xml b/src/main/assembly/hbase-agent.xml
index 0f22066..0ffc65c 100644
--- a/src/main/assembly/hbase-agent.xml
+++ b/src/main/assembly/hbase-agent.xml
@@ -28,21 +28,34 @@
      <binaries>
         <includeDependencies>false</includeDependencies>
         <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
+  	    <outputDirectory>/lib</outputDirectory>
+     </binaries>
+     <includes>
+	  <include>security_plugins.ranger-hbase-plugin-shim:ranger-hbase-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+     </includes>
+    </moduleSet>    
+    <moduleSet>
+     <binaries>
+        <includeDependencies>false</includeDependencies>
+        <unpack>false</unpack>
 	<directoryMode>755</directoryMode>
 	<fileMode>644</fileMode>
         <dependencySets>
             <dependencySet>
-                <outputDirectory>/lib</outputDirectory>
+                <outputDirectory>/lib/ranger-hbase-plugin-impl</outputDirectory>
                 <includes>
                     <include>com.google.code.gson:gson*</include>
                     <include>org.eclipse.persistence:eclipselink</include>
-		    <include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
-		    <include>org.noggit:noggit:jar:${noggit.version}</include>
+		    		<include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
+		   			<include>org.noggit:noggit:jar:${noggit.version}</include>
                 </includes>
                 <unpack>false</unpack>
             </dependencySet>
         </dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+        <outputDirectory>/lib/ranger-hbase-plugin-impl</outputDirectory>
      </binaries>
      <includes>
 	<include>org.apache.ranger:ranger_solrj</include>
@@ -55,7 +68,7 @@
     </moduleSet>
     <moduleSet>
      <binaries>
-        <includeDependencies>false</includeDependencies>
+        <includeDependencies>true</includeDependencies>
         <dependencySets>
                 <dependencySet>
                     <outputDirectory>/install/lib</outputDirectory>
@@ -67,7 +80,7 @@
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang</include>
                         <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
                         <include>junit:junit</include>
                         <include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/hdfs-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/hdfs-agent.xml b/src/main/assembly/hdfs-agent.xml
index 2c18001..deec461 100644
--- a/src/main/assembly/hdfs-agent.xml
+++ b/src/main/assembly/hdfs-agent.xml
@@ -24,39 +24,24 @@
   <baseDirectory>${project.name}-${project.version}-hdfs-plugin</baseDirectory>
   <includeBaseDirectory>true</includeBaseDirectory>
   <moduleSets>
+    
     <moduleSet>
      <binaries>
         <includeDependencies>false</includeDependencies>
         <unpack>false</unpack>
 	    <directoryMode>755</directoryMode>
 	    <fileMode>644</fileMode>
-  		<dependencySets>
-   			<dependencySet>
-     			<outputDirectory>/lib</outputDirectory>
-				<includes>
-					<include>com.google.code.gson:gson*</include>
-					<include>org.eclipse.persistence:javax.persistence</include>
-					<include>org.eclipse.persistence:eclipselink</include>
-					<include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
-					<include>org.noggit:noggit:jar:${noggit.version}</include>
-				</includes>
-				<unpack>false</unpack>
-  			</dependencySet>
-  		</dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+  	    <outputDirectory>/lib</outputDirectory>
      </binaries>
      <includes>
-	<include>org.apache.ranger:ranger_solrj</include>
-	<include>security_plugins.ranger-plugins-audit:ranger-plugins-audit</include>
-	<include>security_plugins.ranger-plugins-cred:ranger-plugins-cred</include>
-	<include>security_plugins.ranger-plugins-impl:ranger-plugins-impl</include>
-	<include>security_plugins.ranger-plugins-common:ranger-plugins-common</include>
-	<include>security_plugins.ranger-hdfs-plugin:ranger-hdfs-plugin</include>
-     </includes>
+	  <include>security_plugins.ranger-hdfs-plugin-shim:ranger-hdfs-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+      </includes>
     </moduleSet>
+    
     <moduleSet>
      <binaries>
-        <includeDependencies>false</includeDependencies>
+        <includeDependencies>true</includeDependencies>
   		<dependencySets>
                 <dependencySet>
                     <outputDirectory>/install/lib</outputDirectory>
@@ -68,9 +53,9 @@
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang</include>
                         <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
-                        <include>junit:junit</include>
+                        <include>junit:junit:${junit.version}</include>
                         <include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>
                         <include>org.apache.hadoop:hadoop-common:jar:${hadoop-common.version}</include>
                         <include>org.apache.hadoop:hadoop-auth:jar:${hadoop-common.version}</include>
@@ -85,6 +70,38 @@
         <include>org.apache.ranger:credentialbuilder</include>
      </includes>
     </moduleSet>
+    
+    <moduleSet>
+     <binaries>
+        <includeDependencies>true</includeDependencies>
+        <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
+  		<dependencySets>
+   			<dependencySet>
+     			<outputDirectory>/lib/ranger-hdfs-plugin-impl</outputDirectory>
+				<includes>
+					<include>com.google.code.gson:gson*</include>
+					<include>org.eclipse.persistence:javax.persistence</include>
+					<include>org.eclipse.persistence:eclipselink</include>
+					<include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
+					<include>org.noggit:noggit:jar:${noggit.version}</include>
+				</includes>
+				<unpack>false</unpack>
+  			</dependencySet>
+  		</dependencySets>
+        <outputDirectory>/lib/ranger-hdfs-plugin-impl</outputDirectory>
+     </binaries>
+    <includes>
+	<include>org.apache.ranger:ranger_solrj</include>
+	<include>security_plugins.ranger-plugins-audit:ranger-plugins-audit</include>
+	<include>security_plugins.ranger-plugins-cred:ranger-plugins-cred</include>
+	<include>security_plugins.ranger-plugins-impl:ranger-plugins-impl</include>
+	<include>security_plugins.ranger-plugins-common:ranger-plugins-common</include>
+	<include>security_plugins.ranger-hdfs-plugin:ranger-hdfs-plugin</include>
+    </includes>
+    </moduleSet>
+    
   </moduleSets> 	
   <fileSets>
     <!-- conf.templates for enable -->

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/hive-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/hive-agent.xml b/src/main/assembly/hive-agent.xml
index d21c6b8..9122547 100644
--- a/src/main/assembly/hive-agent.xml
+++ b/src/main/assembly/hive-agent.xml
@@ -24,6 +24,19 @@
   <baseDirectory>${project.name}-${project.version}-hive-plugin</baseDirectory>
   <includeBaseDirectory>true</includeBaseDirectory>
   <moduleSets>
+     <moduleSet>
+     <binaries>
+        <includeDependencies>false</includeDependencies>
+        <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
+  	    <outputDirectory>/lib</outputDirectory>
+     </binaries>
+     <includes>
+	  <include>security_plugins.ranger-hive-plugin-shim:ranger-hive-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+     </includes>
+    </moduleSet>
     <moduleSet>
      <binaries>
         <includeDependencies>false</includeDependencies>
@@ -32,18 +45,18 @@
 	    <fileMode>644</fileMode>
         <dependencySets>
             <dependencySet>
-                <outputDirectory>/lib</outputDirectory>
+                <outputDirectory>/lib/ranger-hive-plugin-impl</outputDirectory>
                 <includes>
                     <include>com.google.code.gson:gson*</include>
 					<include>org.eclipse.persistence:eclipselink</include>
                     <include>org.eclipse.persistence:javax.persistence</include>
-		    <include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
-		    <include>org.noggit:noggit:jar:${noggit.version}</include>
+		    		<include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
+		   			<include>org.noggit:noggit:jar:${noggit.version}</include>
                 </includes>
                 <unpack>false</unpack>
             </dependencySet>
         </dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+        <outputDirectory>/lib/ranger-hive-plugin-impl</outputDirectory>
      </binaries>
      <includes>
 	<include>org.apache.ranger:ranger_solrj</include>
@@ -56,7 +69,7 @@
     </moduleSet>
     <moduleSet>
      <binaries>
-        <includeDependencies>false</includeDependencies>
+        <includeDependencies>true</includeDependencies>
        <dependencySets>
                 <dependencySet>
                     <outputDirectory>/install/lib</outputDirectory>
@@ -68,7 +81,7 @@
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang</include>
                         <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
                         <include>junit:junit</include>
                         <include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/knox-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/knox-agent.xml b/src/main/assembly/knox-agent.xml
index 4806343..dc73f69 100644
--- a/src/main/assembly/knox-agent.xml
+++ b/src/main/assembly/knox-agent.xml
@@ -24,6 +24,21 @@
   <baseDirectory>${project.name}-${project.version}-knox-plugin</baseDirectory>
   <includeBaseDirectory>true</includeBaseDirectory>
   <moduleSets>
+  
+    <moduleSet>
+     <binaries>
+        <includeDependencies>false</includeDependencies>
+        <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
+  	    <outputDirectory>/lib</outputDirectory>
+     </binaries>
+     <includes>
+	  <include>security_plugins.ranger-knox-plugin-shim:ranger-knox-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+      </includes>
+    </moduleSet>
+    
     <moduleSet>
      <binaries>
         <includeDependencies>false</includeDependencies>
@@ -32,10 +47,10 @@
 	    <fileMode>644</fileMode>
         <dependencySets>
             <dependencySet>
-                <outputDirectory>/lib</outputDirectory>
+                <outputDirectory>/lib/ranger-knox-plugin-impl</outputDirectory>
                 <includes>
                     <include>commons-configuration:commons-configuration</include>
-		    <include>com.google.code.gson:gson*</include>
+		    		<include>com.google.code.gson:gson*</include>
            		    <include>org.apache.httpcomponents:httpmime:jar:${httpcomponent.httpmime.version}</include>
 		    		<include>org.noggit:noggit:jar:${noggit.version}</include>
 		    		<include>com.google.protobuf:protobuf-java:jar:${protobuf-java.version}</include>
@@ -45,7 +60,7 @@
                 <unpack>false</unpack>
             </dependencySet>
         </dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+        <outputDirectory>/lib/ranger-knox-plugin-impl</outputDirectory>
      </binaries>
      <includes>
 		<include>org.apache.ranger:ranger_solrj</include>
@@ -72,7 +87,7 @@
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang</include>
                         <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
                         <include>junit:junit</include>
 						<include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/plugin-kafka.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/plugin-kafka.xml b/src/main/assembly/plugin-kafka.xml
index 3727bde..31498e5 100644
--- a/src/main/assembly/plugin-kafka.xml
+++ b/src/main/assembly/plugin-kafka.xml
@@ -20,14 +20,28 @@
 	<includeBaseDirectory>true</includeBaseDirectory>
 	<moduleSets>
 		<moduleSet>
+	     <binaries>
+	        <includeDependencies>false</includeDependencies>
+	        <unpack>false</unpack>
+		    <directoryMode>755</directoryMode>
+		    <fileMode>644</fileMode>
+	  	    <outputDirectory>/lib</outputDirectory>
+	     </binaries>
+	     <includes>
+		  <include>security_plugins.ranger-kafka-plugin-shim:ranger-kafka-plugin-shim</include>
+		  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+	      </includes>
+	    </moduleSet>
+   	 
+		<moduleSet>
 			<binaries>
-				<includeDependencies>false</includeDependencies>
+				<includeDependencies>true</includeDependencies>
 				<unpack>false</unpack>
 				<directoryMode>755</directoryMode>
 				<fileMode>644</fileMode>
 				<dependencySets>
 					<dependencySet>
-						<outputDirectory>/lib</outputDirectory>
+						<outputDirectory>lib/ranger-kafka-plugin-impl</outputDirectory>
 						<unpack>false</unpack>
 						<includes>
 							<include>commons-configuration:commons-configuration:jar:${commons.configuration.version}
@@ -38,6 +52,7 @@
 							</include>
 							<include>org.apache.hadoop:hadoop-auth:jar:${hadoop-common.version}
 							</include>
+							<include>org.apache.hadoop:hadoop-hdfs:jar:${hadoop.version}</include>
 							<include>com.google.code.gson:gson</include>
 							<include>org.eclipse.persistence:eclipselink</include>
 							<include>org.eclipse.persistence:javax.persistence</include>
@@ -47,7 +62,7 @@
 							</include>
 							<include>commons-lang:commons-lang</include>
 							<include>commons-io:commons-io</include>
-							<include>com.google.guava:guava:jar:${guava.version}</include>
+							<include>com.google.guava:guava:jar:${google.guava.version}</include>
 							<include>org.apache.httpcomponents:httpclient:jar:${httpcomponent.httpclient.version}
 							</include>
 							<include>org.apache.httpcomponents:httpcore:jar:${httpcomponent.httpcore.version}
@@ -59,7 +74,6 @@
 							<include>org.codehaus.jackson:jackson-jaxrs</include>
 							<include>org.codehaus.jackson:jackson-mapper-asl</include>
 							<include>org.codehaus.jackson:jackson-xc</include>
-
 						</includes>
 					</dependencySet>
 					<dependencySet>
@@ -77,7 +91,7 @@
 							<include>commons-lang:commons-lang:jar:${commons.lang.version}
 							</include>
 							<include>commons-logging:commons-logging</include>
-							<include>com.google.guava:guava:jar:${guava.version}</include>
+							<include>com.google.guava:guava:jar:${google.guava.version}</include>
 							<include>org.hamcrest:hamcrest-all</include>
 							<include>junit:junit</include>
 							<include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>
@@ -91,20 +105,14 @@
 						</includes>
 					</dependencySet>
 				</dependencySets>
-				<outputDirectory>/lib</outputDirectory>
+				<outputDirectory>lib/ranger-kafka-plugin-impl</outputDirectory>
 			</binaries>
 			<includes>
+				<include>security_plugins.ranger-kafka-plugin:ranger-kafka-plugin</include>
 				<include>org.apache.ranger:ranger_solrj</include>
-				<include>security_plugins.ranger-plugins-audit:ranger-plugins-audit
-				</include>
-				<include>security_plugins.ranger-plugins-cred:ranger-plugins-cred
-				</include>
-				<include>security_plugins.ranger-plugins-impl:ranger-plugins-impl
-				</include>
-				<include>security_plugins.ranger-plugins-common:ranger-plugins-common
-				</include>
-				<include>security_plugins.ranger-kafka-plugin:ranger-kafka-plugin
-				</include>
+				<include>security_plugins.ranger-plugins-audit:ranger-plugins-audit</include>
+				<include>security_plugins.ranger-plugins-cred:ranger-plugins-cred</include>
+				<include>security_plugins.ranger-plugins-common:ranger-plugins-common</include>
 			</includes>
 		</moduleSet>
 		<moduleSet>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/plugin-yarn.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/plugin-yarn.xml b/src/main/assembly/plugin-yarn.xml
index a791bba..6f8e33b 100644
--- a/src/main/assembly/plugin-yarn.xml
+++ b/src/main/assembly/plugin-yarn.xml
@@ -24,6 +24,20 @@
   <baseDirectory>${project.name}-${project.version}-yarn-plugin</baseDirectory>
   <includeBaseDirectory>true</includeBaseDirectory>
   <moduleSets>
+     <moduleSet>
+     <binaries>
+        <includeDependencies>false</includeDependencies>
+        <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
+  	    <outputDirectory>/lib</outputDirectory>
+     </binaries>
+     <includes>
+	  <include>security_plugins.ranger-yarn-plugin-shim:ranger-yarn-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+      </includes>
+    </moduleSet>
+    
     <moduleSet>
      <binaries>
         <includeDependencies>false</includeDependencies>
@@ -32,7 +46,7 @@
 	    <fileMode>644</fileMode>
         <dependencySets>
             <dependencySet>
-                <outputDirectory>/lib</outputDirectory>
+                <outputDirectory>/lib/ranger-yarn-plugin-impl</outputDirectory>
                 <unpack>false</unpack>
                 <includes>
                     <include>org.apache.hadoop:hadoop-common:jar:${hadoop-common.version}</include>
@@ -54,8 +68,8 @@
                         <include>commons-configuration:commons-configuration:jar:${commons.configuration.version}</include>
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang:jar:${commons.lang.version}</include>
-                        <include>commons-logging:commons-logging</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
                         <include>junit:junit</include>
                         <include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>
@@ -66,7 +80,7 @@
                     </includes>
             </dependencySet>
         </dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+        <outputDirectory>/lib/ranger-yarn-plugin-impl</outputDirectory>
      </binaries>
      <includes>
 		<include>org.apache.ranger:ranger_solrj</include>
@@ -79,7 +93,7 @@
     </moduleSet>
     <moduleSet>
      <binaries>
-        <includeDependencies>false</includeDependencies>
+        <includeDependencies>true</includeDependencies>
         <outputDirectory>/install/lib</outputDirectory>
         <unpack>false</unpack>
      </binaries>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/src/main/assembly/storm-agent.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/storm-agent.xml b/src/main/assembly/storm-agent.xml
index 12ec052..a5f4b2c 100644
--- a/src/main/assembly/storm-agent.xml
+++ b/src/main/assembly/storm-agent.xml
@@ -30,9 +30,22 @@
         <unpack>false</unpack>
 	    <directoryMode>755</directoryMode>
 	    <fileMode>644</fileMode>
+  	    <outputDirectory>/lib</outputDirectory>
+     </binaries>
+     <includes>
+	  <include>security_plugins.ranger-storm-plugin-shim:ranger-storm-plugin-shim</include>
+	  <include>security_plugins.ranger-plugin-classloader:ranger-plugin-classloader</include>
+      </includes>
+    </moduleSet>
+    <moduleSet>
+     <binaries>
+        <includeDependencies>true</includeDependencies>
+        <unpack>false</unpack>
+	    <directoryMode>755</directoryMode>
+	    <fileMode>644</fileMode>
         <dependencySets>
             <dependencySet>
-                <outputDirectory>/lib</outputDirectory>
+                <outputDirectory>lib/ranger-storm-plugin-impl</outputDirectory>
                 <unpack>false</unpack>
                 <includes>
                     <include>commons-configuration:commons-configuration:jar:${commons.configuration.version}</include>
@@ -44,7 +57,7 @@
                     <include>commons-collections:commons-collections</include>
                     <include>com.sun.jersey:jersey-bundle</include>
                     <include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
-                    <include>com.google.guava:guava:jar:${guava.version}</include>
+                    <include>com.google.guava:guava:jar:${google.guava.version}</include>
                     <include>org.codehaus.jackson:jackson-jaxrs:jar:${codehaus.jackson.version}</include>
                     <include>org.codehaus.jackson:jackson-core-asl:jar:${codehaus.jackson.storm.version}</include>
                     <include>org.codehaus.jackson:jackson-mapper-asl:jar:${codehaus.jackson.storm.version}</include>
@@ -55,7 +68,7 @@
                     <include>com.google.protobuf:protobuf-java:jar:${protobuf-java.version}</include>
                     <include>org.apache.hadoop:hadoop-hdfs:jar:${hadoop.version}</include>
                     <include>org.apache.htrace:htrace-core:jar:${htrace-core.version}</include>
-                    <include>commons-cli:commons-cli:jar:${commons.cli.version}</include>
+                    <include>commons-cli:commons-cli:jar:${commons.cli.version}</include>

                     <include>commons-lang:commons-lang:jar:${commons.lang.version}</include>
                     <include>commons-io:commons-io:jar:${commons.io.version}</include>
                 </includes>
@@ -72,7 +85,7 @@
                         <include>commons-io:commons-io:jar:${commons.io.version}</include>
                         <include>commons-lang:commons-lang:jar:${commons.lang.version}</include>
                         <include>commons-logging:commons-logging</include>
-                        <include>com.google.guava:guava:jar:${guava.version}</include>
+                        <include>com.google.guava:guava:jar:${google.guava.version}</include>
                         <include>org.hamcrest:hamcrest-all</include>
                         <include>junit:junit</include>
                         <include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>
@@ -83,7 +96,7 @@
                     </includes>
             </dependencySet>
         </dependencySets>
-        <outputDirectory>/lib</outputDirectory>
+        <outputDirectory>lib/ranger-storm-plugin-impl</outputDirectory>
      </binaries>
      <includes>
 		<include>org.apache.ranger:ranger_solrj</include>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/a2c72902/storm-agent/src/main/java/com/xasecure/authorization/storm/authorizer/XaSecureStormAuthorizer.java
----------------------------------------------------------------------
diff --git a/storm-agent/src/main/java/com/xasecure/authorization/storm/authorizer/XaSecureStormAuthorizer.java
b/storm-agent/src/main/java/com/xasecure/authorization/storm/authorizer/XaSecureStormAuthorizer.java
deleted file mode 100644
index 723dd79..0000000
--- a/storm-agent/src/main/java/com/xasecure/authorization/storm/authorizer/XaSecureStormAuthorizer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package com.xasecure.authorization.storm.authorizer;
-
-import org.apache.ranger.authorization.storm.authorizer.RangerStormAuthorizer;
-
-/**
- * This class exists only to provide for seamless upgrade/downgrade capabilities.  Class
name is in storm conf which must allow for seamles upgrade and downgrade.
- * Thus when class names were changed XaSecure* -> Ranger* this shell class serves to
allow for seamles upgrade as well as downgrade.
- *
- * This class is final because if one needs to customize coprocessor it is expected that
RangerStormAuthorizer would be modified/extended as that is
- * the "real" authorizer!  This class, hence, should NEVER be more than an EMPTY shell!
- */
-final public class XaSecureStormAuthorizer extends RangerStormAuthorizer {
-}


Mime
View raw message