sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] sentry git commit: SENTRY-1667: Switching to Jetty v9 library (Sergio Pena, reviewed by Colm O hEigeartaigh and kalyan kumar kalvagadda)
Date Mon, 23 Oct 2017 08:45:59 GMT
SENTRY-1667: Switching to Jetty v9 library (Sergio Pena, reviewed by Colm O hEigeartaigh and
kalyan kumar kalvagadda)


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/1f77657c
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/1f77657c
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/1f77657c

Branch: refs/heads/akolb-cli
Commit: 1f77657c9d8f97cad48de614663c9d664cd698d6
Parents: fa78d25
Author: Sergio Pena <sergio.pena@cloudera.com>
Authored: Sun Oct 22 15:56:40 2017 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Sun Oct 22 15:56:40 2017 -0500

----------------------------------------------------------------------
 pom.xml                                         | 24 ++++++++++++++---
 sentry-binding/sentry-binding-solr/pom.xml      | 22 +++++++++++++++
 sentry-provider/sentry-provider-db/pom.xml      |  4 +--
 .../db/service/thrift/SentryWebServer.java      | 28 +++++++++++++++-----
 sentry-tests/sentry-tests-solr/pom.xml          | 10 +++++++
 sentry-tests/sentry-tests-sqoop/pom.xml         |  4 +--
 6 files changed, 79 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b1a04c4..af54480 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,7 @@ limitations under the License.
     <hive.version>2.0.0</hive.version>
     <jackson.version>1.8.8</jackson.version>
     <jdo-api.version>3.0.1</jdo-api.version>
-    <jettyVersion>8.1.19.v20160209</jettyVersion>
+    <jetty.version>9.3.21.v20170918</jetty.version>
     <joda-time.version>2.5</joda-time.version>
     <junit.version>4.10</junit.version>
     <kafka.version>0.11.0.1</kafka.version>
