mirror of https://github.com/apache/nifi.git
NIFI-11703 Upgraded to Spring Framework 6 and Jetty 12
- Upgraded Spring Framework from 5.3.31 to 6.0.15 - Upgraded Spring Security from 5.8.7 to 6.2.0 - Upgraded Spring Vault from 2.3.4 to 3.1.0 - Upgraded Jetty from 10.0.18 to 12.0.5 with EE 10 - Upgraded Jersey from 2.41 to 3.1.4 - Upgraded JAXB from 2.3.9 to 4.0.4 - Upgraded AspectJ from 1.9.20.1 to 1.9.21 - Upgraded JMS API from 2.0.1 to 3.1.0 - Upgraded ActiveMQ Broker from 5.18.2 to 6.0.1 for JMS 3 - Upgraded JJWT from 0.9.1 to 0.12.3 - Replaced jackson-module-jaxb-annotations with jackson-module-jakarta-xmlbind-annotations - Replaced maven-jaxb2-plugin with hisrc-higherjaxb40-maven-plugin 2.1.1 - Replaced kongchen swagger-maven-plugin with swagger-codegen-maven-plugin from Swagger 3 - Replaced com.nickwongdev AspectJ Plugin with Codehaus 1.14.0 for newer Java versions - Removed unused cglib-nodep - Removed references to javax.validation - Removed custom Jetty ALPN Processor not required for Java 21 - Removed several tests depending on older Jetty and Jakarta libraries - Removed unnecessary webdefault.xml configurations - Replaced unsupported cross-context servlet forwarding with HTTP forwarding - Replaced javax.servlet references with jakarta.servlet - Replaced javax.xml.bind references with jakarta.xml.bind - Replaced javax.ws references with jakarata.ws - Updated Spring Security CSRF implementation for Spring Security 6 - Updated web.xml versions to 6.0 - Updated REST API templates using new swagger-codegen variables - Removed VALIDATE_DATA property from ParseCEF based on library compatibility issue with javax.validation - Added application URL logging to NiFi JettyServer Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #8197.
This commit is contained in:
parent
4dc0d44dc4
commit
42547eb60c
|
@ -604,23 +604,22 @@ The following binary components are provided under the Common Development and Di
|
|||
(CDDL 1.1) (GPL2 w/ CPE) hk2-utils (org.glassfish.hk2:hk2-utils:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) hk2-locator (org.glassfish.hk2:hk2-locator:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) aopalliance-repackaged (org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42 - https://hk2.java.net/external/javax.inject)
|
||||
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (compat) (javax.mail:mail:jar:1.4.7 - https://kenai.com/projects/javamail/mail)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation (org.glassfish.web:javax.servlet.jsp:jar:2.3.2 - https://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation (org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.2 - https://jstl.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 (org.glassfish:javax.el:jar:3.0.0 - https://el-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API (javax.servlet.jsp:javax.servlet.jsp-api:jar:2.3.1 - https://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API (javax.el:javax.el-api:jar:3.0.0 - https://uel-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API (javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:jar:1.2.1 - https://jcp.org/en/jsr/detail?id=52)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Java Servlet API (javax.servlet:javax.servlet-api:jar:3.1.0 - https://servlet-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Javax JMS Api (javax.jms:javax.jms-api:jar:2.0.1 - https://java.net/projects/jms-spec/pages/Home)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing API (javax.json:javax.json-api:jar:1.0 - https://json-processing-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing Default Provider (org.glassfish:javax.json:jar:1.0.4 - https://jsonp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle (org.glassfish.hk2:osgi-resource-locator:jar:1.0.1 - https://glassfish.org/osgi-resource-locator)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.annotation API (javax.annotation:javax.annotation-api:jar:1.3.2 - https://jcp.org/en/jsr/detail?id=250)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b25 - https://hk2.java.net/external/javax.inject)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.1 - https://jax-rs-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Servlet API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JMS API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing Default Provider
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Annotation API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Inject API as OSGi bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta WS REST Services API
|
||||
|
||||
************************
|
||||
Common Development and Distribution License 1.0
|
||||
|
|
|
@ -154,8 +154,8 @@ limitations under the License.
|
|||
<type>nar</type>
|
||||
</dependency>
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -273,8 +273,8 @@ limitations under the License.
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<groupId>org.eclipse.jetty.ee10</groupId>
|
||||
<artifactId>jetty-ee10-servlet</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -97,6 +97,11 @@ limitations under the License.
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
|
|
|
@ -31,13 +31,10 @@ import java.io.UncheckedIOException;
|
|||
import java.net.URI;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.KeyStore;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Supplier;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.nifi.jetty.configuration.connector.StandardServerConnectorFactory;
|
||||
import org.apache.nifi.minifi.bootstrap.ConfigurationFileHolder;
|
||||
import org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeNotifier;
|
||||
|
@ -50,11 +47,14 @@ import org.apache.nifi.security.ssl.StandardSslContextBuilder;
|
|||
import org.apache.nifi.security.util.KeystoreType;
|
||||
import org.apache.nifi.security.util.TlsPlatform;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -115,7 +115,7 @@ public class RestChangeIngestor implements ChangeIngestor {
|
|||
|
||||
this.configurationChangeNotifier = configurationChangeNotifier;
|
||||
|
||||
HandlerCollection handlerCollection = new HandlerCollection(true);
|
||||
final ContextHandlerCollection handlerCollection = new ContextHandlerCollection();
|
||||
handlerCollection.addHandler(new JettyHandler());
|
||||
this.jetty.setHandler(handlerCollection);
|
||||
}
|
||||
|
@ -235,23 +235,20 @@ public class RestChangeIngestor implements ChangeIngestor {
|
|||
this.differentiator = differentiator;
|
||||
}
|
||||
|
||||
private class JettyHandler extends AbstractHandler {
|
||||
private class JettyHandler extends Handler.Abstract {
|
||||
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException {
|
||||
public boolean handle(Request request, Response response, Callback callback) {
|
||||
|
||||
logRequest(request);
|
||||
|
||||
baseRequest.setHandled(true);
|
||||
|
||||
if (POST.equals(request.getMethod())) {
|
||||
int statusCode;
|
||||
String responseText;
|
||||
try {
|
||||
ByteBuffer newFlowConfig = wrap(toByteArray(request.getInputStream())).duplicate();
|
||||
ByteBuffer newFlowConfig = wrap(toByteArray(Request.asInputStream(request))).duplicate();
|
||||
if (differentiator.isNew(newFlowConfig)) {
|
||||
Collection<ListenerHandleResult> listenerHandleResults = configurationChangeNotifier.notifyListeners(newFlowConfig);
|
||||
java.util.Collection<ListenerHandleResult> listenerHandleResults = configurationChangeNotifier.notifyListeners(newFlowConfig);
|
||||
|
||||
statusCode = 200;
|
||||
for (ListenerHandleResult result : listenerHandleResults) {
|
||||
|
@ -271,15 +268,17 @@ public class RestChangeIngestor implements ChangeIngestor {
|
|||
responseText = "Failed to override config file";
|
||||
}
|
||||
|
||||
writeOutput(response, responseText, statusCode);
|
||||
writeOutput(request, response, responseText, statusCode);
|
||||
} else if (GET.equals(request.getMethod())) {
|
||||
writeOutput(response, GET_TEXT, 200);
|
||||
writeOutput(request, response, GET_TEXT, 200);
|
||||
} else {
|
||||
writeOutput(response, OTHER_TEXT, 404);
|
||||
writeOutput(request, response, OTHER_TEXT, 404);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getPostText(Collection<ListenerHandleResult> listenerHandleResults) {
|
||||
private String getPostText(java.util.Collection<ListenerHandleResult> listenerHandleResults) {
|
||||
StringBuilder postResult = new StringBuilder("The result of notifying listeners:\n");
|
||||
|
||||
for (ListenerHandleResult result : listenerHandleResults) {
|
||||
|
@ -290,22 +289,23 @@ public class RestChangeIngestor implements ChangeIngestor {
|
|||
return postResult.toString();
|
||||
}
|
||||
|
||||
private void writeOutput(HttpServletResponse response, String responseText, int responseCode) throws IOException {
|
||||
private void writeOutput(Request request, Response response, String responseText, int responseCode) {
|
||||
response.setStatus(responseCode);
|
||||
response.setContentType("text/plain");
|
||||
response.setContentLength(responseText.length());
|
||||
try (PrintWriter writer = response.getWriter()) {
|
||||
response.getHeaders().put(HttpHeader.CONTENT_TYPE, "text/plain");
|
||||
response.getHeaders().put(HttpHeader.CONTENT_LENGTH, responseText.length());
|
||||
|
||||
try (PrintWriter writer = new PrintWriter(Response.asBufferedOutputStream(request, response))) {
|
||||
writer.print(responseText);
|
||||
writer.flush();
|
||||
}
|
||||
}
|
||||
|
||||
private void logRequest(HttpServletRequest request) {
|
||||
private void logRequest(Request request) {
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
logger.info("request method = " + request.getMethod());
|
||||
logger.info("request url = " + request.getRequestURL());
|
||||
logger.info("context path = " + request.getContextPath());
|
||||
logger.info("request content type = " + request.getContentType());
|
||||
logger.info("request url = " + request.getHttpURI());
|
||||
logger.info("context path = " + request.getContext().getContextPath());
|
||||
logger.info("request content type = " + request.getHeaders().get(HttpHeader.CONTENT_TYPE));
|
||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,228 +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 org.apache.nifi.minifi.bootstrap.configuration.ingestors;
|
||||
|
||||
import static org.apache.nifi.minifi.bootstrap.configuration.ingestors.PullHttpChangeIngestor.PATH_KEY;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeListener;
|
||||
import org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeNotifier;
|
||||
import org.apache.nifi.minifi.bootstrap.configuration.ListenerHandleResult;
|
||||
import org.apache.nifi.minifi.bootstrap.configuration.differentiators.Differentiator;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
public abstract class PullHttpChangeIngestorCommonTest {
|
||||
|
||||
public static final String FLOW_JSON = "/flow.json";
|
||||
public static volatile Server jetty;
|
||||
public static volatile int port;
|
||||
public static volatile PullHttpChangeIngestor pullHttpChangeIngestor;
|
||||
public static ConfigurationChangeNotifier testNotifier = Mockito.mock(ConfigurationChangeNotifier.class);
|
||||
public static Differentiator<ByteBuffer> mockDifferentiator = Mockito.mock(Differentiator.class);
|
||||
public static final String RESPONSE_STRING = "test";
|
||||
public static final String PATH_RESPONSE_STRING = "path";
|
||||
public static ByteBuffer configBuffer = ByteBuffer.wrap(RESPONSE_STRING.getBytes());
|
||||
public static ByteBuffer pathConfigBuffer = ByteBuffer.wrap(PATH_RESPONSE_STRING.getBytes());
|
||||
public static final String ETAG = "testEtag";
|
||||
public static final String QUOTED_ETAG = "\"testEtag\"";
|
||||
|
||||
public static void init() {
|
||||
QueuedThreadPool queuedThreadPool = new QueuedThreadPool();
|
||||
queuedThreadPool.setDaemon(true);
|
||||
jetty = new Server(queuedThreadPool);
|
||||
|
||||
HandlerCollection handlerCollection = new HandlerCollection(true);
|
||||
handlerCollection.addHandler(new JettyHandler(RESPONSE_STRING, PATH_RESPONSE_STRING));
|
||||
jetty.setHandler(handlerCollection);
|
||||
}
|
||||
|
||||
public abstract void pullHttpChangeIngestorInit(Properties properties) throws IOException;
|
||||
|
||||
@BeforeEach
|
||||
public void setListeners() {
|
||||
Mockito.reset(testNotifier);
|
||||
ConfigurationChangeListener testListener = Mockito.mock(ConfigurationChangeListener.class);
|
||||
when(testListener.getDescriptor()).thenReturn("MockChangeListener");
|
||||
Mockito.when(testNotifier.notifyListeners(Mockito.any())).thenReturn(Collections.singleton(new ListenerHandleResult(testListener)));
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void shutdown() throws Exception {
|
||||
jetty.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewUpdate() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setUseEtag(false);
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(true);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.eq(configBuffer.asReadOnlyBuffer()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoUpdate() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setUseEtag(false);
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(false);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseEtag() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setLastEtag("");
|
||||
|
||||
pullHttpChangeIngestor.setUseEtag(true);
|
||||
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(true);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.eq(configBuffer));
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewUpdateWithPath() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PATH_KEY, FLOW_JSON);
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setUseEtag(false);
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(true);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.eq(pathConfigBuffer.asReadOnlyBuffer()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoUpdateWithPath() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
properties.put(PATH_KEY, FLOW_JSON);
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setUseEtag(false);
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(false);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseEtagWithPath() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
properties.put(PATH_KEY, FLOW_JSON);
|
||||
pullHttpChangeIngestorInit(properties);
|
||||
pullHttpChangeIngestor.setLastEtag("");
|
||||
|
||||
pullHttpChangeIngestor.setUseEtag(true);
|
||||
|
||||
when(mockDifferentiator.isNew(Mockito.any(ByteBuffer.class))).thenReturn(true);
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.eq(pathConfigBuffer.asReadOnlyBuffer()));
|
||||
|
||||
pullHttpChangeIngestor.run();
|
||||
|
||||
verify(testNotifier, Mockito.times(1)).notifyListeners(Mockito.any());
|
||||
}
|
||||
|
||||
static class JettyHandler extends AbstractHandler {
|
||||
volatile String configResponse;
|
||||
volatile String pathResponse;
|
||||
|
||||
public JettyHandler(String configResponse, String pathResponse) {
|
||||
this.configResponse = configResponse;
|
||||
this.pathResponse = pathResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException {
|
||||
|
||||
baseRequest.setHandled(true);
|
||||
|
||||
if ("GET".equals(request.getMethod())) {
|
||||
|
||||
if (QUOTED_ETAG.equals(baseRequest.getHeader("If-None-Match"))) {
|
||||
writeOutput(response, null, 304);
|
||||
} else {
|
||||
if (FLOW_JSON.equals(baseRequest.getPathInfo())) {
|
||||
writeOutput(response, pathResponse, 200);
|
||||
} else {
|
||||
writeOutput(response, configResponse, 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
writeOutput(response, "not a GET request", 404);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeOutput(HttpServletResponse response, String responseBuffer, int responseCode) throws IOException {
|
||||
response.setStatus(responseCode);
|
||||
response.setHeader("ETag", ETAG);
|
||||
if (responseBuffer != null) {
|
||||
response.setContentType("text/plain");
|
||||
response.setContentLength(responseBuffer.length());
|
||||
response.setCharacterEncoding(StandardCharsets.UTF_8.displayName());
|
||||
try (PrintWriter writer = response.getWriter()) {
|
||||
writer.print(responseBuffer);
|
||||
writer.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,88 +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 org.apache.nifi.minifi.bootstrap.configuration.ingestors;
|
||||
|
||||
import static org.apache.nifi.minifi.bootstrap.configuration.ingestors.PullHttpChangeIngestor.PULL_HTTP_BASE_KEY;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import org.apache.nifi.minifi.bootstrap.ConfigurationFileHolder;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
public class PullHttpChangeIngestorSSLTest extends PullHttpChangeIngestorCommonTest {
|
||||
|
||||
@BeforeAll
|
||||
public static void setUp() throws Exception {
|
||||
PullHttpChangeIngestorCommonTest.init();
|
||||
|
||||
SslContextFactory.Server ssl = new SslContextFactory.Server();
|
||||
|
||||
ssl.setKeyStorePath("./src/test/resources/localhost-ks.jks");
|
||||
ssl.setKeyStorePassword("localtest");
|
||||
ssl.setKeyStoreType("JKS");
|
||||
ssl.setTrustStorePath("./src/test/resources/localhost-ts.jks");
|
||||
ssl.setTrustStorePassword("localtest");
|
||||
ssl.setTrustStoreType("JKS");
|
||||
ssl.setNeedClientAuth(true);
|
||||
|
||||
// build the connector
|
||||
final ServerConnector https = new ServerConnector(jetty, ssl);
|
||||
|
||||
// set host and port
|
||||
https.setPort(0);
|
||||
https.setHost("localhost");
|
||||
|
||||
// Severely taxed environments may have significant delays when executing.
|
||||
https.setIdleTimeout(30000L);
|
||||
|
||||
// add the connector
|
||||
jetty.addConnector(https);
|
||||
|
||||
jetty.start();
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
if (!jetty.isStarted()) {
|
||||
throw new IllegalStateException("Jetty server not started");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pullHttpChangeIngestorInit(Properties properties) throws IOException {
|
||||
properties.setProperty(PullHttpChangeIngestor.TRUSTSTORE_LOCATION_KEY, "./src/test/resources/localhost-ts.jks");
|
||||
properties.setProperty(PullHttpChangeIngestor.TRUSTSTORE_PASSWORD_KEY, "localtest");
|
||||
properties.setProperty(PullHttpChangeIngestor.TRUSTSTORE_TYPE_KEY, "JKS");
|
||||
properties.setProperty(PullHttpChangeIngestor.KEYSTORE_LOCATION_KEY, "./src/test/resources/localhost-ks.jks");
|
||||
properties.setProperty(PullHttpChangeIngestor.KEYSTORE_PASSWORD_KEY, "localtest");
|
||||
properties.setProperty(PullHttpChangeIngestor.KEYSTORE_TYPE_KEY, "JKS");
|
||||
port = ((ServerConnector) jetty.getConnectors()[0]).getLocalPort();
|
||||
properties.put(PullHttpChangeIngestor.PORT_KEY, String.valueOf(port));
|
||||
properties.put(PullHttpChangeIngestor.HOST_KEY, "localhost");
|
||||
properties.put(PullHttpChangeIngestor.OVERRIDE_SECURITY, "true");
|
||||
properties.put(PULL_HTTP_BASE_KEY + ".override.core", "true");
|
||||
ConfigurationFileHolder configurationFileHolder = Mockito.mock(ConfigurationFileHolder.class);
|
||||
|
||||
pullHttpChangeIngestor = new PullHttpChangeIngestor();
|
||||
|
||||
pullHttpChangeIngestor.initialize(properties, configurationFileHolder, testNotifier);
|
||||
pullHttpChangeIngestor.setDifferentiator(mockDifferentiator);
|
||||
}
|
||||
}
|
|
@ -1,66 +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 org.apache.nifi.minifi.bootstrap.configuration.ingestors;
|
||||
|
||||
import static org.apache.nifi.minifi.bootstrap.configuration.ingestors.PullHttpChangeIngestor.PULL_HTTP_BASE_KEY;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import org.apache.nifi.minifi.bootstrap.ConfigurationFileHolder;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
public class PullHttpChangeIngestorTest extends PullHttpChangeIngestorCommonTest {
|
||||
|
||||
@BeforeAll
|
||||
public static void setUp() throws Exception {
|
||||
PullHttpChangeIngestorCommonTest.init();
|
||||
|
||||
final ServerConnector http = new ServerConnector(jetty);
|
||||
|
||||
http.setPort(0);
|
||||
http.setHost("localhost");
|
||||
|
||||
http.setIdleTimeout(3000L);
|
||||
jetty.addConnector(http);
|
||||
|
||||
jetty.start();
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
if (!jetty.isStarted()) {
|
||||
throw new IllegalStateException("Jetty server not started");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void pullHttpChangeIngestorInit(Properties properties) throws IOException {
|
||||
port = ((ServerConnector) jetty.getConnectors()[0]).getLocalPort();
|
||||
properties.put(PullHttpChangeIngestor.PORT_KEY, String.valueOf(port));
|
||||
properties.put(PullHttpChangeIngestor.HOST_KEY, "localhost");
|
||||
properties.put(PullHttpChangeIngestor.PULL_HTTP_POLLING_PERIOD_KEY, "30000");
|
||||
properties.put(PULL_HTTP_BASE_KEY + ".override.core", "true");
|
||||
ConfigurationFileHolder configurationFileHolder = Mockito.mock(ConfigurationFileHolder.class);
|
||||
|
||||
pullHttpChangeIngestor = new PullHttpChangeIngestor();
|
||||
pullHttpChangeIngestor.initialize(properties, configurationFileHolder, testNotifier);
|
||||
pullHttpChangeIngestor.setDifferentiator(mockDifferentiator);
|
||||
}
|
||||
}
|
|
@ -32,9 +32,8 @@ limitations under the License.
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<groupId>jakarta.ws.rs</groupId>
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.nifi.minifi.c2.api.security.authorization;
|
|||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import jakarta.ws.rs.core.UriInfo;
|
||||
|
||||
/**
|
||||
* Interface responsible for authorizing a given authentication to access a given uri
|
||||
|
|
|
@ -201,24 +201,21 @@ The following binary components are provided under the Common Development and Di
|
|||
(CDDL 1.1) (GPL2 w/ CPE) hk2-utils (org.glassfish.hk2:hk2-utils:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) hk2-locator (org.glassfish.hk2:hk2-locator:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) aopalliance-repackaged (org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42 - https://hk2.java.net/external/javax.inject)
|
||||
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (compat) (javax.mail:mail:jar:1.4.7 - https://kenai.com/projects/javamail/mail)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation (org.glassfish.web:javax.servlet.jsp:jar:2.3.2 - https://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation (org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.2 - https://jstl.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 (org.glassfish:javax.el:jar:3.0.0 - https://el-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API (javax.servlet.jsp:javax.servlet.jsp-api:jar:2.3.1 - https://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API (javax.el:javax.el-api:jar:3.0.0 - https://uel-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API (javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:jar:1.2.1 - https://jcp.org/en/jsr/detail?id=52)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Java Servlet API (javax.servlet:javax.servlet-api:jar:3.1.0 - https://servlet-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Javax JMS Api (javax.jms:javax.jms-api:jar:2.0.1 - https://java.net/projects/jms-spec/pages/Home)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing API (javax.json:javax.json-api:jar:1.0 - https://json-processing-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing Default Provider (org.glassfish:javax.json:jar:1.0.4 - https://jsonp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle (org.glassfish.hk2:osgi-resource-locator:jar:1.0.1 - https://glassfish.org/osgi-resource-locator)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.annotation API (javax.annotation:javax.annotation-api:jar:1.2 - https://jcp.org/en/jsr/detail?id=250)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b25 - https://hk2.java.net/external/javax.inject)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.1 - https://jax-rs-spec.java.net)
|
||||
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Servlet API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JMS API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing Default Provider
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Annotation API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Inject API as OSGi bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta WS REST Services API
|
||||
|
||||
************************
|
||||
Common Development and Distribution License 1.0
|
||||
|
|
|
@ -124,13 +124,13 @@ limitations under the License.
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<groupId>org.eclipse.jetty.ee10</groupId>
|
||||
<artifactId>jetty-ee10-servlet</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<groupId>org.eclipse.jetty.ee10</groupId>
|
||||
<artifactId>jetty-ee10-webapp</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -150,7 +150,7 @@ limitations under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.ext</groupId>
|
||||
<artifactId>jersey-spring5</artifactId>
|
||||
<artifactId>jersey-spring6</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.containers</groupId>
|
||||
|
@ -187,8 +187,8 @@ limitations under the License.
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -1,548 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<web-app
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee https://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
metadata-complete="false"
|
||||
version="3.1">
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- This file contains the default descriptor for web applications. -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- The intent of this descriptor is to include jetty specific or common -->
|
||||
<!-- configuration for all webapps. If a context has a webdefault.xml -->
|
||||
<!-- descriptor, it is applied before the contexts own web.xml file -->
|
||||
<!-- -->
|
||||
<!-- A context may be assigned a default descriptor by: -->
|
||||
<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
|
||||
<!-- + Passed an arg to addWebApplications -->
|
||||
<!-- -->
|
||||
<!-- This file is used both as the resource within the jetty.jar (which is -->
|
||||
<!-- used as the default if no explicit defaults descriptor is set) and it -->
|
||||
<!-- is copied to the etc directory of the Jetty distro and explicitly -->
|
||||
<!-- by the jetty.xml file. -->
|
||||
<!-- -->
|
||||
<!-- ===================================================================== -->
|
||||
|
||||
<description>
|
||||
Default web.xml file.
|
||||
This file is applied to a Web application before it's own WEB_INF/web.xml file
|
||||
</description>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Removes static configurationCache of Methods from java.beans.Introspector to -->
|
||||
<!-- ensure webapp classloader can be released on undeploy -->
|
||||
<!-- ==================================================================== -->
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Context params to control Session Cookies -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!--
|
||||
UNCOMMENT TO ACTIVATE
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
|
||||
<param-value>127.0.0.1</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
|
||||
<param-value>/</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
|
||||
<param-value>-1</param-value>
|
||||
</context-param>
|
||||
-->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- The default servlet. -->
|
||||
<!-- This servlet, normally mapped to /, provides the handling for static -->
|
||||
<!-- content, OPTIONS and TRACE methods for the context. -->
|
||||
<!-- The following initParameters are supported: -->
|
||||
<!--
|
||||
* acceptRanges If true, range requests and responses are
|
||||
* supported
|
||||
*
|
||||
* dirAllowed If true, directory listings are returned if no
|
||||
* welcome file is found. Else 403 Forbidden.
|
||||
*
|
||||
* welcomeServlets If true, attempt to dispatch to welcome files
|
||||
* that are servlets, but only after no matching static
|
||||
* resources could be found. If false, then a welcome
|
||||
* file must exist on disk. If "exact", then exact
|
||||
* servlet matches are supported without an existing file.
|
||||
* Default is true.
|
||||
*
|
||||
* This must be false if you want directory listings,
|
||||
* but have index.jsp in your welcome file list.
|
||||
*
|
||||
* redirectWelcome If true, welcome files are redirected rather than
|
||||
* forwarded to.
|
||||
*
|
||||
* gzip If set to true, then static content will be served as
|
||||
* gzip content encoded if a matching resource is
|
||||
* found ending with ".gz"
|
||||
*
|
||||
* resourceBase Set to replace the context resource base
|
||||
*
|
||||
* resourceCache If set, this is a context attribute name, which the servlet
|
||||
* will use to look for a shared ResourceCache instance.
|
||||
*
|
||||
* relativeResourceBase
|
||||
* Set with a pathname relative to the base of the
|
||||
* servlet context root. Useful for only serving static content out
|
||||
* of only specific subdirectories.
|
||||
*
|
||||
* pathInfoOnly If true, only the path info will be applied to the resourceBase
|
||||
*
|
||||
* stylesheet Set with the location of an optional stylesheet that will be used
|
||||
* to decorate the directory listing html.
|
||||
*
|
||||
* aliases If True, aliases of resources are allowed (eg. symbolic
|
||||
* links and caps variations). May bypass security constraints.
|
||||
*
|
||||
* etags If True, weak etags will be generated and handled.
|
||||
*
|
||||
* maxCacheSize The maximum total size of the configurationCache or 0 for no configurationCache.
|
||||
* maxCachedFileSize The maximum size of a file to configurationCache
|
||||
* maxCachedFiles The maximum number of files to configurationCache
|
||||
*
|
||||
* useFileMappedBuffer
|
||||
* If set to true, it will use mapped file buffer to serve static content
|
||||
* when using NIO connector. Setting this value to false means that
|
||||
* a direct buffer will be used instead of a mapped file buffer.
|
||||
* By default, this is set to true.
|
||||
*
|
||||
* cacheControl If set, all static content will have this value set as the configurationCache-control
|
||||
* header.
|
||||
*
|
||||
-->
|
||||
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet>
|
||||
<servlet-name>default</servlet-name>
|
||||
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>aliases</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>acceptRanges</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>dirAllowed</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>welcomeServlets</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>redirectWelcome</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCacheSize</param-name>
|
||||
<param-value>256000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFileSize</param-name>
|
||||
<param-value>200000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFiles</param-name>
|
||||
<param-value>2048</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>gzip</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>etags</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>useFileMappedBuffer</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<!--
|
||||
<init-param>
|
||||
<param-name>resourceCache</param-name>
|
||||
<param-value>resourceCache</param-value>
|
||||
</init-param>
|
||||
-->
|
||||
<!--
|
||||
<init-param>
|
||||
<param-name>cacheControl</param-name>
|
||||
<param-value>max-age=3600,public</param-value>
|
||||
</init-param>
|
||||
-->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>default</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- JSP Servlet -->
|
||||
<!-- This is the jasper JSP servlet from the jakarta project -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
|
||||
<!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
|
||||
<!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
|
||||
<!-- following initialization parameters (default values are in square -->
|
||||
<!-- brackets): -->
|
||||
<!-- -->
|
||||
<!-- checkInterval If development is false and reloading is true, -->
|
||||
<!-- background compiles are enabled. checkInterval -->
|
||||
<!-- is the time in seconds between checks to see -->
|
||||
<!-- if a JSP page needs to be recompiled. [300] -->
|
||||
<!-- -->
|
||||
<!-- compiler Which compiler Ant should use to compile JSP -->
|
||||
<!-- pages. See the Ant documenation for more -->
|
||||
<!-- information. [javac] -->
|
||||
<!-- -->
|
||||
<!-- classdebuginfo Should the class file be compiled with -->
|
||||
<!-- debugging information? [true] -->
|
||||
<!-- -->
|
||||
<!-- classpath What class path should I use while compiling -->
|
||||
<!-- generated servlets? [Created dynamically -->
|
||||
<!-- based on the current web application] -->
|
||||
<!-- Set to ? to make the container explicitly set -->
|
||||
<!-- this parameter. -->
|
||||
<!-- -->
|
||||
<!-- development Is Jasper used in development mode (will check -->
|
||||
<!-- for JSP modification on every access)? [true] -->
|
||||
<!-- -->
|
||||
<!-- enablePooling Determines whether tag handler pooling is -->
|
||||
<!-- enabled [true] -->
|
||||
<!-- -->
|
||||
<!-- fork Tell Ant to fork compiles of JSP pages so that -->
|
||||
<!-- a separate JVM is used for JSP page compiles -->
|
||||
<!-- from the one Tomcat is running in. [true] -->
|
||||
<!-- -->
|
||||
<!-- ieClassId The class-id value to be sent to Internet -->
|
||||
<!-- Explorer when using <jsp:plugin> tags. -->
|
||||
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
|
||||
<!-- -->
|
||||
<!-- javaEncoding Java file encoding to use for generating java -->
|
||||
<!-- source files. [UTF-8] -->
|
||||
<!-- -->
|
||||
<!-- keepgenerated Should we keep the generated Java source code -->
|
||||
<!-- for each page instead of deleting it? [true] -->
|
||||
<!-- -->
|
||||
<!-- logVerbosityLevel The level of detailed messages to be produced -->
|
||||
<!-- by this servlet. Increasing levels cause the -->
|
||||
<!-- generation of more messages. Valid values are -->
|
||||
<!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
|
||||
<!-- [WARNING] -->
|
||||
<!-- -->
|
||||
<!-- mappedfile Should we generate static content with one -->
|
||||
<!-- print statement per input line, to ease -->
|
||||
<!-- debugging? [false] -->
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<!-- reloading Should Jasper check for modified JSPs? [true] -->
|
||||
<!-- -->
|
||||
<!-- suppressSmap Should the generation of SMAP info for JSR45 -->
|
||||
<!-- debugging be suppressed? [false] -->
|
||||
<!-- -->
|
||||
<!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
|
||||
<!-- dumped to a file? [false] -->
|
||||
<!-- False if suppressSmap is true -->
|
||||
<!-- -->
|
||||
<!-- scratchdir What scratch directory should we use when -->
|
||||
<!-- compiling JSP pages? [default work directory -->
|
||||
<!-- for the current web application] -->
|
||||
<!-- -->
|
||||
<!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
|
||||
<!-- -->
|
||||
<!-- xpoweredBy Determines whether X-Powered-By response -->
|
||||
<!-- header is added by generated servlet [false] -->
|
||||
<!-- -->
|
||||
<!-- If you wish to use Jikes to compile JSP pages: -->
|
||||
<!-- Set the init parameter "compiler" to "jikes". Define -->
|
||||
<!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
|
||||
<!-- to cause Jikes to emit error messages in a format compatible with -->
|
||||
<!-- Jasper. -->
|
||||
<!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
|
||||
<!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet id="jsp">
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>logVerbosityLevel</param-name>
|
||||
<param-value>DEBUG</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>fork</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>keepgenerated</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>development</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>xpoweredBy</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>compilerTargetVM</param-name>
|
||||
<param-value>1.7</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>compilerSourceVM</param-name>
|
||||
<param-value>1.7</param-value>
|
||||
</init-param>
|
||||
<!--
|
||||
<init-param>
|
||||
<param-name>classpath</param-name>
|
||||
<param-value>?</param-value>
|
||||
</init-param>
|
||||
-->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<url-pattern>*.jsp</url-pattern>
|
||||
<url-pattern>*.jspf</url-pattern>
|
||||
<url-pattern>*.jspx</url-pattern>
|
||||
<url-pattern>*.xsp</url-pattern>
|
||||
<url-pattern>*.JSP</url-pattern>
|
||||
<url-pattern>*.JSPF</url-pattern>
|
||||
<url-pattern>*.JSPX</url-pattern>
|
||||
<url-pattern>*.XSP</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<session-config>
|
||||
<session-timeout>30</session-timeout>
|
||||
</session-config>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Default MIME mappings -->
|
||||
<!-- The default MIME mappings are provided by the mime.properties -->
|
||||
<!-- resource in the org.eclipse.jetty.server.jar file. Additional or modified -->
|
||||
<!-- mappings may be specified here -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- UNCOMMENT TO ACTIVATE
|
||||
<mime-mapping>
|
||||
<extension>mysuffix</extension>
|
||||
<mime-type>mymime/type</mime-type>
|
||||
</mime-mapping>
|
||||
-->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<locale-encoding-mapping-list>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ar</locale>
|
||||
<encoding>ISO-8859-6</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>be</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>bg</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ca</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>cs</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>da</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>de</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>el</locale>
|
||||
<encoding>ISO-8859-7</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>en</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>es</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>et</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fi</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fr</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hr</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hu</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>is</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>it</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>iw</locale>
|
||||
<encoding>ISO-8859-8</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ja</locale>
|
||||
<encoding>Shift_JIS</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ko</locale>
|
||||
<encoding>EUC-KR</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lt</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lv</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>mk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>nl</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>no</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pt</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ro</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ru</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sh</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sk</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sq</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sr</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sv</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>tr</locale>
|
||||
<encoding>ISO-8859-9</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>uk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh</locale>
|
||||
<encoding>GB2312</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh_TW</locale>
|
||||
<encoding>Big5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
</locale-encoding-mapping-list>
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Disable TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method>TRACE</http-method>
|
||||
</web-resource-collection>
|
||||
<auth-constraint/>
|
||||
</security-constraint>
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Enable everything but TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method-omission>TRACE</http-method-omission>
|
||||
</web-resource-collection>
|
||||
</security-constraint>
|
||||
|
||||
</web-app>
|
||||
|
|
@ -54,7 +54,7 @@ limitations under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
|
||||
import com.palantir.docker.compose.DockerComposeExtension;
|
||||
import com.palantir.docker.compose.connection.Container;
|
||||
import com.palantir.docker.compose.connection.DockerPort;
|
||||
|
@ -104,7 +104,7 @@ public abstract class AbstractTestUnsecure {
|
|||
|
||||
protected VersionedDataflow toVersionedDataFlow(InputStream inputStream) throws IOException {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return objectMapper.readValue(IOUtils.toByteArray(inputStream), VersionedDataflow.class);
|
||||
}
|
||||
|
|
|
@ -36,8 +36,8 @@ limitations under the License.
|
|||
<artifactId>jetty-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<groupId>org.eclipse.jetty.ee10</groupId>
|
||||
<artifactId>jetty-ee10-webapp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -43,17 +43,16 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.servlet.ErrorPageErrorHandler;
|
||||
import org.eclipse.jetty.webapp.WebAppClassLoader;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee10.servlet.ErrorPageErrorHandler;
|
||||
import org.eclipse.jetty.ee10.webapp.WebAppClassLoader;
|
||||
import org.eclipse.jetty.ee10.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class JettyServer {
|
||||
private static final Logger logger = LoggerFactory.getLogger(JettyServer.class);
|
||||
private static final String C2_SERVER_HOME = System.getenv("C2_SERVER_HOME");
|
||||
private static final String WEB_DEFAULTS_XML = "webdefault.xml";
|
||||
|
||||
private static final BouncyCastleProvider BOUNCY_CASTLE_PROVIDER = new BouncyCastleProvider();
|
||||
private static final String BCFKS = "BCFKS";
|
||||
|
@ -61,7 +60,7 @@ public class JettyServer {
|
|||
public static void main(String[] args) throws Exception {
|
||||
C2Properties properties = C2Properties.getInstance();
|
||||
|
||||
final HandlerCollection handlers = new HandlerCollection();
|
||||
final Handler.Collection handlers = new ContextHandlerCollection();
|
||||
try (Stream<Path> files = Files.list(Paths.get(C2_SERVER_HOME, "webapps"))) {
|
||||
files.forEach(path -> handlers.addHandler(loadWar(path.toFile(), "/c2", JettyServer.class.getClassLoader())));
|
||||
}
|
||||
|
@ -84,16 +83,9 @@ public class JettyServer {
|
|||
server.setHandler(handlers);
|
||||
server.start();
|
||||
|
||||
// ensure everything started successfully
|
||||
for (Handler handler : server.getChildHandlers()) {
|
||||
// see if the handler is a web app
|
||||
if (handler instanceof WebAppContext) {
|
||||
WebAppContext context = (WebAppContext) handler;
|
||||
|
||||
// see if this webapp had any exceptions that would
|
||||
// cause it to be unavailable
|
||||
for (Handler handler : server.getHandlers()) {
|
||||
if (handler instanceof WebAppContext context) {
|
||||
if (context.getUnavailableException() != null) {
|
||||
|
||||
System.err.println("Failed to start web server: " + context.getUnavailableException().getMessage());
|
||||
System.err.println("Shutting down...");
|
||||
logger.warn("Failed to start web server... shutting down.", context.getUnavailableException());
|
||||
|
@ -161,10 +153,6 @@ public class JettyServer {
|
|||
webappContext.setDisplayName(contextPath);
|
||||
webappContext.setErrorHandler(getErrorHandler());
|
||||
|
||||
// instruction jetty to examine these jars for tlds, web-fragments, etc
|
||||
webappContext.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\\\.jar$|.*/[^/]*taglibs.*\\.jar$" );
|
||||
webappContext.setDefaultsDescriptor(WEB_DEFAULTS_XML);
|
||||
|
||||
// get the temp directory for this webapp
|
||||
File tempDir = Paths.get(C2_SERVER_HOME, "tmp", warFile.getName()).toFile();
|
||||
if (tempDir.exists() && !tempDir.isDirectory()) {
|
||||
|
@ -185,13 +173,7 @@ public class JettyServer {
|
|||
// configure the max form size (3x the default)
|
||||
webappContext.setMaxFormContentSize(600000);
|
||||
|
||||
try {
|
||||
webappContext.setClassLoader(new WebAppClassLoader(parentClassLoader, webappContext));
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("ClassLoader initialization failed", e);
|
||||
}
|
||||
|
||||
logger.info("Loading WAR: " + warFile.getAbsolutePath() + " with context path set to " + contextPath);
|
||||
webappContext.setClassLoader(new WebAppClassLoader(parentClassLoader, webappContext));
|
||||
return webappContext;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,8 @@ limitations under the License.
|
|||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
|
||||
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
@ -93,14 +87,13 @@ limitations under the License.
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<groupId>jakarta.ws.rs</groupId>
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -22,8 +22,8 @@ import org.glassfish.jersey.server.ResourceConfig;
|
|||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.ws.rs.core.Context;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.ws.rs.core.Context;
|
||||
|
||||
public class C2ResourceConfig extends ResourceConfig {
|
||||
|
||||
|
|
|
@ -26,52 +26,51 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.authentication.ProviderManager;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
|
||||
|
||||
import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@EnableMethodSecurity
|
||||
@ImportResource({"classpath:minifi-c2-web-security-context.xml"})
|
||||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||
public class SecurityConfiguration {
|
||||
private AuthenticationProvider authenticationProvider;
|
||||
private X509AuthenticationFilter x509AuthenticationFilter;
|
||||
private C2AnonymousAuthenticationFilter c2AnonymousAuthenticationFilter;
|
||||
|
||||
public SecurityConfiguration() {
|
||||
super(true);
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManager() {
|
||||
return new ProviderManager(authenticationProvider);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Override
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||
// override xxxBean method so the authentication manager is available in app context (necessary for the method level security)
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(WebSecurity web) throws Exception {
|
||||
web.ignoring().antMatchers("/access", "/access/config", "/access/token", "/access/kerberos");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.rememberMe().disable().authorizeRequests().anyRequest().fullyAuthenticated().and()
|
||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
|
||||
http.addFilterBefore(x509AuthenticationFilter, AnonymousAuthenticationFilter.class);
|
||||
http.anonymous().authenticationFilter(c2AnonymousAuthenticationFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.authenticationProvider(authenticationProvider);
|
||||
public SecurityFilterChain securityFilterChain(
|
||||
final HttpSecurity http
|
||||
) throws Exception {
|
||||
return http
|
||||
.rememberMe(AbstractHttpConfigurer::disable)
|
||||
.sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeRequests(authorize -> authorize
|
||||
.requestMatchers(
|
||||
antMatcher("/access"),
|
||||
antMatcher("/access/config"),
|
||||
antMatcher("/access/token"),
|
||||
antMatcher("/access/kerberos")
|
||||
)
|
||||
.permitAll()
|
||||
.anyRequest().fullyAuthenticated()
|
||||
)
|
||||
.addFilterBefore(x509AuthenticationFilter, AnonymousAuthenticationFilter.class)
|
||||
.anonymous(anonymous -> anonymous.authenticationFilter(c2AnonymousAuthenticationFilter))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class C2AnonymousAuthenticationFilter extends AnonymousAuthenticationFilter {
|
||||
|
|
|
@ -26,10 +26,10 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.filter.GenericFilterBean;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class X509AuthenticationFilter extends GenericFilterBean {
|
|||
return;
|
||||
}
|
||||
|
||||
X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
|
||||
X509Certificate[] certs = (X509Certificate[]) request.getAttribute("jakarta.servlet.request.X509Certificate");
|
||||
|
||||
if (certs == null || certs.length == 0) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import jakarta.ws.rs.core.MultivaluedMap;
|
||||
import jakarta.ws.rs.core.UriInfo;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -18,15 +18,15 @@ package org.apache.nifi.minifi.c2.service;
|
|||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
|
||||
import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
|
||||
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.ext.Provider;
|
||||
|
||||
@Provider
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public class C2JsonProvider extends JacksonJaxbJsonProvider {
|
||||
public class C2JsonProvider extends JacksonJsonProvider {
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
|
@ -38,7 +38,4 @@ public class C2JsonProvider extends JacksonJaxbJsonProvider {
|
|||
super();
|
||||
setMapper(objectMapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -16,10 +16,10 @@
|
|||
*/
|
||||
package org.apache.nifi.minifi.c2.service;
|
||||
|
||||
import javax.ws.rs.core.Feature;
|
||||
import javax.ws.rs.core.FeatureContext;
|
||||
import javax.ws.rs.ext.MessageBodyReader;
|
||||
import javax.ws.rs.ext.MessageBodyWriter;
|
||||
import jakarta.ws.rs.core.Feature;
|
||||
import jakarta.ws.rs.core.FeatureContext;
|
||||
import jakarta.ws.rs.ext.MessageBodyReader;
|
||||
import jakarta.ws.rs.ext.MessageBodyWriter;
|
||||
|
||||
public class C2JsonProviderFeature implements Feature {
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package org.apache.nifi.minifi.c2.service;
|
||||
|
||||
import static javax.ws.rs.core.HttpHeaders.CONTENT_LENGTH;
|
||||
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
|
||||
import static jakarta.ws.rs.core.HttpHeaders.CONTENT_LENGTH;
|
||||
import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.base.Suppliers;
|
||||
|
@ -48,18 +48,18 @@ import java.util.concurrent.ExecutionException;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.HttpHeaders;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.WebApplicationException;
|
||||
import jakarta.ws.rs.core.Context;
|
||||
import jakarta.ws.rs.core.HttpHeaders;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import jakarta.ws.rs.core.UriInfo;
|
||||
import org.apache.nifi.c2.protocol.api.C2Heartbeat;
|
||||
import org.apache.nifi.c2.protocol.api.C2HeartbeatResponse;
|
||||
import org.apache.nifi.c2.protocol.api.C2OperationAck;
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.apache.nifi.minifi.c2.api.ConfigurationProvider;
|
|||
import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
|
||||
import org.apache.nifi.minifi.c2.api.util.Pair;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigurationProviderInfo {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.nifi.minifi.c2.service;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.nifi.minifi.c2.service;
|
|||
import org.apache.nifi.minifi.c2.api.Configuration;
|
||||
import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
public class ConfigurationProviderValue {
|
||||
private final Configuration configuration;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package org.apache.nifi.minifi.c2.util;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
public class HttpRequestUtil {
|
||||
public static String getQueryString(HttpServletRequest request) {
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
||||
version="6.0">
|
||||
<display-name>minifi-c2</display-name>
|
||||
|
||||
<context-param>
|
||||
|
@ -36,7 +39,7 @@
|
|||
<servlet-name>jerseySpring</servlet-name>
|
||||
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
|
||||
<init-param>
|
||||
<param-name>javax.ws.rs.Application</param-name>
|
||||
<param-name>jakarta.ws.rs.Application</param-name>
|
||||
<param-value>org.apache.nifi.minifi.c2.configuration.C2ResourceConfig</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
|
|
|
@ -45,7 +45,7 @@ limitations under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import org.apache.nifi.controller.flow.VersionedDataflow;
|
||||
|
@ -41,7 +41,7 @@ public class StandardFlowSerDeService implements FlowSerDeService {
|
|||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
objectMapper.setDefaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL));
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return new StandardFlowSerDeService(objectMapper);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
|
@ -162,7 +162,7 @@ public class StandardFlowEnrichServiceTest {
|
|||
|
||||
private VersionedDataflow flowFromString(String flow) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
try {
|
||||
|
@ -176,7 +176,7 @@ public class StandardFlowEnrichServiceTest {
|
|||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
objectMapper.setDefaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL));
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
try {
|
||||
|
|
|
@ -26,7 +26,7 @@ import static org.apache.commons.io.IOUtils.write;
|
|||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
@ -147,7 +147,7 @@ public class TransformYamlCommandFactory {
|
|||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setDefaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL));
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return objectMapper;
|
||||
}
|
||||
|
|
|
@ -853,9 +853,6 @@ The following binary components are provided under the Apache Software License v
|
|||
Morfologic includes data from BSD-licensed dictionary of Polish (SGJP)
|
||||
(http://sgjp.pl/morfeusz/)
|
||||
|
||||
Servlet-api.jar and javax.servlet-*.jar are under the CDDL license, the original
|
||||
source code for this can be found at http://www.eclipse.org/jetty/downloads.php
|
||||
|
||||
===========================================================================
|
||||
Kuromoji Japanese Morphological Analyzer - Apache Lucene Integration
|
||||
===========================================================================
|
||||
|
@ -2434,28 +2431,23 @@ The following binary components are provided under the Common Development and Di
|
|||
(CDDL 1.1) (GPL2 w/ CPE) jersey-server (com.sun.jersey:jersey-server:jar:1.9 - https://jersey.java.net/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) jersey-guice (com.sun.jersey.contribs:jersey-guice:jar:1.9 - https://jersey.java.net/)
|
||||
|
||||
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Old JAXB Runtime (com.sun.xml.bind:jaxb-impl:jar:2.2.3-1 - http://jaxb.java.net/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Java Architecture For XML Binding (javax.xml.bind:jaxb-api:jar:2.2.2 - https://jaxb.dev.java.net/)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Servlet API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JMS API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta JSON Processing Default Provider
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Annotation API
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta Inject API as OSGi bundle
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Jakarta WS REST Services API
|
||||
(CDDL 1.1) JSR 356: Java API for WebSocket
|
||||
(CDDL 1.1) (GPL2 w/ CPE) MIME Streaming Extension (org.jvnet.mimepull:mimepull:jar:1.9.3 - http://mimepull.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (compat) (javax.mail:mail:jar:1.4.7 - http://kenai.com/projects/javamail/mail)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSP Implementation (org.glassfish.web:javax.servlet.jsp:jar:2.3.2 - http://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages (TM) TagLib Implementation (org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.2 - http://jstl.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 (org.glassfish:javax.el:jar:3.0.0 - http://el-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) API (javax.servlet.jsp:javax.servlet.jsp-api:jar:2.3.1 - http://jsp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Expression Language 3.0 API (javax.el:javax.el-api:jar:3.0.0 - http://uel-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaServer Pages(TM) Standard Tag Library API (javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:jar:1.2.1 - http://jcp.org/en/jsr/detail?id=52)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Java Servlet API (javax.servlet:javax.servlet-api:jar:3.1.0 - http://servlet-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) Javax JMS Api (javax.jms:javax.jms-api:jar:2.0.1 - http://java.net/projects/jms-spec/pages/Home)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing API (javax.json:javax.json-api:jar:1.0 - http://json-processing-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JSON Processing Default Provider (org.glassfish:javax.json:jar:1.0.4 - https://jsonp.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) OSGi resource locator bundle (org.glassfish.hk2:osgi-resource-locator:jar:1.0.1 - http://glassfish.org/osgi-resource-locator)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.annotation API (javax.annotation:javax.annotation-api:jar:1.2 - http://jcp.org/en/jsr/detail?id=250)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b25 - https://hk2.java.net/external/javax.inject)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.0.1 - http://jax-rs-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.1 - http://jax-rs-spec.java.net)
|
||||
(CDDL 1.1) (GPL2 w/ CPE) JavaMail API (com.sun.mail:javax.mail:jar:1.6.1)
|
||||
(CDDL 1.1) JSR 356: Java API for WebSocket (javax.websocket:javax.websocket-api:1.1)
|
||||
|
||||
************************
|
||||
Common Development and Distribution License 1.0
|
||||
|
@ -2463,7 +2455,6 @@ Common Development and Distribution License 1.0
|
|||
|
||||
The following binary components are provided under the Common Development and Distribution License 1.0. See project link for details.
|
||||
|
||||
(CDDL 1.0) JavaServlet(TM) Specification (javax.servlet:servlet-api:jar:2.5 - no url available)
|
||||
(CDDL 1.0) (GPL3) Streaming API For XML (javax.xml.stream:stax-api:jar:1.0-2 - no url provided)
|
||||
(CDDL 1.0) JavaBeans Activation Framework (JAF) (javax.activation:activation:jar:1.1 - http://java.sun.com/products/javabeans/jaf/index.jsp)
|
||||
(CDDL 1.0) JHighlight (org.codelibs:jhighlight:1.0.2 - https://github.com/codelibs/jhighlight)
|
||||
|
|
|
@ -99,8 +99,8 @@ language governing permissions and limitations under the License. -->
|
|||
</build>
|
||||
<dependencies>
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<include>ch.qos.logback:logback-classic</include>
|
||||
<include>ch.qos.logback:logback-core</include>
|
||||
<!-- Servlet API -->
|
||||
<include>javax.servlet:javax.servlet-api</include>
|
||||
<include>jakarta.servlet:jakarta.servlet-api</include>
|
||||
<include>org.eclipse.jetty.toolchain:jetty-schemas</include>
|
||||
<!-- Apache NiFi -->
|
||||
<include>org.apache.nifi:nifi-api</include>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</parent>
|
||||
<artifactId>nifi-hashicorp-vault</artifactId>
|
||||
<properties>
|
||||
<spring.vault.version>2.3.4</spring.vault.version>
|
||||
<spring.vault.version>3.1.0</spring.vault.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -29,11 +29,15 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<artifactId>jetty-http2-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-java-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.apache.nifi.jetty.configuration.connector;
|
||||
|
||||
import org.apache.nifi.jetty.configuration.connector.alpn.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.http2.HTTP2Cipher;
|
||||
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
|
||||
|
@ -46,6 +46,14 @@ public class StandardServerConnectorFactory implements ServerConnectorFactory {
|
|||
|
||||
private static final Set<ApplicationLayerProtocol> DEFAULT_APPLICATION_LAYER_PROTOCOLS = Collections.singleton(ApplicationLayerProtocol.HTTP_1_1);
|
||||
|
||||
private static final String ALPN_PROTOCOL = "alpn";
|
||||
|
||||
private static final String[] APPLICATION_PROTOCOLS = new String[]{
|
||||
ALPN_PROTOCOL,
|
||||
ApplicationLayerProtocol.H2.getProtocol(),
|
||||
ApplicationLayerProtocol.HTTP_1_1.getProtocol()
|
||||
};
|
||||
|
||||
private final Server server;
|
||||
|
||||
private final int port;
|
||||
|
@ -90,7 +98,7 @@ public class StandardServerConnectorFactory implements ServerConnectorFactory {
|
|||
} else {
|
||||
final List<ConnectionFactory> connectionFactories = new ArrayList<>();
|
||||
if (applicationLayerProtocols.contains(ApplicationLayerProtocol.H2)) {
|
||||
final ALPNServerConnectionFactory alpnServerConnectionFactory = new ALPNServerConnectionFactory();
|
||||
final ALPNServerConnectionFactory alpnServerConnectionFactory = new ALPNServerConnectionFactory(APPLICATION_PROTOCOLS);
|
||||
final HTTP2ServerConnectionFactory http2ServerConnectionFactory = new HTTP2ServerConnectionFactory(httpConfiguration);
|
||||
|
||||
connectionFactories.add(alpnServerConnectionFactory);
|
||||
|
|
|
@ -1,64 +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 org.apache.nifi.jetty.configuration.connector.alpn;
|
||||
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnection;
|
||||
import org.eclipse.jetty.io.AbstractConnection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.ssl.ALPNProcessor;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
|
||||
|
||||
import javax.net.ssl.SSLEngine;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ALPN Server Connection Factory with standard ALPN Processor implementation
|
||||
*/
|
||||
public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFactory {
|
||||
private static final String ALPN_PROTOCOL = "alpn";
|
||||
|
||||
private final ALPNProcessor.Server processor;
|
||||
|
||||
public ALPNServerConnectionFactory() {
|
||||
super(ALPN_PROTOCOL);
|
||||
processor = new StandardALPNProcessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new Server Connection and configure the connection using ALPN Processor
|
||||
*
|
||||
* @param connector Connector for the Connection
|
||||
* @param endPoint End Point for the Connection
|
||||
* @param sslEngine SSL Engine for the Connection
|
||||
* @param protocols Application Protocols
|
||||
* @param defaultProtocol Default Application Protocol
|
||||
* @return ALPN Server Connection
|
||||
*/
|
||||
@Override
|
||||
protected AbstractConnection newServerConnection(
|
||||
final Connector connector,
|
||||
final EndPoint endPoint,
|
||||
final SSLEngine sslEngine,
|
||||
final List<String> protocols,
|
||||
final String defaultProtocol
|
||||
) {
|
||||
final ALPNServerConnection connection = new ALPNServerConnection(connector, endPoint, sslEngine, protocols, defaultProtocol);
|
||||
processor.configure(sslEngine, connection);
|
||||
return connection;
|
||||
}
|
||||
}
|
|
@ -1,122 +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 org.apache.nifi.jetty.configuration.connector.alpn;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import javax.net.ssl.SSLEngine;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnection;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.ssl.ALPNProcessor;
|
||||
import org.eclipse.jetty.io.ssl.SslConnection;
|
||||
import org.eclipse.jetty.io.ssl.SslHandshakeListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Standard ALPN Processor supporting JDK 1.8.0-251 and higher based on Jetty JDK9ServerALPNProcessor
|
||||
*/
|
||||
public class StandardALPNProcessor implements ALPNProcessor.Server, SslHandshakeListener {
|
||||
private static final Logger logger = LoggerFactory.getLogger(StandardALPNProcessor.class);
|
||||
|
||||
/**
|
||||
* Applies to SSL Engine instances regardless of implementation
|
||||
*
|
||||
* @param sslEngine SSL Engine to be evaluated
|
||||
* @return Applicable Status
|
||||
*/
|
||||
@Override
|
||||
public boolean appliesTo(final SSLEngine sslEngine) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure ALPN negotiation for Connection
|
||||
*
|
||||
* @param sslEngine SSL Engine to be configured
|
||||
* @param connection Connection to be configured
|
||||
*/
|
||||
@Override
|
||||
public void configure(final SSLEngine sslEngine, final Connection connection) {
|
||||
logger.debug("Configuring Connection Remote Address [{}]", connection.getEndPoint().getRemoteSocketAddress());
|
||||
final ALPNServerConnection serverConnection = (ALPNServerConnection) connection;
|
||||
final ProtocolSelector protocolSelector = new ProtocolSelector(serverConnection);
|
||||
sslEngine.setHandshakeApplicationProtocolSelector(protocolSelector);
|
||||
|
||||
final SslConnection.DecryptedEndPoint endPoint = (SslConnection.DecryptedEndPoint) serverConnection.getEndPoint();
|
||||
endPoint.getSslConnection().addHandshakeListener(protocolSelector);
|
||||
}
|
||||
|
||||
private static final class ProtocolSelector implements BiFunction<SSLEngine, List<String>, String>, SslHandshakeListener {
|
||||
private final ALPNServerConnection serverConnection;
|
||||
|
||||
private ProtocolSelector(final ALPNServerConnection connection) {
|
||||
serverConnection = connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Select supported Application Layer Protocol based on requested protocols
|
||||
*
|
||||
* @param sslEngine SSL Engine
|
||||
* @param protocols Protocols requested
|
||||
* @return Protocol selected or null when no supported protocol found
|
||||
*/
|
||||
@Override
|
||||
public String apply(final SSLEngine sslEngine, final List<String> protocols) {
|
||||
String protocol = null;
|
||||
try {
|
||||
serverConnection.select(protocols);
|
||||
protocol = serverConnection.getProtocol();
|
||||
logger.debug("Connection Remote Address [{}] Application Layer Protocol [{}] selected", serverConnection.getEndPoint().getRemoteSocketAddress(), protocol);
|
||||
} catch (final Throwable e) {
|
||||
logger.debug("Connection Remote Address [{}] Application Layer Protocols {} not supported", serverConnection.getEndPoint().getRemoteSocketAddress(), protocols);
|
||||
}
|
||||
return protocol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for successful handshake checks for selected Application Layer Protocol
|
||||
*
|
||||
* @param event Event is not used
|
||||
*/
|
||||
@Override
|
||||
public void handshakeSucceeded(final Event event) {
|
||||
final SocketAddress remoteAddress = serverConnection.getEndPoint().getRemoteSocketAddress();
|
||||
final SSLSession session = event.getSSLEngine().getSession();
|
||||
logger.debug("Connection Remote Address [{}] Handshake Succeeded [{}] Cipher Suite [{}]", remoteAddress, session.getProtocol(), session.getCipherSuite());
|
||||
|
||||
final String protocol = serverConnection.getProtocol();
|
||||
if (protocol == null) {
|
||||
logger.debug("Connection Remote Address [{}] Application Layer Protocol not supported", remoteAddress);
|
||||
serverConnection.unsupported();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle for failed handshake logs status
|
||||
*
|
||||
* @param event Event is not used
|
||||
* @param failure Failure cause to be logged
|
||||
*/
|
||||
@Override
|
||||
public void handshakeFailed(final Event event, final Throwable failure) {
|
||||
logger.debug("Connection Remote Address [{}] Handshake Failed", serverConnection.getEndPoint().getRemoteSocketAddress(), failure);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.apache.nifi.jetty.configuration.connector;
|
||||
|
||||
import org.apache.nifi.jetty.configuration.connector.alpn.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
|
@ -71,7 +71,7 @@ class StandardServerConnectorFactoryTest {
|
|||
final HttpConnectionFactory httpConnectionFactory = assertHttpConnectionFactoryFound(serverConnector);
|
||||
assertHttpConnectionFactorySecured(httpConnectionFactory);
|
||||
|
||||
final SslContextFactory.Server sslContextFactory = (SslContextFactory.Server) sslConnectionFactory.getSslContextFactory();
|
||||
final SslContextFactory.Server sslContextFactory = sslConnectionFactory.getSslContextFactory();
|
||||
assertFalse(sslContextFactory.getNeedClientAuth());
|
||||
assertFalse(sslContextFactory.getWantClientAuth());
|
||||
assertNotNull(sslContextFactory.getIncludeProtocols());
|
||||
|
@ -94,7 +94,7 @@ class StandardServerConnectorFactoryTest {
|
|||
final HttpConnectionFactory httpConnectionFactory = assertHttpConnectionFactoryFound(serverConnector);
|
||||
assertHttpConnectionFactorySecured(httpConnectionFactory);
|
||||
|
||||
final SslContextFactory.Server sslContextFactory = (SslContextFactory.Server) sslConnectionFactory.getSslContextFactory();
|
||||
final SslContextFactory.Server sslContextFactory = sslConnectionFactory.getSslContextFactory();
|
||||
assertTrue(sslContextFactory.getNeedClientAuth());
|
||||
assertArrayEquals(INCLUDE_PROTOCOLS, sslContextFactory.getIncludeProtocols());
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class StandardServerConnectorFactoryTest {
|
|||
assertHttpConnectionFactorySecured(httpConnectionFactory);
|
||||
|
||||
final SslConnectionFactory sslConnectionFactory = assertSslConnectionFactoryFound(serverConnector);
|
||||
final SslContextFactory.Server sslContextFactory = (SslContextFactory.Server) sslConnectionFactory.getSslContextFactory();
|
||||
final SslContextFactory.Server sslContextFactory = sslConnectionFactory.getSslContextFactory();
|
||||
assertFalse(sslContextFactory.getNeedClientAuth());
|
||||
|
||||
assertHttp2ConnectionFactoriesFound(serverConnector);
|
||||
|
@ -127,7 +127,7 @@ class StandardServerConnectorFactoryTest {
|
|||
assertNull(connectionFactory);
|
||||
|
||||
final SslConnectionFactory sslConnectionFactory = assertSslConnectionFactoryFound(serverConnector);
|
||||
final SslContextFactory.Server sslContextFactory = (SslContextFactory.Server) sslConnectionFactory.getSslContextFactory();
|
||||
final SslContextFactory.Server sslContextFactory = sslConnectionFactory.getSslContextFactory();
|
||||
assertFalse(sslContextFactory.getNeedClientAuth());
|
||||
|
||||
assertHttp2ConnectionFactoriesFound(serverConnector);
|
||||
|
|
|
@ -99,28 +99,6 @@
|
|||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${jetty.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.littleshoot</groupId>
|
||||
<artifactId>littleproxy</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
|
|
|
@ -35,7 +35,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.apache.nifi.events.EventReporter;
|
||||
import org.apache.nifi.remote.Peer;
|
||||
import org.apache.nifi.remote.PeerDescription;
|
||||
|
@ -339,7 +338,6 @@ public class PeerSelector {
|
|||
* @param direction whether sending flowfiles to these peers or receiving them
|
||||
* @return the map of weighted peers
|
||||
*/
|
||||
@NotNull
|
||||
private Map<PeerStatus, Double> createDestinationMap(Set<PeerStatus> peerStatuses, TransferDirection direction) {
|
||||
final Map<PeerStatus, Double> peerWorkloads = new HashMap<>();
|
||||
|
||||
|
@ -469,7 +467,6 @@ public class PeerSelector {
|
|||
*
|
||||
* @return the set of queryable peers (empty set if the cache is {@code null})
|
||||
*/
|
||||
@NotNull
|
||||
private Set<PeerStatus> getLastFetchedQueryablePeers() {
|
||||
return peerStatusCache != null ? peerStatusCache.getStatuses() : Collections.emptySet();
|
||||
}
|
||||
|
@ -479,7 +476,6 @@ public class PeerSelector {
|
|||
*
|
||||
* @return the most recent peer statuses (empty set if the cache is {@code null})
|
||||
*/
|
||||
@NotNull
|
||||
private Set<PeerStatus> getPeerStatuses() {
|
||||
if (isPeerRefreshNeeded()) {
|
||||
refreshPeerStatusCache();
|
||||
|
|
|
@ -19,12 +19,12 @@ package org.apache.nifi.remote.cluster;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Collection;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import jakarta.xml.bind.Marshaller;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.apache.nifi.remote.cluster;
|
||||
|
||||
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
|
||||
|
||||
public class NodeInformationAdapter extends XmlAdapter<AdaptedNodeInformation, NodeInformation> {
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,11 +44,11 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -20,12 +20,12 @@ import java.io.IOException;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.nifi.web.util.WebUtils;
|
||||
|
|
|
@ -20,10 +20,10 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||
import com.fasterxml.jackson.annotation.JsonInclude.Value;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
|
||||
|
||||
import javax.ws.rs.ext.ContextResolver;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
import jakarta.ws.rs.ext.ContextResolver;
|
||||
import jakarta.ws.rs.ext.Provider;
|
||||
|
||||
@Provider
|
||||
public class ObjectMapperResolver implements ContextResolver<ObjectMapper> {
|
||||
|
@ -33,7 +33,7 @@ public class ObjectMapperResolver implements ContextResolver<ObjectMapper> {
|
|||
public ObjectMapperResolver() {
|
||||
mapper = new ObjectMapper();
|
||||
mapper.setDefaultPropertyInclusion(Value.construct(Include.NON_NULL, Include.ALWAYS));
|
||||
mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(mapper.getTypeFactory()));
|
||||
mapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(mapper.getTypeFactory()));
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ package org.apache.nifi.web.util;
|
|||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -24,11 +24,11 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.client.Client;
|
||||
import javax.ws.rs.client.ClientBuilder;
|
||||
import javax.ws.rs.core.UriBuilderException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.ws.rs.client.Client;
|
||||
import jakarta.ws.rs.client.ClientBuilder;
|
||||
import jakarta.ws.rs.core.UriBuilderException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@ import org.mockito.Mock;
|
|||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
|
||||
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
|
||||
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency> <!-- handling this explicitly Must be in root lib -->
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import java.util.Objects;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -20,10 +20,10 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -20,8 +20,8 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import java.util.Objects;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -20,10 +20,10 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -20,8 +20,8 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import java.util.Objects;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.extension.manifest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@ApiModel
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.nifi.extension.manifest;
|
|||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
|
|
|
@ -20,10 +20,10 @@ import org.apache.nifi.extension.manifest.ExtensionManifest;
|
|||
import org.apache.nifi.extension.manifest.parser.ExtensionManifestException;
|
||||
import org.apache.nifi.extension.manifest.parser.ExtensionManifestParser;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.JAXBElement;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.io.InputStream;
|
||||
|
||||
|
|
|
@ -90,16 +90,6 @@
|
|||
<version>2.0.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xmlunit</groupId>
|
||||
<artifactId>xmlunit-core</artifactId>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.apache.nifi.atlas;
|
||||
|
||||
import com.sun.jersey.api.client.UniformInterfaceException;
|
||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
||||
import org.apache.atlas.AtlasClientV2;
|
||||
import org.apache.atlas.AtlasErrorCode;
|
||||
import org.apache.atlas.AtlasServiceException;
|
||||
|
@ -33,7 +32,6 @@ import org.apache.nifi.util.Tuple;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -170,9 +168,9 @@ public class NiFiAtlasClient implements AutoCloseable {
|
|||
private AtlasTypesDef getTypeDefs(String ... typeNames) throws AtlasServiceException {
|
||||
final AtlasTypesDef typeDefs = new AtlasTypesDef();
|
||||
for (int i = 0; i < typeNames.length; i++) {
|
||||
final MultivaluedMap<String, String> searchParams = new MultivaluedMapImpl();
|
||||
searchParams.add(SearchFilter.PARAM_NAME, typeNames[i]);
|
||||
final AtlasTypesDef typeDef = atlasClient.getAllTypeDefs(new SearchFilter(searchParams));
|
||||
final SearchFilter searchFilter = new SearchFilter();
|
||||
searchFilter.setParam(SearchFilter.PARAM_NAME, typeNames[i]);
|
||||
final AtlasTypesDef typeDef = atlasClient.getAllTypeDefs(searchFilter);
|
||||
typeDefs.getEntityDefs().addAll(typeDef.getEntityDefs());
|
||||
}
|
||||
logger.debug("typeDefs={}", typeDefs);
|
||||
|
|
|
@ -34,12 +34,12 @@ import org.glassfish.jersey.client.ClientProperties;
|
|||
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.ws.rs.client.Client;
|
||||
import javax.ws.rs.client.Entity;
|
||||
import javax.ws.rs.client.Invocation;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import jakarta.ws.rs.client.Client;
|
||||
import jakarta.ws.rs.client.Entity;
|
||||
import jakarta.ws.rs.client.Invocation;
|
||||
import jakarta.ws.rs.client.WebTarget;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
|
|
@ -20,8 +20,8 @@ package org.apache.nifi.processor.util.list;
|
|||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlTransient;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* A simple POJO for maintaining state about the last entities listed by an AbstractListProcessor that was performed so that
|
||||
|
|
|
@ -25,26 +25,8 @@
|
|||
<artifactId>nifi-flow-registry-client-bundle</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<!-- Set JAX RS and Jersey versions for Registry Client library -->
|
||||
<jakarta.rs.api.version>3.1.0</jakarta.rs.api.version>
|
||||
<jersey.bom.version>3.1.3</jersey.bom.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>nifi-flow-registry-client-services</module>
|
||||
<module>nifi-flow-registry-client-nar</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey</groupId>
|
||||
<artifactId>jersey-bom</artifactId>
|
||||
<version>${jersey.bom.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
<groupId>org.glassfish.jersey.core</groupId>
|
||||
<artifactId>jersey-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.containers</groupId>
|
||||
<artifactId>jersey-container-servlet</artifactId>
|
||||
</dependency>
|
||||
<!-- Override scope to compile since framework NAR won't get this from a parent NAR -->
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb2.maven2</groupId>
|
||||
<artifactId>maven-jaxb2-plugin</artifactId>
|
||||
<groupId>org.patrodyne.jvnet</groupId>
|
||||
<artifactId>hisrc-higherjaxb40-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>current</id>
|
||||
|
|
|
@ -29,10 +29,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.JAXBElement;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
|
|
|
@ -20,8 +20,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import org.apache.nifi.web.api.dto.util.DateTimeAdapter;
|
||||
import org.apache.nifi.web.api.dto.util.TimezoneAdapter;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.nifi.web.api.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Details for the access configuration.
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.nifi.web.api.dto;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.nifi.web.api.entity.TenantEntity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.nifi.web.api.dto;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.nifi.web.api.entity.ComponentReferenceEntity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Details for the access configuration.
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.nifi.web.api.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of a response to the API. This particular entity holds the users access status.
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.nifi.web.api.dto;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.nifi.web.api.dto.util.InstantAdapter;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import java.time.Instant;
|
||||
|
||||
@XmlRootElement(name = "accessTokenExpiration")
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.nifi.web.api.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
import java.util.Collection;
|
||||
|
||||
@XmlType(name = "affectedComponent")
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.nifi.web.api.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* The allowable values for a property with a constrained set of options.
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.nifi.web.api.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* A request to analyze (a part) of the flow.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue