You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by govind-menon <gi...@git.apache.org> on 2018/06/27 05:21:39 UTC
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
GitHub user govind-menon opened a pull request:
https://github.com/apache/storm/pull/2738
Storm 1311 Migration of UI from Clojure to Jersey/Grizzly I
This PR contains the basic frameworks and the GET requests. PUT's and storm.py changes to follow
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/govind-menon/storm STORM-1311-Jetty
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2738.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2738
----
commit 9c510968cdebcfb1d6e4df5f3b45d73173d6e81c
Author: Govind Menon <go...@...>
Date: 2018-05-29T19:57:41Z
STORM-1311: UI Migration from clj to java
commit 086f6c6f9cd0b30f47dd32be32e14aa36ead03f2
Author: Govind Menon <go...@...>
Date: 2018-06-01T17:41:35Z
STORM-1311: Using Jetty instead of Grizzly
commit 96b5b1aca60271431246167ae8f993ca678f661f
Author: Govind Menon <go...@...>
Date: 2018-06-27T05:17:50Z
STORM-1311: Adding all GET routes
----
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198541404
--- Diff: storm-core/pom.xml ---
@@ -170,6 +171,58 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey</groupId>
+ <artifactId>jersey-bom</artifactId>
+ <version>${jersey.version}</version>
+ <type>pom</type>
--- End diff --
Not supper familiar with this, but why do we need a pom? Is this just the instructions that they gave us?
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198547512
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
+
+ @Context
+ private HttpServletRequest servletRequest;
+
+
+ @Context
+ private ServletContext servletContext;
+
+ public static NimbusClient nimbusClient =
+ NimbusClient.getConfiguredClient(Utils.readStormConfig());
+
+ public static Map<String, Object> config = Utils.readStormConfig();
+ /**
+ * /api/v1/cluster/configuration -> nimbus configuration.
+ */
+
+ @GET
+ @Path("/cluster/configuration")
+ @Produces("application/json")
+ public String getClusterConfiguration() {
+ try {
+ return nimbusClient.getClient().getNimbusConf();
+ } catch (TException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * /api/v1/cluster/summary -> cluster summary.
+ */
+ @GET
+ @Path("/cluster/summary")
+ @Produces("application/json")
+ public String getClusterSummary() {
+ try {
+ String user = servletRequest.getRemoteUser();
+ return JSONValue.toJSONString(
--- End diff --
Where is the callback handling that was in before?
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198546447
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
+
+ @Context
+ private HttpServletRequest servletRequest;
+
+
+ @Context
+ private ServletContext servletContext;
+
+ public static NimbusClient nimbusClient =
+ NimbusClient.getConfiguredClient(Utils.readStormConfig());
+
+ public static Map<String, Object> config = Utils.readStormConfig();
+ /**
+ * /api/v1/cluster/configuration -> nimbus configuration.
+ */
+
+ @GET
+ @Path("/cluster/configuration")
+ @Produces("application/json")
+ public String getClusterConfiguration() {
+ try {
+ return nimbusClient.getClient().getNimbusConf();
+ } catch (TException e) {
+ e.printStackTrace();
--- End diff --
In the old code any exception was turned into a 500 error. We should look at using exception mapping, I think DRPC does this.
And this goes everywhere.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198554010
--- Diff: storm-core/src/jvm/org/apache/storm/ui/filters/AuthorizedUserFilter.java ---
@@ -0,0 +1,120 @@
+/*
+ * 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.storm.ui.filters;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.StringJoiner;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.PathSegment;
+import javax.ws.rs.ext.Provider;
+
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.daemon.StormCommon;
+import org.apache.storm.generated.AuthorizationException;
+import org.apache.storm.security.auth.IAuthorizer;
+import org.apache.storm.security.auth.ReqContext;
+import org.apache.storm.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Provider
+public class AuthorizedUserFilter implements ContainerRequestFilter {
+
+ public static final Logger LOG = LoggerFactory.getLogger(AuthorizedUserFilter.class);
+ public static Map<String, Object> conf = Utils.readStormConfig();
+ public static IAuthorizer uiImpersonationHandler;
+ public static IAuthorizer uiAclHandler;
+
+ static {
+ try {
+ uiImpersonationHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_IMPERSONATION_AUTHORIZER), conf);
+ uiAclHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_AUTHORIZER), conf);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void filter(ContainerRequestContext containerRequestContext) throws IOException {
+ List<PathSegment> matchedOps = containerRequestContext.getUriInfo().getPathSegments();
+
+ matchedOps = matchedOps.subList(2, matchedOps.size());
+
+ StringJoiner stringJoiner = new StringJoiner("/");
+ for (PathSegment matchedOp : matchedOps) {
+ stringJoiner.add(matchedOp.getPath());
+ }
+
+ String op = stringJoiner.toString();
+
+ ReqContext reqContext = ReqContext.context();
+
+ if (reqContext.isImpersonating()) {
+ if (uiImpersonationHandler != null) {
+ if (!uiImpersonationHandler.permit(reqContext, op, null)) {
+ Principal realPrincipal = reqContext.realPrincipal();
+ Principal principal = reqContext.principal();
+ String user = "unknown";
+ if (principal != null) {
+ user = principal.getName();
+ }
+ String realUser = "unknown";
+ if (realPrincipal != null) {
+ realUser = realPrincipal.getName();
+ }
+ InetAddress remoteAddress = reqContext.remoteAddress();
+
+ throw new IOException(
+ "user '" + realUser + "' is not authorized to impersonate user '"
+ + user + "' from host '" + remoteAddress.toString() + "'. Please"
+ + "see SECURITY.MD to learn how to configure impersonation ACL."
+ );
+ }
+
+ LOG.warn(" principal " + reqContext.realPrincipal().toString() + " is trying to impersonate "
+ + reqContext.principal().toString() + " but "
+ + conf.get(DaemonConfig.NIMBUS_IMPERSONATION_AUTHORIZER)
+ + " has no authorizer configured. This is a potential security hole."
+ + "Please see SECURITY.MD to learn how to configure an impersonation authorizer.");
+ }
+ }
+
+ if (uiAclHandler != null) {
+ if (!uiAclHandler.permit(reqContext, op, null)) {
--- End diff --
For some operations the topology config is required to be able to check if the user is allowed to perform this operation. Here it is always null, and will likely result in NPEs when security is enabled.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198543006
--- Diff: storm-core/src/jvm/org/apache/storm/ui/Main.java ---
@@ -0,0 +1,82 @@
+/*
+ * 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.storm.ui;
+
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.daemon.drpc.webapp.ReqContextFilter;
+import org.apache.storm.security.auth.IHttpCredentialsPlugin;
+import org.apache.storm.security.auth.ServerAuthUtils;
+import org.apache.storm.ui.filters.AuthorizedUserFilter;
+import org.apache.storm.utils.Utils;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.servlet.ServletContainer;
+
+import javax.servlet.DispatcherType;
+import java.util.EnumSet;
+import java.util.Map;
+
+/**
+ * Main class.
+ *
+ */
+public class Main {
+
+ public static void addRequestContextFilter(ServletContextHandler context,
+ String configName, Map<String, Object> conf) {
+ IHttpCredentialsPlugin auth = ServerAuthUtils.getHttpCredentialsPlugin(conf, (String) conf.get(configName));
+ ReqContextFilter filter = new ReqContextFilter(auth);
+ context.addFilter(new FilterHolder(filter), "/*", EnumSet.allOf(DispatcherType.class));
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ Map<String, Object> conf = Utils.readStormConfig();
+
+ ResourceConfig config = new ResourceConfig().packages("org.apache.storm.ui.resources")
+ .register(AuthorizedUserFilter.class);
+
+
+ ServletHolder jerseyServlet = new ServletHolder(new ServletContainer(config));
+ jerseyServlet.setInitOrder(0);
+
+
+ ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ context.setContextPath("/");
+
+
+ Server jettyServer = new Server(4443);
--- End diff --
I thought the port that we bound to was from a config.
---
[GitHub] storm issue #2738: Storm 1311 Migration of UI from Clojure to Jersey/Grizzly...
Posted by govind-menon <gi...@git.apache.org>.
Github user govind-menon commented on the issue:
https://github.com/apache/storm/pull/2738
PR is missing a lot of changes - will put up again in some time.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by govind-menon <gi...@git.apache.org>.
Github user govind-menon closed the pull request at:
https://github.com/apache/storm/pull/2738
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198555599
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
+
+ @Context
+ private HttpServletRequest servletRequest;
+
+
+ @Context
+ private ServletContext servletContext;
--- End diff --
This is not used can we remove it?
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198541582
--- Diff: storm-core/pom.xml ---
@@ -170,6 +171,58 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey</groupId>
+ <artifactId>jersey-bom</artifactId>
+ <version>${jersey.version}</version>
+ <type>pom</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-http</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-servlet</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-grizzly2</artifactId>
+ <version>1.19.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-grizzly2-servlet</artifactId>
+ <version>1.19.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.grizzly</groupId>
+ <artifactId>grizzly-framework</artifactId>
+ <version>2.4.3</version>
--- End diff --
nit: and this one too, a property instead of a hard coded version, that is used in multiple places.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198553532
--- Diff: storm-core/src/jvm/org/apache/storm/ui/filters/AuthorizedUserFilter.java ---
@@ -0,0 +1,120 @@
+/*
+ * 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.storm.ui.filters;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.StringJoiner;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.PathSegment;
+import javax.ws.rs.ext.Provider;
+
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.daemon.StormCommon;
+import org.apache.storm.generated.AuthorizationException;
+import org.apache.storm.security.auth.IAuthorizer;
+import org.apache.storm.security.auth.ReqContext;
+import org.apache.storm.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Provider
+public class AuthorizedUserFilter implements ContainerRequestFilter {
+
+ public static final Logger LOG = LoggerFactory.getLogger(AuthorizedUserFilter.class);
+ public static Map<String, Object> conf = Utils.readStormConfig();
+ public static IAuthorizer uiImpersonationHandler;
+ public static IAuthorizer uiAclHandler;
+
+ static {
+ try {
+ uiImpersonationHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_IMPERSONATION_AUTHORIZER), conf);
+ uiAclHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_AUTHORIZER), conf);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void filter(ContainerRequestContext containerRequestContext) throws IOException {
+ List<PathSegment> matchedOps = containerRequestContext.getUriInfo().getPathSegments();
+
+ matchedOps = matchedOps.subList(2, matchedOps.size());
+
+ StringJoiner stringJoiner = new StringJoiner("/");
+ for (PathSegment matchedOp : matchedOps) {
+ stringJoiner.add(matchedOp.getPath());
+ }
+
+ String op = stringJoiner.toString();
--- End diff --
This does not work for creating the op from a URL. The ops that implementations of IAuthorizer expect are things like "getClusterInfo" not "cluster/summary".
---
[GitHub] storm issue #2738: Storm 1311 Migration of UI from Clojure to Jersey/Grizzly...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on the issue:
https://github.com/apache/storm/pull/2738
Can I suggest perhaps a different path forward? instead of creating the jersey/jackson server part first, instead start migrating the ui implementation to java first while writing some unit tests for them, and then put in the final part that replaces the routing.
i.e.
replace `cluster-summary` with `UIHelpers.getClusterInfo`, write unit tests for `UIHelpers.getClusterInfo` and then verify that the UI works as expected.
Then try replacing `json-resonse` everywhere in `core.clj` with something new in `UIHelpers`...
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198545289
--- Diff: storm-client/src/jvm/org/apache/storm/Constants.java ---
@@ -55,5 +55,7 @@
public static final String COMMON_ONHEAP_MEMORY_RESOURCE_NAME = "onheap.memory.mb";
public static final String COMMON_OFFHEAP_MEMORY_RESOURCE_NAME = "offheap.memory.mb";
public static final String COMMON_TOTAL_MEMORY_RESOURCE_NAME = "memory.mb";
+
+ public static final String STORM_API_URL_PREFIX = "/api/v1/";
--- End diff --
This is never used.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198544238
--- Diff: storm-core/src/jvm/org/apache/storm/ui/UiHelpers.java ---
@@ -0,0 +1,1266 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.storm.ui;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableMap;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import javax.servlet.DispatcherType;
+import javax.servlet.Servlet;
+import javax.ws.rs.core.SecurityContext;
+
+import com.google.common.collect.Lists;
+import org.apache.storm.Config;
+import org.apache.storm.Constants;
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.generated.Bolt;
+import org.apache.storm.generated.BoltAggregateStats;
+import org.apache.storm.generated.ClusterSummary;
+import org.apache.storm.generated.CommonAggregateStats;
+import org.apache.storm.generated.ComponentAggregateStats;
+import org.apache.storm.generated.ComponentPageInfo;
+import org.apache.storm.generated.ExecutorInfo;
+import org.apache.storm.generated.ExecutorSummary;
+import org.apache.storm.generated.GetInfoOptions;
+import org.apache.storm.generated.GlobalStreamId;
+import org.apache.storm.generated.Grouping;
+import org.apache.storm.generated.LogConfig;
+import org.apache.storm.generated.LogLevel;
+import org.apache.storm.generated.Nimbus;
+import org.apache.storm.generated.NumErrorsChoice;
+import org.apache.storm.generated.OwnerResourceSummary;
+import org.apache.storm.generated.ProfileAction;
+import org.apache.storm.generated.ProfileRequest;
+import org.apache.storm.generated.SpoutSpec;
+import org.apache.storm.generated.StormTopology;
+import org.apache.storm.generated.SupervisorPageInfo;
+import org.apache.storm.generated.SupervisorSummary;
+import org.apache.storm.generated.TopologyHistoryInfo;
+import org.apache.storm.generated.TopologyInfo;
+import org.apache.storm.generated.TopologyPageInfo;
+import org.apache.storm.generated.TopologyStats;
+import org.apache.storm.generated.TopologySummary;
+import org.apache.storm.generated.WorkerSummary;
+import org.apache.storm.logging.filters.AccessLoggingFilter;
+import org.apache.storm.stats.StatsUtil;
+import org.apache.storm.utils.ObjectReader;
+import org.apache.storm.utils.TopologySpoutLag;
+import org.apache.storm.utils.Utils;
+import org.apache.storm.utils.VersionInfo;
+import org.apache.storm.utils.WebAppUtils;
+import org.apache.thrift.TException;
+import org.eclipse.jetty.http.HttpStatus;
+import org.eclipse.jetty.http.HttpVersion;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.servlets.CrossOriginFilter;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.json.simple.JSONValue;
+
+public class UiHelpers {
--- End diff --
Can we please not just change the capitalization of files. git and HSF+ (which is case insensitive) really don't like this, and I am going to have to jump through hoops each time I go from one branch to another. I cannot even merge in your pull request on the mac because of this.
Also because of how this was moved I have no way of knowing what changed and what didn't. You changed so much git no longer considers it a move, but a rewrite.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198543401
--- Diff: storm-core/src/jvm/org/apache/storm/ui/Main.java ---
@@ -0,0 +1,82 @@
+/*
+ * 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.storm.ui;
+
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.daemon.drpc.webapp.ReqContextFilter;
+import org.apache.storm.security.auth.IHttpCredentialsPlugin;
+import org.apache.storm.security.auth.ServerAuthUtils;
+import org.apache.storm.ui.filters.AuthorizedUserFilter;
+import org.apache.storm.utils.Utils;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.servlet.ServletContainer;
+
+import javax.servlet.DispatcherType;
+import java.util.EnumSet;
+import java.util.Map;
+
+/**
+ * Main class.
+ *
+ */
+public class Main {
+
+ public static void addRequestContextFilter(ServletContextHandler context,
+ String configName, Map<String, Object> conf) {
+ IHttpCredentialsPlugin auth = ServerAuthUtils.getHttpCredentialsPlugin(conf, (String) conf.get(configName));
+ ReqContextFilter filter = new ReqContextFilter(auth);
+ context.addFilter(new FilterHolder(filter), "/*", EnumSet.allOf(DispatcherType.class));
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ Map<String, Object> conf = Utils.readStormConfig();
+
+ ResourceConfig config = new ResourceConfig().packages("org.apache.storm.ui.resources")
+ .register(AuthorizedUserFilter.class);
+
+
+ ServletHolder jerseyServlet = new ServletHolder(new ServletContainer(config));
+ jerseyServlet.setInitOrder(0);
+
+
+ ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ context.setContextPath("/");
+
+
+ Server jettyServer = new Server(4443);
+ jettyServer.setHandler(context);
+
+ addRequestContextFilter(context, DaemonConfig.DRPC_HTTP_CREDS_PLUGIN, conf);
--- End diff --
Why are we adding the the DRPC creds plugin to the UI?
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198557270
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
+
+ @Context
+ private HttpServletRequest servletRequest;
+
+
+ @Context
+ private ServletContext servletContext;
+
+ public static NimbusClient nimbusClient =
+ NimbusClient.getConfiguredClient(Utils.readStormConfig());
+
+ public static Map<String, Object> config = Utils.readStormConfig();
+ /**
+ * /api/v1/cluster/configuration -> nimbus configuration.
+ */
+
+ @GET
+ @Path("/cluster/configuration")
+ @Produces("application/json")
+ public String getClusterConfiguration() {
+ try {
+ return nimbusClient.getClient().getNimbusConf();
+ } catch (TException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * /api/v1/cluster/summary -> cluster summary.
+ */
+ @GET
+ @Path("/cluster/summary")
+ @Produces("application/json")
+ public String getClusterSummary() {
+ try {
+ String user = servletRequest.getRemoteUser();
+ return JSONValue.toJSONString(
+ UiHelpers.getClusterSummary(
+ nimbusClient.getClient().getClusterInfo(), user, config)
+ );
+ } catch (TException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * /api/v1/nimbus/summary -> nimbus summary.
+ */
+ @GET
+ @Path("/nimbus/summary")
+ @Produces("application/json")
+ public String getNimbusSummary() {
+ try {
+ String user = servletRequest.getRemoteUser();
+ return JSONValue.toJSONString(
--- End diff --
Nimbus summary is not just a cluster summary.
```
(defn nimbus-summary
([secure?]
(thrift/with-configured-nimbus-connection nimbus
(nimbus-summary
(.get_nimbuses (.getClusterInfo ^Nimbus$Client nimbus)) secure?)))
([nimbuses secure?]
(let [nimbus-seeds (set (map #(str %1 ":" (*STORM-CONF* NIMBUS-THRIFT-PORT)) (remove #(Utils/isLocalhostAddress %) (set (*STORM-CONF* NIMBUS-SEEDS)))))
alive-nimbuses (set (map #(str (.get_host %1) ":" (.get_port %1)) nimbuses))
offline-nimbuses (clojure.set/difference nimbus-seeds alive-nimbuses)
offline-nimbuses-summary (map #(convert-to-nimbus-summary %1) offline-nimbuses)]
{"nimbuses"
(concat offline-nimbuses-summary
(for [^NimbusSummary n nimbuses
:let [uptime (.get_uptime_secs n)]]
{
"host" (.get_host n)
"port" (.get_port n)
"nimbusLogLink" (nimbus-log-link (.get_host n) secure?)
"status" (if (.is_isLeader n) "Leader" "Not a Leader")
"version" (.get_version n)
"nimbusUpTime" (UIHelpers/prettyUptimeSec uptime)
"nimbusUpTimeSeconds" uptime}))})))
```
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198555396
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
--- End diff --
This is not used, can we remove it?
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198549134
--- Diff: storm-core/src/jvm/org/apache/storm/ui/resources/StormApiResource.java ---
@@ -0,0 +1,374 @@
+/*
+ * 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.storm.ui.resources;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.storm.ui.UiHelpers;
+import org.apache.storm.utils.NimbusClient;
+import org.apache.storm.utils.Utils;
+import org.apache.thrift.TException;
+import org.json.simple.JSONValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Root resource (exposed at "storm" path).
+ */
+@Path("/api/v1/")
+public class StormApiResource {
+
+ public static final Logger LOG = LoggerFactory.getLogger(StormApiResource.class);
+
+ @Context
+ private UriInfo info;
+
+ @Context
+ private HttpServletRequest servletRequest;
+
+
+ @Context
+ private ServletContext servletContext;
+
+ public static NimbusClient nimbusClient =
--- End diff --
The old code `thrift/with-configured-nimbus-connection` checks impersonation and we need to have an equivalent here.
```
(defmacro with-configured-nimbus-connection
[client-sym & body]
`(let [conf# (clojurify-structure (ConfigUtils/readStormConfig))
context# (ReqContext/context)
user# (if (.principal context#) (.getName (.principal context#)))
nimbusClient# (NimbusClient/getConfiguredClientAs conf# user#)
~client-sym (.getClient nimbusClient#)
conn# (.transport nimbusClient#)
]
(try
~@body
(finally (.close conn#)))))
```
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198544889
--- Diff: storm-core/src/jvm/org/apache/storm/ui/filters/AuthorizedUserFilter.java ---
@@ -0,0 +1,120 @@
+/*
+ * 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.storm.ui.filters;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.StringJoiner;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.PathSegment;
+import javax.ws.rs.ext.Provider;
+
+import org.apache.storm.DaemonConfig;
+import org.apache.storm.daemon.StormCommon;
+import org.apache.storm.generated.AuthorizationException;
+import org.apache.storm.security.auth.IAuthorizer;
+import org.apache.storm.security.auth.ReqContext;
+import org.apache.storm.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Provider
+public class AuthorizedUserFilter implements ContainerRequestFilter {
+
+ public static final Logger LOG = LoggerFactory.getLogger(AuthorizedUserFilter.class);
+ public static Map<String, Object> conf = Utils.readStormConfig();
+ public static IAuthorizer uiImpersonationHandler;
+ public static IAuthorizer uiAclHandler;
+
+ static {
+ try {
+ uiImpersonationHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_IMPERSONATION_AUTHORIZER), conf);
+ uiAclHandler = StormCommon.mkAuthorizationHandler(
+ (String) conf.get(DaemonConfig.NIMBUS_AUTHORIZER), conf);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
--- End diff --
We need to do more than just print a stack trace if we cannot make these classes, because it is going to quietly disable security.
---
[GitHub] storm pull request #2738: Storm 1311 Migration of UI from Clojure to Jersey/...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2738#discussion_r198541159
--- Diff: storm-core/pom.xml ---
@@ -170,6 +171,58 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey</groupId>
+ <artifactId>jersey-bom</artifactId>
+ <version>${jersey.version}</version>
+ <type>pom</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-http</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-servlet</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-grizzly2</artifactId>
+ <version>1.19.4</version>
--- End diff --
nit: can we make this a property too?
---