@@ -270,6 +270,12 @@ limitations under the License.
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-common</artifactId>
         <version>${hive.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.eclipse.jetty.aggregate</groupId>
+            <artifactId>jetty-all</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive.hcatalog</groupId>
@@ -285,6 +291,12 @@ limitations under the License.
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-metastore</artifactId>
         <version>${hive.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.eclipse.jetty.aggregate</groupId>
+            <artifactId>jetty-all</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
@@ -343,6 +355,12 @@ limitations under the License.
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-service</artifactId>
         <version>${hive.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.eclipse.jetty.aggregate</groupId>
+            <artifactId>jetty-all</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
@@ -610,12 +628,12 @@ limitations under the License.
       <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-server</artifactId>
-        <version>${jettyVersion}</version>
+        <version>${jetty.version}</version>
       </dependency>
       <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-servlet</artifactId>
-        <version>${jettyVersion}</version>
+        <version>${jetty.version}</version>
       </dependency>
     </dependencies>
   </dependencyManagement>

http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/sentry-binding/sentry-binding-solr/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-solr/pom.xml b/sentry-binding/sentry-binding-solr/pom.xml
index 9cb8d27..ed2624b 100644
--- a/sentry-binding/sentry-binding-solr/pom.xml
+++ b/sentry-binding/sentry-binding-solr/pom.xml
@@ -49,6 +49,28 @@ limitations under the License.
     <dependency>
       <groupId>org.apache.sentry</groupId>
       <artifactId>sentry-provider-db</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.eclipse.jetty</groupId>
+          <artifactId>jetty-server</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.eclipse.jetty</groupId>
+          <artifactId>jetty-util</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.eclipse.jetty</groupId>
+          <artifactId>jetty-http</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.eclipse.jetty</groupId>
+          <artifactId>jetty-http</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.eclipse.jetty</groupId>
+          <artifactId>jetty-servlet</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>

http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/sentry-provider/sentry-provider-db/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/pom.xml b/sentry-provider/sentry-provider-db/pom.xml
index 4481e08..cd19032 100644
--- a/sentry-provider/sentry-provider-db/pom.xml
+++ b/sentry-provider/sentry-provider-db/pom.xml
@@ -197,12 +197,12 @@ limitations under the License.
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-util</artifactId>
-      <version>${jettyVersion}</version>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-http</artifactId>
-      <version>${jettyVersion}</version>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>

http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
index 3f4a2ff..66a2f9e 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryWebServer.java
@@ -33,19 +33,23 @@ import java.util.Set;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
 import com.google.common.collect.Sets;
+import javax.servlet.DispatcherType;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
 import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
-import org.eclipse.jetty.server.DispatcherType;
+import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
 import org.eclipse.jetty.server.handler.ContextHandler;
 import org.eclipse.jetty.server.handler.ContextHandlerCollection;
 import org.eclipse.jetty.server.handler.ResourceHandler;
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
 import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
@@ -66,7 +70,7 @@ public class SentryWebServer {
     server = new Server();
 
     // Create a channel connector for "http/https" requests
-    SelectChannelConnector connector = new SelectChannelConnector();
+    ServerConnector connector;
     if (conf.getBoolean(ServerConfig.SENTRY_WEB_USE_SSL, false)) {
       SslContextFactory sslContextFactory = new SslContextFactory();
       sslContextFactory.setKeyStorePath(conf.get(ServerConfig.SENTRY_WEB_SSL_KEYSTORE_PATH,
""));
@@ -79,12 +83,24 @@ public class SentryWebServer {
           .split(Strings.nullToEmpty(conf.get(ServerConfig.SENTRY_SSL_PROTOCOL_BLACKLIST))));
       sslContextFactory.addExcludeProtocols(moreExcludedSSLProtocols.toArray(
           new String[moreExcludedSSLProtocols.size()]));
-      connector = new SslSelectChannelConnector(sslContextFactory);
+
+      HttpConfiguration httpConfiguration = new HttpConfiguration();
+      httpConfiguration.setSecurePort(port);
+      httpConfiguration.setSecureScheme("https");
+      httpConfiguration.addCustomizer(new SecureRequestCustomizer());
+
+      connector = new ServerConnector(
+          server,
+          new SslConnectionFactory(sslContextFactory, "http/1.1"),
+          new HttpConnectionFactory(httpConfiguration));
+
       LOGGER.info("Now using SSL mode.");
+    } else {
+      connector = new ServerConnector(server, new HttpConnectionFactory());
     }
 
     connector.setPort(port);
-    server.addConnector(connector);
+    server.setConnectors(new Connector[] { connector });
 
     ServletContextHandler servletContextHandler = new ServletContextHandler();
     ServletHolder servletHolder = new ServletHolder(AdminServlet.class);

http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/sentry-tests/sentry-tests-solr/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/pom.xml b/sentry-tests/sentry-tests-solr/pom.xml
index efb708c..311e441 100644
--- a/sentry-tests/sentry-tests-solr/pom.xml
+++ b/sentry-tests/sentry-tests-solr/pom.xml
@@ -63,6 +63,16 @@ limitations under the License.
       <version>6.1.26</version>
     </dependency>
     <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-server</artifactId>
+      <version>8.1.10.v20130312</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlet</artifactId>
+      <version>8.1.10.v20130312</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
       <exclusions>

http://git-wip-us.apache.org/repos/asf/sentry/blob/1f77657c/sentry-tests/sentry-tests-sqoop/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-sqoop/pom.xml b/sentry-tests/sentry-tests-sqoop/pom.xml
index 05b1653..6723c4d 100644
--- a/sentry-tests/sentry-tests-sqoop/pom.xml
+++ b/sentry-tests/sentry-tests-sqoop/pom.xml
@@ -66,12 +66,12 @@ limitations under the License.
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-servlet</artifactId>
-      <version>8.1.10.v20130312</version>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
-       <version>8.1.10.v20130312</version>
+       <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>


Mime
View raw message