You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2024/01/23 00:52:32 UTC
(nifi) branch main updated: NIFI-12657 Removed MiNiFi C2 Server modules This closes #8291.
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 3fcf5f25b4 NIFI-12657 Removed MiNiFi C2 Server modules This closes #8291.
3fcf5f25b4 is described below
commit 3fcf5f25b4c705f6909d058d81a7b8b6d6a648f1
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Mon Jan 22 16:21:04 2024 -0600
NIFI-12657 Removed MiNiFi C2 Server modules
This closes #8291.
Signed-off-by: Joseph Witt <jo...@apache.org>
---
.github/workflows/ci-workflow.yml | 3 -
.github/workflows/docker-tests.yml | 7 -
.github/workflows/integration-tests.yml | 1 -
c2/c2-client-bundle/README.md | 2 +-
minifi/minifi-c2/README.md | 55 --
minifi/minifi-c2/c2-integration-test.graphml | 630 ---------------------
minifi/minifi-c2/c2-integration-test.png | Bin 26942 -> 0 bytes
minifi/minifi-c2/minifi-c2-api/pom.xml | 40 --
.../apache/nifi/minifi/c2/api/Configuration.java | 55 --
.../nifi/minifi/c2/api/ConfigurationProvider.java | 43 --
.../c2/api/ConfigurationProviderException.java | 42 --
.../minifi/c2/api/InvalidParameterException.java | 28 -
.../minifi/c2/api/cache/ConfigurationCache.java | 39 --
.../c2/api/cache/ConfigurationCacheFileInfo.java | 53 --
.../c2/api/cache/WriteableConfiguration.java | 29 -
.../minifi/c2/api/properties/C2Properties.java | 53 --
.../security/authorization/AuthorityGranter.java | 36 --
.../authorization/AuthorizationException.java | 26 -
.../c2/api/security/authorization/Authorizer.java | 36 --
.../minifi/c2/api/util/DelegatingOutputStream.java | 54 --
.../org/apache/nifi/minifi/c2/api/util/Pair.java | 44 --
minifi/minifi-c2/minifi-c2-assembly/LICENSE | 330 -----------
minifi/minifi-c2/minifi-c2-assembly/NOTICE | 240 --------
minifi/minifi-c2/minifi-c2-assembly/README.md | 96 ----
minifi/minifi-c2/minifi-c2-assembly/pom.xml | 247 --------
.../src/main/assembly/dependencies.xml | 80 ---
.../src/main/resources/bin/c2.bat | 41 --
.../src/main/resources/bin/c2.sh | 125 ----
.../src/main/resources/conf/authorities.yaml | 17 -
.../src/main/resources/conf/authorizations.yaml | 63 ---
.../src/main/resources/conf/c2.properties | 27 -
.../src/main/resources/conf/logback.xml | 38 --
.../src/main/resources/conf/minifi-c2-context.xml | 73 ---
.../conf/minifi-c2-web-security-context.xml | 31 -
.../resources/files/raspi3/config.test.json.v1 | 54 --
.../minifi-c2-cache-filesystem/pom.xml | 35 --
.../filesystem/FileSystemCacheFileInfoImpl.java | 86 ---
.../filesystem/FileSystemConfigurationCache.java | 115 ----
.../FileSystemWritableConfiguration.java | 105 ----
.../FileSystemConfigurationCacheTest.java | 104 ----
.../src/test/resources/files/config.test.json.v1 | 54 --
.../minifi-c2-cache/minifi-c2-cache-s3/pom.xml | 53 --
.../minifi/c2/cache/s3/S3CacheFileInfoImpl.java | 130 -----
.../minifi/c2/cache/s3/S3ConfigurationCache.java | 106 ----
.../nifi/minifi/c2/cache/s3/S3OutputStream.java | 219 -------
.../c2/cache/s3/S3WritableConfiguration.java | 101 ----
minifi/minifi-c2/minifi-c2-cache/pom.xml | 32 --
minifi/minifi-c2/minifi-c2-docker/README.md | 27 -
.../minifi-c2-docker/dockerhub/.dockerignore | 19 -
.../minifi-c2-docker/dockerhub/DockerBuild.sh | 29 -
.../minifi-c2-docker/dockerhub/DockerImage.txt | 16 -
.../minifi-c2-docker/dockerhub/DockerRun.sh | 19 -
.../minifi-c2-docker/dockerhub/Dockerfile | 59 --
.../minifi-c2-docker/dockermaven/.dockerignore | 17 -
.../minifi-c2-docker/dockermaven/Dockerfile | 73 ---
.../dockermaven/integration-test.sh | 74 ---
minifi/minifi-c2/minifi-c2-docker/pom.xml | 167 ------
.../minifi-c2-integration-tests/README.md | 27 -
.../minifi-c2/minifi-c2-integration-tests/pom.xml | 128 -----
.../c2/integration/test/AbstractTestUnsecure.java | 111 ----
...elegatingConfigurationProviderUnsecureTest.java | 37 --
.../test/FileSystemCacheProviderUnsecureTest.java | 36 --
.../test/health/HttpStatusCodeHealthCheck.java | 55 --
.../test/health/HttpsStatusCodeHealthCheck.java | 70 ---
.../conf/minifi-c2-context.xml | 56 --
.../test/resources/c2-secure/conf/authorities.yaml | 21 -
.../resources/c2-secure/conf/authorizations.yaml | 30 -
.../test/resources/c2-secure/conf/c2.properties | 27 -
.../conf/minifi-c2-context.xml | 56 --
.../c2-upstream-secure/conf/authorities.yaml | 17 -
.../c2-upstream-secure/conf/authorizations.yaml | 32 --
.../c2/files/raspi2/config.application.json.v1 | 39 --
.../c2/files/raspi3/config.application.json.v1 | 39 --
.../c2/files/raspi3/config.application.json.v2 | 39 --
...docker-compose-DelegatingProviderSecureTest.yml | 55 --
...cker-compose-DelegatingProviderUnsecureTest.yml | 32 --
...r-compose-FileSystemCacheProviderSecureTest.yml | 40 --
...cker-compose-FileSystemProviderUnsecureTest.yml | 25 -
.../src/test/resources/overlay.properties | 16 -
.../src/test/resources/squid/squid.conf | 19 -
minifi/minifi-c2/minifi-c2-jetty/pom.xml | 55 --
.../apache/nifi/minifi/c2/jetty/JettyServer.java | 187 ------
.../minifi-c2-provider-cache/pom.xml | 35 --
.../provider/cache/CacheConfigurationProvider.java | 46 --
.../cache/CacheConfigurationProviderTest.java | 71 ---
.../minifi-c2-provider-delegating/pom.xml | 48 --
.../DelegatingConfigurationProvider.java | 166 ------
.../DelegatingConfigurationProviderTest.java | 196 -------
.../minifi-c2-provider-util/pom.xml | 39 --
.../minifi/c2/provider/util/HttpConnector.java | 180 ------
minifi/minifi-c2/minifi-c2-provider/pom.xml | 33 --
minifi/minifi-c2/minifi-c2-service/pom.xml | 109 ----
.../minifi/c2/configuration/C2ResourceConfig.java | 37 --
.../minifi/c2/configuration/Configuration.java | 28 -
.../minifi/c2/security/SecurityConfiguration.java | 90 ---
.../C2AnonymousAuthenticationFilter.java | 38 --
.../authentication/C2AuthenticationToken.java | 51 --
.../authentication/X509AuthenticationFilter.java | 70 ---
.../authentication/X509AuthenticationProvider.java | 49 --
.../authentication/X509AuthenticationToken.java | 53 --
.../authorization/GrantedAuthorityAuthorizer.java | 138 -----
.../PrincipalStringAuthorityGranter.java | 54 --
.../nifi/minifi/c2/service/C2JsonProvider.java | 41 --
.../minifi/c2/service/C2JsonProviderFeature.java | 31 -
.../nifi/minifi/c2/service/C2ProtocolContext.java | 96 ----
.../nifi/minifi/c2/service/C2ProtocolService.java | 27 -
.../nifi/minifi/c2/service/ConfigService.java | 437 --------------
.../c2/service/ConfigurationProviderInfo.java | 51 --
.../c2/service/ConfigurationProviderKey.java | 69 ---
.../c2/service/ConfigurationProviderValue.java | 49 --
.../minifi/c2/service/SimpleC2ProtocolService.java | 132 -----
.../nifi/minifi/c2/util/HttpRequestUtil.java | 41 --
.../src/main/webapp/WEB-INF/web.xml | 59 --
minifi/minifi-c2/pom.xml | 38 --
.../main/markdown/minifi-java-agent-quick-start.md | 2 +-
minifi/minifi-integration-tests/README.md | 2 +-
minifi/minifi-integration-tests/pom.xml | 8 -
.../src/test/resources/Dockerfile.minific2.test | 24 -
.../c2-authoritative/conf/authorities.yaml | 21 -
.../c2-authoritative/conf/authorizations.yaml | 41 --
.../c2-authoritative/conf/c2.properties | 27 -
.../c2-authoritative/conf/minifi-c2-context.xml | 63 ---
.../files/edge1/raspi3/config.application.json.v1 | 39 --
.../files/edge2/raspi2/config.application.json.v1 | 39 --
.../files/edge3/raspi3/config.application.json.v1 | 39 --
.../c2/hierarchical/c2-edge2/conf/c2.properties | 27 -
.../c2-edge2/conf/minifi-c2-context.xml | 62 --
.../c2/hierarchical/minifi-edge1/bootstrap.conf | 211 -------
.../c2/hierarchical/minifi-edge1/expected.json | 8 -
.../c2/hierarchical/minifi-edge2/bootstrap.conf | 204 -------
.../c2/hierarchical/minifi-edge2/expected.json | 8 -
.../c2/hierarchical/minifi-edge3/bootstrap.conf | 214 -------
.../c2/hierarchical/minifi-edge3/expected.json | 8 -
.../c2-authoritative/conf/authorities.yaml | 21 -
.../c2-authoritative/conf/authorizations.yaml | 52 --
.../protocol/c2-authoritative/conf/c2.properties | 27 -
.../c2-authoritative/conf/minifi-c2-context.xml | 63 ---
.../files/raspi3/config.application.json.v1 | 162 ------
.../files/raspi4/config.application.json.v1 | 162 ------
.../c2/protocol/minifi-edge1/bootstrap.conf | 180 ------
.../c2/protocol/minifi-edge1/expected.json | 17 -
.../c2/protocol/minifi-edge2/bootstrap.conf | 181 ------
.../c2/protocol/minifi-edge2/expected.json | 17 -
.../c2/protocol/minifi-edge3/bootstrap.conf | 181 ------
.../c2/protocol/minifi-edge3/expected.json | 17 -
.../resources/docker-compose-c2-hierarchical.yml | 141 -----
.../test/resources/docker-compose-c2-protocol.yml | 100 ----
.../src/test/resources/squid/squid.conf | 19 -
minifi/pom.xml | 1 -
nifi-code-coverage/pom.xml | 41 --
150 files changed, 3 insertions(+), 10655 deletions(-)
diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml
index 9aacfdf0a8..6e8a0cdbf1 100644
--- a/.github/workflows/ci-workflow.yml
+++ b/.github/workflows/ci-workflow.yml
@@ -37,9 +37,7 @@ env:
--no-snapshot-updates
--no-transfer-progress
--fail-fast
- -pl -:minifi-c2-integration-tests
-pl -:minifi-integration-tests
- -pl -:minifi-c2-assembly
-pl -:minifi-assembly
-pl -:nifi-assembly
-pl -:nifi-kafka-connector-assembly
@@ -69,7 +67,6 @@ env:
-P include-new-ui
MAVEN_PROJECTS: >-
-pl -minifi/minifi-assembly
- -pl -minifi/minifi-c2/minifi-c2-assembly
-pl -minifi/minifi-toolkit/minifi-toolkit-assembly
-pl -nifi-registry/nifi-registry-assembly
-pl -nifi-registry/nifi-registry-toolkit/nifi-registry-toolkit-assembly
diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml
index 13fd9e961b..6c085c7874 100644
--- a/.github/workflows/docker-tests.yml
+++ b/.github/workflows/docker-tests.yml
@@ -31,8 +31,6 @@ on:
- 'nifi-toolkit/nifi-toolkit-encrypt-config/**'
- 'minifi/minifi-assembly/**'
- 'minifi/minifi-docker/**'
- - 'minifi/minifi-c2/minifi-c2-assembly/**'
- - 'minifi/minifi-c2/minifi-c2-docker/**'
pull_request:
paths:
- '.github/workflows/docker-tests.yml'
@@ -45,8 +43,6 @@ on:
- 'nifi-toolkit/nifi-toolkit-encrypt-config/**'
- 'minifi/minifi-assembly/**'
- 'minifi/minifi-docker/**'
- - 'minifi/minifi-c2/minifi-c2-assembly/**'
- - 'minifi/minifi-c2/minifi-c2-docker/**'
env:
DEFAULT_MAVEN_OPTS: >-
@@ -74,7 +70,6 @@ env:
-pl nifi-registry/nifi-registry-assembly
-pl nifi-toolkit/nifi-toolkit-assembly
-pl minifi/minifi-assembly
- -pl minifi/minifi-c2/minifi-c2-assembly
MAVEN_CLEAN_ARGUMENTS: >-
-T 2.0C
@@ -86,7 +81,6 @@ env:
-pl -nifi-toolkit/nifi-toolkit-cli
-pl -nifi-toolkit/nifi-toolkit-encrypt-config
-pl -minifi/minifi-assembly
- -pl -minifi/minifi-c2/minifi-c2-assembly
# build and test Docker Images
MAVEN_DOCKER_ARGUMENTS: >-
@@ -94,7 +88,6 @@ env:
-P docker
MAVEN_DOCKER_PROJECTS: >-
-pl minifi/minifi-docker
- -pl minifi/minifi-c2/minifi-c2-docker
-pl nifi-docker/dockermaven
-pl nifi-registry/nifi-registry-docker-maven/dockermaven
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index e0d5eb04c1..583323cdb0 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -66,7 +66,6 @@ env:
-P nifi-registry-integration-tests
MAVEN_BUILD_EXCLUDE_PROJECTS: >-
-pl -:minifi-assembly
- -pl -:minifi-c2-assembly
-pl -:nifi-assembly
-pl -:nifi-toolkit-assembly
-pl -:nifi-registry-assembly
diff --git a/c2/c2-client-bundle/README.md b/c2/c2-client-bundle/README.md
index 90915076d5..b9f83b2c7a 100644
--- a/c2/c2-client-bundle/README.md
+++ b/c2/c2-client-bundle/README.md
@@ -13,7 +13,7 @@
limitations under the License.
-->
## Apache NiFi MiNiFi Command and Control (C2) Client
-The c2-client-bundle provides implementation for the client aspect of the [C2 Protocol](https://cwiki.apache.org/confluence/display/MINIFI/C2+Design). The essence of the implementation is the heartbeat construction and the communication with the [C2 server](../../../../minifi-c2/README.md) via the C2HttpClient.
+The c2-client-bundle provides implementation for the client aspect of the [C2 Protocol](https://cwiki.apache.org/confluence/display/MINIFI/C2+Design). The essence of the implementation is the heartbeat construction and the communication with the C2 server via the C2HttpClient.
Currently, relying on the [C2 Protocol API](../c2-protocol) is limited to sending heartbeats and processing/acknowledging UPDATE configuration operation in the response (if any). When exposed the new configuration will be downloaded and passed back to the system using the C2 protocol.
diff --git a/minifi/minifi-c2/README.md b/minifi/minifi-c2/README.md
deleted file mode 100644
index 2d6c541b4e..0000000000
--- a/minifi/minifi-c2/README.md
+++ /dev/null
@@ -1,55 +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.
--->
-## Apache NiFi MiNiFi Command and Control (C2) Server
-MiNiFi agents allow us to push data flows down to smaller devices on the edge of the network. This provides many of the niceties of processing data with NiFi in a smaller package. One big challenge with many disparate agents running on all sorts of devices is coordinating their work and pushing out revised flows.
-
-The C2 server is the beginning of an attempt to address this usecase. It provides an endpoint for existing PullHttpChangeIngestor functionality that is intended to facilitate distributing appropriate flow definitions to each class of agent.
-
-In the assumed usecase one or more class of MiNiFi agent polls the C2 server periodically for updates to its flow. When there is a new version available, the C2 server will send it back to the agent at which point the agent will attempt to restart itself with the new flow, rolling back if there is a problem starting.
-
-The C2 server is intended to be extensible and flexibly configurable. The ConfigurationProvider interface is the main extension point where arbitrary logic should be able to be used to get updated flows. The server supports bidirectional TLS authentication and configurable authorization.
-
-### Usage
-After building, extract minifi-c2/minifi-c2-assembly/target/minifi-c2-VERSION-bin.tar.gz into a directory.
-
-./bin/c2.sh or ./bin/c2.bat will start the server.
-
-[./conf/c2.properties](./minifi-c2-assembly/src/main/resources/conf/c2.properties) can be used to configure the listening port, tls settings.
-
-[./conf/minifi-c2-context.xml](./minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml) can be configured according to the [configuration provider examples below](#configuration-providers) to retrieve configuration payloads from the appropriate provider.
-
-[./conf/authorities.yaml](./minifi-c2-assembly/src/main/resources/conf/authorities.yaml) determines the authority or authorities (arbitrary string value) to assign to requesters based on their DN.
-
-[./conf/authorizations.yaml](./minifi-c2-assembly/src/main/resources/conf/authorizations.yaml) is used to determine whether to allow access based on a requester's authorities.
-
-When using the `CacheConfigurationProvider`, by default, the server will look for files in the `./files/` directory to satisfy requests. It will resolve the correct file using the query parameters and content type provided to it and then serve up either the requested version if specified in the query parameters or the latest if unspecified. Alternatively, if the `S3ConfigurationCache` is used, the server will look for files in a given Amazon S3 bucket. The S3 bucket name, prefix, region [...]
-
-The pattern can be configured in [./conf/minifi-c2-context.xml](./minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml) and the default value (${class}/config) will replace ${class} with the class query parameter and then look for CLASS/config.CONTENT_TYPE.vVERSION in the directory structure.
-
-Ex: http://localhost:10090/c2/config?class=raspi&version=1 with an Accept header that matches application/json would result in [./files/raspi3/config.application.json.v1](./minifi-c2-assembly/src/main/resources/files/raspi3/config.application.json.v1) and omitting the version parameter would look for the highest version number in the directory.
-
-The version resolution is cached in memory to accommodate many devices polling periodically. The cache duration can be configured with additional arguments in [./conf/minifi-c2-context.xml](../minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/minifi-c2-context.xml#L55) that call the [overloaded constructor.](./minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigService.java#L81)
-
-MiNiFi Java agents can be configured to poll the C2 server by [configuring the PullHttpChangeIngestor in their bootstrap.conf.](../minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/bootstrap.conf#L37)
-
-### Configuration Providers:
-There are two `ConfigurationProvider` implementations provided out of the box.
-1. The [CacheConfigurationProvider](./minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml) looks at a directory on the filesystem or in an Amazon S3 bucket. Which backend storage is used can be selected in `minifi-c2-context.xml` via the constructors to `CacheConfigurationProvider`.
-2. The [DelegatingConfigurationProvider](./minifi-c2-integration-tests/src/test/resources/c2-unsecure-delegating/conf/minifi-c2-context.xml) delegates to another C2 server to allow for hierarchical C2 structures to help with scaling and/or bridging networks.
-
-### Example network diagram:
-Below is a network diagram showing the different configurations tested by [our hierarchical integration test docker-compose file.](../minifi-integration-tests/src/test/resources/docker-compose-c2-hierarchical.yml) It consists of a "cluster" network where real processing might occur as well as 3 "edge" networks that can get configuration from the cluster network a few different ways. The edge1 instance can directly access the authoritative C2 server via HTTPS. The edge2 instance is rep [...]
-
-
diff --git a/minifi/minifi-c2/c2-integration-test.graphml b/minifi/minifi-c2/c2-integration-test.graphml
deleted file mode 100644
index 3171924b30..0000000000
--- a/minifi/minifi-c2/c2-integration-test.graphml
+++ /dev/null
@@ -1,630 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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.
--->
-<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns https://www.yworks.com/xml/schema/graphm [...]
- <!--Created by yEd 3.17-->
- <key attr.name="Description" attr.type="string" for="graph" id="d0"/>
- <key for="port" id="d1" yfiles.type="portgraphics"/>
- <key for="port" id="d2" yfiles.type="portgeometry"/>
- <key for="port" id="d3" yfiles.type="portuserdata"/>
- <key attr.name="url" attr.type="string" for="node" id="d4"/>
- <key attr.name="description" attr.type="string" for="node" id="d5"/>
- <key for="node" id="d6" yfiles.type="nodegraphics"/>
- <key for="graphml" id="d7" yfiles.type="resources"/>
- <key attr.name="url" attr.type="string" for="edge" id="d8"/>
- <key attr.name="description" attr.type="string" for="edge" id="d9"/>
- <key for="edge" id="d10" yfiles.type="edgegraphics"/>
- <graph edgedefault="directed" id="G">
- <data key="d0"/>
- <node id="n0">
- <data key="d5"/>
- <data key="d6">
- <y:ShapeNode>
- <y:Geometry height="235.78499794006348" width="200.0" x="697.236499786377" y="142.0"/>
- <y:Fill hasColor="false" transparent="false"/>
- <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="sides" modelPosition="n" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.509765625" x="49.7451171875" y="-21.96875">Cluster Network</y:NodeLabel>
- <y:Shape type="rectangle"/>
- </y:ShapeNode>
- </data>
- </node>
- <node id="n1">
- <data key="d5"/>
- <data key="d6">
- <y:ShapeNode>
- <y:Geometry height="235.78499794006348" width="353.0" x="337.4729995727539" y="142.0"/>
- <y:Fill hasColor="false" transparent="false"/>
- <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="sides" modelPosition="s" textColor="#000000" verticalTextPosition="bottom" visible="true" width="95.751953125" x="128.6240234375" y="239.78499794006348">Edge1 Network</y:NodeLabel>
- <y:Shape type="rectangle"/>
- </y:ShapeNode>
- </data>
- </node>
- <node id="n2">
- <data key="d5"/>
- <data key="d6">
- <y:ShapeNode>
- <y:Geometry height="235.78499794006348" width="244.92939949035645" x="673.236499786377" y="383.0"/>
- <y:Fill hasColor="false" transparent="false"/>
- <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="sides" modelPosition="s" textColor="#000000" verticalTextPosition="bottom" visible="true" width="95.751953125" x="74.58872318267822" y="239.78499794006348">Edge2 Network</y:NodeLabel>
- <y:Shape type="rectangle"/>
- </y:ShapeNode>
- </data>
- </node>
- <node id="n3">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="46.887996673583984" width="39.527000427246094" x="673.236499786377" y="232.556001663208"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="102.66015625" x="-31.566577911376953" y="50.887996673583984">C2-Authoritative<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="1"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <node id="n4">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="45.56999588012695" width="67.49800109863281" x="406.2509994506836" y="233.21500205993652"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="82.3984375" x="-7.450218200683594" y="49.56999588012695">MiNiFi-Edge1<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="2"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <node id="n5">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="46.887996673583984" width="39.527000427246094" x="777.4729995727539" y="353.556001663208"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="62.177734375" x="-11.325366973876953" y="50.887996673583984">C2-Edge2<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="1"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <node id="n6">
- <data key="d5"/>
- <data key="d6">
- <y:ShapeNode>
- <y:Geometry height="235.78499794006348" width="353.0" x="904.0" y="142.0"/>
- <y:Fill hasColor="false" transparent="false"/>
- <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="sides" modelPosition="s" textColor="#000000" verticalTextPosition="bottom" visible="true" width="95.751953125" x="128.6240234375" y="239.78499794006348">Edge3 Network</y:NodeLabel>
- <y:Shape type="rectangle"/>
- </y:ShapeNode>
- </data>
- </node>
- <node id="n7">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="56.231998443603516" width="35.095298767089844" x="883.0706005096436" y="227.88400077819824"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="79.955078125" x="-22.429889678955078" y="60.231998443603516">Squid-Edge3<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="3"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <node id="n8">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="45.56999588012695" width="67.49800109863281" x="763.4874992370605" y="494.2150020599365"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="82.3984375" x="-7.450218200683594" y="49.56999588012695">MiNiFi-Edge2<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="2"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <node id="n9">
- <data key="d5"/>
- <data key="d6">
- <y:SVGNode>
- <y:Geometry height="45.56999588012695" width="67.49800109863281" x="1150.2509994506836" y="233.21500205993652"/>
- <y:Fill color="#CCCCFF" transparent="false"/>
- <y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="82.3984375" x="-7.450218200683594" y="49.56999588012695">MiNiFi-Edge3<y:LabelModel>
- <y:SmartNodeLabelModel distance="4.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="-0.5" nodeRatioX="0.0" nodeRatioY="0.5" offsetX="0.0" offsetY="4.0" upX="0.0" upY="-1.0"/>
- </y:ModelParameter>
- </y:NodeLabel>
- <y:SVGNodeProperties usingVisualBounds="true"/>
- <y:SVGModel svgBoundsPolicy="0">
- <y:SVGContent refid="2"/>
- </y:SVGModel>
- </y:SVGNode>
- </data>
- </node>
- <edge id="e0" source="n7" target="n3">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" hasText="false" height="4.0" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true" width="4.0" x="-87.13782024383545" y="-32.0">
- <y:LabelModel>
- <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartEdgeLabelModelParameter angle="0.0" distance="30.0" distanceToCenter="true" position="right" ratio="0.5" segment="0"/>
- </y:ModelParameter>
- <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
- </y:EdgeLabel>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- <edge id="e1" source="n5" target="n3">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="797.236499786377" y="307.0"/>
- </y:Path>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.884765625" x="-49.6274086199204" y="-39.45283459422296">https<y:LabelModel>
- <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartEdgeLabelModelParameter angle="0.0" distance="14.742631550828632" distanceToCenter="false" position="left" ratio="0.5051381794669789" segment="0"/>
- </y:ModelParameter>
- <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
- </y:EdgeLabel>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- <edge id="e2" source="n2" target="n5">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- <edge id="e3" source="n8" target="n5">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="866.0" y="430.0"/>
- </y:Path>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true" width="28.6328125" x="62.408460259019535" y="-57.01320364330013">http<y:LabelModel>
- <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartEdgeLabelModelParameter angle="0.0" distance="13.608613619663785" distanceToCenter="false" position="right" ratio="3.4125279749916686" segment="-2"/>
- </y:ModelParameter>
- <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
- </y:EdgeLabel>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- <edge id="e4" source="n4" target="n3">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.884765625" x="92.36250114440918" y="21.015625">https<y:LabelModel>
- <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartEdgeLabelModelParameter angle="0.0" distance="30.0" distanceToCenter="true" position="right" ratio="0.5" segment="0"/>
- </y:ModelParameter>
- <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
- </y:EdgeLabel>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- <edge id="e5" source="n9" target="n7">
- <data key="d9"/>
- <data key="d10">
- <y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
- <y:LineStyle color="#000000" type="line" width="1.0"/>
- <y:Arrows source="none" target="standard"/>
- <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true" width="152.470703125" x="-202.3311014175415" y="-38.984375">https through http proxy<y:LabelModel>
- <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
- </y:LabelModel>
- <y:ModelParameter>
- <y:SmartEdgeLabelModelParameter angle="0.0" distance="30.0" distanceToCenter="true" position="right" ratio="0.5" segment="0"/>
- </y:ModelParameter>
- <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
- </y:EdgeLabel>
- <y:BendStyle smoothed="false"/>
- </y:PolyLineEdge>
- </data>
- </edge>
- </graph>
- <data key="d7">
- <y:Resources>
- <y:Resource id="1"><?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- x="0px" y="0px" width="41px" height="48px" viewBox="-0.875 -0.887 41 48" enable-background="new -0.875 -0.887 41 48"
- xml:space="preserve">
-<defs>
-</defs>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-979.1445" x2="682.0508" y2="-979.1445" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#3C89C9"/>
- <stop offset="0.1482" style="stop-color:#60A6DD"/>
- <stop offset="0.3113" style="stop-color:#81C1F0"/>
- <stop offset="0.4476" style="stop-color:#95D1FB"/>
- <stop offset="0.5394" style="stop-color:#9CD7FF"/>
- <stop offset="0.636" style="stop-color:#98D4FD"/>
- <stop offset="0.7293" style="stop-color:#8DCAF6"/>
- <stop offset="0.8214" style="stop-color:#79BBEB"/>
- <stop offset="0.912" style="stop-color:#5EA5DC"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M19.625,36.763C8.787,36.763,0,34.888,0,32.575v10c0,2.313,8.787,4.188,19.625,4.188
- c10.839,0,19.625-1.875,19.625-4.188v-10C39.25,34.888,30.464,36.763,19.625,36.763z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-973.1445" x2="682.0508" y2="-973.1445" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#9CD7FF"/>
- <stop offset="0.0039" style="stop-color:#9DD7FF"/>
- <stop offset="0.2273" style="stop-color:#BDE5FF"/>
- <stop offset="0.4138" style="stop-color:#D1EEFF"/>
- <stop offset="0.5394" style="stop-color:#D9F1FF"/>
- <stop offset="0.6155" style="stop-color:#D5EFFE"/>
- <stop offset="0.6891" style="stop-color:#C9E7FA"/>
- <stop offset="0.7617" style="stop-color:#B6DAF3"/>
- <stop offset="0.8337" style="stop-color:#9AC8EA"/>
- <stop offset="0.9052" style="stop-color:#77B0DD"/>
- <stop offset="0.9754" style="stop-color:#4D94CF"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M19.625,36.763c10.839,0,19.625-1.875,19.625-4.188l-1.229-2c0,2.168-8.235,3.927-18.396,3.927
- c-9.481,0-17.396-1.959-18.396-3.927l-1.229,2C0,34.888,8.787,36.763,19.625,36.763z"/>
-<path fill="#3C89C9" d="M19.625,26.468c10.16,0,19.625,2.775,19.625,2.775c-0.375,2.721-5.367,5.438-19.554,5.438
- c-12.125,0-18.467-2.484-19.541-4.918C-0.127,29.125,9.465,26.468,19.625,26.468z"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-965.6948" x2="682.0508" y2="-965.6948" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#3C89C9"/>
- <stop offset="0.1482" style="stop-color:#60A6DD"/>
- <stop offset="0.3113" style="stop-color:#81C1F0"/>
- <stop offset="0.4476" style="stop-color:#95D1FB"/>
- <stop offset="0.5394" style="stop-color:#9CD7FF"/>
- <stop offset="0.636" style="stop-color:#98D4FD"/>
- <stop offset="0.7293" style="stop-color:#8DCAF6"/>
- <stop offset="0.8214" style="stop-color:#79BBEB"/>
- <stop offset="0.912" style="stop-color:#5EA5DC"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M19.625,23.313C8.787,23.313,0,21.438,0,19.125v10c0,2.313,8.787,4.188,19.625,4.188
- c10.839,0,19.625-1.875,19.625-4.188v-10C39.25,21.438,30.464,23.313,19.625,23.313z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-959.6948" x2="682.0508" y2="-959.6948" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#9CD7FF"/>
- <stop offset="0.0039" style="stop-color:#9DD7FF"/>
- <stop offset="0.2273" style="stop-color:#BDE5FF"/>
- <stop offset="0.4138" style="stop-color:#D1EEFF"/>
- <stop offset="0.5394" style="stop-color:#D9F1FF"/>
- <stop offset="0.6155" style="stop-color:#D5EFFE"/>
- <stop offset="0.6891" style="stop-color:#C9E7FA"/>
- <stop offset="0.7617" style="stop-color:#B6DAF3"/>
- <stop offset="0.8337" style="stop-color:#9AC8EA"/>
- <stop offset="0.9052" style="stop-color:#77B0DD"/>
- <stop offset="0.9754" style="stop-color:#4D94CF"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M19.625,23.313c10.839,0,19.625-1.875,19.625-4.188l-1.229-2c0,2.168-8.235,3.926-18.396,3.926
- c-9.481,0-17.396-1.959-18.396-3.926l-1.229,2C0,21.438,8.787,23.313,19.625,23.313z"/>
-<path fill="#3C89C9" d="M19.476,13.019c10.161,0,19.625,2.775,19.625,2.775c-0.375,2.721-5.367,5.438-19.555,5.438
- c-12.125,0-18.467-2.485-19.541-4.918C-0.277,15.674,9.316,13.019,19.476,13.019z"/>
-<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-952.4946" x2="682.0508" y2="-952.4946" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#3C89C9"/>
- <stop offset="0.1482" style="stop-color:#60A6DD"/>
- <stop offset="0.3113" style="stop-color:#81C1F0"/>
- <stop offset="0.4476" style="stop-color:#95D1FB"/>
- <stop offset="0.5394" style="stop-color:#9CD7FF"/>
- <stop offset="0.636" style="stop-color:#98D4FD"/>
- <stop offset="0.7293" style="stop-color:#8DCAF6"/>
- <stop offset="0.8214" style="stop-color:#79BBEB"/>
- <stop offset="0.912" style="stop-color:#5EA5DC"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_5_)" d="M19.625,10.113C8.787,10.113,0,8.238,0,5.925v10c0,2.313,8.787,4.188,19.625,4.188
- c10.839,0,19.625-1.875,19.625-4.188v-10C39.25,8.238,30.464,10.113,19.625,10.113z"/>
-<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="642.8008" y1="-946.4946" x2="682.0508" y2="-946.4946" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#9CD7FF"/>
- <stop offset="0.0039" style="stop-color:#9DD7FF"/>
- <stop offset="0.2273" style="stop-color:#BDE5FF"/>
- <stop offset="0.4138" style="stop-color:#D1EEFF"/>
- <stop offset="0.5394" style="stop-color:#D9F1FF"/>
- <stop offset="0.6155" style="stop-color:#D5EFFE"/>
- <stop offset="0.6891" style="stop-color:#C9E7FA"/>
- <stop offset="0.7617" style="stop-color:#B6DAF3"/>
- <stop offset="0.8337" style="stop-color:#9AC8EA"/>
- <stop offset="0.9052" style="stop-color:#77B0DD"/>
- <stop offset="0.9754" style="stop-color:#4D94CF"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<path fill="url(#SVGID_6_)" d="M19.625,10.113c10.839,0,19.625-1.875,19.625-4.188l-1.229-2c0,2.168-8.235,3.926-18.396,3.926
- c-9.481,0-17.396-1.959-18.396-3.926L0,5.925C0,8.238,8.787,10.113,19.625,10.113z"/>
-<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="644.0293" y1="-943.4014" x2="680.8223" y2="-943.4014" gradientTransform="matrix(1 0 0 -1 -642.8008 -939.4756)">
- <stop offset="0" style="stop-color:#9CD7FF"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</linearGradient>
-<ellipse fill="url(#SVGID_7_)" cx="19.625" cy="3.926" rx="18.396" ry="3.926"/>
-<path opacity="0.24" fill="#FFFFFF" enable-background="new " d="M31.04,45.982c0,0-4.354,0.664-7.29,0.781
- c-3.125,0.125-8.952,0-8.952,0l-2.384-10.292l0.044-2.108l-1.251-1.154L9.789,23.024l-0.082-0.119L9.5,20.529l-1.65-1.254
- L5.329,8.793c0,0,4.213,0.903,7.234,1.07s8.375,0.25,8.375,0.25l3,9.875l-0.25,1.313l1.063,2.168l2.312,9.645l-0.521,1.416
- l1.46,1.834L31.04,45.982z"/>
-</svg>
-</y:Resource>
- <y:Resource id="2"><?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- x="0px" y="0px" width="68px" height="46px" viewBox="-0.064 -0.075 68 46" enable-background="new -0.064 -0.075 68 46"
- xml:space="preserve">
-<defs>
-</defs>
-<radialGradient id="SVGID_1_" cx="478.8413" cy="1991.2729" r="21.6001" gradientTransform="matrix(1.15 0 0 1 -526.6598 -1982.4023)" gradientUnits="userSpaceOnUse">
- <stop offset="0" style="stop-color:#F2F2F2"/>
- <stop offset="1" style="stop-color:#8D8D8D"/>
-</radialGradient>
-<path fill="url(#SVGID_1_)" d="M10.263,1.903c0-0.987,0.807-1.794,1.794-1.794h43.279c0.986,0,1.795,0.807,1.795,1.794v26.978
- c0,0.987-0.809,1.794-1.795,1.794h-43.28c-0.987,0-1.794-0.807-1.794-1.794L10.263,1.903L10.263,1.903z"/>
-<path display="none" fill="none" stroke="#3C89C9" stroke-width="0.2185" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
- M10.263,1.903c0-0.987,0.807-1.794,1.794-1.794h43.279c0.986,0,1.795,0.807,1.795,1.794v26.978c0,0.987-0.809,1.794-1.795,1.794
- h-43.28c-0.987,0-1.794-0.807-1.794-1.794L10.263,1.903L10.263,1.903z"/>
-<radialGradient id="SVGID_2_" cx="455.894" cy="1983.9624" r="47.8462" fx="493.5344" fy="1977.5143" gradientTransform="matrix(1.1935 0 0 1 -509.6731 -1982.4023)" gradientUnits="userSpaceOnUse">
- <stop offset="0" style="stop-color:#4D4D4D"/>
- <stop offset="1" style="stop-color:#999999"/>
-</radialGradient>
-<path fill="url(#SVGID_2_)" d="M11.18,2.819c0-0.987,0.807-1.794,1.794-1.794h41.649c0.986,0,1.795,0.807,1.795,1.794v24.943
- c0,0.985-0.809,1.794-1.795,1.794H12.974c-0.987,0-1.794-0.809-1.794-1.794V2.819z"/>
-<radialGradient id="SVGID_3_" cx="456.8843" cy="1984.0386" r="30.6699" gradientTransform="matrix(1.1923 0 0 1 -510.1314 -1982.4023)" gradientUnits="userSpaceOnUse">
- <stop offset="0" style="stop-color:#9CD7FF"/>
- <stop offset="1" style="stop-color:#3C89C9"/>
-</radialGradient>
-<path fill="url(#SVGID_3_)" d="M11.689,3.228c0-0.987,0.807-1.794,1.794-1.794h40.633c0.986,0,1.795,0.807,1.795,1.794v24.126
- c0,0.986-0.809,1.794-1.795,1.794H13.483c-0.987,0-1.794-0.809-1.794-1.794V3.228z"/>
-<path opacity="0.24" fill="#F2F2F2" d="M11.689,21.472V3.228c0-0.987,0.807-1.794,1.794-1.794h40.633
- c0.986,0,1.795,0.807,1.795,1.794v9.454c0,0.987-10.518,5.21-18.256,6.795C29.917,21.062,11.689,21.472,11.689,21.472z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="131.3501" y1="-212.2612" x2="131.3501" y2="-170.6274" gradientTransform="matrix(1 0 0 -1 -97.6001 -165.0498)">
- <stop offset="0" style="stop-color:#4D4D4D"/>
- <stop offset="0.0667" style="stop-color:#717171"/>
- <stop offset="0.069" style="stop-color:#757575"/>
- <stop offset="0.0831" style="stop-color:#8C8C8C"/>
- <stop offset="0.0996" style="stop-color:#9E9E9E"/>
- <stop offset="0.1196" style="stop-color:#AAAAAA"/>
- <stop offset="0.1466" style="stop-color:#B1B1B1"/>
- <stop offset="0.2121" style="stop-color:#B3B3B3"/>
- <stop offset="1" style="stop-color:#C5C5C5"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M58.385,32.234c-0.689-0.856-2.154-1.559-3.254-1.559H12c-1.1,0-2.552,0.711-3.227,1.579
- l-7.546,9.717C0,43.55,0.042,43.785,0,44.55v0.125c0.056,0.393,0.311,1.002,1.248,1.002h64.75c0.75,0.002,1.5-0.252,1.5-1.002V44.55
- c0-0.813,0-0.813-1.254-2.559L58.385,32.234z"/>
-<path opacity="0.23" fill="#F2F2F2" enable-background="new " d="M58.385,32.234c-0.689-0.856-2.154-1.559-3.254-1.559H12
- c-1.1,0-2.552,0.711-3.227,1.579l-7.055,9.085l58.098-7.33L58.385,32.234z"/>
-<path fill="#6E6E6E" d="M59.75,37.205c0.344,0.431,0.172,0.783-0.377,0.783H8.249c-0.55,0-0.742-0.369-0.427-0.819l2.786-3.986
- c0.315-0.45,1.023-0.819,1.573-0.819h42.729c0.551,0,1.279,0.354,1.623,0.783L59.75,37.205z"/>
-<path fill="#6E6E6E" d="M40.43,41.906c0.072,0.217-0.057,0.395-0.285,0.395H26.727c-0.229,0-0.364-0.18-0.3-0.398l0.822-2.826
- c0.064-0.221,0.303-0.399,0.532-0.399h11.167c0.229,0,0.475,0.179,0.547,0.396L40.43,41.906z"/>
-</svg>
-</y:Resource>
- <y:Resource id="3"><?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- x="0px" y="0px" width="36px" height="57px" viewBox="0 -0.741 36 57" enable-background="new 0 -0.741 36 57"
- xml:space="preserve">
-<defs>
-</defs>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="230.1768" y1="798.6021" x2="180.3346" y2="798.6021" gradientTransform="matrix(1 0 0 1 -195.2002 -770.8008)">
- <stop offset="0" style="stop-color:#4D4D4D"/>
- <stop offset="1" style="stop-color:#8D8D8D"/>
-</linearGradient>
-<rect y="0.943" fill="url(#SVGID_1_)" width="34.977" height="53.716"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="224.6807" y1="798.6021" x2="200.6973" y2="798.6021" gradientTransform="matrix(1 0 0 1 -195.2002 -770.8008)">
- <stop offset="0.0319" style="stop-color:#848484"/>
- <stop offset="0.1202" style="stop-color:#8C8C8C"/>
- <stop offset="0.308" style="stop-color:#969696"/>
- <stop offset="0.5394" style="stop-color:#999999"/>
- <stop offset="0.5501" style="stop-color:#9C9C9C"/>
- <stop offset="0.6256" style="stop-color:#B0B0B0"/>
- <stop offset="0.7118" style="stop-color:#BEBEBE"/>
- <stop offset="0.8178" style="stop-color:#C7C7C7"/>
- <stop offset="1" style="stop-color:#C9C9C9"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M5.497,0.943c7.945-1.258,16.04-1.258,23.983,0c0,17.905,0,35.811,0,53.716
- c-7.943,1.258-16.039,1.258-23.983,0C5.497,36.753,5.497,18.848,5.497,0.943z"/>
-<path fill="#515151" d="M5.497,14.621c7.995,0,15.989,0,23.983,0c0,13.346,0,26.693,0,40.037c-7.943,1.258-16.039,1.258-23.983,0
- C5.497,41.314,5.497,27.967,5.497,14.621z"/>
-<path opacity="0.43" fill="#565656" d="M5.497,4.745c7.982-0.628,16.001-0.628,23.983,0c0,2.707,0,5.413,0,8.12
- c-7.994,0-15.989,0-23.983,0C5.497,10.158,5.497,7.452,5.497,4.745z"/>
-<path opacity="0.43" fill="none" stroke="#4D4D4D" stroke-width="0.0999" stroke-miterlimit="10" d="M5.497,4.745
- c7.982-0.628,16.001-0.628,23.983,0c0,2.707,0,5.413,0,8.12c-7.994,0-15.989,0-23.983,0C5.497,10.158,5.497,7.452,5.497,4.745z"/>
-<polygon opacity="0.43" fill="#565656" stroke="#4D4D4D" stroke-width="0.0135" stroke-miterlimit="10" enable-background="new " points="
- 6.496,5.746 9.869,5.606 9.869,6.661 6.496,6.799 "/>
-<rect x="31.307" y="2.517" fill="#E7ED00" stroke="#717171" stroke-width="0.1926" stroke-miterlimit="10" width="3.692" height="1.505"/>
-<rect x="31.307" y="5.8" fill="#C8FF00" stroke="#717171" stroke-width="0.1926" stroke-miterlimit="10" width="3.692" height="1.507"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="29.4414" y1="35.1235" x2="5.4995" y2="35.1235">
- <stop offset="0" style="stop-color:#808080"/>
- <stop offset="0.1907" style="stop-color:#828282"/>
- <stop offset="0.2955" style="stop-color:#8A8A8A"/>
- <stop offset="0.3795" style="stop-color:#989898"/>
- <stop offset="0.4524" style="stop-color:#ACACAC"/>
- <stop offset="0.5175" style="stop-color:#C5C5C5"/>
- <stop offset="0.5273" style="stop-color:#C9C9C9"/>
- <stop offset="0.5914" style="stop-color:#C9C9C9"/>
- <stop offset="0.9681" style="stop-color:#C9C9C9"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M5.5,14.822c0,13.22,0,26.438,0,39.66c7.931,1.256,16.012,1.256,23.941,0c0-13.222,0-26.439,0-39.66
- C21.461,14.822,13.48,14.822,5.5,14.822z M28.396,18.703c-0.74,0.01-1.482,0.02-2.225,0.029c0-0.951,0-1.901-0.001-2.85
- c0.742-0.003,1.483-0.005,2.224-0.008C28.396,16.817,28.396,17.76,28.396,18.703z M16.354,42.496c0-0.961,0-1.924,0-2.885
- c0.744,0.006,1.489,0.006,2.233,0c0,0.961,0,1.924,0,2.885C17.843,42.503,17.098,42.503,16.354,42.496z M18.587,43.568
- c0,0.955,0,1.91,0,2.866c-0.744,0.009-1.489,0.009-2.234,0c0-0.956,0-1.911,0-2.866C17.098,43.574,17.843,43.574,18.587,43.568z
- M18.586,27.742c0,0.961,0,1.922,0,2.886c-0.744,0.004-1.488,0.004-2.231,0c0-0.964,0-1.925,0-2.886
- C17.099,27.746,17.842,27.746,18.586,27.742z M16.354,26.671c0-0.955,0-1.91,0-2.865c0.743,0.002,1.487,0.002,2.23,0
- c0,0.955,0,1.91,0,2.865C17.842,26.675,17.099,26.675,16.354,26.671z M16.354,34.583c0-0.961,0-1.924,0-2.885
- c0.744,0.004,1.488,0.004,2.231,0c0,0.961,0,1.924,0,2.885C17.842,34.588,17.099,34.588,16.354,34.583z M18.586,35.656
- c0,0.961,0,1.924,0.001,2.885c-0.745,0.008-1.489,0.008-2.233,0c0-0.961,0-1.924,0-2.885C17.099,35.66,17.842,35.66,18.586,35.656z
- M15.307,30.619c-0.742-0.01-1.484-0.021-2.227-0.039c0-0.957,0-1.916,0-2.875c0.742,0.014,1.485,0.023,2.226,0.029
- C15.307,28.695,15.307,29.656,15.307,30.619z M15.307,31.689c0,0.961,0,1.924,0,2.885c-0.742-0.012-1.485-0.025-2.227-0.047
- c0-0.959,0.001-1.92,0.001-2.877C13.822,31.667,14.565,31.68,15.307,31.689z M15.307,35.644c0,0.959,0,1.922-0.001,2.883
- c-0.742-0.012-1.485-0.031-2.228-0.056c0-0.959,0.001-1.918,0.001-2.877C13.821,35.617,14.564,35.633,15.307,35.644z M15.306,39.597
- c0,0.96,0,1.922,0,2.883c-0.742-0.016-1.486-0.037-2.228-0.064c0-0.959,0-1.916,0.001-2.877
- C13.82,39.564,14.563,39.585,15.306,39.597z M19.637,39.597c0.742-0.012,1.484-0.033,2.227-0.059c0,0.959,0,1.918,0,2.875
- c-0.741,0.029-1.483,0.052-2.227,0.064C19.637,41.519,19.637,40.559,19.637,39.597z M19.637,38.527c0-0.961,0-1.924,0-2.883
- c0.74-0.012,1.482-0.027,2.225-0.05c0,0.959,0,1.918,0.002,2.876C21.121,38.496,20.377,38.515,19.637,38.527z M19.637,34.572
- c0-0.961,0-1.922-0.002-2.883c0.741-0.01,1.483-0.021,2.225-0.039c0.002,0.957,0.002,1.916,0.002,2.875
- C21.119,34.547,20.376,34.564,19.637,34.572z M19.635,30.619c0-0.963,0-1.924,0-2.885c0.74-0.006,1.483-0.017,2.225-0.029
- c0,0.959,0,1.916,0,2.875C21.118,30.599,20.376,30.609,19.635,30.619z M19.633,26.666c0-0.955,0-1.909,0-2.864
- c0.741-0.005,1.483-0.013,2.227-0.021c0,0.951,0,1.903,0,2.856C21.118,26.65,20.375,26.66,19.633,26.666z M19.633,22.732
- c-0.001-0.963-0.001-1.924-0.001-2.885c0.741-0.002,1.483-0.006,2.226-0.012c0,0.959,0.002,1.918,0.002,2.877
- C21.116,22.72,20.374,22.728,19.633,22.732z M18.586,22.736c-0.744,0.002-1.487,0.002-2.23,0c0-0.963,0-1.924,0-2.887
- c0.743,0.002,1.487,0.002,2.23,0C18.586,20.813,18.586,21.773,18.586,22.736z M15.309,22.732c-0.742-0.004-1.483-0.012-2.226-0.02
- c0-0.959,0.001-1.918,0.001-2.877c0.742,0.006,1.484,0.01,2.226,0.012C15.31,20.808,15.309,21.769,15.309,22.732z M15.309,23.801
- c0,0.955,0,1.91,0,2.864c-0.742-0.006-1.483-0.016-2.227-0.027c0-0.953,0-1.906,0-2.859C13.825,23.789,14.566,23.796,15.309,23.801z
- M12.036,26.617c-0.742-0.017-1.483-0.033-2.225-0.055c0-0.947,0-1.895,0.001-2.841c0.741,0.019,1.483,0.031,2.225,0.042
- C12.037,24.716,12.036,25.666,12.036,26.617z M12.035,27.683c0,0.957,0,1.916,0,2.873c-0.742-0.021-1.483-0.047-2.225-0.076
- c0-0.953,0-1.904,0-2.857C10.552,27.646,11.293,27.667,12.035,27.683z M12.035,31.621c0,0.957-0.001,1.914-0.001,2.871
- c-0.742-0.023-1.483-0.055-2.224-0.092c0-0.953,0-1.906,0-2.859C10.551,31.572,11.292,31.6,12.035,31.621z M12.033,35.56
- c0,0.956-0.001,1.914-0.001,2.871c-0.742-0.031-1.484-0.066-2.225-0.111c0-0.953,0.001-1.906,0.001-2.858
- C10.549,35.5,11.291,35.533,12.033,35.56z M12.031,39.498c0,0.955,0,1.914-0.001,2.869c-0.742-0.035-1.484-0.078-2.225-0.129
- c0-0.953,0-1.904,0.001-2.857C10.547,39.426,11.289,39.465,12.031,39.498z M12.03,43.435c0,0.951-0.001,1.901-0.001,2.854
- c-0.742-0.041-1.484-0.09-2.225-0.149c0-0.944,0.001-1.892,0.001-2.838C10.546,43.353,11.288,43.4,12.03,43.435z M13.077,43.482
- c0.743,0.031,1.486,0.053,2.228,0.067c0,0.956,0,1.91,0,2.864c-0.742-0.016-1.486-0.041-2.229-0.074
- C13.077,45.389,13.077,44.435,13.077,43.482z M15.305,47.486c0,0.961,0,1.922,0,2.883c-0.743-0.019-1.487-0.047-2.23-0.084
- c0-0.959,0-1.918,0.001-2.875C13.818,47.443,14.562,47.468,15.305,47.486z M16.353,47.504c0.745,0.009,1.49,0.009,2.234,0
- c0.001,0.96,0.001,1.924,0.001,2.883c-0.745,0.011-1.49,0.011-2.235,0C16.353,49.427,16.353,48.464,16.353,47.504z M19.639,47.486
- c0.741-0.018,1.483-0.043,2.227-0.076c0,0.957,0.002,1.916,0.002,2.875c-0.742,0.037-1.486,0.065-2.229,0.084
- C19.639,49.406,19.639,48.447,19.639,47.486z M19.637,46.414c0-0.954,0-1.908,0-2.864c0.742-0.015,1.484-0.036,2.229-0.067
- c0,0.953,0,1.905,0,2.857C21.122,46.373,20.379,46.398,19.637,46.414z M22.911,43.435c0.741-0.035,1.483-0.082,2.224-0.135
- c0,0.945,0,1.895,0.002,2.838c-0.74,0.059-1.482,0.107-2.226,0.15C22.911,45.336,22.911,44.386,22.911,43.435z M22.911,42.369
- c-0.001-0.957-0.001-1.914-0.002-2.871c0.741-0.032,1.483-0.069,2.225-0.117c0,0.954,0.001,1.906,0.001,2.857
- C24.395,42.289,23.652,42.333,22.911,42.369z M22.909,38.431c0-0.957-0.001-1.915-0.001-2.871c0.742-0.027,1.482-0.061,2.224-0.098
- c0.001,0.951,0.001,1.904,0.001,2.857C24.393,38.363,23.65,38.4,22.909,38.431z M22.908,34.494c0-0.957-0.002-1.916-0.002-2.871
- c0.742-0.021,1.482-0.051,2.225-0.079c0,0.952,0,1.903,0.001,2.856C24.391,34.437,23.648,34.468,22.908,34.494z M22.906,30.556
- c0-0.957,0-1.916-0.002-2.873c0.742-0.016,1.484-0.037,2.226-0.061c0,0.953,0.001,1.904,0.001,2.857
- C24.391,30.509,23.648,30.535,22.906,30.556z M22.904,26.617c0-0.951,0-1.901,0-2.854c0.74-0.011,1.482-0.025,2.224-0.042
- c0,0.946,0.001,1.894,0.001,2.841C24.389,26.583,23.646,26.601,22.904,26.617z M22.902,22.699c0-0.957,0-1.916,0-2.874
- c0.742-0.007,1.482-0.014,2.225-0.023c0.001,0.953,0.001,1.906,0.001,2.859C24.387,22.676,23.646,22.689,22.902,22.699z
- M22.902,18.76C22.9,17.802,22.9,16.845,22.9,15.887c0.742,0,1.481-0.003,2.225-0.004c0.001,0.953,0.001,1.906,0.002,2.858
- C24.385,18.75,23.643,18.756,22.902,18.76z M21.855,18.767c-0.742,0.004-1.482,0.007-2.225,0.009c0-0.961,0-1.922,0-2.884
- c0.741,0,1.482-0.001,2.225-0.002C21.855,16.849,21.855,17.808,21.855,18.767z M18.585,18.779c-0.743,0.001-1.486,0.001-2.229,0
- c0-0.961,0-1.923,0-2.885c0.742,0,1.486,0,2.229,0C18.585,16.855,18.585,17.817,18.585,18.779z M15.31,18.777
- c-0.742-0.002-1.483-0.005-2.225-0.009c0-0.959,0-1.918,0-2.877c0.742,0,1.483,0.001,2.225,0.002
- C15.31,16.854,15.31,17.815,15.31,18.777z M12.039,18.76c-0.742-0.005-1.483-0.011-2.225-0.019c0-0.953,0-1.905,0.001-2.858
- c0.742,0.001,1.483,0.004,2.224,0.004C12.039,16.845,12.039,17.803,12.039,18.76z M12.039,19.827c0,0.957-0.001,1.915-0.001,2.872
- c-0.741-0.01-1.483-0.021-2.224-0.035c0-0.953,0-1.906,0-2.859C10.555,19.813,11.296,19.819,12.039,19.827z M8.768,22.64
- c-0.741-0.018-1.482-0.035-2.223-0.057c0-0.943,0-1.887,0-2.831c0.741,0.013,1.482,0.025,2.223,0.036
- C8.768,20.739,8.768,21.689,8.768,22.64z M8.767,23.697c0,0.944,0,1.89,0,2.832c-0.741-0.024-1.482-0.053-2.223-0.084
- c0-0.938,0-1.873,0-2.811C7.284,23.658,8.026,23.679,8.767,23.697z M8.766,27.587c0,0.949-0.001,1.898-0.001,2.85
- c-0.74-0.033-1.481-0.068-2.222-0.111c0-0.942,0-1.887,0-2.83C7.284,27.529,8.025,27.56,8.766,27.587z M8.765,31.494
- c0,0.951-0.001,1.9-0.001,2.852c-0.74-0.04-1.481-0.087-2.221-0.139c0-0.943,0-1.887,0-2.831C7.283,31.42,8.023,31.459,8.765,31.494
- z M8.763,35.404c0,0.949,0,1.899,0,2.851c-0.741-0.052-1.481-0.104-2.22-0.168c0-0.942,0-1.886,0-2.829
- C7.282,35.31,8.022,35.361,8.763,35.404z M8.762,39.312c0,0.949,0,1.899-0.001,2.852c-0.741-0.059-1.48-0.123-2.219-0.195
- c0-0.943,0-1.889,0-2.83C7.281,39.203,8.021,39.26,8.762,39.312z M8.76,43.219c0,0.944,0,1.888-0.001,2.832
- c-0.74-0.065-1.479-0.14-2.218-0.224c0-0.938,0-1.875,0-2.812C7.281,43.092,8.02,43.16,8.76,43.219z M8.759,47.109
- c0,0.951,0,1.9,0,2.851c-0.741-0.073-1.48-0.158-2.219-0.253c0-0.942,0-1.887,0-2.828C7.279,46.964,8.019,47.039,8.759,47.109z
- M9.804,47.201c0.741,0.06,1.483,0.111,2.224,0.154c0,0.955,0,1.912,0,2.868c-0.742-0.045-1.484-0.103-2.225-0.166
- C9.804,49.107,9.804,48.154,9.804,47.201z M12.027,51.291c0,0.957,0,1.916,0,2.873c-0.742-0.053-1.484-0.114-2.225-0.188
- c0-0.951,0.001-1.904,0.001-2.857C10.544,51.187,11.285,51.244,12.027,51.291z M13.075,51.353c0.743,0.039,1.486,0.067,2.229,0.086
- c0,0.961,0,1.922,0,2.885c-0.743-0.021-1.487-0.053-2.229-0.094C13.075,53.269,13.075,52.312,13.075,51.353z M16.353,51.459
- c0.745,0.009,1.49,0.009,2.235,0c0,0.961,0,1.924,0,2.885c-0.745,0.013-1.491,0.013-2.235,0
- C16.353,53.382,16.353,52.42,16.353,51.459z M19.639,51.439c0.741-0.019,1.485-0.049,2.229-0.086c0,0.959,0,1.92,0.001,2.877
- c-0.743,0.041-1.485,0.072-2.229,0.094C19.639,53.361,19.639,52.4,19.639,51.439z M22.913,51.291
- c0.743-0.047,1.483-0.104,2.226-0.172c0,0.953,0,1.906,0,2.857c-0.74,0.073-1.481,0.135-2.224,0.188
- C22.914,53.205,22.914,52.248,22.913,51.291z M22.913,50.224c-0.001-0.956-0.001-1.912-0.001-2.869
- c0.742-0.043,1.484-0.095,2.225-0.154c0,0.953,0,1.906,0.002,2.857C24.396,50.123,23.654,50.179,22.913,50.224z M26.184,47.109
- c0.739-0.066,1.479-0.145,2.217-0.229c0,0.942,0,1.887,0,2.83c-0.736,0.092-1.478,0.177-2.217,0.252
- C26.184,49.009,26.184,48.06,26.184,47.109z M26.184,46.051c-0.002-0.944-0.002-1.888-0.002-2.832
- c0.739-0.06,1.48-0.127,2.219-0.202c0,0.938,0,1.873,0,2.811C27.662,45.912,26.923,45.986,26.184,46.051z M26.182,42.162
- c0-0.95-0.002-1.9-0.002-2.85c0.74-0.052,1.48-0.109,2.219-0.176c0.002,0.943,0.002,1.887,0.002,2.83
- C27.662,42.039,26.921,42.105,26.182,42.162z M26.18,38.253c0-0.95,0-1.9-0.002-2.852c0.742-0.041,1.482-0.093,2.221-0.146
- c0,0.942,0,1.887,0,2.829C27.66,38.15,26.92,38.203,26.18,38.253z M26.178,34.345c0-0.949,0-1.898,0-2.852
- c0.74-0.034,1.481-0.073,2.221-0.117c0,0.943,0,1.887,0,2.83C27.659,34.258,26.918,34.305,26.178,34.345z M26.177,30.437
- c0-0.949,0-1.9-0.001-2.85c0.741-0.027,1.481-0.059,2.221-0.092c0,0.943,0.002,1.888,0.002,2.83
- C27.659,30.367,26.918,30.404,26.177,30.437z M26.176,26.529c-0.001-0.942-0.001-1.888-0.001-2.832
- c0.742-0.018,1.482-0.039,2.222-0.063c0,0.938,0,1.873,0,2.811C27.657,26.476,26.917,26.503,26.176,26.529z M26.174,22.64
- c0-0.951-0.001-1.901-0.001-2.851c0.741-0.01,1.483-0.022,2.224-0.035c0,0.943,0,1.886,0,2.831
- C27.657,22.605,26.915,22.623,26.174,22.64z M8.769,15.881c0,0.95,0,1.9-0.001,2.85c-0.741-0.008-1.482-0.018-2.223-0.028
- c0-0.943,0-1.887,0-2.83C7.286,15.876,8.028,15.878,8.769,15.881z M6.54,50.758c0.738,0.097,1.478,0.183,2.218,0.258
- c0,0.95,0,1.901,0,2.853c-0.741-0.084-1.48-0.178-2.218-0.28C6.54,52.646,6.54,51.701,6.54,50.758z M26.184,53.869
- c0-0.95,0-1.899,0-2.853c0.739-0.075,1.479-0.163,2.217-0.259c0.002,0.941,0.002,1.889,0.002,2.83
- C27.663,53.693,26.925,53.785,26.184,53.869z"/>
-<path id="highlight_2_" opacity="0.17" fill="#FFFFFF" enable-background="new " d="M0,0.943h5.497c0,0,6.847-0.943,11.974-0.943
- C22.6,0,29.48,0.943,29.48,0.943h5.496v41.951c0,0-12.076-0.521-18.623-2.548C9.807,38.32,0,30.557,0,30.557V0.943z"/>
-</svg>
-</y:Resource>
- </y:Resources>
- </data>
-</graphml>
diff --git a/minifi/minifi-c2/c2-integration-test.png b/minifi/minifi-c2/c2-integration-test.png
deleted file mode 100644
index 404063e906..0000000000
Binary files a/minifi/minifi-c2/c2-integration-test.png and /dev/null differ
diff --git a/minifi/minifi-c2/minifi-c2-api/pom.xml b/minifi/minifi-c2/minifi-c2-api/pom.xml
deleted file mode 100644
index 276e044b79..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-api</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jakarta.ws.rs</groupId>
- <artifactId>jakarta.ws.rs-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java
deleted file mode 100644
index 3f78b52269..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java
+++ /dev/null
@@ -1,55 +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.c2.api;
-
-import java.io.InputStream;
-import java.net.URL;
-
-/**
- * Represents a MiNiFi configuration of a given version, format matches the format of the ConfigurationProvider
- *
- * This object may be cached so it should attempt to minimize the amount of memory used to represent state (input stream should come from persistent storage if possible.)
- */
-public interface Configuration {
- /**
- * Gets the version
- *
- * @return the version
- */
- String getVersion();
-
- /**
- * Returns a boolean indicating whether this version exists
- *
- * @return a boolean indicating whether this version exists
- */
- boolean exists();
- /**
- * Returns an input stream to read the configuration with
- *
- * @return an input stream to read the configuration with
- */
- InputStream getInputStream() throws ConfigurationProviderException;
-
- /**
- * Gets the URL of the resource
- *
- * @return the URL of the resource
- */
- URL getURL() throws ConfigurationProviderException;
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java
deleted file mode 100644
index 4892be57ad..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java
+++ /dev/null
@@ -1,43 +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.c2.api;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * A configuration provider is capable of taking a parameter map and returning a configuration with a given content type
- */
-public interface ConfigurationProvider {
- /**
- * Gets the content types that this provider returns
- *
- * @return the content types that this provider returns
- */
- List<String> getContentTypes() throws ConfigurationProviderException;
-
- /**
- * Gets the configuration that corresponds to the passed in parameters
- *
- * @param version the version of the configuration to get
- * @param parameters the parameters passed in by the client (please note that these are provided by a client and should NOT be trusted to be sanitized)
- * @return an input stream of the configuration
- * @throws ConfigurationProviderException if there is an error in the configuration
- */
- Configuration getConfiguration(String contentType, Integer version, Map<String, List<String>> parameters) throws ConfigurationProviderException;
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java
deleted file mode 100644
index d510482702..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java
+++ /dev/null
@@ -1,42 +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.c2.api;
-
-public class ConfigurationProviderException extends Exception {
- public ConfigurationProviderException(String message) {
- super(message);
- }
-
- public ConfigurationProviderException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ConfigurationProviderException.Wrapper wrap() {
- return new Wrapper(this);
- }
-
- public static class Wrapper extends RuntimeException {
- public Wrapper(ConfigurationProviderException cause) {
- super(cause);
- }
-
- public ConfigurationProviderException unwrap() {
- return (ConfigurationProviderException) getCause();
- }
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java
deleted file mode 100644
index 33f8aa0cf9..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java
+++ /dev/null
@@ -1,28 +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.c2.api;
-
-public class InvalidParameterException extends ConfigurationProviderException {
- public InvalidParameterException(String message) {
- super(message);
- }
-
- public InvalidParameterException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java
deleted file mode 100644
index fdfd86882e..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java
+++ /dev/null
@@ -1,39 +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.c2.api.cache;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-
-/**
- * Cache for storing configurations so they don't have to be pulled from
- * the provider more often than necessary.
- */
-public interface ConfigurationCache {
- /**
- * Returns the information on a given cache entry.
- *
- * @param parameters The parameters that identify the entry.
- * @return {@link ConfigurationCacheFileInfo information} on the entry.
- * @throws InvalidParameterException Thrown when there are illegal/invalid parameters.
- */
- ConfigurationCacheFileInfo getCacheFileInfo(String contentType,
- Map<String, List<String>> parameters) throws InvalidParameterException;
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java
deleted file mode 100644
index 73578ba54a..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java
+++ /dev/null
@@ -1,53 +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.c2.api.cache;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-
-import java.io.IOException;
-import java.util.stream.Stream;
-
-/**
- * Information on the different versions of a cache entry
- */
-public interface ConfigurationCacheFileInfo {
- /**
- * Returns the version the file would be assigned based on its name
- *
- * @param filename the filename
- * @return the version
- */
- Integer getVersionIfMatch(String filename);
-
- /**
- * Returns a stream of WritableConfigurations for this cache entry
- *
- * @return the stream
- * @throws IOException if there is an error getting the configurations
- */
- Stream<WriteableConfiguration> getCachedConfigurations() throws IOException;
-
- /**
- * Returns a WritableConfiguration for the given version of this cache entry
- *
- * @param version the version
- * @return the configuration
- * @throws ConfigurationProviderException if there is a problem getting the configuration
- */
- WriteableConfiguration getConfiguration(Integer version) throws ConfigurationProviderException;
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java
deleted file mode 100644
index 20d2d2eba9..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java
+++ /dev/null
@@ -1,29 +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.c2.api.cache;
-
-import org.apache.nifi.minifi.c2.api.Configuration;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-
-import java.io.OutputStream;
-
-public interface WriteableConfiguration extends Configuration {
- OutputStream getOutputStream() throws ConfigurationProviderException;
-
- String getName();
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java
deleted file mode 100644
index cd9e4c9927..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java
+++ /dev/null
@@ -1,53 +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.c2.api.properties;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-public class C2Properties extends Properties {
- public static final String MINIFI_C2_SERVER_SECURE = "minifi.c2.server.secure";
- public static final String MINIFI_C2_SERVER_KEYSTORE_TYPE = "minifi.c2.server.keystoreType";
- public static final String MINIFI_C2_SERVER_KEYSTORE = "minifi.c2.server.keystore";
- public static final String MINIFI_C2_SERVER_KEYSTORE_PASSWD = "minifi.c2.server.keystorePasswd";
- public static final String MINIFI_C2_SERVER_KEY_PASSWD = "minifi.c2.server.keyPasswd";
- public static final String MINIFI_C2_SERVER_TRUSTSTORE = "minifi.c2.server.truststore";
- public static final String MINIFI_C2_SERVER_TRUSTSTORE_TYPE = "minifi.c2.server.truststoreType";
- public static final String MINIFI_C2_SERVER_TRUSTSTORE_PASSWD = "minifi.c2.server.truststorePasswd";
-
- private static final C2Properties properties = initProperties();
-
- private static C2Properties initProperties() {
- C2Properties properties = new C2Properties();
- try (InputStream inputStream = C2Properties.class.getClassLoader().getResourceAsStream("c2.properties")) {
- properties.load(inputStream);
- } catch (IOException e) {
- throw new RuntimeException("Unable to load c2.properties", e);
- }
- return properties;
- }
-
- public static C2Properties getInstance() {
- return properties;
- }
-
- public boolean isSecure() {
- return Boolean.parseBoolean(getProperty(MINIFI_C2_SERVER_SECURE, "false"));
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java
deleted file mode 100644
index 2a7d9139b6..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java
+++ /dev/null
@@ -1,36 +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.c2.api.security.authorization;
-
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-
-import java.util.Collection;
-
-/**
- * Interface responsible for taking an authentication object and returning the GrantedAuthorities it should have
- */
-public interface AuthorityGranter {
- /**
- * Returns the authorities a given Authentication object should receive
- *
- * @param authentication the authentication
- * @return the authorities it should receive
- */
- Collection<GrantedAuthority> grantAuthorities(Authentication authentication);
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java
deleted file mode 100644
index 454288a9e8..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java
+++ /dev/null
@@ -1,26 +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.c2.api.security.authorization;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-
-public class AuthorizationException extends ConfigurationProviderException {
- public AuthorizationException(String message) {
- super(message);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java
deleted file mode 100644
index 34e511c032..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java
+++ /dev/null
@@ -1,36 +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.c2.api.security.authorization;
-
-import org.springframework.security.core.Authentication;
-
-import jakarta.ws.rs.core.UriInfo;
-
-/**
- * Interface responsible for authorizing a given authentication to access a given uri
- */
-public interface Authorizer {
- /**
- * Throws an AuthorizationException if the authentication should not access the given uri
- *
- * @param authentication the authentication
- * @param uriInfo the uri
- * @throws AuthorizationException if the authentication should not access the uri
- */
- void authorize(Authentication authentication, UriInfo uriInfo) throws AuthorizationException;
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java
deleted file mode 100644
index a3f5254719..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java
+++ /dev/null
@@ -1,54 +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.c2.api.util;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-public class DelegatingOutputStream extends OutputStream {
- private final OutputStream delegate;
-
- public DelegatingOutputStream(OutputStream delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void write(int b) throws IOException {
- delegate.write(b);
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- delegate.write(b);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- delegate.write(b, off, len);
- }
-
- @Override
- public void flush() throws IOException {
- delegate.flush();
- }
-
- @Override
- public void close() throws IOException {
- delegate.close();
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java b/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java
deleted file mode 100644
index edca7d0002..0000000000
--- a/minifi/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java
+++ /dev/null
@@ -1,44 +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.c2.api.util;
-
-public class Pair<T, U> {
- private final T first;
- private final U second;
-
- public Pair(T first, U second) {
- this.first = first;
- this.second = second;
- }
-
- public T getFirst() {
- return first;
- }
-
- public U getSecond() {
- return second;
- }
-
- @Override
- public String toString() {
- return "Pair{" +
- "first=" + first +
- ", second=" + second +
- '}';
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-assembly/LICENSE b/minifi/minifi-c2/minifi-c2-assembly/LICENSE
deleted file mode 100644
index a4b4e878b9..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/LICENSE
+++ /dev/null
@@ -1,330 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-APACHE MINIFI SUBCOMPONENTS:
-
-The Apache MiNiFi project contains subcomponents with separate copyright
-notices and license terms. Your use of the source code for the these
-subcomponents is subject to the terms and conditions of the following
-licenses.
-
-The binary distribution of this product bundles 'Slf4j' which is available
-under a "3-clause BSD" license. For details see http://www.slf4j.org/
-
- Copyright (c) 2004-2013 QOS.ch
- All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-The binary distribution of this product bundles 'Antlr 3' which is available
-under a "3-clause BSD" license. For details see http://www.antlr3.org/license.html
-
- Copyright (c) 2010 Terence Parr
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- Neither the name of the author nor the names of its contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
-
-This product bundles 'asm' which is available under a 3-Clause BSD style license.
-For details see http://asm.ow2.org/asmdex-license.html
-
- Copyright (c) 2012 France Télécom
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
-
-The binary distribution of this product bundles 'JLine' under a BSD
-style license.
-
- Copyright (c) 2002-2006, Marc Prud'hommeaux <mw...@cornell.edu>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or
- without modification, are permitted provided that the following
- conditions are met:
-
- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer
- in the documentation and/or other materials provided with
- the distribution.
-
- Neither the name of JLine nor the names of its contributors
- may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-assembly/NOTICE b/minifi/minifi-c2/minifi-c2-assembly/NOTICE
deleted file mode 100644
index 6c8771e917..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/NOTICE
+++ /dev/null
@@ -1,240 +0,0 @@
-Apache NiFi MiNiFi
-Copyright 2014-2018 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (https://www.apache.org/).
-
-===========================================
-Apache Software License v2
-===========================================
-
-This product includes the following work from the Apache Kafka project:
-S3OutputStream.java
-
-The following binary components are provided under the Apache Software License v2
-
- (ASLv2) Apache NiFi
- The following NOTICE information applies:
- Apache NiFi
- Copyright 2014-2018 The Apache Software Foundation
-
- This product includes software developed at
- The Apache Software Foundation (https://www.apache.org/).
-
- This product includes the following work from the Apache Hadoop project:
-
- BoundedByteArrayOutputStream.java adapted to SoftLimitBoundedByteArrayOutputStream.java
-
- This includes derived works from the Apache Software License V2 library python-evtx (https://github.com/williballenthin/python-evtx)
- Copyright 2012, 2013 Willi Ballenthin william.ballenthin@mandiant.com
- while at Mandiant https://www.mandiant.com
- The derived work is adapted from Evtx/Evtx.py, Evtx/BinaryParser.py, Evtx/Nodes.py, Evtx/Views.py and can be found in the org.apache.nifi.processors.evtx.parser package.
-
-
-
- This includes derived works from the Apache Storm (ASLv2 licensed) project (https://github.com/apache/storm):
- Copyright 2015 The Apache Software Foundation
- The derived work is adapted from
- org/apache/storm/hive/common/HiveWriter.java
- org/apache/storm/hive/common/HiveOptions.java
- and can be found in the org.apache.nifi.util.hive package
-
- This includes derived works from the Apache Hive (ASLv2 licensed) project (https://github.com/apache/hive):
- Copyright 2008-2018 The Apache Software Foundation
- The derived work is adapted from
- release-1.2.1/ql/src/java/org/apache/hadoop/hive/ql/io/orc/WriterImpl.java
- and can be found in the org.apache.hadoop.hive.ql.io.orc package
-
- (ASLv2) Apache Commons Lang
- The following NOTICE information applies:
- Apache Commons Lang
- Copyright 2001-2015 The Apache Software Foundation
-
- This product includes software from the Spring Framework,
- under the Apache License 2.0 (see: StringUtils.containsWhitespace())
-
- (ASLv2) Apache Commons Codec
- The following NOTICE information applies:
- Apache Commons Codec
- Copyright 2002-2014 The Apache Software Foundation
-
- src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java
- contains test data from http://aspell.net/test/orig/batch0.tab.
- Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org)
-
- ===============================================================================
-
- The content of package org.apache.commons.codec.language.bm has been translated
- from the original php source code available at https://stevemorse.org/phoneticinfo.htm
- with permission from the original authors.
- Original source copyright:
- Copyright (c) 2008 Alexander Beider & Stephen P. Morse.
-
- (ASLv2) AWS Java SDK
- The following NOTICE information applies:
- Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-
- This product includes software developed by
- Amazon Technologies, Inc (https://www.amazon.com/).
-
- **********************
- THIRD PARTY COMPONENTS
- **********************
- This software includes third party software subject to the following copyrights:
- - XML parsing and utility functions from JetS3t - Copyright 2006-2009 James Murty.
- - PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc.
-
- The licenses for these third party components are included in LICENSE.txt
-
- (ASLv2) JsonPath
- The following NOTICE information applies:
- Copyright 2011 JsonPath authors
-
- (ASLv2) JSON-SMART
- The following NOTICE information applies:
- Copyright 2011 JSON-SMART authors
-
- (ASLv2) Jackson JSON processor
- The following NOTICE information applies:
- # Jackson JSON processor
-
- Jackson is a high-performance, Free/Open Source JSON processing library.
- It was originally written by Tatu Saloranta (tatu.saloranta@iki.fi), and has
- been in development since 2007.
- It is currently developed by a community of developers, as well as supported
- commercially by FasterXML.com.
-
- ## Licensing
-
- Jackson core and extension components may licensed under different licenses.
- To find the details that apply to this artifact see the accompanying LICENSE file.
- For more information, including possible other licensing options, contact
- FasterXML.com (https://fasterxml.com).
-
- ## Credits
-
- A list of contributors may be found from CREDITS file, which is included
- in some artifacts (usually source distributions); but is always available
- from the source code management (SCM) system project uses.
-
- (ASLv2) Apache Commons Collections
- The following NOTICE information applies:
- Apache Commons Collections
- Copyright 2001-2013 The Apache Software Foundation
-
- (ASLv2) Jettison
- The following NOTICE information applies:
- Copyright 2006 Envoi Solutions LLC
-
- (ASLv2) Apache HttpComponents
- The following NOTICE information applies:
- Apache HttpClient
- Copyright 1999-2015 The Apache Software Foundation
-
- Apache HttpCore
- Copyright 2005-2015 The Apache Software Foundation
-
- Apache HttpMime
- Copyright 1999-2013 The Apache Software Foundation
-
- This project contains annotations derived from JCIP-ANNOTATIONS
- Copyright (c) 2005 Brian Goetz and Tim Peierls. See https://www.jcip.net
-
- (ASLv2) Apache Commons Net
- The following NOTICE information applies:
- Apache Commons Net
- Copyright 2001-2013 The Apache Software Foundation
-
- (ASLv2) Swagger Core
- The following NOTICE information applies:
- Swagger Core 1.5.3-M1
- Copyright 2015 Reverb Technologies, Inc.
-
- (ASLv2) Spring Security
- The following NOTICE information applies:
- Spring Security 5
- Copyright (c) 2002-2021 Pivotal, Inc.
-
- (ASLv2) Spring Framework
- The following NOTICE information applies:
- Spring Framework 5
- Copyright (c) 2002-2021 Pivotal, Inc.
-
- (ASLv2) Apache Commons IO
- The following NOTICE information applies:
- Apache Commons IO
- Copyright 2002-2018 The Apache Software Foundation
-
- (ASLv2) Apache ZooKeeper
- The following NOTICE information applies:
- Apache ZooKeeper
- Copyright 2009-2012 The Apache Software Foundation
-
- (ASLv2) The Netty Project
- The following NOTICE information applies:
- The Netty Project
- Copyright 2011 The Netty Project
-
- (ASLv2) Apache Curator
- The following NOTICE information applies:
- Curator Framework
- Copyright 2011-2014 The Apache Software Foundation
-
- Curator Client
- Copyright 2011-2014 The Apache Software Foundation
-
- Curator Recipes
- Copyright 2011-2014 The Apache Software Foundation
-
-************************
-Common Development and Distribution License 1.1
-************************
-
-The following binary components are provided under the Common Development and Distribution License 1.1. See project link for details.
-
- (CDDL 1.1) (GPL2 w/ CPE) jersey-client (org.glassfish.jersey.core:jersey-client:jar:2.26 - https://jersey.github.io/)
- (CDDL 1.1) (GPL2 w/ CPE) jersey-common (org.glassfish.jersey.core:jersey-common:jar:2.26 - https://jersey.github.io/)
- (CDDL 1.1) (GPL2 w/ CPE) jersey-entity-filtering (org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26 - https://jersey.github.io/)
- (CDDL 1.1) (GPL2 w/ CPE) jersey-hk2 (org.glassfish.jersey.inject:jersey-hk2:jar:2.26 - https://jersey.github.io/)
- (CDDL 1.1) (GPL2 w/ CPE) jersey-media-json-jackson (org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.26 - https://jersey.github.io/)
- (CDDL 1.1) (GPL2 w/ CPE) hk2-api (org.glassfish.hk2:hk2-api:jar:2.5.0-b42 - https://javaee.github.io/glassfish/)
- (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) 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
-************************
-
-The following binary components are provided under the Common Development and Distribution License 1.0. See project link for details.
-
- (CDDL 1.0) JavaBeans Activation Framework (JAF) (javax.activation:activation:jar:1.1 - https://java.sun.com/products/javabeans/jaf/index.jsp)
- (CDDL 1.0) (GPL3) Streaming API For XML (javax.xml.stream:stax-api:jar:1.0-2 - no url provided)
- (CDDL 1.0) JSR311 API (javax.ws.rs:jsr311-api:jar:1.1.1 - https://jsr311.dev.java.net)
-
-
-************************
-Eclipse Public License 1.0
-************************
-
-The following binary components are provided under the Eclipse Public License 1.0. See project link for details.
-
- (EPL 1.0) AspectJ Weaver (org.aspectj:aspectjweaver:jar:1.8.5 - https://www.eclipse.org/aspectj/)
- (EPL 1.0)(LGPL 2.1) Logback Classic (ch.qos.logback:logback-classic:jar:1.2.6 - https://logback.qos.ch/)
- (EPL 1.0)(LGPL 2.1) Logback Core (ch.qos.logback:logback-core:jar:1.2.6 - https://logback.qos.ch/)
- (EPL 1.0)(MPL 2.0) H2 Database (com.h2database:h2:jar:1.3.176 - https://www.h2database.com/html/license.html)
diff --git a/minifi/minifi-c2/minifi-c2-assembly/README.md b/minifi/minifi-c2/minifi-c2-assembly/README.md
deleted file mode 100644
index 01508bf8e5..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/README.md
+++ /dev/null
@@ -1,96 +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
- https://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.
--->
-# Apache NiFi - MiNiFi - Command and Control (C2) Server
-
-MiNiFi is a child project effort of Apache NiFi. The MiNiFi C2 Server aids in transforming and distributing MiNiFi configuration files to MiNiFi instances over HTTP.
-
-## Table of Contents
-
-- [Requirements](#requirements)
-- [Getting Started](#getting-started)
-- [Getting Help](#getting-help)
-- [Documentation](#documentation)
-- [License](#license)
-- [Export Control](#export-control)
-
-## Requirements
-* Java 21
-* Apache Maven 3
-
-## Getting Started
-
-The C2 server is built either as part of the top level MiNiFi build or as a build of the minifi-c2 module.
-
-```
-mvn clean install
-```
-
-It can be started with either c2.sh or c2.bat depending on platform.
-
-## Getting Help
-If you have questions, you can reach out to our mailing list: dev@nifi.apache.org
-([archive](https://mail-archives.apache.org/mod_mbox/nifi-dev)).
-We're also often available in IRC: #nifi on
-[irc.freenode.net](https://webchat.freenode.net/?channels=#nifi).
-
-## Documentation
-
-See https://nifi.apache.org/minifi and https://cwiki.apache.org/confluence/display/NIFI/MiNiFi for the latest documentation.
-
-## License
-
-Except as otherwise noted this software is licensed under the
-[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)
-
-Licensed 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
-
- https://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.
-
-## Export Control
-
-This distribution includes cryptographic software. The country in which you
-currently reside may have restrictions on the import, possession, use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check your country's laws, regulations and
-policies concerning the import, possession, or use, and re-export of encryption
-software, to see if this is permitted. See <https://www.wassenaar.org/> for more
-information.
-
-The U.S. Government Department of Commerce, Bureau of Industry and Security
-(BIS), has classified this software as Export Commodity Control Number (ECCN)
-5D002.C.1, which includes information security software using or performing
-cryptographic functions with asymmetric algorithms. The form and manner of this
-Apache Software Foundation distribution makes it eligible for export under the
-License Exception ENC Technology Software Unrestricted (TSU) exception (see the
-BIS Export Administration Regulations, Section 740.13) for both object code and
-source code.
-
-The following provides more details on the included cryptographic software:
-
-Apache NiFi - MiNiFi uses BouncyCastle, JCraft Inc., and the built-in
-java cryptography libraries for SSL, SSH, and the protection
-of sensitive configuration parameters. See
-https://bouncycastle.org/about.html
-https://jcraft.com/c-info.html
-https://www.oracle.com/us/products/export/export-regulations-345813.html
-for more details on each of these libraries cryptography features.
diff --git a/minifi/minifi-c2/minifi-c2-assembly/pom.xml b/minifi/minifi-c2/minifi-c2-assembly/pom.xml
deleted file mode 100644
index fec5061fe1..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/pom.xml
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-assembly</artifactId>
- <packaging>pom</packaging>
- <description>This is the assembly of Apache MiNiFi's - Command And Control Server</description>
- <properties>
- <minifi.c2.server.port>10090</minifi.c2.server.port>
-
- <minifi.c2.server.secure>false</minifi.c2.server.secure>
- <minifi.c2.server.keystore>./conf/keystore.jks</minifi.c2.server.keystore>
- <minifi.c2.server.keystoreType>jks</minifi.c2.server.keystoreType>
- <minifi.c2.server.keystorePasswd />
- <minifi.c2.server.keyPasswd />
- <minifi.c2.server.truststore>./conf/truststore.jks</minifi.c2.server.truststore>
- <minifi.c2.server.truststoreType>jks</minifi.c2.server.truststoreType>
- <minifi.c2.server.truststorePasswd />
-
- <minifi.c2.server.provider.nifi.rest.api.url>http://localhost:8080/nifi-api</minifi.c2.server.provider.nifi.rest.api.url>
- </properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <finalName>minifi-c2-${project.version}</finalName>
- <attach>false</attach>
- </configuration>
- <executions>
- <execution>
- <id>make shared resource</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <archiverConfig>
- <defaultDirectoryMode>0755</defaultDirectoryMode>
- <directoryMode>0755</directoryMode>
- <fileMode>0644</fileMode>
- </archiverConfig>
- <descriptors>
- <descriptor>src/main/assembly/dependencies.xml</descriptor>
- </descriptors>
- <tarLongFileMode>posix</tarLongFileMode>
- <formats>zip</formats>
- <escapeString>\</escapeString>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-cache-filesystem</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-cache-s3</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-provider-cache</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-provider-delegating</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-jetty</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-toolkit-configuration</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-json-jackson</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.ee10</groupId>
- <artifactId>jetty-ee10-servlet</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.ee10</groupId>
- <artifactId>jetty-ee10-webapp</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.ext</groupId>
- <artifactId>jersey-spring6</artifactId>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-jetty-http</artifactId>
- <exclusions>
- <!-- jetty-continuation is not included in Jetty 10 -->
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-continuation</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-servlet</artifactId>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>jakarta.servlet</groupId>
- <artifactId>jakarta.servlet-api</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-service</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- </dependencies>
- <profiles>
- <profile>
- <id>targz</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <finalName>minifi-c2-${project.version}</finalName>
- <attach>false</attach>
- </configuration>
- <executions>
- <execution>
- <id>make shared resource</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <archiverConfig>
- <defaultDirectoryMode>0755</defaultDirectoryMode>
- <directoryMode>0755</directoryMode>
- <fileMode>0644</fileMode>
- </archiverConfig>
- <descriptors>
- <descriptor>src/main/assembly/dependencies.xml</descriptor>
- </descriptors>
- <tarLongFileMode>posix</tarLongFileMode>
- <formats>tar.gz</formats>
- <escapeString>\</escapeString>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/assembly/dependencies.xml b/minifi/minifi-c2/minifi-c2-assembly/src/main/assembly/dependencies.xml
deleted file mode 100644
index 026200c66a..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/assembly/dependencies.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.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.
--->
-<assembly>
- <id>bin</id>
- <formats>
- <format>dir</format>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>true</includeBaseDirectory>
- <baseDirectory>minifi-c2-${project.version}</baseDirectory>
-
- <dependencySets>
- <!-- Write out all non-war dependency artifacts to lib directory -->
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- <useProjectArtifact>false</useProjectArtifact>
- <directoryMode>0770</directoryMode>
- <fileMode>0660</fileMode>
- <excludes>
- <exclude>*:war</exclude>
- </excludes>
- </dependencySet>
-
- <!-- Write out all war dependency artifacts to lib directory -->
- <dependencySet>
- <outputDirectory>webapps</outputDirectory>
- <useProjectArtifact>false</useProjectArtifact>
- <directoryMode>0770</directoryMode>
- <fileMode>0660</fileMode>
- <includes>
- <include>*:war</include>
- </includes>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <directory>${project.basedir}/src/main/resources</directory>
- <outputDirectory>/</outputDirectory>
- <fileMode>0755</fileMode>
- <filtered>true</filtered>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>./README.md</source>
- <outputDirectory>./</outputDirectory>
- <destName>README</destName>
- <fileMode>0644</fileMode>
- <filtered>true</filtered>
- </file>
- <file>
- <source>./LICENSE</source>
- <outputDirectory>./</outputDirectory>
- <destName>LICENSE</destName>
- <fileMode>0644</fileMode>
- <filtered>true</filtered>
- </file>
- <file>
- <source>./NOTICE</source>
- <outputDirectory>./</outputDirectory>
- <destName>NOTICE</destName>
- <fileMode>0644</fileMode>
- <filtered>true</filtered>
- </file>
- </files>
-</assembly>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.bat b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.bat
deleted file mode 100644
index 468f07a1e7..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.bat
+++ /dev/null
@@ -1,41 +0,0 @@
-@echo off
-rem
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements. See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-rem
-
-rem Use JAVA_HOME if it's set; otherwise, just use java
-
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-set JAVA_EXE=%JAVA_HOME%\bin\java.exe
-goto startConfig
-
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly.
-echo Instead the PATH will be used to find the java executable.
-echo.
-set JAVA_EXE=java
-goto startConfig
-
-:startConfig
-set LIB_DIR=%~dp0..\conf;%~dp0..\lib
-
-set C2_SERVER_HOME=%~sdp0..\
-
-SET JAVA_PARAMS=-cp %LIB_DIR%\* -Xms12m -Xmx24m %JAVA_ARGS% org.apache.nifi.minifi.c2.jetty.JettyServer
-
-cmd.exe /C "%JAVA_EXE%" %JAVA_PARAMS% %*
-
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.sh b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.sh
deleted file mode 100755
index 172069ab77..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/bin/c2.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-#
-
-# Script structure inspired from Apache Karaf and other Apache projects with similar startup approaches
-
-SCRIPT_DIR=$(dirname "$0")
-SCRIPT_NAME=$(basename "$0")
-export C2_SERVER_HOME=$(cd "${SCRIPT_DIR}" && cd .. && pwd)
-PROGNAME=$(basename "$0")
-
-
-warn() {
- echo "${PROGNAME}: $*"
-}
-
-die() {
- warn "$*"
- exit 1
-}
-
-detectOS() {
- # OS specific support (must be 'true' or 'false').
- cygwin=false;
- aix=false;
- os400=false;
- darwin=false;
- case "$(uname)" in
- CYGWIN*)
- cygwin=true
- ;;
- AIX*)
- aix=true
- ;;
- OS400*)
- os400=true
- ;;
- Darwin)
- darwin=true
- ;;
- esac
- # For AIX, set an environment variable
- if ${aix}; then
- export LDR_CNTRL=MAXDATA=0xB0000000@DSA
- echo ${LDR_CNTRL}
- fi
-}
-
-locateJava() {
- # Setup the Java Virtual Machine
- if $cygwin ; then
- [ -n "${JAVA}" ] && JAVA=$(cygpath --unix "${JAVA}")
- [ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
- fi
-
- if [ "x${JAVA}" = "x" ] && [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=$(java-config --jre-home)
- fi
- if [ "x${JAVA}" = "x" ]; then
- if [ "x${JAVA_HOME}" != "x" ]; then
- if [ ! -d "${JAVA_HOME}" ]; then
- die "JAVA_HOME is not valid: ${JAVA_HOME}"
- fi
- JAVA="${JAVA_HOME}/bin/java"
- else
- warn "JAVA_HOME not set; results may vary"
- JAVA=$(type java)
- JAVA=$(expr "${JAVA}" : '.* \(/.*\)$')
- if [ "x${JAVA}" = "x" ]; then
- die "java command not found"
- fi
- fi
- fi
-}
-
-init() {
- # Determine if there is special OS handling we must perform
- detectOS
-
- # Locate the Java VM to execute
- locateJava
-}
-
-run() {
- LIBS="${C2_SERVER_HOME}/lib/*"
-
- sudo_cmd_prefix=""
- if $cygwin; then
- C2_SERVER_HOME=$(cygpath --path --windows "${C2_SERVER_HOME}")
- CLASSPATH="$C2_SERVER_HOME/conf;$(cygpath --path --windows "${LIBS}")"
- else
- CLASSPATH="$C2_SERVER_HOME/conf:${LIBS}"
- fi
-
- echo
- echo "Java home: ${JAVA_HOME}"
- echo "C2 Server home: ${C2_SERVER_HOME}"
- echo
- echo
-
- if [ "$1" = "debug" ]; then
- "${JAVA}" -cp "${CLASSPATH}" -Xms12m -Xmx128m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 org.apache.nifi.minifi.c2.jetty.JettyServer $@
- else
- "${JAVA}" -cp "${CLASSPATH}" -Xms12m -Xmx128m org.apache.nifi.minifi.c2.jetty.JettyServer $@
- fi
- return $?
-}
-
-init
-run "$@"
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorities.yaml b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorities.yaml
deleted file mode 100644
index a57dd4cc3a..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorities.yaml
+++ /dev/null
@@ -1,17 +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.
-
-CN=raspi3, OU=NIFI:
- - CLASS_RASPI_3
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorizations.yaml b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorizations.yaml
deleted file mode 100644
index d341a50a58..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/authorizations.yaml
+++ /dev/null
@@ -1,63 +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.
-
-Default Action: deny
-Paths:
- /c2/config:
- Default Action: deny
- Actions:
- - Authorization: CLASS_RASPI_3
- Query Parameters:
- class: raspi3
- Action: allow
- - Authorization: ROLE_SUPERUSER
- Action: allow
-
- # Default authorization lets anonymous pull any config. Remove below to change that.
- - Authorization: ROLE_ANONYMOUS
- Action: allow
-
- /c2/config/contentTypes:
- Default Action: deny
- Actions:
- - Authorization: CLASS_RASPI_3
- Action: allow
- # Default authorization lets anonymous pull any config. Remove below to change that.
- - Authorization: ROLE_ANONYMOUS
- Action: allow
-
- /c2/config/heartbeat:
- Default Action: deny
- Actions:
- - Authorization: CLASS_RASPI_3
- Action: allow
- - Authorization: ROLE_SUPERUSER
- Action: allow
-
- # Default authorization lets anonymous pull any config. Remove below to change that.
- - Authorization: ROLE_ANONYMOUS
- Action: allow
-
- /c2/config/acknowledge:
- Default Action: deny
- Actions:
- - Authorization: CLASS_RASPI_3
- Action: allow
- - Authorization: ROLE_SUPERUSER
- Action: allow
-
- # Default authorization lets anonymous pull any config. Remove below to change that.
- - Authorization: ROLE_ANONYMOUS
- Action: allow
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/c2.properties b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/c2.properties
deleted file mode 100644
index c68a3e33a6..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/c2.properties
+++ /dev/null
@@ -1,27 +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.
-#
-
-minifi.c2.server.port=${minifi.c2.server.port}
-
-minifi.c2.server.secure=${minifi.c2.server.secure}
-minifi.c2.server.keystore=${minifi.c2.server.keystore}
-minifi.c2.server.keystoreType=${minifi.c2.server.keystoreType}
-minifi.c2.server.keystorePasswd=${minifi.c2.server.keystorePasswd}
-minifi.c2.server.keyPasswd=${minifi.c2.server.keyPasswd}
-minifi.c2.server.truststore=${minifi.c2.server.truststore}
-minifi.c2.server.truststoreType=${minifi.c2.server.truststoreType}
-minifi.c2.server.truststorePasswd=${minifi.c2.server.truststorePasswd}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/logback.xml b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/logback.xml
deleted file mode 100644
index b9a8129d28..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/logback.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ /*
- ~ * 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.
- ~ */
- -->
-
-<configuration scan="true" scanPeriod="30 seconds">
- <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
- <resetJUL>true</resetJUL>
- </contextListener>
-
- <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
- <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>
- </encoder>
- </appender>
-
- <logger name="org.apache.nifi.minifi.c2" level="DEBUG"/>
-
- <root level="INFO">
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</configuration>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml
deleted file mode 100644
index cae8dcb241..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-context.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<beans default-lazy-init="true"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
-
- <bean id="configService" class="org.apache.nifi.minifi.c2.service.ConfigService" scope="singleton">
- <constructor-arg>
- <list>
- <bean class="org.apache.nifi.minifi.c2.provider.cache.CacheConfigurationProvider">
- <constructor-arg>
- <list>
- <value>application/json</value>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache">
- <constructor-arg>
- <value>./files</value>
- </constructor-arg>
- <constructor-arg>
- <value>\${class}/config</value>
- </constructor-arg>
- </bean>
- </constructor-arg>
- <!--<constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.s3.S3ConfigurationCache">
- <constructor-arg>
- <value>bucket</value>
- </constructor-arg>
- <constructor-arg>
- <value>prefix/</value>
- </constructor-arg>
- <constructor-arg>
- <value>\${class}</value>
- </constructor-arg>
- <constructor-arg>
- <value>access-key</value>
- </constructor-arg>
- <constructor-arg>
- <value>secret-key</value>
- </constructor-arg>
- <constructor-arg>
- <value>us-east-1</value>
- </constructor-arg>
- </bean>
- </constructor-arg>-->
- </bean>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.GrantedAuthorityAuthorizer">
- <constructor-arg value="classpath:authorizations.yaml"/>
- </bean>
- </constructor-arg>
- </bean>
-</beans>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-web-security-context.xml b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-web-security-context.xml
deleted file mode 100644
index 9035c2fe10..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/conf/minifi-c2-web-security-context.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
-
- <bean id="x509AuthenticationProvider" class="org.apache.nifi.minifi.c2.security.authentication.X509AuthenticationProvider">
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.PrincipalStringAuthorityGranter">
- <constructor-arg value="classpath:authorities.yaml"/>
- </bean>
- </constructor-arg>
- </bean>
-
- <bean id="x509AuthenticationFilter" class="org.apache.nifi.minifi.c2.security.authentication.X509AuthenticationFilter"/>
-
- <bean id="c2AnonymousAuthenticationFilter" class="org.apache.nifi.minifi.c2.security.authentication.C2AnonymousAuthenticationFilter"/>
-</beans>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/files/raspi3/config.test.json.v1 b/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/files/raspi3/config.test.json.v1
deleted file mode 100644
index 5ec729f6fb..0000000000
--- a/minifi/minifi-c2/minifi-c2-assembly/src/main/resources/files/raspi3/config.test.json.v1
+++ /dev/null
@@ -1,54 +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.
-
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "MiNiFi Flow",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/pom.xml b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/pom.xml
deleted file mode 100644
index 584a7ee22e..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2-cache</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-cache-filesystem</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemCacheFileInfoImpl.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemCacheFileInfoImpl.java
deleted file mode 100644
index ae2c1ae8a8..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemCacheFileInfoImpl.java
+++ /dev/null
@@ -1,86 +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.c2.cache.filesystem;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.api.util.Pair;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Comparator;
-import java.util.Objects;
-import java.util.stream.Stream;
-
-public class FileSystemCacheFileInfoImpl implements ConfigurationCacheFileInfo {
- private final FileSystemConfigurationCache cache;
- private final Path dirPath;
- private final String expectedFilename;
- private final int expectedFilenameLength;
-
- public FileSystemCacheFileInfoImpl(FileSystemConfigurationCache cache, Path dirPath, String expectedFilename) {
- this.cache = cache;
- this.dirPath = dirPath;
- this.expectedFilename = expectedFilename;
- this.expectedFilenameLength = expectedFilename.length();
- }
-
- @Override
- public Integer getVersionIfMatch(String filename) {
- if (!filename.startsWith(expectedFilename) || filename.length() == expectedFilenameLength) {
- return null;
- }
- try {
- return Integer.parseInt(filename.substring(expectedFilenameLength));
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- @Override
- public Stream<WriteableConfiguration> getCachedConfigurations() throws IOException {
- return Files.list(dirPath).map(p -> {
- Integer version = getVersionIfMatch(p.getFileName().toString());
- if (version == null) {
- return null;
- }
- return new Pair<>(version, p);
- }).filter(Objects::nonNull)
- .sorted(Comparator.comparing(pair -> ((Pair<Integer, Path>) pair).getFirst())
- .reversed()).map(pair -> new FileSystemWritableConfiguration(cache, pair.getSecond(), Integer.toString(pair.getFirst())));
- }
-
- @Override
- public WriteableConfiguration getConfiguration(Integer version) throws ConfigurationProviderException {
- if (version == null) {
- try {
- return getCachedConfigurations().findFirst().orElseThrow(() -> new ConfigurationProviderException("No configurations found for " + dirPath + "/" + expectedFilename + "[0-9]+"));
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to get cached configurations.", e);
- }
- }
- try {
- return new FileSystemWritableConfiguration(cache, cache.resolveChildAndVerifyParent(dirPath, expectedFilename + version), Integer.toString(version));
- } catch (NumberFormatException e) {
- throw new InvalidParameterException("Expected numeric version.", e);
- }
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemConfigurationCache.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemConfigurationCache.java
deleted file mode 100644
index 704dea91ef..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemConfigurationCache.java
+++ /dev/null
@@ -1,115 +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.c2.cache.filesystem;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.util.Pair;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Implementation of {@link ConfigurationCache} that uses the local file
- * system for caching configurations.
- *
- */
-public class FileSystemConfigurationCache implements ConfigurationCache {
- private static final Logger logger = LoggerFactory.getLogger(FileSystemConfigurationCache.class);
-
- private final Path pathRoot;
- private final String pathPattern;
-
- /**
- * Creates a new cache.
- * @param pathRoot The root path for configurations. This path will be appended
- * to the environment variable <code>C2_SERVER_HOME</code>.
- * @param pathPattern The pattern to determine the path.
- * @throws IOException Thrown if the path cannot be created.
- */
- public FileSystemConfigurationCache(String pathRoot, String pathPattern) throws IOException {
- final String serverHome = System.getenv("C2_SERVER_HOME");
- final String homePath = serverHome == null ? "." : serverHome;
- this.pathRoot = Paths.get(homePath).resolve(pathRoot).toAbsolutePath();
- Files.createDirectories(this.pathRoot);
- this.pathPattern = pathPattern;
- }
-
- /**
- * Resolves a parent {@link Path path} and child directory.
- * @param parent The parent {@link Path path}.
- * @param s The child directory.
- * @return The resolved {@link Path}.
- * @throws InvalidParameterException Thrown if the child directory is
- * not actually a child directory of the parent.
- */
- protected Path resolveChildAndVerifyParent(Path parent, String s) throws InvalidParameterException {
- Path child = parent.resolve(s).toAbsolutePath();
- if (child.toAbsolutePath().getParent().equals(parent)) {
- return child;
- } else {
- throw new InvalidParameterException("Path entry " + s + " not child of " + parent);
- }
- }
-
- @Override
- public ConfigurationCacheFileInfo getCacheFileInfo(String contentType, Map<String, List<String>> parameters) throws InvalidParameterException {
- String pathString = pathPattern;
- for (Map.Entry<String, List<String>> entry : parameters.entrySet()) {
- if (entry.getValue().size() != 1) {
- throw new InvalidParameterException("Multiple values for same parameter not supported in this provider.");
- }
- pathString = pathString.replaceAll(Pattern.quote("${" + entry.getKey() + "}"), entry.getValue().get(0));
- }
- pathString = pathString + "." + contentType.replace('/', '.');
- String[] split = pathString.split("/");
- for (String s1 : split) {
- int openBrace = s1.indexOf("${");
- if (openBrace >= 0 && openBrace < s1.length() + 2) {
- int closeBrace = s1.indexOf("}", openBrace + 2);
- if (closeBrace >= 0) {
- throw new InvalidParameterException("Found unsubstituted variable " + s1.substring(openBrace + 2, closeBrace));
- }
- }
- }
- String[] splitPath = split;
- Path path = pathRoot.toAbsolutePath();
- for (int i = 0; i < splitPath.length - 1; i++) {
- String s = splitPath[i];
- path = resolveChildAndVerifyParent(path, s);
- }
- Pair<Path, String> dirPathAndFilename = new Pair<>(path, splitPath[splitPath.length - 1]);
- if (logger.isDebugEnabled()) {
- StringBuilder message = new StringBuilder("Parameters {");
- message.append(parameters.entrySet().stream().map(e -> e.getKey() + ": [" + String.join(", ", e.getValue()) + "]").collect(Collectors.joining(", ")));
- message.append("} -> ");
- message.append(dirPathAndFilename.getFirst().resolve(dirPathAndFilename.getSecond()).toAbsolutePath());
- logger.debug(message.toString());
- }
- return new FileSystemCacheFileInfoImpl(this, dirPathAndFilename.getFirst(), dirPathAndFilename.getSecond() + ".v");
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemWritableConfiguration.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemWritableConfiguration.java
deleted file mode 100644
index 65afe5c1fd..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/main/java/org/apache/nifi/minifi/c2/cache/filesystem/FileSystemWritableConfiguration.java
+++ /dev/null
@@ -1,105 +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.c2.cache.filesystem;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.api.util.DelegatingOutputStream;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardOpenOption;
-import java.util.UUID;
-
-public class FileSystemWritableConfiguration implements WriteableConfiguration {
- private final FileSystemConfigurationCache cache;
- private final Path path;
- private final String version;
-
- public FileSystemWritableConfiguration(FileSystemConfigurationCache cache, Path path, String version) {
- this.cache = cache;
- this.path = path;
- this.version = version;
- }
-
- @Override
- public String getVersion() {
- return version;
- }
-
- @Override
- public boolean exists() {
- return Files.exists(path);
- }
-
- @Override
- public OutputStream getOutputStream() throws ConfigurationProviderException {
- try {
- Path parent = path.getParent();
- Files.createDirectories(parent);
- Path tmpPath = cache.resolveChildAndVerifyParent(parent, path.getFileName().toString() + "." + UUID.randomUUID().toString());
- return new DelegatingOutputStream(Files.newOutputStream(tmpPath)) {
- @Override
- public void close() throws IOException {
- super.close();
- Files.move(tmpPath, path);
- }
- };
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to open " + path + " for writing.", e);
- }
- }
-
- @Override
- public InputStream getInputStream() throws ConfigurationProviderException {
- try {
- return Files.newInputStream(path, StandardOpenOption.READ);
- } catch (IOException e) {
- if (Files.exists(path)) {
- throw new ConfigurationProviderException("Unable to open " + path + " for reading.", e);
- } else {
- throw new InvalidParameterException("File not found: " + path, e);
- }
- }
- }
-
- @Override
- public URL getURL() throws ConfigurationProviderException {
- try {
- return path.toUri().toURL();
- } catch (MalformedURLException murle) {
- throw new ConfigurationProviderException("Could not determine URL of " + path, murle);
- }
- }
-
- @Override
- public String getName() {
- return path.getFileName().toString();
- }
-
- @Override
- public String toString() {
- return "FileSystemWritableConfiguration{path=" + path + ", version='" + version + "'}";
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/java/org/apache/nifi/minfi/c2/cache/filesystem/FileSystemConfigurationCacheTest.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/java/org/apache/nifi/minfi/c2/cache/filesystem/FileSystemConfigurationCacheTest.java
deleted file mode 100644
index d731545a54..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/java/org/apache/nifi/minfi/c2/cache/filesystem/FileSystemConfigurationCacheTest.java
+++ /dev/null
@@ -1,104 +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.minfi.c2.cache.filesystem;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Stream;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache;
-import org.junit.jupiter.api.Test;
-
-public class FileSystemConfigurationCacheTest {
-
- private static final String PATH_ROOT = "src/test/resources/files";
- private static final String FLOW_CONTENT_TYPE = "test/json";
- public static final String NOT_REGISTERED_CONTENT_TYPE = "test/contenttype";
-
- @Test
- public void getConfigurationTest() throws IOException, ConfigurationProviderException {
- final String pathPattern = "config";
-
- FileSystemConfigurationCache cache = new FileSystemConfigurationCache(PATH_ROOT, pathPattern);
-
- Map<String, List<String>> parameters = new HashMap<>();
-
- ConfigurationCacheFileInfo info = cache.getCacheFileInfo(FLOW_CONTENT_TYPE, parameters);
-
- WriteableConfiguration configuration = info.getConfiguration(1);
-
- assertEquals("config.test.json.v1", configuration.getName());
- assertEquals("1", configuration.getVersion());
- assertTrue(configuration.exists());
- }
-
- @Test
- public void getNonexistantConfigurationTest() throws IOException, ConfigurationProviderException {
- final String pathPattern = "config";
-
- FileSystemConfigurationCache cache = new FileSystemConfigurationCache(PATH_ROOT, pathPattern);
-
- Map<String, List<String>> parameters = new HashMap<>();
-
- ConfigurationCacheFileInfo info = cache.getCacheFileInfo(NOT_REGISTERED_CONTENT_TYPE, parameters);
-
- WriteableConfiguration configuration = info.getConfiguration(1);
-
- assertEquals("config.test.contenttype.v1", configuration.getName());
- assertEquals("1", configuration.getVersion());
- assertFalse(configuration.exists());
- }
-
- @Test
- public void getCachedConfigurationsTest() throws IOException, ConfigurationProviderException {
- final String pathPattern = "config";
-
- FileSystemConfigurationCache cache = new FileSystemConfigurationCache(PATH_ROOT, pathPattern);
-
- Map<String, List<String>> parameters = new HashMap<>();
-
- ConfigurationCacheFileInfo info = cache.getCacheFileInfo(FLOW_CONTENT_TYPE, parameters);
-
- Stream<WriteableConfiguration> configs = info.getCachedConfigurations();
-
- assertEquals(1, configs.count());
- }
-
- @Test
- public void getConfigurationInvalidParametersTest() throws IOException {
- final String pathRoot = "files";
- final String pathPattern = "${test}/config";
-
- FileSystemConfigurationCache cache = new FileSystemConfigurationCache(pathRoot, pathPattern);
-
- Map<String, List<String>> parameters = new HashMap<>();
-
- assertThrows(InvalidParameterException.class, () -> cache.getCacheFileInfo(NOT_REGISTERED_CONTENT_TYPE, parameters));
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/resources/files/config.test.json.v1 b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/resources/files/config.test.json.v1
deleted file mode 100644
index 784143f19c..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-filesystem/src/test/resources/files/config.test.json.v1
+++ /dev/null
@@ -1,54 +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.
-
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "NiFi Flow",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/pom.xml b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/pom.xml
deleted file mode 100644
index ccbede8620..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2-cache</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-cache-s3</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk-s3</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3CacheFileInfoImpl.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3CacheFileInfoImpl.java
deleted file mode 100644
index f93d1a8e32..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3CacheFileInfoImpl.java
+++ /dev/null
@@ -1,130 +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.c2.cache.s3;
-
-import com.amazonaws.services.s3.AmazonS3;
-import com.amazonaws.services.s3.iterable.S3Objects;
-import com.amazonaws.services.s3.model.GetObjectRequest;
-import com.amazonaws.services.s3.model.S3Object;
-import com.amazonaws.services.s3.model.S3ObjectSummary;
-
-import java.io.IOException;
-import java.util.Comparator;
-import java.util.Objects;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.api.util.Pair;
-
-public class S3CacheFileInfoImpl implements ConfigurationCacheFileInfo {
-
- private final AmazonS3 s3;
- private final String bucket;
- private final String prefix;
- private final String expectedFilename;
-
- /**
- * Creates a new S3 cache file info.
- * @param s3 The {@link AmazonS3 client}.
- * @param bucket The S3 bucket.
- * @param prefix The S3 object prefix.
- */
- public S3CacheFileInfoImpl(AmazonS3 s3, String bucket, String prefix,
- String expectedFilename) {
-
- this.s3 = s3;
- this.bucket = bucket;
- this.prefix = prefix;
- this.expectedFilename = expectedFilename;
-
- }
-
- @Override
- public Integer getVersionIfMatch(String objectKey) {
-
- String filename = objectKey.substring(prefix.length());
-
- int expectedFilenameLength = expectedFilename.length();
- if (!filename.startsWith(expectedFilename) || filename.length() == expectedFilenameLength) {
- return null;
- }
- try {
- return Integer.parseInt(filename.substring(expectedFilenameLength));
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- @Override
- public WriteableConfiguration getConfiguration(Integer version)
- throws ConfigurationProviderException {
-
- if (version == null) {
-
- try {
- return getCachedConfigurations().findFirst()
- .orElseThrow(() -> new ConfigurationProviderException("No configurations found."));
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to get cached configurations.", e);
- }
-
- } else {
-
- final S3Object s3Object;
-
- if (StringUtils.isEmpty(prefix) || StringUtils.equals(prefix, "/")) {
- s3Object = s3.getObject(new GetObjectRequest(bucket,
- expectedFilename + version.toString()));
- } else {
- s3Object = s3.getObject(new GetObjectRequest(bucket,
- prefix + expectedFilename + version.toString()));
- }
-
- if (s3Object == null) {
- throw new ConfigurationProviderException("No configurations found for object key.");
- }
-
- return new S3WritableConfiguration(s3, s3Object, Integer.toString(version));
-
- }
-
- }
-
- @Override
- public Stream<WriteableConfiguration> getCachedConfigurations() throws IOException {
-
- Iterable<S3ObjectSummary> objectSummaries = S3Objects.withPrefix(s3, bucket, prefix);
- Stream<S3ObjectSummary> objectStream = StreamSupport.stream(objectSummaries.spliterator(), false);
-
- return objectStream.map(p -> {
- Integer version = getVersionIfMatch(p.getKey());
- if (version == null) {
- return null;
- }
- return new Pair<>(version, p);
- }).filter(Objects::nonNull)
- .sorted(Comparator.comparing(pair -> ((Pair<Integer, S3ObjectSummary>) pair).getFirst())
- .reversed()).map(pair -> new S3WritableConfiguration(s3, pair.getSecond(), Integer.toString(pair.getFirst())));
-
- }
-
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3ConfigurationCache.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3ConfigurationCache.java
deleted file mode 100644
index 01a13802e1..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3ConfigurationCache.java
+++ /dev/null
@@ -1,106 +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.c2.cache.s3;
-
-import com.amazonaws.auth.AWSStaticCredentialsProvider;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.regions.Regions;
-import com.amazonaws.services.s3.AmazonS3;
-import com.amazonaws.services.s3.AmazonS3Client;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-
-public class S3ConfigurationCache implements ConfigurationCache {
-
- private final AmazonS3 s3;
- private final String bucket;
- private final String prefix;
- private final String pathPattern;
-
- /**
- * Creates a new S3 configuration cache.
- * @param bucket The S3 bucket.
- * @param prefix The S3 object prefix.
- * @param pathPattern The path pattern.
- * @param accessKey The (optional) S3 access key.
- * @param secretKey The (optional) S3 secret key.
- * @param region The AWS region (e.g. us-east-1).
- * @throws IOException Thrown if the configuration cannot be read.
- */
- public S3ConfigurationCache(String bucket, String prefix, String pathPattern,
- String accessKey, String secretKey, String region) throws IOException {
-
- this.bucket = bucket;
- this.prefix = prefix;
- this.pathPattern = pathPattern;
-
- if (!StringUtils.isEmpty(accessKey)) {
-
- s3 = AmazonS3Client.builder()
- .withCredentials(new AWSStaticCredentialsProvider(
- new BasicAWSCredentials(accessKey, secretKey)))
- .withRegion(Regions.fromName(region))
- .build();
-
- } else {
-
- s3 = AmazonS3Client.builder()
- .withRegion(Regions.fromName(region))
- .build();
- }
-
- }
-
- @Override
- public ConfigurationCacheFileInfo getCacheFileInfo(String contentType,
- Map<String, List<String>> parameters) throws InvalidParameterException {
-
- String pathString = pathPattern;
- for (Map.Entry<String, List<String>> entry : parameters.entrySet()) {
- if (entry.getValue().size() != 1) {
- throw new InvalidParameterException("Multiple values for same parameter"
- + " are not supported by this provider.");
- }
- pathString = pathString.replaceAll(Pattern.quote("${" + entry.getKey() + "}"),
- entry.getValue().get(0));
- }
- pathString = pathString + "." + contentType.replace('/', '.');
- String[] split = pathString.split("/");
- for (String s1 : split) {
- int openBrace = s1.indexOf("${");
- if (openBrace >= 0 && openBrace < s1.length() + 2) {
- int closeBrace = s1.indexOf("}", openBrace + 2);
- if (closeBrace >= 0) {
- throw new InvalidParameterException("Found unsubstituted variable "
- + s1.substring(openBrace + 2, closeBrace));
- }
- }
- }
-
- return new S3CacheFileInfoImpl(s3, bucket, prefix, pathString + ".v");
- }
-
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3OutputStream.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3OutputStream.java
deleted file mode 100644
index abd4e4664c..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3OutputStream.java
+++ /dev/null
@@ -1,219 +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.c2.cache.s3;
-
-import com.amazonaws.AmazonClientException;
-import com.amazonaws.event.ProgressEvent;
-import com.amazonaws.event.ProgressListener;
-import com.amazonaws.services.s3.AmazonS3;
-import com.amazonaws.services.s3.model.AbortMultipartUploadRequest;
-import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
-import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
-import com.amazonaws.services.s3.model.ObjectMetadata;
-import com.amazonaws.services.s3.model.PartETag;
-import com.amazonaws.services.s3.model.UploadPartRequest;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This implementation has heavily borrowed Kafka's implementation
- * which borrowed the general structure of Hadoop's implementation.
- */
-public class S3OutputStream extends OutputStream {
-
- private static final Logger log = LoggerFactory.getLogger(S3OutputStream.class);
-
- private final AmazonS3 s3;
- private final String bucket;
- private final String key;
- private final ProgressListener progressListener;
- private final int partSize;
- private boolean closed;
- private ByteBuffer buffer;
- private MultipartUpload multiPartUpload;
-
- /**
- * Creates a new S3 output stream for an object.
- * @param bucket The bucket.
- * @param key The object's key.
- * @param s3 An S3 {@link AmazonS3 client}.
- */
- public S3OutputStream(String bucket, String key, AmazonS3 s3) {
- this.s3 = s3;
- this.bucket = bucket;
- this.key = key;
- this.partSize = 1024;
- this.closed = false;
- this.buffer = ByteBuffer.allocate(this.partSize);
- this.progressListener = new ConnectProgressListener();
- this.multiPartUpload = null;
- log.debug("Create S3OutputStream for bucket '{}' key '{}'", bucket, key);
- }
-
- @Override
- public void write(int b) throws IOException {
- buffer.put((byte) b);
- if (!buffer.hasRemaining()) {
- uploadPart();
- }
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- if (b == null) {
- throw new NullPointerException();
- } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
- throw new IndexOutOfBoundsException();
- } else if (len == 0) {
- return;
- }
-
- if (buffer.remaining() < len) {
- int firstPart = buffer.remaining();
- buffer.put(b, off, firstPart);
- uploadPart();
- write(b, off + firstPart, len - firstPart);
- } else {
- buffer.put(b, off, len);
- }
- }
-
- private void uploadPart() throws IOException {
- uploadPart(partSize);
- buffer.clear();
- }
-
- private void uploadPart(int size) throws IOException {
- if (multiPartUpload == null) {
- log.debug("New multi-part upload for bucket '{}' key '{}'", bucket, key);
- multiPartUpload = newMultipartUpload();
- }
-
- try {
- multiPartUpload.uploadPart(new ByteArrayInputStream(buffer.array()), size);
- } catch (Exception e) {
- if (multiPartUpload != null) {
- multiPartUpload.abort();
- log.debug("Multipart upload aborted for bucket '{}' key '{}'.", bucket, key);
- }
- throw new IOException("Part upload failed: ", e.getCause());
- }
- }
-
- public void commit() throws IOException {
- if (closed) {
- log.warn("Tried to commit data for bucket '{}' key '{}' on a closed stream. Ignoring.", bucket, key);
- return;
- }
-
- try {
- if (buffer.hasRemaining()) {
- uploadPart(buffer.position());
- }
- multiPartUpload.complete();
- log.debug("Upload complete for bucket '{}' key '{}'", bucket, key);
- } catch (Exception e) {
- log.error("Multipart upload failed to complete for bucket '{}' key '{}'", bucket, key);
- throw new RuntimeException("Multipart upload failed to complete.", e);
- } finally {
- buffer.clear();
- multiPartUpload = null;
- close();
- }
- }
-
- @Override
- public void close() throws IOException {
- if (closed) {
- return;
- }
- closed = true;
- if (multiPartUpload != null) {
- multiPartUpload.abort();
- log.debug("Multipart upload aborted for bucket '{}' key '{}'.", bucket, key);
- }
- super.close();
- }
-
- private MultipartUpload newMultipartUpload() throws IOException {
- InitiateMultipartUploadRequest initRequest = new InitiateMultipartUploadRequest(bucket, key, new ObjectMetadata());
- try {
- return new MultipartUpload(s3.initiateMultipartUpload(initRequest).getUploadId());
- } catch (AmazonClientException e) {
- throw new IOException("Unable to initiate MultipartUpload: " + e, e);
- }
- }
-
- private class MultipartUpload {
- private final String uploadId;
- private final List<PartETag> partETags;
-
- public MultipartUpload(String uploadId) {
- this.uploadId = uploadId;
- this.partETags = new ArrayList<>();
- log.debug("Initiated multi-part upload for bucket '{}' key '{}' with id '{}'", bucket, key, uploadId);
- }
-
- public void uploadPart(ByteArrayInputStream inputStream, int partSize) {
- int currentPartNumber = partETags.size() + 1;
- UploadPartRequest request = new UploadPartRequest()
- .withBucketName(bucket)
- .withKey(key)
- .withUploadId(uploadId)
- .withInputStream(inputStream)
- .withPartNumber(currentPartNumber)
- .withPartSize(partSize)
- .withGeneralProgressListener(progressListener);
- log.debug("Uploading part {} for id '{}'", currentPartNumber, uploadId);
- partETags.add(s3.uploadPart(request).getPartETag());
- }
-
- public void complete() {
- log.debug("Completing multi-part upload for key '{}', id '{}'", key, uploadId);
- CompleteMultipartUploadRequest completeRequest =
- new CompleteMultipartUploadRequest(bucket, key, uploadId, partETags);
- s3.completeMultipartUpload(completeRequest);
- }
-
- public void abort() {
- log.warn("Aborting multi-part upload with id '{}'", uploadId);
- try {
- s3.abortMultipartUpload(new AbortMultipartUploadRequest(bucket, key, uploadId));
- } catch (Exception e) {
- // ignoring failure on abort.
- log.warn("Unable to abort multipart upload, you may need to purge uploaded parts: ", e);
- }
- }
- }
-
- // Dummy listener for now, just logs the event progress.
- private static class ConnectProgressListener implements ProgressListener {
- @Override
- public void progressChanged(ProgressEvent progressEvent) {
- log.debug("Progress event: " + progressEvent);
- }
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3WritableConfiguration.java b/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3WritableConfiguration.java
deleted file mode 100644
index 7bcf0a668b..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/minifi-c2-cache-s3/src/main/java/org/apache/nifi/minifi/c2/cache/s3/S3WritableConfiguration.java
+++ /dev/null
@@ -1,101 +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.c2.cache.s3;
-
-import com.amazonaws.services.s3.AmazonS3;
-import com.amazonaws.services.s3.model.S3Object;
-import com.amazonaws.services.s3.model.S3ObjectSummary;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-
-public class S3WritableConfiguration implements WriteableConfiguration {
-
- private final AmazonS3 s3;
- private final S3Object s3Object;
- private final String version;
-
- /**
- * Creates a new S3 writable configuration.
- * @param s3 An S3 {@link AmazonS3 client}.
- * @param s3ObjectSummary The S3 object {@link S3ObjectSummary summary}.
- * @param version The version of the configuration.
- */
- public S3WritableConfiguration(AmazonS3 s3, S3ObjectSummary s3ObjectSummary, String version) {
-
- this.s3 = s3;
- this.s3Object = s3.getObject(s3ObjectSummary.getBucketName(), s3ObjectSummary.getKey());
- this.version = version;
-
- }
-
- /**
- * Creates a new S3 writable configuration.
- * @param s3 An S3 {@link AmazonS3 client}.
- * @param s3Object The S3 {@link S3Object object}.
- * @param version The version of the configuration.
- */
- public S3WritableConfiguration(AmazonS3 s3, S3Object s3Object, String version) {
-
- this.s3 = s3;
- this.s3Object = s3Object;
- this.version = version;
-
- }
-
- @Override
- public String getVersion() {
- return version;
- }
-
- @Override
- public boolean exists() {
- return s3.doesObjectExist(s3Object.getBucketName(), s3Object.getKey());
- }
-
- @Override
- public OutputStream getOutputStream() throws ConfigurationProviderException {
- return new S3OutputStream(s3Object.getBucketName(), s3Object.getKey(), s3);
- }
-
- @Override
- public InputStream getInputStream() throws ConfigurationProviderException {
- return s3Object.getObjectContent();
- }
-
- @Override
- public URL getURL() throws ConfigurationProviderException {
- return s3.getUrl(s3Object.getBucketName(), s3Object.getKey());
- }
-
- @Override
- public String getName() {
- return s3Object.getKey();
- }
-
- @Override
- public String toString() {
- return "FileSystemWritableConfiguration{objectKey=" + s3Object.getKey()
- + ", version='" + version + "'}";
- }
-
-}
diff --git a/minifi/minifi-c2/minifi-c2-cache/pom.xml b/minifi/minifi-c2/minifi-c2-cache/pom.xml
deleted file mode 100644
index 2db718f01f..0000000000
--- a/minifi/minifi-c2/minifi-c2-cache/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-cache</artifactId>
- <packaging>pom</packaging>
-
- <modules>
- <module>minifi-c2-cache-filesystem</module>
- <module>minifi-c2-cache-s3</module>
- </modules>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-docker/README.md b/minifi/minifi-c2/minifi-c2-docker/README.md
deleted file mode 100644
index 9e0d846aac..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/README.md
+++ /dev/null
@@ -1,27 +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.
--->
-
-Apache MiNiFi Command And Control Server
--------------
-A subproject of Apache NiFi and a complementary data collection approach that supplements the core tenets of NiFi in dataflow management, focusing on the collection of data at the source of its creation.
-
-Specific goals for the initial thrust of the MiNiFi effort comprise:
-
-* small and lightweight footprint,
-* central management of agents,
-* generation of data provenance, and
-* integration with NiFi for follow-on dataflow management and full chain of custody of information.
-
-Perspectives of the role of MiNiFi should be from the perspective of the agent acting immediately at, or directly adjacent to, source sensors, systems, or servers.
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockerhub/.dockerignore b/minifi/minifi-c2/minifi-c2-docker/dockerhub/.dockerignore
deleted file mode 100644
index 30a2650305..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockerhub/.dockerignore
+++ /dev/null
@@ -1,19 +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.
-
-# Place files you want to exclude from the docker build here similar to .gitignore https://docs.docker.com/engine/reference/builder/#dockerignore-file
-DockerBuild.sh
-DockerRun.sh
-DockerImage.txt
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerBuild.sh b/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerBuild.sh
deleted file mode 100755
index 7342c361ac..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerBuild.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-# 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.
-
-DOCKER_UID="${1:-1000}"
-DOCKER_GID="${2:-1000}"
-
-DOCKER_IMAGE="$(grep -Ev '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)"
-MINIFI_C2_IMAGE_VERSION="$(echo "${DOCKER_IMAGE}" | cut -d : -f 2)"
-
-root_dir="../../../.."
-mvn_cmd="${root_dir}/mvnw -f ${root_dir}/pom.xml help:evaluate -q -D forceStdout"
-IMAGE_NAME="$(${mvn_cmd} -D expression=docker.jre.image.name)"
-IMAGE_TAG="$(${mvn_cmd} -D expression=docker.image.tag)"
-
-echo "Building MiNiFi C2 Server Image: '${DOCKER_IMAGE}' Version: '${MINIFI_C2_IMAGE_VERSION}' Using: '${IMAGE_NAME}:${IMAGE_TAG}' User/Group: '${DOCKER_UID}/${DOCKER_GID}'"
-docker build --build-arg IMAGE_NAME="${IMAGE_NAME}" --build-arg IMAGE_TAG="${IMAGE_TAG}" --build-arg UID="${DOCKER_UID}" --build-arg GID="${DOCKER_GID}" --build-arg MINIFI_C2_VERSION="${MINIFI_C2_IMAGE_VERSION}" -t "${DOCKER_IMAGE}" .
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerImage.txt b/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerImage.txt
deleted file mode 100644
index 41b4b9af13..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerImage.txt
+++ /dev/null
@@ -1,16 +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.
-
-apache/nifi-minifi-c2:2.0.0
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerRun.sh b/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerRun.sh
deleted file mode 100755
index 24c9cfb1cd..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerRun.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# 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.
-
-DOCKER_IMAGE="$(grep -Ev '(^#|^\s*$|^\s*\t*#)' DockerImage.txt)"
-echo "Running Docker Image: $DOCKER_IMAGE"
-docker run -it -d "$DOCKER_IMAGE"
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockerhub/Dockerfile b/minifi/minifi-c2/minifi-c2-docker/dockerhub/Dockerfile
deleted file mode 100644
index cbbfcd553a..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockerhub/Dockerfile
+++ /dev/null
@@ -1,59 +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.
-#
-
-ARG IMAGE_NAME
-ARG IMAGE_TAG
-FROM ${IMAGE_NAME}:${IMAGE_TAG}
-LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
-LABEL site="https://nifi.apache.org"
-
-ARG UID=1000
-ARG GID=1000
-ARG MINIFI_C2_VERSION=2.0.0
-ARG MIRROR=https://archive.apache.org/dist
-
-ENV MINIFI_C2_BASE_DIR /opt/minifi-c2
-ENV MINIFI_C2_HOME ${MINIFI_C2_BASE_DIR}/minifi-c2-current
-ENV MINIFI_C2_BINARY minifi-c2-${MINIFI_C2_VERSION}-bin.zip
-ENV MINIFI_C2_BINARY_PATH nifi/${MINIFI_C2_VERSION}/${MINIFI_C2_BINARY}
-ENV MINIFI_C2_BINARY_URL ${MIRROR}/${MINIFI_C2_BINARY_PATH}
-
-RUN mkdir -p ${MINIFI_C2_BASE_DIR}
-
-# Download, validate, and expand Apache MiNiFi C2 binary.
-RUN apt-get update \
- && apt-get install -y zip \
- && rm -rf /var/lib/apt/lists/* \
- && curl -fSL "${MINIFI_C2_BINARY_URL}" -o "${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY}" \
- && echo "$(curl ${MINIFI_C2_BINARY_URL}.sha256) *${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY}" | sha256sum -c - \
- && unzip "${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY}" -d "${MINIFI_C2_BASE_DIR}" \
- && rm "${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY}" \
- && groupadd -g ${GID} c2 \
- && useradd --shell /bin/bash -u ${UID} -g ${GID} -m c2 \
- && ln -s "${MINIFI_C2_BASE_DIR}/minifi-c2-${MINIFI_C2_VERSION}" "${MINIFI_C2_HOME}" \
- && chown -R -L c2:c2 "${MINIFI_C2_BASE_DIR}"
-
-USER c2
-
-#Default http port
-EXPOSE 10090
-
-WORKDIR ${MINIFI_C2_HOME}
-
-# Startup MiNiFi C2
-ENTRYPOINT ["./bin/c2.sh", "run"]
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockermaven/.dockerignore b/minifi/minifi-c2/minifi-c2-docker/dockermaven/.dockerignore
deleted file mode 100644
index c46cae92af..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockermaven/.dockerignore
+++ /dev/null
@@ -1,17 +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.
-
-# Place files you want to exclude from the docker build here similar to .gitignore https://docs.docker.com/engine/reference/builder/#dockerignore-file
-integration-test.sh
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockermaven/Dockerfile b/minifi/minifi-c2/minifi-c2-docker/dockermaven/Dockerfile
deleted file mode 100644
index 98b6b05cfd..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockermaven/Dockerfile
+++ /dev/null
@@ -1,73 +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.
-#
-
-ARG IMAGE_NAME
-ARG IMAGE_TAG
-FROM ${IMAGE_NAME}:${IMAGE_TAG} AS builder
-LABEL stage=builder
-
-ARG UID=1000
-ARG GID=1000
-ARG MINIFI_C2_VERSION
-ARG MINIFI_C2_BINARY_NAME
-ARG MINIFI_C2_BINARY
-
-ENV MINIFI_C2_USER c2
-ENV MINIFI_C2_BASE_DIR /opt/minifi-c2
-ENV MINIFI_C2_HOME ${MINIFI_C2_BASE_DIR}/minifi-c2-current
-
-RUN mkdir -p ${MINIFI_C2_BASE_DIR}
-COPY $MINIFI_C2_BINARY $MINIFI_C2_BASE_DIR
-
-RUN apt-get update \
- && apt-get install -y unzip \
- && apt-get -y autoremove \
- && apt-get clean autoclean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
- && unzip ${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY_NAME} -d ${MINIFI_C2_BASE_DIR} \
- && rm ${MINIFI_C2_BASE_DIR}/${MINIFI_C2_BINARY_NAME} \
- && groupadd -g ${GID} ${MINIFI_C2_USER} \
- && useradd --shell /bin/bash -u ${UID} -g ${GID} -m ${MINIFI_C2_USER} \
- && ln -s ${MINIFI_C2_BASE_DIR}/minifi-c2-${MINIFI_C2_VERSION} ${MINIFI_C2_HOME} \
- && chown -R -L ${MINIFI_C2_USER}:${MINIFI_C2_USER} ${MINIFI_C2_BASE_DIR}
-
-FROM ${IMAGE_NAME}:${IMAGE_TAG}
-LABEL maintainer="Apache NiFi <de...@nifi.apache.org>"
-LABEL site="https://nifi.apache.org"
-
-ARG UID
-ARG GID
-
-ENV MINIFI_C2_USER c2
-ENV MINIFI_C2_BASE_DIR /opt/minifi-c2
-ENV MINIFI_C2_HOME ${MINIFI_C2_BASE_DIR}/minifi-c2-current
-
-RUN groupadd -g ${GID} ${MINIFI_C2_USER} \
- && useradd --shell /bin/bash -u ${UID} -g ${GID} -m ${MINIFI_C2_USER}
-
-COPY --chown=c2:c2 --from=builder ${MINIFI_C2_BASE_DIR} ${MINIFI_C2_BASE_DIR}
-
-USER ${MINIFI_C2_USER}
-
-#Default http port
-EXPOSE 10090
-
-WORKDIR ${MINIFI_C2_HOME}
-
-# Startup MiNiFi C2
-ENTRYPOINT ["./bin/c2.sh", "run"]
diff --git a/minifi/minifi-c2/minifi-c2-docker/dockermaven/integration-test.sh b/minifi/minifi-c2/minifi-c2-docker/dockermaven/integration-test.sh
deleted file mode 100755
index aa0ce17ed5..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/dockermaven/integration-test.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-set -exuo pipefail
-
-TAG=$1
-VERSION=$2
-
-container_name="nifi-minifi-c2-${TAG}-integration-test"
-image_name="apache/nifi-minifi-c2:${TAG}"
-port=10090
-
-trap '{ docker inspect -f "{{json .State}}" "${container_name}"; docker rm -f "${container_name}"; }' EXIT
-
-echo "Deleting any existing ${container_name} containers"
-docker rm -f "${container_name}"
-echo
-
-echo "Checking that all files are owned by C2"
-test -z "$(docker run --rm --entrypoint /bin/bash "${image_name}" -c "find /opt/minifi-c2 ! -user c2")"
-echo
-
-echo "Checking environment variables"
-test "/opt/minifi-c2/minifi-c2-current" = "$(docker run --rm --entrypoint /bin/bash "${image_name}" -c 'echo -n ${MINIFI_C2_HOME}')"
-test "/opt/minifi-c2/minifi-c2-${VERSION}" = "$(docker run --rm --entrypoint /bin/bash "${image_name}" -c 'readlink ${MINIFI_C2_BASE_DIR}/minifi-c2-current')"
-
-test "/opt/minifi-c2" = "$(docker run --rm --entrypoint /bin/bash "${image_name}" -c 'echo -n ${MINIFI_C2_BASE_DIR}')"
-echo
-
-echo "Starting MiNiFi C2 container..."
-docker run -d --name "${container_name}" "${image_name}"
-ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "${container_name}")
-echo
-
-max_iterations=10
-sleep_time=10
-
-sleep ${sleep_time}
-for i in $(seq 1 "${max_iterations}") :; do
- echo "Waiting for MiNiFi C2 startup - iteration: ${i}"
- if docker exec "${container_name}" bash -c " echo Running < /dev/tcp/${ip}/${port}"; then
- echo "MiNiFi C2 found active on port ${port}"
- break
- fi
- echo
- if [ "${i}" -eq "${max_iterations}" ]; then
- echo "MiNiFi C2 did not start within expected time"
- exit 1
- fi
- sleep 10
-done
-echo
-
-echo "Checking MiNiFi C2 Config Access (Invalid request)"
-test "400" = "$(docker exec "${container_name}" bash -c "curl -sSo /dev/null -w %{http_code} -m 10 --retry 5 --retry-connrefused --retry-max-time 60 http://${ip}:${port}/c2/config")"
-echo
-
-echo "Stopping MiNiFi C2 container"
-time docker stop "${container_name}"
-echo
diff --git a/minifi/minifi-c2/minifi-c2-docker/pom.xml b/minifi/minifi-c2/minifi-c2-docker/pom.xml
deleted file mode 100644
index 5a3355a820..0000000000
--- a/minifi/minifi-c2/minifi-c2-docker/pom.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>minifi-c2-docker</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <properties>
- <minifi.c2.version>${project.version}</minifi.c2.version>
- </properties>
-
- <profiles>
- <!-- Profile for building official Docker images. Not bound to build phases since that would require anyone build to have the Docker engine installed on their machine -->
- <profile>
- <id>docker</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-assembly-for-docker</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>process-sources</phase>
- <configuration>
- <target name="copy assembly for docker image build">
- <copy todir="${project.basedir}/target" overwrite="true" flatten="true">
- <fileset dir="${project.basedir}/../minifi-c2-assembly/target" includes="*.zip">
- <include name="*.zip" />
- </fileset>
- </copy>
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>build-docker-image</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- <configuration>
- <images>
- <image>
- <name>apache/nifi-minifi-c2</name>
- <build>
- <tags>
- <tag>${minifi.c2.version}-maven</tag>
- </tags>
- <dockerFile>dockermaven/Dockerfile</dockerFile>
- <contextDir>${project.basedir}</contextDir>
- <args>
- <IMAGE_NAME>${docker.jre.image.name}</IMAGE_NAME>
- <IMAGE_TAG>${docker.image.tag}</IMAGE_TAG>
- <UID>1000</UID>
- <GID>1000</GID>
- <MINIFI_C2_VERSION>${minifi.c2.version}</MINIFI_C2_VERSION>
- <MINIFI_C2_BINARY_NAME>minifi-c2-${minifi.c2.version}-bin.zip</MINIFI_C2_BINARY_NAME>
- <MINIFI_C2_BINARY>target/minifi-c2-${minifi.c2.version}-bin.zip</MINIFI_C2_BINARY>
- </args>
- </build>
- </image>
- </images>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <id>Docker integration tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <arguments>
- <argument>${project.version}-maven</argument>
- <argument>${project.version}</argument>
- </arguments>
- <executable>${project.basedir}/dockermaven/integration-test.sh</executable>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>docker-skip-tests</id>
- <activation>
- <property>
- <name>skipTests</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <id>Docker integration tests</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>docker-test-skip-test</id>
- <activation>
- <property>
- <name>maven.test.skip</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <id>Docker integration tests</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/README.md b/minifi/minifi-c2/minifi-c2-integration-tests/README.md
deleted file mode 100644
index cf5d005bb7..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/README.md
+++ /dev/null
@@ -1,27 +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.
--->
-# Apache NiFi MiNiFi Command and Control (C2) Server
-
-## How to execute minifi-c2-integration-tests
-
-### Build required modules
-- mvn -pl minifi/minifi-assembly -am install -T1C -DskipTests
-- mvn -pl minifi/minifi-docker -am install -T1C -DskipTests -P docker
-- mvn -pl minifi/minifi-c2/minifi-c2-assembly -am install -T1C -DskipTests
-- mvn -pl minifi/minifi-c2/minifi-c2-docker -am install -T1C -DskipTests -P docker
-- mvn -pl nifi-toolkit/nifi-toolkit-assembly -am install -T1C -DskipTests
-
-### Execute integration tests
-- mvn verify -Pdocker -f minifi/minifi-c2/minifi-c2-integration-tests/pom.xml
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/pom.xml b/minifi/minifi-c2/minifi-c2-integration-tests/pom.xml
deleted file mode 100644
index 88cabf7df8..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-integration-tests</artifactId>
- <packaging>jar</packaging>
-
- <properties>
- <minifi.c2.version>${project.version}</minifi.c2.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-security-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.palantir.docker.compose</groupId>
- <artifactId>docker-compose-junit-jupiter</artifactId>
- <version>2.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-framework-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- <excludes>
- <exclude>**/minifi-c2-context.xml</exclude>
- </excludes>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>**/minifi-c2-context.xml</include>
- </includes>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes combine.children="append">
- <exclude>**/config.application.json.*</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>docker</id>
- <properties>
- <name>docker</name>
- </properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/AbstractTestUnsecure.java b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/AbstractTestUnsecure.java
deleted file mode 100644
index 34dfec97df..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/AbstractTestUnsecure.java
+++ /dev/null
@@ -1,111 +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.c2.integration.test;
-
-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.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
-import com.palantir.docker.compose.DockerComposeExtension;
-import com.palantir.docker.compose.connection.Container;
-import com.palantir.docker.compose.connection.DockerPort;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import org.apache.commons.io.IOUtils;
-import org.apache.nifi.controller.flow.VersionedDataflow;
-import org.junit.jupiter.api.Test;
-
-public abstract class AbstractTestUnsecure {
- protected String c2Url;
-
- public static String getUnsecureConfigUrl(Container container) {
- DockerPort dockerPort = container.port(10090);
- return "http://" + dockerPort.getIp() + ":" + dockerPort.getExternalPort() + "/c2/config";
- }
-
- protected void setup(DockerComposeExtension docker) {
- c2Url = getConfigUrl(docker);
- }
-
- protected String getConfigUrl(DockerComposeExtension docker) {
- return getUnsecureConfigUrl(docker.containers().container("c2"));
- }
-
- @Test
- public void testCurrentVersion() throws IOException {
- VersionedDataflow versionedDataflow = getFlowDefinition(c2Url + "?class=raspi3");
- assertEquals("raspi3.v2", versionedDataflow.getRootGroup().getName());
- }
-
- @Test
- public void testVersion1() throws IOException {
- VersionedDataflow versionedDataflow = getFlowDefinition(c2Url + "?class=raspi3&version=1");
- assertEquals("raspi3.v1", versionedDataflow.getRootGroup().getName());
- }
-
- @Test
- public void testVersion2() throws IOException {
- VersionedDataflow versionedDataflow = getFlowDefinition(c2Url + "?class=raspi3&version=2");
- assertEquals("raspi3.v2", versionedDataflow.getRootGroup().getName());
- }
-
- @Test
- public void testUnacceptable() throws IOException {
- HttpURLConnection urlConnection = openSuperUserUrlConnection(c2Url + "?class=raspi3");
- try {
- urlConnection.setRequestProperty("Accept", "text/invalid");
- assertEquals(406, urlConnection.getResponseCode());
- } finally {
- urlConnection.disconnect();
- }
- }
-
- @Test
- public void testInvalid() throws IOException {
- HttpURLConnection urlConnection = openSuperUserUrlConnection(c2Url);
- try {
- assertEquals(400, urlConnection.getResponseCode());
- } finally {
- urlConnection.disconnect();
- }
- }
-
- public VersionedDataflow getFlowDefinition(String urlString) throws IOException {
- HttpURLConnection urlConnection = openSuperUserUrlConnection(urlString);
- urlConnection.setRequestProperty("Accept", "application/json");
- try (InputStream inputStream = urlConnection.getInputStream()) {
- return toVersionedDataFlow(inputStream);
- } finally {
- urlConnection.disconnect();
- }
- }
-
- protected HttpURLConnection openSuperUserUrlConnection(String url) throws IOException {
- return (HttpURLConnection) URI.create(url).toURL().openConnection();
- }
-
- protected VersionedDataflow toVersionedDataFlow(InputStream inputStream) throws IOException {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setAnnotationIntrospector(new JakartaXmlBindAnnotationIntrospector(objectMapper.getTypeFactory()));
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- return objectMapper.readValue(IOUtils.toByteArray(inputStream), VersionedDataflow.class);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/DelegatingConfigurationProviderUnsecureTest.java b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/DelegatingConfigurationProviderUnsecureTest.java
deleted file mode 100644
index 50a663bee8..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/DelegatingConfigurationProviderUnsecureTest.java
+++ /dev/null
@@ -1,37 +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.c2.integration.test;
-
-import com.palantir.docker.compose.DockerComposeExtension;
-import org.apache.nifi.minifi.c2.integration.test.health.HttpStatusCodeHealthCheck;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public class DelegatingConfigurationProviderUnsecureTest extends AbstractTestUnsecure {
- @RegisterExtension
- public static DockerComposeExtension docker = DockerComposeExtension.builder()
- .file("target/test-classes/docker-compose-DelegatingProviderUnsecureTest.yml")
- .waitingForService("c2-upstream", new HttpStatusCodeHealthCheck(DelegatingConfigurationProviderUnsecureTest::getUnsecureConfigUrl, 400))
- .waitingForService("c2", new HttpStatusCodeHealthCheck(DelegatingConfigurationProviderUnsecureTest::getUnsecureConfigUrl, 400))
- .build();
-
- @BeforeEach
- public void setup() {
- super.setup(docker);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/FileSystemCacheProviderUnsecureTest.java b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/FileSystemCacheProviderUnsecureTest.java
deleted file mode 100644
index 7d56b7376a..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/FileSystemCacheProviderUnsecureTest.java
+++ /dev/null
@@ -1,36 +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.c2.integration.test;
-
-import com.palantir.docker.compose.DockerComposeExtension;
-import org.apache.nifi.minifi.c2.integration.test.health.HttpStatusCodeHealthCheck;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public class FileSystemCacheProviderUnsecureTest extends AbstractTestUnsecure {
- @RegisterExtension
- public static DockerComposeExtension docker = DockerComposeExtension.builder()
- .file("target/test-classes/docker-compose-FileSystemProviderUnsecureTest.yml")
- .waitingForService("c2", new HttpStatusCodeHealthCheck(FileSystemCacheProviderUnsecureTest::getUnsecureConfigUrl, 400))
- .build();
-
- @BeforeEach
- public void setup() {
- super.setup(docker);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpStatusCodeHealthCheck.java b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpStatusCodeHealthCheck.java
deleted file mode 100644
index fe8d64e2d7..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpStatusCodeHealthCheck.java
+++ /dev/null
@@ -1,55 +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.c2.integration.test.health;
-
-import com.palantir.docker.compose.connection.Container;
-import com.palantir.docker.compose.connection.waiting.HealthCheck;
-import com.palantir.docker.compose.connection.waiting.SuccessOrFailure;
-
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.util.function.Function;
-
-public class HttpStatusCodeHealthCheck implements HealthCheck<Container> {
- private final Function<Container, String> urlFunction;
- private final int expected;
-
- public HttpStatusCodeHealthCheck(Function<Container, String> urlFunction, int expected) {
- this.urlFunction = urlFunction;
- this.expected = expected;
- }
-
- @Override
- public SuccessOrFailure isHealthy(Container target) {
- try {
- int responseCode = openConnection(urlFunction.apply(target)).getResponseCode();
- if (responseCode == expected) {
- return SuccessOrFailure.success();
- } else {
- return SuccessOrFailure.failure("Expected Status code " + expected + " got " + responseCode);
- }
- } catch (IOException e) {
- return SuccessOrFailure.failure("Expected Status code " + expected + " got IOException " + e.getMessage());
- }
- }
-
- protected HttpURLConnection openConnection(String url) throws IOException {
- return ((HttpURLConnection) URI.create(url).toURL().openConnection());
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpsStatusCodeHealthCheck.java b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpsStatusCodeHealthCheck.java
deleted file mode 100644
index 19e2e5b66c..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/java/org/apache/nifi/minifi/c2/integration/test/health/HttpsStatusCodeHealthCheck.java
+++ /dev/null
@@ -1,70 +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.c2.integration.test.health;
-
-import com.palantir.docker.compose.connection.Container;
-import com.palantir.docker.compose.connection.DockerPort;
-import com.palantir.docker.compose.connection.waiting.HealthCheck;
-import com.palantir.docker.compose.connection.waiting.SuccessOrFailure;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLSocketFactory;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.URI;
-import java.util.List;
-import java.util.function.Function;
-import java.util.function.Supplier;
-
-public class HttpsStatusCodeHealthCheck implements HealthCheck<List<Container>> {
- private final Function<Container, String> urlFunction;
- private final Function<List<Container>, Container> proxyExtractor;
- private final Function<List<Container>, Container> serverExtractor;
- private final Supplier<SSLSocketFactory> sslSocketFactorySupplier;
- private final int expected;
-
- public HttpsStatusCodeHealthCheck(Function<Container, String> urlFunction, Function<List<Container>, Container> proxyExtractor,
- Function<List<Container>, Container> serverExtractor, Supplier<SSLSocketFactory> sslSocketFactorySupplier, int expected) {
- this.urlFunction = urlFunction;
- this.proxyExtractor = proxyExtractor;
- this.serverExtractor = serverExtractor;
- this.sslSocketFactorySupplier = sslSocketFactorySupplier;
- this.expected = expected;
- }
-
- @Override
- public SuccessOrFailure isHealthy(List<Container> target) {
-
- return new HttpStatusCodeHealthCheck(urlFunction, expected) {
- @Override
- protected HttpURLConnection openConnection(String url) throws IOException {
- DockerPort dockerPort = proxyExtractor.apply(target).port(3128);
- return getHttpURLConnection(url, sslSocketFactorySupplier.get(), dockerPort.getIp(), dockerPort.getExternalPort());
- }
- }.isHealthy(serverExtractor.apply(target));
- }
-
- public static HttpURLConnection getHttpURLConnection(String url, SSLSocketFactory sslSocketFactory, String proxyHostname, int proxyPort) throws IOException {
- HttpsURLConnection httpURLConnection = (HttpsURLConnection) URI.create(url).toURL().openConnection(
- new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHostname, proxyPort)));
- httpURLConnection.setSSLSocketFactory(sslSocketFactory);
- return httpURLConnection;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure-delegating/conf/minifi-c2-context.xml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure-delegating/conf/minifi-c2-context.xml
deleted file mode 100644
index 5696552b3a..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure-delegating/conf/minifi-c2-context.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ 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.
- -->
-<beans default-lazy-init="true"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.1.xsd
- http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
-
- <bean id="configService" class="org.apache.nifi.minifi.c2.service.ConfigService" scope="singleton">
- <constructor-arg>
- <list>
- <bean class="org.apache.nifi.minifi.c2.provider.delegating.DelegatingConfigurationProvider">
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache">
- <constructor-arg>
- <value>./cache</value>
- </constructor-arg>
- <constructor-arg>
- <value>${class}/${class}</value>
- </constructor-arg>
- </bean>
- </constructor-arg>
- <constructor-arg>
- <value>https://c2-upstream:10443</value>
- </constructor-arg>
- </bean>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.GrantedAuthorityAuthorizer">
- <constructor-arg value="classpath:authorizations.yaml"/>
- </bean>
- </constructor-arg>
- </bean>
-</beans>
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorities.yaml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorities.yaml
deleted file mode 100644
index c137c0020d..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorities.yaml
+++ /dev/null
@@ -1,21 +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.
-
-CN=user1:
- - CLASS_RASPI_2
-CN=user2:
- - CLASS_RASPI_3
-CN=user3:
- - ROLE_SUPERUSER
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorizations.yaml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorizations.yaml
deleted file mode 100644
index fec97d5961..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/authorizations.yaml
+++ /dev/null
@@ -1,30 +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.
-
-Default Action: deny
-Paths:
- /c2/config:
- Default Action: deny
- Actions:
- - Authorization: CLASS_RASPI_3
- Query Parameters:
- class: raspi3
- Action: allow
- - Authorization: CLASS_RASPI_2
- Query Parameters:
- class: raspi2
- Action: allow
- - Authorization: ROLE_SUPERUSER
- Action: allow
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/c2.properties b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/c2.properties
deleted file mode 100644
index b68335049b..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-secure/conf/c2.properties
+++ /dev/null
@@ -1,27 +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.
-#
-
-minifi.c2.server.port=10443
-
-minifi.c2.server.secure=true
-minifi.c2.server.keystore=./conf/keystore.jks
-minifi.c2.server.keystoreType=JKS
-minifi.c2.server.keystorePasswd=badKeystorePass
-minifi.c2.server.keyPasswd=badKeyPass
-minifi.c2.server.truststore=./conf/truststore.jks
-minifi.c2.server.truststoreType=JKS
-minifi.c2.server.truststorePasswd=badTrustPass
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-unsecure-delegating/conf/minifi-c2-context.xml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-unsecure-delegating/conf/minifi-c2-context.xml
deleted file mode 100644
index abb39960e2..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-unsecure-delegating/conf/minifi-c2-context.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ 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.
- -->
-<beans default-lazy-init="true"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.1.xsd
- http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
-
- <bean id="configService" class="org.apache.nifi.minifi.c2.service.ConfigService" scope="singleton">
- <constructor-arg>
- <list>
- <bean class="org.apache.nifi.minifi.c2.provider.delegating.DelegatingConfigurationProvider">
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache">
- <constructor-arg>
- <value>./cache</value>
- </constructor-arg>
- <constructor-arg>
- <value>${class}/${class}</value>
- </constructor-arg>
- </bean>
- </constructor-arg>
- <constructor-arg>
- <value>http://c2-upstream:10090</value>
- </constructor-arg>
- </bean>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.GrantedAuthorityAuthorizer">
- <constructor-arg value="classpath:authorizations.yaml"/>
- </bean>
- </constructor-arg>
- </bean>
-</beans>
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorities.yaml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorities.yaml
deleted file mode 100644
index 22be1347ed..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorities.yaml
+++ /dev/null
@@ -1,17 +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.
-
-CN=c2, OU=NIFI:
- - C2
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorizations.yaml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorizations.yaml
deleted file mode 100644
index 6d626f7200..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2-upstream-secure/conf/authorizations.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the \"License\"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an \"AS IS\" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-Default Action: deny
-Paths:
- /c2/config:
- Default Action: deny
- Actions:
- - Authorization: C2
- Query Parameters:
- class: raspi4
- Action: deny
- - Authorization: C2
- Action: allow
-
- /c2/config/contentTypes:
- Default Action: deny
- Actions:
- - Authorization: C2
- Action: allow
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi2/config.application.json.v1 b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi2/config.application.json.v1
deleted file mode 100644
index 2225d3a0db..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi2/config.application.json.v1
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "raspi2.v1",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v1 b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v1
deleted file mode 100644
index 0d502bd2f6..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v1
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "raspi3.v1",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v2 b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v2
deleted file mode 100644
index b787d40b2e..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/c2/files/raspi3/config.application.json.v2
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "raspi3.v2",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderSecureTest.yml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderSecureTest.yml
deleted file mode 100644
index cd4a9ff126..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderSecureTest.yml
+++ /dev/null
@@ -1,55 +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.
-
-version: "2"
-
-services:
- c2-upstream:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10443"
- hostname: c2-upstream
- volumes:
- - ./c2/files:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/files
-
- - ./c2-secure/conf/c2.properties:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/c2.properties
- - ./c2-upstream-secure/conf/authorities.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorities.yaml
- - ./c2-upstream-secure/conf/authorizations.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorizations.yaml
-
- - ./certificates-DelegatingConfigurationProviderSecureTest/c2-upstream/keystore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/keystore.jks
- - ./certificates-DelegatingConfigurationProviderSecureTest/c2-upstream/truststore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/truststore.jks
-
- c2:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10443"
- hostname: c2
- volumes:
- - ./c2-secure-delegating/conf/minifi-c2-context.xml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/minifi-c2-context.xml
-
- - ./c2-secure/conf/c2.properties:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/c2.properties
- - ./c2-secure/conf/authorities.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorities.yaml
- - ./c2-secure/conf/authorizations.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorizations.yaml
-
- - ./certificates-DelegatingConfigurationProviderSecureTest/c2/keystore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/keystore.jks
- - ./certificates-DelegatingConfigurationProviderSecureTest/c2/truststore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/truststore.jks
-
- squid:
- image: chrisdaish/squid
- ports:
- - "3128"
- hostname: squid
- volumes:
- - ./squid/squid.conf:/etc/squid/squid.conf
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderUnsecureTest.yml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderUnsecureTest.yml
deleted file mode 100644
index ebbc1eb172..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-DelegatingProviderUnsecureTest.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the \"License\"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an \"AS IS\" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-version: "2"
-
-services:
- c2-upstream:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10090"
- hostname: c2-upstream
- volumes:
- - ./c2/files:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/files
- c2:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10090"
- hostname: c2
- volumes:
- - ./c2-unsecure-delegating/conf/minifi-c2-context.xml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/minifi-c2-context.xml
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemCacheProviderSecureTest.yml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemCacheProviderSecureTest.yml
deleted file mode 100644
index 179065ca86..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemCacheProviderSecureTest.yml
+++ /dev/null
@@ -1,40 +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.
-
-version: "2"
-
-services:
- c2:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10443"
- hostname: c2
- volumes:
- - ./c2/files:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/files
-
- - ./c2-secure/conf/c2.properties:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/c2.properties
- - ./c2-secure/conf/authorities.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorities.yaml
- - ./c2-secure/conf/authorizations.yaml:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/authorizations.yaml
-
- - ./certificates-FileSystemCacheProviderSecureTest/c2/keystore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/keystore.jks
- - ./certificates-FileSystemCacheProviderSecureTest/c2/truststore.jks:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/conf/truststore.jks
-
- squid:
- image: chrisdaish/squid
- ports:
- - "3128"
- hostname: squid
- volumes:
- - ./squid/squid.conf:/etc/squid/squid.conf
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemProviderUnsecureTest.yml b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemProviderUnsecureTest.yml
deleted file mode 100644
index 392850745b..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/docker-compose-FileSystemProviderUnsecureTest.yml
+++ /dev/null
@@ -1,25 +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.
-
-version: "2"
-
-services:
- c2:
- image: apache/nifi-minifi-c2:${minifi.c2.version}-maven
- ports:
- - "10090"
- hostname: c2
- volumes:
- - ./c2/files:/opt/minifi-c2/minifi-c2-${minifi.c2.version}/files
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/overlay.properties b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/overlay.properties
deleted file mode 100644
index b1312a0905..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/overlay.properties
+++ /dev/null
@@ -1,16 +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.
-#
diff --git a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/squid/squid.conf b/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/squid/squid.conf
deleted file mode 100644
index 90a5248152..0000000000
--- a/minifi/minifi-c2/minifi-c2-integration-tests/src/test/resources/squid/squid.conf
+++ /dev/null
@@ -1,19 +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.
-
-http_access allow all
-
-# Choose the port you want. Below we set it to default 3128.
-http_port 3128
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-jetty/pom.xml b/minifi/minifi-c2/minifi-c2-jetty/pom.xml
deleted file mode 100644
index 7ad5c93aa9..0000000000
--- a/minifi/minifi-c2/minifi-c2-jetty/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-jetty</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.ee10</groupId>
- <artifactId>jetty-ee10-webapp</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-jetty-configuration</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-security-ssl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk18on</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-jetty/src/main/java/org/apache/nifi/minifi/c2/jetty/JettyServer.java b/minifi/minifi-c2/minifi-c2-jetty/src/main/java/org/apache/nifi/minifi/c2/jetty/JettyServer.java
deleted file mode 100644
index 86d25994b8..0000000000
--- a/minifi/minifi-c2/minifi-c2-jetty/src/main/java/org/apache/nifi/minifi/c2/jetty/JettyServer.java
+++ /dev/null
@@ -1,187 +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.c2.jetty;
-
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE_TYPE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEY_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE_TYPE;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.KeyStore;
-import java.util.stream.Stream;
-import javax.net.ssl.SSLContext;
-import org.apache.nifi.jetty.configuration.connector.StandardServerConnectorFactory;
-import org.apache.nifi.minifi.c2.api.properties.C2Properties;
-import org.apache.nifi.security.ssl.StandardKeyStoreBuilder;
-import org.apache.nifi.security.ssl.StandardSslContextBuilder;
-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.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 BouncyCastleProvider BOUNCY_CASTLE_PROVIDER = new BouncyCastleProvider();
- private static final String BCFKS = "BCFKS";
-
- public static void main(String[] args) throws Exception {
- C2Properties properties = C2Properties.getInstance();
-
- 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())));
- }
-
- Server server;
- int port = Integer.parseInt(properties.getProperty("minifi.c2.server.port", "10090"));
- if (properties.isSecure()) {
- server = new Server();
- StandardServerConnectorFactory serverConnectorFactory = new StandardServerConnectorFactory(server, port);
- serverConnectorFactory.setSslContext(buildSSLContext(properties));
- serverConnectorFactory.setWantClientAuth(true);
-
- ServerConnector https = serverConnectorFactory.getServerConnector();
- https.setPort(port);
- server.addConnector(https);
- } else {
- server = new Server(port);
- }
-
- server.setHandler(handlers);
- server.start();
-
- 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());
- server.stop();
- System.exit(1);
- }
- }
- }
-
- server.dumpStdErr();
- server.join();
- }
-
- private static SSLContext buildSSLContext(C2Properties properties) {
- KeyStore keyStore;
- KeyStore truststore;
-
- File keyStoreFile = Paths.get(C2_SERVER_HOME).resolve(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE)).toFile();
- logger.debug("Loading Key Store [{}]", keyStoreFile.getPath());
- try (FileInputStream keyStoreStream = new FileInputStream(keyStoreFile)) {
- final String keyStoreType = properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_TYPE);
- final StandardKeyStoreBuilder builder = new StandardKeyStoreBuilder()
- .type(keyStoreType)
- .inputStream(keyStoreStream)
- .password(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_PASSWD).toCharArray());
-
- if (BCFKS.equals(keyStoreType)) {
- builder.provider(BOUNCY_CASTLE_PROVIDER);
- }
-
- keyStore = builder.build();
- } catch (IOException ioe) {
- throw new UncheckedIOException("Key Store loading failed", ioe);
- }
-
- File trustStoreFile = Paths.get(C2_SERVER_HOME).resolve(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE)).toFile();
- logger.debug("Loading Trust Store [{}]", trustStoreFile.getPath());
- try (FileInputStream trustStoreStream = new FileInputStream(trustStoreFile)) {
- final String trustStoreType = properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_TYPE);
-
- final StandardKeyStoreBuilder builder = new StandardKeyStoreBuilder()
- .type(trustStoreType)
- .inputStream(trustStoreStream)
- .password(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_PASSWD).toCharArray());
-
- if (BCFKS.equals(trustStoreType)) {
- builder.provider(BOUNCY_CASTLE_PROVIDER);
- }
-
- truststore = builder.build();
- } catch (IOException ioe) {
- throw new UncheckedIOException("Trust Store loading failed", ioe);
- }
-
- return new StandardSslContextBuilder()
- .keyStore(keyStore)
- .keyPassword(properties.getProperty(MINIFI_C2_SERVER_KEY_PASSWD).toCharArray())
- .trustStore(truststore)
- .build();
- }
-
- private static WebAppContext loadWar(final File warFile, final String contextPath, final ClassLoader parentClassLoader) {
- final WebAppContext webappContext = new WebAppContext(warFile.getPath(), contextPath);
- webappContext.setContextPath(contextPath);
- webappContext.setDisplayName(contextPath);
- webappContext.setErrorHandler(getErrorHandler());
-
- // get the temp directory for this webapp
- File tempDir = Paths.get(C2_SERVER_HOME, "tmp", warFile.getName()).toFile();
- if (tempDir.exists() && !tempDir.isDirectory()) {
- throw new RuntimeException(tempDir.getAbsolutePath() + " is not a directory");
- } else if (!tempDir.exists()) {
- final boolean made = tempDir.mkdirs();
- if (!made) {
- throw new RuntimeException(tempDir.getAbsolutePath() + " could not be created");
- }
- }
- if (!(tempDir.canRead() && tempDir.canWrite())) {
- throw new RuntimeException(tempDir.getAbsolutePath() + " directory does not have read/write privilege");
- }
-
- // configure the temp dir
- webappContext.setTempDirectory(tempDir);
-
- // configure the max form size (3x the default)
- webappContext.setMaxFormContentSize(600000);
-
- webappContext.setClassLoader(new WebAppClassLoader(parentClassLoader, webappContext));
- return webappContext;
- }
-
- private static ErrorPageErrorHandler getErrorHandler() {
- final ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler();
- errorHandler.setShowServlet(false);
- errorHandler.setShowStacks(false);
- errorHandler.setShowMessageInTitle(false);
- return errorHandler;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/pom.xml b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/pom.xml
deleted file mode 100644
index 77fd351823..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2-provider</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-provider-cache</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/main/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProvider.java b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/main/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProvider.java
deleted file mode 100644
index f65a86bc9a..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/main/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProvider.java
+++ /dev/null
@@ -1,46 +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.c2.provider.cache;
-
-import org.apache.nifi.minifi.c2.api.Configuration;
-import org.apache.nifi.minifi.c2.api.ConfigurationProvider;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-
-import java.util.List;
-import java.util.Map;
-
-public class CacheConfigurationProvider implements ConfigurationProvider {
- private final List<String> contentTypes;
- private final ConfigurationCache configurationCache;
-
- public CacheConfigurationProvider(List<String> contentTypes, ConfigurationCache configurationCache) {
- this.contentTypes = contentTypes;
- this.configurationCache = configurationCache;
- }
-
- @Override
- public List<String> getContentTypes() {
- return contentTypes;
- }
-
- @Override
- public Configuration getConfiguration(String contentType, Integer version, Map<String, List<String>> parameters) throws ConfigurationProviderException {
- return configurationCache.getCacheFileInfo(contentType, parameters).getConfiguration(version);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/test/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProviderTest.java b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/test/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProviderTest.java
deleted file mode 100644
index a4d8275148..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-cache/src/test/java/org/apache/nifi/minifi/c2/provider/cache/CacheConfigurationProviderTest.java
+++ /dev/null
@@ -1,71 +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.c2.provider.cache;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class CacheConfigurationProviderTest {
- public static final String TEST_CONTENT_TYPE = "test/contenttype";
- public static final String TEST_CONTENT_TYPE_2 = "test/contenttype2";
-
- private CacheConfigurationProvider cacheConfigurationProvider;
- private ConfigurationCache configConfigurationCache;
-
- @BeforeEach
- public void setup() {
- configConfigurationCache = mock(ConfigurationCache.class);
- cacheConfigurationProvider = new CacheConfigurationProvider(Arrays.asList(TEST_CONTENT_TYPE, TEST_CONTENT_TYPE_2), configConfigurationCache);
- }
-
- @Test
- public void testContentType() {
- assertEquals(Arrays.asList(TEST_CONTENT_TYPE, TEST_CONTENT_TYPE_2), cacheConfigurationProvider.getContentTypes());
- }
-
- @Test
- public void testGetConfiguration() throws ConfigurationProviderException {
- int version = 99;
-
- ConfigurationCacheFileInfo configurationCacheFileInfo = mock(ConfigurationCacheFileInfo.class);
- ConfigurationCacheFileInfo configurationCacheFileInfo2 = mock(ConfigurationCacheFileInfo.class);
- WriteableConfiguration configuration = mock(WriteableConfiguration.class);
- WriteableConfiguration configuration2 = mock(WriteableConfiguration.class);
-
- Map<String, List<String>> parameters = mock(Map.class);
- when(configConfigurationCache.getCacheFileInfo(TEST_CONTENT_TYPE, parameters)).thenReturn(configurationCacheFileInfo);
- when(configConfigurationCache.getCacheFileInfo(TEST_CONTENT_TYPE_2, parameters)).thenReturn(configurationCacheFileInfo2);
- when(configurationCacheFileInfo.getConfiguration(version)).thenReturn(configuration);
- when(configurationCacheFileInfo2.getConfiguration(version)).thenReturn(configuration2);
-
- assertEquals(configuration, cacheConfigurationProvider.getConfiguration(TEST_CONTENT_TYPE, version, parameters));
- assertEquals(configuration2, cacheConfigurationProvider.getConfiguration(TEST_CONTENT_TYPE_2, version, parameters));
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/pom.xml b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/pom.xml
deleted file mode 100644
index bf250f7a4a..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2-provider</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-provider-delegating</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-provider-util</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/main/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProvider.java b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/main/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProvider.java
deleted file mode 100644
index b749461cbc..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/main/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProvider.java
+++ /dev/null
@@ -1,166 +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.c2.provider.delegating;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.nifi.minifi.c2.api.Configuration;
-import org.apache.nifi.minifi.c2.api.ConfigurationProvider;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorizationException;
-import org.apache.nifi.minifi.c2.provider.util.HttpConnector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class DelegatingConfigurationProvider implements ConfigurationProvider {
- public static final Pattern errorPattern = Pattern.compile("^Server returned HTTP response code: ([0-9]+) for URL:.*");
- private static final Logger logger = LoggerFactory.getLogger(DelegatingConfigurationProvider.class);
- private final ConfigurationCache configurationCache;
- private final HttpConnector httpConnector;
- private final ObjectMapper objectMapper;
-
- public DelegatingConfigurationProvider(ConfigurationCache configurationCache, HttpConnector httpConnector) {
- this.configurationCache = configurationCache;
- this.httpConnector = httpConnector;
- this.objectMapper = new ObjectMapper();
- }
-
- @Override
- public List<String> getContentTypes() throws ConfigurationProviderException {
- try {
- HttpURLConnection httpURLConnection = httpConnector.get("/c2/config/contentTypes");
- try {
- List<String> contentTypes = objectMapper.readValue(httpURLConnection.getInputStream(), List.class);
- if (logger.isDebugEnabled()) {
- logger.debug("Got content types: " + contentTypes);
- }
- return contentTypes;
- } finally {
- httpURLConnection.disconnect();
- }
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to get content types from delegate.", e);
- }
- }
-
- @Override
- public Configuration getConfiguration(String contentType, Integer version, Map<String, List<String>> parameters) throws ConfigurationProviderException {
- HttpURLConnection remoteC2ServerConnection = null;
- try {
- if (version == null) {
- remoteC2ServerConnection = getDelegateConnection(contentType, parameters);
- version = Integer.parseInt(remoteC2ServerConnection.getHeaderField("X-Content-Version"));
- if (logger.isDebugEnabled()) {
- logger.debug("Got current version " + version + " from upstream.");
- }
- }
- ConfigurationCacheFileInfo cacheFileInfo = configurationCache.getCacheFileInfo(contentType, parameters);
- WriteableConfiguration configuration = cacheFileInfo.getConfiguration(version);
- if (!configuration.exists()) {
- if (remoteC2ServerConnection == null) {
- remoteC2ServerConnection = getDelegateConnection(contentType, parameters);
- }
- try (InputStream inputStream = remoteC2ServerConnection.getInputStream();
- OutputStream outputStream = configuration.getOutputStream()) {
- IOUtils.copy(inputStream, outputStream);
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to copy remote configuration to cache.", e);
- }
- }
- return configuration;
- } finally {
- if (remoteC2ServerConnection != null) {
- remoteC2ServerConnection.disconnect();
- }
- }
- }
-
- protected HttpURLConnection getDelegateConnection(String contentType, Map<String, List<String>> parameters) throws ConfigurationProviderException {
- StringBuilder queryStringBuilder = new StringBuilder();
- try {
- parameters.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getKey)).forEachOrdered(e -> e.getValue().stream().sorted().forEachOrdered(v -> {
- try {
- queryStringBuilder.append(URLEncoder.encode(e.getKey(), "UTF-8")).append("=").append(URLEncoder.encode(v, "UTF-8"));
- } catch (UnsupportedEncodingException ex) {
- throw new ConfigurationProviderException("Unsupported encoding.", ex).wrap();
- }
- queryStringBuilder.append("&");
- }));
- } catch (ConfigurationProviderException.Wrapper e) {
- throw e.unwrap();
- }
- String url = "/c2/config";
- if (queryStringBuilder.length() > 0) {
- queryStringBuilder.setLength(queryStringBuilder.length() - 1);
- url = url + "?" + queryStringBuilder.toString();
- }
- HttpURLConnection httpURLConnection = httpConnector.get(url);
- httpURLConnection.setRequestProperty("Accepts", contentType);
- try {
- int responseCode;
- try {
- responseCode = httpURLConnection.getResponseCode();
- } catch (IOException e) {
- Matcher matcher = errorPattern.matcher(e.getMessage());
- if (matcher.matches()) {
- responseCode = Integer.parseInt(matcher.group(1));
- } else {
- throw e;
- }
- }
- if (responseCode >= 400) {
- String message = "";
- InputStream inputStream = httpURLConnection.getErrorStream();
- if (inputStream != null) {
- try {
- message = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
- } finally {
- inputStream.close();
- }
- }
- if (responseCode == 400) {
- throw new InvalidParameterException(message);
- } else if (responseCode == 403) {
- throw new AuthorizationException("Got authorization exception from upstream server " + message);
- } else {
- throw new ConfigurationProviderException(message);
- }
- }
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to get response code from upstream server.", e);
- }
- return httpURLConnection;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/test/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProviderTest.java b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/test/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProviderTest.java
deleted file mode 100644
index 6e88a8fa64..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-delegating/src/test/java/org/apache/nifi/minifi/c2/provider/delegating/DelegatingConfigurationProviderTest.java
+++ /dev/null
@@ -1,196 +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.c2.provider.delegating;
-
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCache;
-import org.apache.nifi.minifi.c2.api.cache.ConfigurationCacheFileInfo;
-import org.apache.nifi.minifi.c2.api.cache.WriteableConfiguration;
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorizationException;
-import org.apache.nifi.minifi.c2.provider.util.HttpConnector;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class DelegatingConfigurationProviderTest {
- private ConfigurationCache configurationCache;
- private HttpConnector httpConnector;
- private HttpURLConnection httpURLConnection;
- private DelegatingConfigurationProvider delegatingConfigurationProvider;
- private Map<String, List<String>> parameters;
- private Integer version;
- private String endpointPath;
- private String contentType;
-
- @BeforeEach
- public void setup() throws ConfigurationProviderException {
- contentType = "test/json";
- version = 2;
- parameters = new HashMap<>();
- parameters.put("net", Collections.singletonList("edge"));
- parameters.put("class", Collections.singletonList("raspi3"));
- parameters.put("version", Collections.singletonList(Integer.toString(version)));
- endpointPath = "/c2/config?class=raspi3&net=edge&version=2";
- initMocks();
- }
-
- public void initMocks() throws ConfigurationProviderException {
- configurationCache = mock(ConfigurationCache.class);
- httpConnector = mock(HttpConnector.class);
- httpURLConnection = mock(HttpURLConnection.class);
- delegatingConfigurationProvider = new DelegatingConfigurationProvider(configurationCache, httpConnector);
- when(httpConnector.get(endpointPath)).thenReturn(httpURLConnection);
- }
-
- @Test
- public void testGetDelegateConnectionNoParameters() throws ConfigurationProviderException {
- endpointPath = "/c2/config";
- initMocks();
- assertEquals(httpURLConnection, delegatingConfigurationProvider.getDelegateConnection(contentType, Collections.emptyMap()));
- verify(httpURLConnection).setRequestProperty("Accepts", contentType);
- }
-
- @Test
- public void testGetDelegateConnectionParameters() throws ConfigurationProviderException {
- assertEquals(httpURLConnection, delegatingConfigurationProvider.getDelegateConnection(contentType, parameters));
- verify(httpURLConnection).setRequestProperty("Accepts", contentType);
- }
-
- @Test
- public void testGetDelegateConnection403() throws IOException {
- when(httpURLConnection.getResponseCode()).thenReturn(403);
- assertThrows(AuthorizationException.class, () -> delegatingConfigurationProvider.getDelegateConnection(contentType, parameters));
- }
-
- @Test
- public void testGetDelegateConnection400() throws IOException {
- when(httpURLConnection.getResponseCode()).thenThrow(new IOException("Server returned HTTP response code: 400 for URL: " + endpointPath));
- assertThrows(InvalidParameterException.class, () -> delegatingConfigurationProvider.getDelegateConnection(contentType, parameters));
- }
-
- @Test
- public void testGetDelegateConnection401() throws IOException {
- when(httpURLConnection.getResponseCode()).thenReturn(401);
- assertThrows(ConfigurationProviderException.class, () -> delegatingConfigurationProvider.getDelegateConnection(contentType, parameters));
- }
-
- @Test
- public void testGetContentTypesMalformed() throws ConfigurationProviderException, IOException {
- endpointPath = "/c2/config/contentTypes";
- initMocks();
- when(httpURLConnection.getInputStream()).thenReturn(new ByteArrayInputStream("[malformed".getBytes(StandardCharsets.UTF_8)));
- assertThrows(ConfigurationProviderException.class, () -> delegatingConfigurationProvider.getContentTypes());
- }
-
- @Test
- public void testGetContentTypesIOE() throws ConfigurationProviderException, IOException {
- endpointPath = "/c2/config/contentTypes";
- initMocks();
- when(httpURLConnection.getInputStream()).thenThrow(new IOException());
- assertThrows(ConfigurationProviderException.class, () -> delegatingConfigurationProvider.getContentTypes());
- }
-
- @Test
- public void testGetContentTypes() throws ConfigurationProviderException, IOException {
- endpointPath = "/c2/config/contentTypes";
- initMocks();
- List<String> contentTypes = Arrays.asList(contentType, "application/json");
- when(httpURLConnection.getInputStream()).thenReturn(new ByteArrayInputStream(("[\"" + String.join("\", \"", contentTypes) + "\"]").getBytes(StandardCharsets.UTF_8)));
- assertEquals(contentTypes, delegatingConfigurationProvider.getContentTypes());
- }
-
- @Test
- public void testGetConfigurationExistsWithVersion() throws ConfigurationProviderException {
- ConfigurationCacheFileInfo configurationCacheFileInfo = mock(ConfigurationCacheFileInfo.class);
- WriteableConfiguration configuration = mock(WriteableConfiguration.class);
- when(configurationCache.getCacheFileInfo(contentType, parameters)).thenReturn(configurationCacheFileInfo);
- when(configurationCacheFileInfo.getConfiguration(version)).thenReturn(configuration);
- when(configuration.exists()).thenReturn(true);
-
- assertEquals(configuration, delegatingConfigurationProvider.getConfiguration(contentType, version, parameters));
- }
-
- @Test
- public void testGetConfigurationDoesntExistWithVersion() throws ConfigurationProviderException, IOException {
- ConfigurationCacheFileInfo configurationCacheFileInfo = mock(ConfigurationCacheFileInfo.class);
- WriteableConfiguration configuration = mock(WriteableConfiguration.class);
- byte[] payload = "payload".getBytes(StandardCharsets.UTF_8);
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- when(httpURLConnection.getInputStream()).thenReturn(new ByteArrayInputStream(payload));
- when(configuration.getOutputStream()).thenReturn(output);
- when(configurationCache.getCacheFileInfo(contentType, parameters)).thenReturn(configurationCacheFileInfo);
- when(configurationCacheFileInfo.getConfiguration(version)).thenReturn(configuration);
- when(configuration.exists()).thenReturn(false);
-
- assertEquals(configuration, delegatingConfigurationProvider.getConfiguration(contentType, version, parameters));
- assertArrayEquals(payload, output.toByteArray());
- }
-
- @Test
- public void testGetConfigurationExistsWithNoVersion() throws ConfigurationProviderException {
- parameters.remove("version");
- endpointPath = "/c2/config?class=raspi3&net=edge";
- initMocks();
- ConfigurationCacheFileInfo configurationCacheFileInfo = mock(ConfigurationCacheFileInfo.class);
- WriteableConfiguration configuration = mock(WriteableConfiguration.class);
- when(httpURLConnection.getHeaderField("X-Content-Version")).thenReturn("2");
- when(configurationCache.getCacheFileInfo(contentType, parameters)).thenReturn(configurationCacheFileInfo);
- when(configurationCacheFileInfo.getConfiguration(version)).thenReturn(configuration);
- when(configuration.exists()).thenReturn(true);
-
- assertEquals(configuration, delegatingConfigurationProvider.getConfiguration(contentType, null, parameters));
- }
-
- @Test
- public void testGetConfigurationDoesntExistWithNoVersion() throws ConfigurationProviderException, IOException {
- parameters.remove("version");
- endpointPath = "/c2/config?class=raspi3&net=edge";
- initMocks();
- ConfigurationCacheFileInfo configurationCacheFileInfo = mock(ConfigurationCacheFileInfo.class);
- WriteableConfiguration configuration = mock(WriteableConfiguration.class);
- byte[] payload = "payload".getBytes(StandardCharsets.UTF_8);
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- when(httpURLConnection.getInputStream()).thenReturn(new ByteArrayInputStream(payload));
- when(configuration.getOutputStream()).thenReturn(output);
- when(httpURLConnection.getHeaderField("X-Content-Version")).thenReturn("2");
- when(configurationCache.getCacheFileInfo(contentType, parameters)).thenReturn(configurationCacheFileInfo);
- when(configurationCacheFileInfo.getConfiguration(version)).thenReturn(configuration);
- when(configuration.exists()).thenReturn(false);
-
- assertEquals(configuration, delegatingConfigurationProvider.getConfiguration(contentType, null, parameters));
- assertArrayEquals(payload, output.toByteArray());
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/pom.xml b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/pom.xml
deleted file mode 100644
index 667c79ed98..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2-provider</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-provider-util</artifactId>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-security-ssl</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/src/main/java/org/apache/nifi/minifi/c2/provider/util/HttpConnector.java b/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/src/main/java/org/apache/nifi/minifi/c2/provider/util/HttpConnector.java
deleted file mode 100644
index 8b82be1fd8..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/minifi-c2-provider-util/src/main/java/org/apache/nifi/minifi/c2/provider/util/HttpConnector.java
+++ /dev/null
@@ -1,180 +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.c2.provider.util;
-
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEYSTORE_TYPE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_KEY_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE_PASSWD;
-import static org.apache.nifi.minifi.c2.api.properties.C2Properties.MINIFI_C2_SERVER_TRUSTSTORE_TYPE;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.net.HttpURLConnection;
-import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.Proxy;
-import java.net.URI;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.util.Base64;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.properties.C2Properties;
-import org.apache.nifi.security.ssl.StandardKeyStoreBuilder;
-import org.apache.nifi.security.ssl.StandardSslContextBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HttpConnector {
-
- private static final Logger logger = LoggerFactory.getLogger(HttpConnector.class);
- private static final String HTTPS = "https:";
- private static final String C2_SERVER_HOME = System.getenv("C2_SERVER_HOME");
-
- private final String baseUrl;
- private final SSLContext sslContext;
- private final Proxy proxy;
- private final String proxyAuthorization;
-
- public HttpConnector(String baseUrl) throws InvalidParameterException, GeneralSecurityException, IOException {
- this(baseUrl, null, 0);
- }
-
- public HttpConnector(String baseUrl, String proxyHost, int proxyPort) throws InvalidParameterException, GeneralSecurityException, IOException {
- this(baseUrl, proxyHost, proxyPort, null, null);
- }
-
- public HttpConnector(String baseUrl, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword) throws InvalidParameterException {
- if (baseUrl.startsWith(HTTPS)) {
- sslContext = buildSSLContext();
- } else {
- sslContext = null;
- }
- this.baseUrl = baseUrl;
- if (proxyHost != null && !proxyHost.isEmpty()) {
- if (proxyPort == 0) {
- throw new InvalidParameterException("Must specify proxy port with proxy host");
- }
- proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
- } else {
- proxy = null;
- }
-
- if (proxyUsername != null && !proxyUsername.isEmpty()) {
- if (proxy == null) {
- throw new InvalidParameterException("Cannot specify proxy username without proxy host.");
- }
- if (proxyPassword == null) {
- throw new InvalidParameterException("Must specify proxy password with proxy username.");
- }
- proxyAuthorization = "Basic " + Base64.getEncoder().encodeToString((proxyHost + ":" + proxyPassword).getBytes(StandardCharsets.UTF_8));
- } else {
- proxyAuthorization = null;
- }
- }
-
- private SSLContext buildSSLContext() {
- C2Properties properties = C2Properties.getInstance();
- KeyStore keyStore;
- KeyStore truststore;
-
- Path c2ServerHome = Paths.get(C2_SERVER_HOME);
- File keyStoreFile = c2ServerHome.resolve(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE)).toFile();
- logger.debug("Loading Key Store [{}]", keyStoreFile.getPath());
- try (FileInputStream keyStoreStream = new FileInputStream(keyStoreFile)) {
- keyStore = new StandardKeyStoreBuilder()
- .type(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_TYPE))
- .inputStream(keyStoreStream)
- .password(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_PASSWD).toCharArray())
- .build();
- } catch (IOException ioe) {
- throw new UncheckedIOException("Key Store loading failed", ioe);
- }
-
- File trustStoreFile = c2ServerHome.resolve(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE)).toFile();
- logger.debug("Loading Trust Store [{}]", trustStoreFile.getPath());
- try (FileInputStream trustStoreStream = new FileInputStream(trustStoreFile)) {
- truststore = new StandardKeyStoreBuilder()
- .type(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_TYPE))
- .inputStream(trustStoreStream)
- .password(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_PASSWD).toCharArray())
- .build();
- } catch (IOException ioe) {
- throw new UncheckedIOException("Trust Store loading failed", ioe);
- }
-
- return new StandardSslContextBuilder()
- .keyStore(keyStore)
- .keyPassword(properties.getProperty(MINIFI_C2_SERVER_KEY_PASSWD).toCharArray())
- .trustStore(truststore)
- .build();
- }
-
- public HttpURLConnection get(String endpointPath) throws ConfigurationProviderException {
- return get(endpointPath, Collections.emptyMap());
- }
-
- public HttpURLConnection get(String endpointPath, Map<String, List<String>> headers) throws ConfigurationProviderException {
- String endpointUrl = baseUrl + endpointPath;
- if (logger.isDebugEnabled()) {
- logger.debug("Connecting to endpoint: " + endpointUrl);
- }
- URL url;
- try {
- url = URI.create(endpointUrl).toURL();
- } catch (IllegalArgumentException | MalformedURLException e) {
- throw new ConfigurationProviderException("Malformed url " + endpointUrl, e);
- }
-
- HttpURLConnection httpURLConnection;
- try {
- if (proxy == null) {
- httpURLConnection = (HttpURLConnection) url.openConnection();
- } else {
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- }
- if (sslContext != null) {
- HttpsURLConnection httpsURLConnection = (HttpsURLConnection) httpURLConnection;
- SSLSocketFactory socketFactory = sslContext.getSocketFactory();
- httpsURLConnection.setSSLSocketFactory(socketFactory);
- }
- } catch (IOException e) {
- throw new ConfigurationProviderException("Unable to connect to " + url, e);
- }
- if (proxyAuthorization != null) {
- httpURLConnection.setRequestProperty("Proxy-Authorization", proxyAuthorization);
- }
- headers.forEach((s, strings) -> httpURLConnection.setRequestProperty(s, String.join(",", strings)));
- return httpURLConnection;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-provider/pom.xml b/minifi/minifi-c2/minifi-c2-provider/pom.xml
deleted file mode 100644
index cfa613072a..0000000000
--- a/minifi/minifi-c2/minifi-c2-provider/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-provider</artifactId>
- <packaging>pom</packaging>
-
- <modules>
- <module>minifi-c2-provider-util</module>
- <module>minifi-c2-provider-cache</module>
- <module>minifi-c2-provider-delegating</module>
- </modules>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-service/pom.xml b/minifi/minifi-c2/minifi-c2-service/pom.xml
deleted file mode 100644
index 6a5fccad41..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi-c2</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2-service</artifactId>
- <packaging>war</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-api</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>c2-protocol-api</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-security-cert</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
- <artifactId>jackson-jakarta-rs-json-provider</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jakarta.servlet</groupId>
- <artifactId>jakarta.servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jakarta.ws.rs</groupId>
- <artifactId>jakarta.ws.rs-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-annotations</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-server</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/C2ResourceConfig.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/C2ResourceConfig.java
deleted file mode 100644
index f75e531969..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/C2ResourceConfig.java
+++ /dev/null
@@ -1,37 +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.c2.configuration;
-
-import org.apache.nifi.minifi.c2.service.C2JsonProviderFeature;
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.context.ApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
-
-import jakarta.servlet.ServletContext;
-import jakarta.ws.rs.core.Context;
-
-public class C2ResourceConfig extends ResourceConfig {
-
- public C2ResourceConfig(@Context ServletContext servletContext) {
- final ApplicationContext appCtx = WebApplicationContextUtils.getWebApplicationContext(servletContext);
-
- // register Jackson Object Mapper Resolver
- register(C2JsonProviderFeature.class);
- register(appCtx.getBean("configService"));
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/Configuration.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/Configuration.java
deleted file mode 100644
index 19b647f0f1..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/configuration/Configuration.java
+++ /dev/null
@@ -1,28 +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.c2.configuration;
-
-import org.apache.nifi.minifi.c2.security.SecurityConfiguration;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.ImportResource;
-
-@org.springframework.context.annotation.Configuration
-@Import({SecurityConfiguration.class})
-@ImportResource({"classpath:minifi-c2-context.xml"})
-public class Configuration {
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/SecurityConfiguration.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/SecurityConfiguration.java
deleted file mode 100644
index be1440bb1f..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/SecurityConfiguration.java
+++ /dev/null
@@ -1,90 +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.c2.security;
-
-import org.apache.nifi.minifi.c2.security.authentication.C2AnonymousAuthenticationFilter;
-import org.apache.nifi.minifi.c2.security.authentication.X509AuthenticationFilter;
-import org.apache.nifi.minifi.c2.security.authentication.X509AuthenticationProvider;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-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.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.configuration.EnableWebSecurity;
-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
-@EnableMethodSecurity
-@ImportResource({"classpath:minifi-c2-web-security-context.xml"})
-public class SecurityConfiguration {
- private AuthenticationProvider authenticationProvider;
- private X509AuthenticationFilter x509AuthenticationFilter;
- private C2AnonymousAuthenticationFilter c2AnonymousAuthenticationFilter;
-
- @Bean
- public AuthenticationManager authenticationManager() {
- return new ProviderManager(authenticationProvider);
- }
-
- @Bean
- 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
- public void setX509AuthenticationProvider(X509AuthenticationProvider x509AuthenticationProvider) {
- this.authenticationProvider = x509AuthenticationProvider;
- }
-
- @Autowired
- public void setX509AuthenticationFilter(X509AuthenticationFilter x509AuthenticationFilter) {
- this.x509AuthenticationFilter = x509AuthenticationFilter;
- }
-
- @Autowired
- public void setC2AnonymousAuthenticationFilter(C2AnonymousAuthenticationFilter c2AnonymousAuthenticationFilter) {
- this.c2AnonymousAuthenticationFilter = c2AnonymousAuthenticationFilter;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AnonymousAuthenticationFilter.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AnonymousAuthenticationFilter.java
deleted file mode 100644
index f56279c4f9..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AnonymousAuthenticationFilter.java
+++ /dev/null
@@ -1,38 +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.c2.security.authentication;
-
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
-
-import jakarta.servlet.http.HttpServletRequest;
-import java.util.Arrays;
-
-public class C2AnonymousAuthenticationFilter extends AnonymousAuthenticationFilter {
- public static final String ANONYMOUS = "anonymous";
-
- public C2AnonymousAuthenticationFilter() {
- super(ANONYMOUS);
- }
-
- @Override
- protected Authentication createAuthentication(HttpServletRequest request) {
- return new C2AuthenticationToken(ANONYMOUS, null, Arrays.asList(new SimpleGrantedAuthority("ROLE_ANONYMOUS")));
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AuthenticationToken.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AuthenticationToken.java
deleted file mode 100644
index d6f85ec5bb..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/C2AuthenticationToken.java
+++ /dev/null
@@ -1,51 +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.c2.security.authentication;
-
-import org.springframework.security.authentication.AbstractAuthenticationToken;
-import org.springframework.security.core.GrantedAuthority;
-
-import java.util.Collection;
-
-public class C2AuthenticationToken extends AbstractAuthenticationToken {
- private final String principal;
- private Object credentials;
-
- public C2AuthenticationToken(String principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
- super(authorities);
- setAuthenticated(true);
- this.principal = principal;
- this.credentials = credentials;
- }
-
- @Override
- public Object getCredentials() {
- return credentials;
- }
-
- @Override
- public Object getPrincipal() {
- return principal;
- }
-
- @Override
- public void eraseCredentials() {
- super.eraseCredentials();
- credentials = null;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationFilter.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationFilter.java
deleted file mode 100644
index 78dbcadc38..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationFilter.java
+++ /dev/null
@@ -1,70 +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.c2.security.authentication;
-
-import org.apache.nifi.minifi.c2.util.HttpRequestUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.web.filter.GenericFilterBean;
-
-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;
-
-public class X509AuthenticationFilter extends GenericFilterBean {
- private static final Logger logger = LoggerFactory.getLogger(X509AuthenticationFilter.class);
- private AuthenticationManager authenticationManager;
-
- @Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- authenticateIfPossible(request);
- chain.doFilter(request, response);
- }
-
- private void authenticateIfPossible(ServletRequest request) {
- if (!request.isSecure()) {
- return;
- }
-
- X509Certificate[] certs = (X509Certificate[]) request.getAttribute("jakarta.servlet.request.X509Certificate");
-
- if (certs == null || certs.length == 0) {
- if (logger.isDebugEnabled()) {
- logger.debug("Unable to get certificates in request from " + HttpRequestUtil.getClientString(request));
- }
- return;
- }
-
- Authentication authentication = authenticationManager.authenticate(new X509AuthenticationToken(certs));
- if (authentication.isAuthenticated()) {
- SecurityContextHolder.getContext().setAuthentication(authentication);
- }
- }
-
- @Autowired
- public void setAuthenticationManager(AuthenticationManager authenticationManager) {
- this.authenticationManager = authenticationManager;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationProvider.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationProvider.java
deleted file mode 100644
index c297947a33..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationProvider.java
+++ /dev/null
@@ -1,49 +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.c2.security.authentication;
-
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorityGranter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.authentication.AuthenticationProvider;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-
-public class X509AuthenticationProvider implements AuthenticationProvider {
- private static final Logger logger = LoggerFactory.getLogger(X509AuthenticationProvider.class);
- private final AuthorityGranter authorityGranter;
-
- public X509AuthenticationProvider(AuthorityGranter authorityGranter) {
- this.authorityGranter = authorityGranter;
- }
-
- @Override
- public Authentication authenticate(Authentication authentication) throws AuthenticationException {
- X509AuthenticationToken x509AuthenticationToken = (X509AuthenticationToken) authentication;
- if (logger.isDebugEnabled()) {
- logger.debug("Authenticating " + X509AuthenticationToken.class.getSimpleName() + " with principal " + x509AuthenticationToken.getPrincipal());
- }
- return new C2AuthenticationToken(x509AuthenticationToken.getPrincipal(), x509AuthenticationToken.getCredentials(),
- authorityGranter.grantAuthorities(authentication));
- }
-
- @Override
- public boolean supports(Class<?> authentication) {
- return X509AuthenticationToken.class.isAssignableFrom(authentication);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationToken.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationToken.java
deleted file mode 100644
index 296637dce6..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authentication/X509AuthenticationToken.java
+++ /dev/null
@@ -1,53 +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.c2.security.authentication;
-
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.apache.nifi.security.cert.StandardPrincipalFormatter;
-import org.springframework.security.authentication.AbstractAuthenticationToken;
-import org.springframework.security.core.GrantedAuthority;
-
-public class X509AuthenticationToken extends AbstractAuthenticationToken {
- private final X509Certificate[] x509Certificates;
- private final String subjectDn;
-
- public X509AuthenticationToken(X509Certificate[] x509Certificates) {
- this(x509Certificates, null);
- setAuthenticated(false);
- }
-
- protected X509AuthenticationToken(X509Certificate[] x509Certificates, Collection<GrantedAuthority> grantedAuthorities) {
- super(grantedAuthorities);
- this.x509Certificates = Arrays.copyOf(x509Certificates, x509Certificates.length, X509Certificate[].class);
- X509Certificate x509Certificate = x509Certificates[0];
- this.subjectDn = StandardPrincipalFormatter.getInstance().getSubject(x509Certificate);
- }
-
- @Override
- public X509Certificate[] getCredentials() {
- return x509Certificates;
- }
-
- @Override
- public String getPrincipal() {
- return subjectDn;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/GrantedAuthorityAuthorizer.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/GrantedAuthorityAuthorizer.java
deleted file mode 100644
index 1654fa240c..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/GrantedAuthorityAuthorizer.java
+++ /dev/null
@@ -1,138 +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.c2.security.authorization;
-
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorizationException;
-import org.apache.nifi.minifi.c2.api.security.authorization.Authorizer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.io.Resource;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-import org.yaml.snakeyaml.Yaml;
-
-import jakarta.ws.rs.core.MultivaluedMap;
-import jakarta.ws.rs.core.UriInfo;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-public class GrantedAuthorityAuthorizer implements Authorizer {
- private static final Logger logger = LoggerFactory.getLogger(GrantedAuthorityAuthorizer.class);
-
- public static final String DENY = "deny";
- public static final String ALLOW = "allow";
- public static final String DEFAULT_ACTION = "Default Action";
- private final Map<String, Object> grantedAuthorityMap;
-
- public GrantedAuthorityAuthorizer(Resource configYaml) throws IOException {
- try (InputStream inputStream = configYaml.getInputStream()) {
- grantedAuthorityMap = as(Map.class, new Yaml().load(inputStream), o -> new IllegalArgumentException("Expected yaml map for root of configuration but was " + o));
- }
- }
-
- @Override
- public void authorize(Authentication authentication, UriInfo uriInfo) throws AuthorizationException {
- if (authentication == null) {
- throw new AuthorizationException("null authentication object provided.");
- }
-
- if (!authentication.isAuthenticated()) {
- throw new AuthorizationException(authentication + " not authenticated.");
- }
-
- Set<String> authorities = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.toSet());
-
- String defaultAction = as(String.class, grantedAuthorityMap.getOrDefault(DEFAULT_ACTION, DENY));
- String path = uriInfo.getAbsolutePath().getPath();
- Map<String, Object> pathAuthorizations = as(Map.class, grantedAuthorityMap.get("Paths"));
- if (pathAuthorizations == null && !ALLOW.equalsIgnoreCase(defaultAction)) {
- throw new AuthorizationException("Didn't find authorizations for " + path + " and default policy is " + defaultAction + " instead of allow");
- }
-
- Map<String, Object> pathAuthorization = as(Map.class, pathAuthorizations.get(path));
- if (pathAuthorization == null && !ALLOW.equalsIgnoreCase(defaultAction)) {
- throw new AuthorizationException("Didn't find authorizations for " + path + " and default policy is " + defaultAction + " instead of allow");
- }
- defaultAction = as(String.class, pathAuthorization.getOrDefault(DEFAULT_ACTION, defaultAction));
- List<Map<String, Object>> actions = as(List.class, pathAuthorization.get("Actions"));
- MultivaluedMap<String, String> queryParameters = uriInfo.getQueryParameters();
- for (Map<String, Object> action : actions) {
- String ruleAction = as(String.class, action.get("Action"));
- if (ruleAction == null || !(ALLOW.equalsIgnoreCase(ruleAction) || DENY.equalsIgnoreCase(ruleAction))) {
- throw new AuthorizationException("Expected Action key of allow or deny for " + action);
- }
- String authorization = as(String.class, action.get("Authorization"));
- if (authorization != null && !authorities.contains(authorization)) {
- continue;
- }
- Map<String, Object> parameters = as(Map.class, action.get("Query Parameters"));
- if (parameters != null) {
- boolean foundParameterMismatch = false;
- for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
- Object value = parameter.getValue();
- if (value instanceof String) {
- value = Arrays.asList((String)value);
- }
- if (!Objects.equals(queryParameters.get(parameter.getKey()), value)) {
- foundParameterMismatch = true;
- break;
- }
- }
- if (foundParameterMismatch) {
- continue;
- }
- }
- if (ALLOW.equalsIgnoreCase(ruleAction)) {
- if (logger.isDebugEnabled()) {
- logger.debug("Action " + action + "matched which resulted in " + ruleAction);
- }
- return;
- } else {
- throw new AuthorizationException("Action " + action + " matched which resulted in " + ruleAction);
- }
- }
- if (ALLOW.equalsIgnoreCase(defaultAction)) {
- if (logger.isDebugEnabled()) {
- logger.debug("Found no matching actions so falling back to default action " + defaultAction);
- }
- } else {
- throw new AuthorizationException("Didn't find authorizations for " + path + " and default policy is " + defaultAction + " instead of allow");
- }
- }
-
- private static <T> T as(Class<T> clazz, Object object) throws AuthorizationException {
- return as(clazz, object, o -> new AuthorizationException("Expected " + clazz + " but was " + o));
- }
-
- private static <T, E extends Throwable> T as(Class<T> clazz, Object object, Function<Object, E> exceptionSupplier) throws E {
- if (object == null) {
- return null;
- }
- if (!clazz.isInstance(object)) {
- throw exceptionSupplier.apply(object);
- }
- return clazz.cast(object);
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/PrincipalStringAuthorityGranter.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/PrincipalStringAuthorityGranter.java
deleted file mode 100644
index 24e1ffa40b..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/security/authorization/PrincipalStringAuthorityGranter.java
+++ /dev/null
@@ -1,54 +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.c2.security.authorization;
-
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorityGranter;
-import org.springframework.core.io.Resource;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class PrincipalStringAuthorityGranter implements AuthorityGranter {
- private final Map<String, List<String>> grantedAuthorityMap;
-
- public PrincipalStringAuthorityGranter(Resource configYaml) throws IOException {
- try (InputStream inputStream = configYaml.getInputStream()) {
- Object yaml = new Yaml().load(inputStream);
- if (!(yaml instanceof Map)) {
- throw new IllegalArgumentException("Expected authority map of Principal -> Authority list");
- }
- grantedAuthorityMap = (Map<String, List<String>>) yaml;
- }
- }
- @Override
- public Collection<GrantedAuthority> grantAuthorities(Authentication authentication) {
- List<String> authorities = grantedAuthorityMap.get(authentication.getPrincipal().toString());
- if (authorities == null) {
- return null;
- }
- return authorities.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList());
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProvider.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProvider.java
deleted file mode 100644
index 47d59eb2bf..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProvider.java
+++ /dev/null
@@ -1,41 +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.c2.service;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
-
-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 JacksonJsonProvider {
-
- private static final ObjectMapper objectMapper = new ObjectMapper();
-
- static {
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- }
-
- public C2JsonProvider() {
- super();
- setMapper(objectMapper);
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProviderFeature.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProviderFeature.java
deleted file mode 100644
index ff1579ca16..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2JsonProviderFeature.java
+++ /dev/null
@@ -1,31 +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.c2.service;
-
-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 {
-
- @Override
- public boolean configure(FeatureContext context) {
- context.register(C2JsonProvider.class, MessageBodyReader.class, MessageBodyWriter.class);
- return true;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolContext.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolContext.java
deleted file mode 100644
index e09af8e7b2..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolContext.java
+++ /dev/null
@@ -1,96 +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.c2.service;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URI;
-
-public class C2ProtocolContext {
- private static final Logger logger = LoggerFactory.getLogger(C2ProtocolContext.class);
-
- private static final C2ProtocolContext EMPTY = builder().build();
-
- private final URI baseUri;
- private final Long contentLength;
- private final String sha256;
-
- C2ProtocolContext(final Builder builder) {
- this.baseUri = builder.baseUri;
- this.contentLength = builder.contentLength;
- this.sha256 = builder.sha256;
- }
-
- public URI getBaseUri() {
- return baseUri;
- }
-
- public Long getContentLength() {
- return contentLength;
- }
-
- public String getSha256() {
- return sha256;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static C2ProtocolContext empty() {
- return EMPTY;
- }
-
- public static class Builder {
-
- private URI baseUri;
- private Long contentLength;
- private String sha256;
-
- private Builder() {
- }
-
- public Builder baseUri(final URI baseUri) {
- this.baseUri = baseUri;
- return this;
- }
-
- public Builder contentLength(final Long contentLength) {
- this.contentLength = contentLength;
- return this;
- }
-
- public Builder contentLength(final String contentLength) {
- try {
- this.contentLength = Long.valueOf(contentLength);
- } catch (final NumberFormatException e) {
- logger.debug("Could not parse content length string: " + contentLength, e);
- }
- return this;
- }
-
- public Builder sha256(final String sha256) {
- this.sha256 = sha256;
- return this;
- }
-
- public C2ProtocolContext build() {
- return new C2ProtocolContext(this);
- }
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolService.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolService.java
deleted file mode 100644
index 756c92065a..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/C2ProtocolService.java
+++ /dev/null
@@ -1,27 +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.c2.service;
-
-import org.apache.nifi.c2.protocol.api.C2Heartbeat;
-import org.apache.nifi.c2.protocol.api.C2HeartbeatResponse;
-import org.apache.nifi.c2.protocol.api.C2OperationAck;
-
-public interface C2ProtocolService {
- C2HeartbeatResponse processHeartbeat(C2Heartbeat heartbeat, C2ProtocolContext context);
-
- void processOperationAck(C2OperationAck operationAck, C2ProtocolContext context);
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigService.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigService.java
deleted file mode 100644
index b233e77492..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigService.java
+++ /dev/null
@@ -1,437 +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.c2.service;
-
-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;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-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;
-import org.apache.nifi.minifi.c2.api.ConfigurationProvider;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-import org.apache.nifi.minifi.c2.api.InvalidParameterException;
-import org.apache.nifi.minifi.c2.api.security.authorization.AuthorizationException;
-import org.apache.nifi.minifi.c2.api.security.authorization.Authorizer;
-import org.apache.nifi.minifi.c2.api.util.Pair;
-import org.apache.nifi.minifi.c2.util.HttpRequestUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.core.context.SecurityContextHolder;
-
-@Configuration
-@Path("/config")
-public class ConfigService {
-
- public static final String MESSAGE_400 = "MiNiFi C2 server was unable to complete the request because it was invalid. The request should not be retried without modification.";
-
- private static final Logger logger = LoggerFactory.getLogger(ConfigService.class);
- private final Authorizer authorizer;
- private final ObjectMapper objectMapper;
- private final Supplier<ConfigurationProviderInfo> configurationProviderInfo;
- private final LoadingCache<ConfigurationProviderKey, ConfigurationProviderValue> configurationCache;
- private final C2ProtocolService c2ProtocolService;
-
- @Context
- protected HttpServletRequest httpServletRequest;
-
- @Context
- protected UriInfo uriInfo;
-
- public ConfigService(List<ConfigurationProvider> configurationProviders, Authorizer authorizer) {
- this(configurationProviders, authorizer, 1000, 300_000);
- }
-
- public ConfigService(List<ConfigurationProvider> configurationProviders, Authorizer authorizer, long maximumCacheSize, long cacheTtlMillis) {
- this.objectMapper = new ObjectMapper();
-
- this.authorizer = authorizer;
- if (configurationProviders == null || configurationProviders.size() == 0) {
- throw new IllegalArgumentException("Expected at least one configuration provider");
- }
- this.configurationProviderInfo = Suppliers.memoizeWithExpiration(() -> initContentTypeInfo(configurationProviders), cacheTtlMillis, TimeUnit.MILLISECONDS);
- CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.newBuilder();
- if (maximumCacheSize >= 0) {
- cacheBuilder.maximumSize(maximumCacheSize);
- }
- if (cacheTtlMillis >= 0) {
- cacheBuilder.refreshAfterWrite(cacheTtlMillis, TimeUnit.MILLISECONDS);
- }
- this.configurationCache = cacheBuilder
- .build(new CacheLoader<ConfigurationProviderKey, ConfigurationProviderValue>() {
- @Override
- public ConfigurationProviderValue load(ConfigurationProviderKey key) throws Exception {
- return initConfigurationProviderValue(key);
- }
- });
- this.c2ProtocolService = new SimpleC2ProtocolService();
- }
-
- public ConfigurationProviderValue initConfigurationProviderValue(ConfigurationProviderKey key) {
- if (logger.isDebugEnabled()) {
- logger.debug("Attempting to load and cache configuration with key " + key);
- }
- try {
- List<MediaType> acceptValues = key.getAcceptValues();
- Pair<MediaType, ConfigurationProvider> providerPair = getProvider(acceptValues);
-
- Map<String, List<String>> parameters = key.getParameters();
-
- Integer version = null;
- List<String> versionList = parameters.get("version");
- if (versionList != null && versionList.size() > 0) {
- try {
- version = Integer.parseInt(versionList.get(0));
- } catch (NumberFormatException e) {
- throw new InvalidParameterException("Unable to parse " + version + " as integer.", e);
- }
- }
- return new ConfigurationProviderValue(providerPair.getSecond().getConfiguration(providerPair.getFirst().toString(), version, parameters), providerPair.getFirst(), null);
- } catch (ConfigurationProviderException e) {
- return new ConfigurationProviderValue(null, null, e);
- }
- }
-
- protected ConfigurationProviderInfo initContentTypeInfo(List<ConfigurationProvider> configurationProviders) {
- List<Pair<MediaType, ConfigurationProvider>> mediaTypeList = new ArrayList<>();
- List<String> contentTypes = new ArrayList<>();
- Set<MediaType> seenMediaTypes = new LinkedHashSet<>();
-
- for (ConfigurationProvider configurationProvider : configurationProviders) {
- try {
- for (String contentTypeString : configurationProvider.getContentTypes()) {
- MediaType mediaType = MediaType.valueOf(contentTypeString);
- if (seenMediaTypes.add(mediaType)) {
- contentTypes.add(contentTypeString);
- mediaTypeList.add(new Pair<>(mediaType, configurationProvider));
- }
- }
- } catch (ConfigurationProviderException e) {
- return new ConfigurationProviderInfo(null, null, e);
- }
- }
- return new ConfigurationProviderInfo(mediaTypeList, contentTypes, null);
- }
-
- @POST
- @Path("/heartbeat")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- @Operation(
- description = "An endpoint for a MiNiFi Agent to send a heartbeat to the C2 server"
- )
- @ApiResponses({
- @ApiResponse(
- responseCode = "200",
- description = "Success",
- content = @Content(schema = @Schema(implementation = C2HeartbeatResponse.class))
- ),
- @ApiResponse(
- responseCode = "400",
- description = MESSAGE_400
- )
- })
- public Response heartbeat(
- @Context HttpServletRequest request, @Context HttpHeaders httpHeaders, @Context UriInfo uriInfo,
- @Parameter(required = true) final C2Heartbeat heartbeat) {
-
- try {
- authorizer.authorize(SecurityContextHolder.getContext().getAuthentication(), uriInfo);
- } catch (AuthorizationException e) {
- logger.warn(HttpRequestUtil.getClientString(request) + " not authorized to access " + uriInfo, e);
- return Response.status(403).build();
- }
-
- List<MediaType> acceptValues = httpHeaders.getAcceptableMediaTypes();
- boolean defaultAccept = false;
- if (acceptValues.size() == 0) {
- acceptValues = Collections.singletonList(MediaType.WILDCARD_TYPE);
- defaultAccept = true;
- }
- if (logger.isDebugEnabled()) {
- StringBuilder builder = new StringBuilder("Handling request from ")
- .append(HttpRequestUtil.getClientString(request))
- .append(" with Accept");
- if (defaultAccept) {
- builder.append(" default value");
- }
- builder.append(": ")
- .append(acceptValues.stream().map(Object::toString).collect(Collectors.joining(", ")));
- logger.debug(builder.toString());
- }
-
- try {
- final String flowId;
- Response response;
- final String agentClass = heartbeat.getAgentClass();
- if (agentClass == null || agentClass.equals("")) {
- logger.warn("No agent class provided, returning OK (200)");
- response = Response.ok().build();
- return response;
- } else {
- Map<String, List<String>> parameters = Collections.singletonMap("class", Collections.singletonList(agentClass));
- ConfigurationProviderValue configurationProviderValue = configurationCache.get(new ConfigurationProviderKey(acceptValues, parameters));
- org.apache.nifi.minifi.c2.api.Configuration configuration;
- try {
- configuration = configurationProviderValue.getConfiguration();
- } catch (ConfigurationProviderException cpe) {
- logger.warn("No flow available for agent class " + agentClass + ", returning OK (200) with no update request");
- response = Response.ok(new C2HeartbeatResponse()).build();
- return response;
- }
- try (InputStream inputStream = configuration.getInputStream();
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
- MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
- byte[] buffer = new byte[1024];
- int read;
- while ((read = inputStream.read(buffer)) >= 0) {
- outputStream.write(buffer, 0, read);
- sha256.update(buffer, 0, read);
- }
- flowId = bytesToHex(sha256.digest());
-
- } catch (ConfigurationProviderException | IOException | NoSuchAlgorithmException e) {
- logger.error("Error reading or checksumming configuration file", e);
- throw new WebApplicationException(500);
- }
- final C2ProtocolContext heartbeatContext = C2ProtocolContext.builder()
- .baseUri(uriInfo.getBaseUriBuilder().path("/config").queryParam("class", agentClass).build())
- .contentLength(httpServletRequest.getHeader(CONTENT_LENGTH))
- .sha256(flowId)
- .build();
-
- try {
- final C2HeartbeatResponse heartbeatResponse = c2ProtocolService.processHeartbeat(heartbeat, heartbeatContext);
- response = Response.ok(heartbeatResponse).build();
- } catch (Exception e) {
- logger.error("Heartbeat processing failed", e);
- response = Response.status(BAD_REQUEST).entity(e.getMessage()).build();
- }
- }
- return response;
- } catch (ExecutionException | UncheckedExecutionException e) {
- Throwable cause = e.getCause();
- if (cause instanceof WebApplicationException) {
- throw (WebApplicationException) cause;
- }
- logger.error(HttpRequestUtil.getClientString(request) + " made request with " + HttpRequestUtil.getQueryString(request) + " that caused error.", cause);
- return Response.status(500).entity("Internal error").build();
- }
- }
-
- @POST
- @Path("/acknowledge")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- @Operation(
- description = "An endpoint for a MiNiFi Agent to send an operation acknowledgement to the C2 server"
- )
- @ApiResponses({
- @ApiResponse(
- responseCode = "400",
- description = MESSAGE_400
- )
- })
- public Response acknowledge(
- @Parameter(required = true) final C2OperationAck operationAck) {
-
- final C2ProtocolContext ackContext = C2ProtocolContext.builder()
- .baseUri(getBaseUri())
- .contentLength(httpServletRequest.getHeader(CONTENT_LENGTH))
- .build();
-
- c2ProtocolService.processOperationAck(operationAck, ackContext);
-
- return Response.ok().build();
-
- }
-
- @GET
- @Path("/contentTypes")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getContentTypes(@Context HttpServletRequest request, @Context UriInfo uriInfo) {
- try {
- authorizer.authorize(SecurityContextHolder.getContext().getAuthentication(), uriInfo);
- } catch (AuthorizationException e) {
- logger.warn(HttpRequestUtil.getClientString(request) + " not authorized to access " + uriInfo, e);
- return Response.status(403).build();
- }
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- List<String> contentTypes;
- try {
- contentTypes = configurationProviderInfo.get().getContentTypes();
- } catch (ConfigurationProviderException e) {
- logger.warn("Unable to initialize content type information.", e);
- return Response.status(500).build();
- }
- try {
- objectMapper.writerWithDefaultPrettyPrinter().writeValue(byteArrayOutputStream, contentTypes);
- } catch (IOException e) {
- logger.warn("Unable to write configuration providers to output stream.", e);
- return Response.status(500).build();
- }
- return Response.ok().type(MediaType.APPLICATION_JSON_TYPE).entity(byteArrayOutputStream.toByteArray()).build();
- }
-
- @GET
- public Response getConfig(@Context HttpServletRequest request, @Context HttpHeaders httpHeaders, @Context UriInfo uriInfo) {
- try {
- authorizer.authorize(SecurityContextHolder.getContext().getAuthentication(), uriInfo);
- } catch (AuthorizationException e) {
- logger.warn(HttpRequestUtil.getClientString(request) + " not authorized to access " + uriInfo, e);
- return Response.status(403).build();
- }
- Map<String, List<String>> parameters = new HashMap<>(uriInfo.getQueryParameters());
- List<MediaType> acceptValues = httpHeaders.getAcceptableMediaTypes();
- boolean defaultAccept = false;
- if (acceptValues.size() == 0) {
- acceptValues = Collections.singletonList(MediaType.WILDCARD_TYPE);
- defaultAccept = true;
- }
- if (logger.isDebugEnabled()) {
- StringBuilder builder = new StringBuilder("Handling request from ")
- .append(HttpRequestUtil.getClientString(request))
- .append(" with parameters ")
- .append(parameters)
- .append(" and Accept");
- if (defaultAccept) {
- builder.append(" default value");
- }
- builder.append(": ")
- .append(acceptValues.stream().map(Object::toString).collect(Collectors.joining(", ")));
- logger.debug(builder.toString());
- }
-
- try {
- ConfigurationProviderValue configurationProviderValue = configurationCache.get(new ConfigurationProviderKey(acceptValues, parameters));
- org.apache.nifi.minifi.c2.api.Configuration configuration = configurationProviderValue.getConfiguration();
- Response.ResponseBuilder ok = Response.ok();
- ok = ok.header("X-Content-Version", configuration.getVersion());
- ok = ok.type(configurationProviderValue.getMediaType());
- byte[] buffer = new byte[1024];
- int read;
- try (InputStream inputStream = configuration.getInputStream();
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
- MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
- while ((read = inputStream.read(buffer)) >= 0) {
- outputStream.write(buffer, 0, read);
- sha256.update(buffer, 0, read);
- }
- ok = ok.header("X-Content-SHA-256", bytesToHex(sha256.digest()));
- ok = ok.entity(outputStream.toByteArray());
- } catch (ConfigurationProviderException | IOException | NoSuchAlgorithmException e) {
- logger.error("Error reading or checksumming configuration file", e);
- throw new WebApplicationException(500);
- }
- return ok.build();
- } catch (AuthorizationException e) {
- logger.warn(HttpRequestUtil.getClientString(request) + " not authorized to access " + uriInfo, e);
- return Response.status(403).build();
- } catch (InvalidParameterException e) {
- logger.info(HttpRequestUtil.getClientString(request) + " made invalid request with " + HttpRequestUtil.getQueryString(request), e);
- return Response.status(400).entity("Invalid request.").build();
- } catch (ConfigurationProviderException e) {
- logger.warn("Unable to get configuration.", e);
- return Response.status(500).build();
- } catch (ExecutionException | UncheckedExecutionException e) {
- Throwable cause = e.getCause();
- if (cause instanceof WebApplicationException) {
- throw (WebApplicationException) cause;
- }
- logger.error(HttpRequestUtil.getClientString(request) + " made request with " + HttpRequestUtil.getQueryString(request) + " that caused error.", cause);
- return Response.status(500).entity("Internal error").build();
- }
- }
-
- // see: https://stackoverflow.com/questions/15429257/how-to-convert-byte-array-to-hexstring-in-java#answer-15429408
- protected static String bytesToHex(byte[] in) {
- final StringBuilder builder = new StringBuilder();
- for (byte b : in) {
- builder.append(String.format("%02x", b));
- }
- return builder.toString();
- }
-
- private Pair<MediaType, ConfigurationProvider> getProvider(List<MediaType> acceptValues) throws ConfigurationProviderException {
- List<Pair<MediaType, ConfigurationProvider>> mediaTypeList;
- try {
- mediaTypeList = this.configurationProviderInfo.get().getMediaTypeList();
- } catch (ConfigurationProviderException.Wrapper e) {
- throw e.unwrap();
- }
- for (MediaType accept : acceptValues) {
- for (Pair<MediaType, ConfigurationProvider> pair : mediaTypeList) {
- MediaType mediaType = pair.getFirst();
- if (accept.isCompatible(mediaType)) {
- return new Pair<>(mediaType, pair.getSecond());
- }
- }
- }
-
- throw new WebApplicationException(Response.status(406).entity("Unable to find configuration provider for " +
- "\"Accept: " + acceptValues.stream().map(Object::toString).collect(Collectors.joining(", ")) + "\" supported media types are " +
- mediaTypeList.stream().map(Pair::getFirst).map(Object::toString).collect(Collectors.joining(", "))).build());
- }
-
- private URI getBaseUri() {
- // Forwarded Headers are expected to have been applied as part of servlet filter chain
- return uriInfo.getBaseUri();
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderInfo.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderInfo.java
deleted file mode 100644
index 966be41e31..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderInfo.java
+++ /dev/null
@@ -1,51 +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.c2.service;
-
-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 jakarta.ws.rs.core.MediaType;
-import java.util.List;
-
-public class ConfigurationProviderInfo {
- private final List<Pair<MediaType, ConfigurationProvider>> mediaTypeList;
- private final List<String> contentTypes;
- private final ConfigurationProviderException configurationProviderException;
-
- public ConfigurationProviderInfo(List<Pair<MediaType, ConfigurationProvider>> mediaTypeList, List<String> contentTypes, ConfigurationProviderException configurationProviderException) {
- this.mediaTypeList = mediaTypeList;
- this.contentTypes = contentTypes;
- this.configurationProviderException = configurationProviderException;
- }
-
- public List<Pair<MediaType, ConfigurationProvider>> getMediaTypeList() throws ConfigurationProviderException {
- if (configurationProviderException != null) {
- throw configurationProviderException;
- }
- return mediaTypeList;
- }
-
- public List<String> getContentTypes() throws ConfigurationProviderException {
- if (configurationProviderException != null) {
- throw configurationProviderException;
- }
- return contentTypes;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderKey.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderKey.java
deleted file mode 100644
index 57ad63213f..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderKey.java
+++ /dev/null
@@ -1,69 +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.c2.service;
-
-import jakarta.ws.rs.core.MediaType;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class ConfigurationProviderKey {
- private final List<MediaType> acceptValues;
- private final Map<String, List<String>> parameters;
-
- public ConfigurationProviderKey(List<MediaType> acceptValues, Map<String, List<String>> parameters) {
- this.acceptValues = Collections.unmodifiableList(new ArrayList<>(acceptValues));
- this.parameters = Collections.unmodifiableMap(parameters.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> Collections.unmodifiableList(new ArrayList<>(e.getValue())))));
- }
-
- public List<MediaType> getAcceptValues() {
- return acceptValues;
- }
-
- public Map<String, List<String>> getParameters() {
- return parameters;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ConfigurationProviderKey that = (ConfigurationProviderKey) o;
-
- if (!acceptValues.equals(that.acceptValues)) return false;
- return parameters.equals(that.parameters);
- }
-
- @Override
- public String toString() {
- return "ConfigurationProviderKey{" +
- "acceptValues=" + acceptValues +
- ", parameters=" + parameters +
- '}';
- }
-
- @Override
- public int hashCode() {
- int result = acceptValues.hashCode();
- result = 31 * result + parameters.hashCode();
- return result;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderValue.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderValue.java
deleted file mode 100644
index 90923805d0..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/ConfigurationProviderValue.java
+++ /dev/null
@@ -1,49 +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.c2.service;
-
-import org.apache.nifi.minifi.c2.api.Configuration;
-import org.apache.nifi.minifi.c2.api.ConfigurationProviderException;
-
-import jakarta.ws.rs.core.MediaType;
-
-public class ConfigurationProviderValue {
- private final Configuration configuration;
- private final MediaType mediaType;
- private final ConfigurationProviderException configurationProviderException;
-
- public ConfigurationProviderValue(Configuration configuration, MediaType mediaType, ConfigurationProviderException configurationProviderException) {
- this.configuration = configuration;
- this.mediaType = mediaType;
- this.configurationProviderException = configurationProviderException;
- }
-
- public Configuration getConfiguration() throws ConfigurationProviderException {
- if (configurationProviderException != null) {
- throw configurationProviderException;
- }
- return configuration;
- }
-
- public MediaType getMediaType() throws ConfigurationProviderException {
- if (configurationProviderException != null) {
- throw configurationProviderException;
- }
- return mediaType;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/SimpleC2ProtocolService.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/SimpleC2ProtocolService.java
deleted file mode 100644
index 132fc8df3d..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/service/SimpleC2ProtocolService.java
+++ /dev/null
@@ -1,132 +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.c2.service;
-
-import org.apache.nifi.c2.protocol.api.C2Heartbeat;
-import org.apache.nifi.c2.protocol.api.C2HeartbeatResponse;
-import org.apache.nifi.c2.protocol.api.C2Operation;
-import org.apache.nifi.c2.protocol.api.C2OperationAck;
-import org.apache.nifi.c2.protocol.api.C2OperationState;
-import org.apache.nifi.c2.protocol.api.OperandType;
-import org.apache.nifi.c2.protocol.api.OperationState;
-import org.apache.nifi.c2.protocol.api.OperationType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-@Service
-public class SimpleC2ProtocolService implements C2ProtocolService {
-
- private static final Logger logger = LoggerFactory.getLogger(SimpleC2ProtocolService.class);
-
- private static final Set<String> issuedOperationIds = new HashSet<>();
- private static final String LOCATION = "location";
- private static final String FLOW_ID = "flowId";
-
- private final Map<String, String> currentFlowIds;
-
- public SimpleC2ProtocolService() {
- currentFlowIds = new HashMap<>(1000);
- }
-
- @Override
- public void processOperationAck(final C2OperationAck operationAck, final C2ProtocolContext context) {
- // This service assumes there is a single Operation UPDATE to pass over the updated flow
- logger.debug("Received operation acknowledgement: {}; {}", operationAck, context);
- // Remove the operator ID from the list of issued operations and log the state
- final String operationId = operationAck.getOperationId();
- try {
- OperationState opState = OperationState.DONE;
- String details = null;
-
- /* Partial applications are rare and only happen when an operation consists of updating multiple config
- * items and some succeed ( we don't yet have the concept of rollback in agents ).
- * Fully Applied yields an operation success.
- * Operation Not Understood and Not Applied give little details but also will result in Operation Failure.
- * We should explore if providing textual details. */
- final C2OperationState c2OperationState = operationAck.getOperationState();
- if (null != c2OperationState) {
- details = c2OperationState.getDetails();
- if (c2OperationState.getState() != C2OperationState.OperationState.FULLY_APPLIED) {
- opState = OperationState.FAILED;
- }
- }
-
- if (!issuedOperationIds.remove(operationId)) {
- logger.warn("Operation with ID " + operationId + " has either already been acknowledged or is unknown to this server");
- } else if (null != c2OperationState) {
- final C2OperationState.OperationState operationState = c2OperationState.getState();
- logger.debug("Operation with ID " + operationId + " acknowledged with a state of " + operationState.name() + "(" + opState.name() + "), details = "
- + (details == null ? "" : details));
- }
-
- // Optionally, an acknowledgement can include some of the info normally passed in a heartbeat.
- // If this info is present, process it as a heartbeat, so we update our latest known state of the agent.
- if (operationAck.getAgentInfo() != null
- || operationAck.getDeviceInfo() != null
- || operationAck.getFlowInfo() != null) {
- final C2Heartbeat heartbeatInfo = toHeartbeat(operationAck);
- logger.trace("Operation acknowledgement contains additional info. Processing as heartbeat: {}", heartbeatInfo);
- processHeartbeat(heartbeatInfo, context);
- }
-
- } catch (final Exception e) {
- logger.warn("Encountered exception while processing operation ack", e);
- }
- }
-
- @Override
- public C2HeartbeatResponse processHeartbeat(final C2Heartbeat heartbeat, final C2ProtocolContext context) {
-
- C2HeartbeatResponse c2HeartbeatResponse = new C2HeartbeatResponse();
- String currentFlowId = currentFlowIds.get(heartbeat.getAgentId());
- if (currentFlowId == null || !currentFlowId.equals(context.getSha256())) {
- // Create a single UPDATE operation to fetch the flow from the specified URL
- C2Operation c2Operation = new C2Operation();
- final String operationID = UUID.randomUUID().toString();
- issuedOperationIds.add(operationID);
- c2Operation.setIdentifier(operationID);
- c2Operation.setOperation(OperationType.UPDATE);
- c2Operation.setOperand(OperandType.CONFIGURATION);
- Map<String, String> args = new HashMap<>();
- args.put(LOCATION, context.getBaseUri().toString());
- args.put(FLOW_ID, context.getSha256());
- c2Operation.setArgs(args);
- List<C2Operation> requestedOperations = Collections.singletonList(c2Operation);
- c2HeartbeatResponse.setRequestedOperations(requestedOperations);
- currentFlowIds.put(heartbeat.getAgentId(), context.getSha256());
- }
-
- return c2HeartbeatResponse;
- }
-
- private static C2Heartbeat toHeartbeat(final C2OperationAck ack) {
- final C2Heartbeat heartbeat = new C2Heartbeat();
- heartbeat.setDeviceInfo(ack.getDeviceInfo());
- heartbeat.setAgentInfo(ack.getAgentInfo());
- heartbeat.setFlowInfo(ack.getFlowInfo());
- return heartbeat;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/util/HttpRequestUtil.java b/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/util/HttpRequestUtil.java
deleted file mode 100644
index 8ee9b972a1..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/java/org/apache/nifi/minifi/c2/util/HttpRequestUtil.java
+++ /dev/null
@@ -1,41 +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.c2.util;
-
-import jakarta.servlet.ServletRequest;
-import jakarta.servlet.http.HttpServletRequest;
-
-public class HttpRequestUtil {
- public static String getQueryString(HttpServletRequest request) {
- String queryString = request.getQueryString();
- if (queryString == null) {
- return "no query string";
- }
- return "query string \"" + queryString + "\"";
- }
-
- public static String getClientString(ServletRequest request) {
- String remoteHost = request.getRemoteHost();
- String remoteAddr = request.getRemoteAddr();
- String result = "Client " + remoteHost;
- if (!remoteAddr.equals(remoteHost)) {
- result = result + " (" + remoteAddr + ")";
- }
- return result;
- }
-}
diff --git a/minifi/minifi-c2/minifi-c2-service/src/main/webapp/WEB-INF/web.xml b/minifi/minifi-c2/minifi-c2-service/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 693bbc1ceb..0000000000
--- a/minifi/minifi-c2/minifi-c2-service/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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="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>
- <param-name>contextClass</param-name>
- <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
- </context-param>
-
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>org.apache.nifi.minifi.c2.configuration.Configuration</param-value>
- </context-param>
-
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
-
- <servlet>
- <servlet-name>jerseySpring</servlet-name>
- <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
- <init-param>
- <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>
- </servlet>
- <servlet-mapping>
- <servlet-name>jerseySpring</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
- <filter>
- <filter-name>springSecurityFilterChain</filter-name>
- <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>springSecurityFilterChain</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-</web-app>
diff --git a/minifi/minifi-c2/pom.xml b/minifi/minifi-c2/pom.xml
deleted file mode 100644
index e02fdcf9b3..0000000000
--- a/minifi/minifi-c2/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>minifi</artifactId>
- <groupId>org.apache.nifi.minifi</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>minifi-c2</artifactId>
- <packaging>pom</packaging>
-
- <modules>
- <module>minifi-c2-api</module>
- <module>minifi-c2-cache</module>
- <module>minifi-c2-provider</module>
- <module>minifi-c2-service</module>
- <module>minifi-c2-jetty</module>
- <module>minifi-c2-assembly</module>
- <module>minifi-c2-docker</module>
- <module>minifi-c2-integration-tests</module>
- </modules>
-</project>
diff --git a/minifi/minifi-docs/src/main/markdown/minifi-java-agent-quick-start.md b/minifi/minifi-docs/src/main/markdown/minifi-java-agent-quick-start.md
index 8d8c907529..fcf6afdf94 100644
--- a/minifi/minifi-docs/src/main/markdown/minifi-java-agent-quick-start.md
+++ b/minifi/minifi-docs/src/main/markdown/minifi-java-agent-quick-start.md
@@ -104,7 +104,7 @@ You can use the MiNiFi Toolkit, located in your MiNiFi installation directory, a
**Result:** Once you have your _flow.json.raw_ file in the `minifi/conf` directory, launch that instance of MiNiFi and your dataflow begins automatically.
### Utilizing a C2 Server via the c2 protocol
-If you have a [C2 server](../../../../minifi-c2/README.md) running, you can expose the whole _flow.json_ for the agent to download. As the agent is heartbeating via the C2 protocol, changes in flow version will trigger automatic config updates.
+If you have a C2 server running, you can expose the whole _flow.json_ for the agent to download. As the agent is heartbeating via the C2 protocol, changes in flow version will trigger automatic config updates.
1. Launch C2 server
2. Configure MiNiFi for C2 capability
diff --git a/minifi/minifi-integration-tests/README.md b/minifi/minifi-integration-tests/README.md
index 40fefb8d20..f356183562 100644
--- a/minifi/minifi-integration-tests/README.md
+++ b/minifi/minifi-integration-tests/README.md
@@ -12,7 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-# Apache NiFi MiNiFi Command and Control (C2) Server
+# Apache NiFi MiNiFi Integration Tests
## How to execute minifi-integration-tests
diff --git a/minifi/minifi-integration-tests/pom.xml b/minifi/minifi-integration-tests/pom.xml
index b13268e24c..6ce288590d 100644
--- a/minifi/minifi-integration-tests/pom.xml
+++ b/minifi/minifi-integration-tests/pom.xml
@@ -27,7 +27,6 @@ limitations under the License.
<properties>
<minifi.version>${project.version}</minifi.version>
- <minifi.c2.version>${project.version}</minifi.c2.version>
</properties>
<dependencies>
@@ -43,13 +42,6 @@ limitations under the License.
<version>2.0.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.nifi.minifi</groupId>
- <artifactId>minifi-c2-integration-tests</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.nifi.minifi</groupId>
<artifactId>minifi-toolkit-configuration</artifactId>
diff --git a/minifi/minifi-integration-tests/src/test/resources/Dockerfile.minific2.test b/minifi/minifi-integration-tests/src/test/resources/Dockerfile.minific2.test
deleted file mode 100644
index d0f37853d2..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/Dockerfile.minific2.test
+++ /dev/null
@@ -1,24 +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.
-
-FROM apache/nifi-minifi-c2:${minifi.version}-maven
-
-USER root
-
-RUN apt-get update && apt-get install -y python3
-
-USER c2
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorities.yaml b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorities.yaml
deleted file mode 100644
index 426f1b81e7..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorities.yaml
+++ /dev/null
@@ -1,21 +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.
-
-CN=minifi-edge1, OU=NIFI:
- - EDGE_1
-CN=c2-edge2, OU=NIFI:
- - EDGE_2
-CN=minifi-edge3, OU=NIFI:
- - EDGE_3
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorizations.yaml b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorizations.yaml
deleted file mode 100644
index 24097b8b15..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/authorizations.yaml
+++ /dev/null
@@ -1,41 +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.
-
-Default Action: deny
-Paths:
- /c2/config:
- Default Action: deny
- Actions:
- - Authorization: EDGE_1
- Query Parameters:
- net: edge1
- class: raspi3
- Action: allow
- - Authorization: EDGE_2
- Query Parameters:
- net: edge2
- class: raspi2
- Action: allow
- - Authorization: EDGE_3
- Query Parameters:
- net: edge3
- class: raspi3
- Action: allow
-
- /c2/config/contentTypes:
- Default Action: deny
- Actions:
- - Authorization: EDGE_2
- Action: allow
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/c2.properties b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/c2.properties
deleted file mode 100644
index d1b01ee7bf..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/c2.properties
+++ /dev/null
@@ -1,27 +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.
-#
-
-minifi.c2.server.port=10443
-
-minifi.c2.server.secure=true
-minifi.c2.server.keystore=./conf/keystore.jks
-minifi.c2.server.keystoreType=JKS
-minifi.c2.server.keystorePasswd=badKeystorePass
-minifi.c2.server.keyPasswd=badKeystorePass
-minifi.c2.server.truststore=./conf/truststore.jks
-minifi.c2.server.truststoreType=JKS
-minifi.c2.server.truststorePasswd=badTrustPass
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/minifi-c2-context.xml b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/minifi-c2-context.xml
deleted file mode 100644
index 13604ea0a2..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/conf/minifi-c2-context.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<beans default-lazy-init="true"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.1.xsd
- http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
-
- <bean id="configService" class="org.apache.nifi.minifi.c2.service.ConfigService" scope="singleton">
- <constructor-arg>
- <list>
- <bean class="org.apache.nifi.minifi.c2.provider.cache.CacheConfigurationProvider">
- <constructor-arg>
- <list>
- <value>application/json</value>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache">
- <constructor-arg>
- <value>./files</value>
- </constructor-arg>
- <constructor-arg>
- <value>${net}/${class}/config</value>
- </constructor-arg>
- </bean>
- </constructor-arg>
- </bean>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.GrantedAuthorityAuthorizer">
- <constructor-arg value="classpath:authorizations.yaml"/>
- </bean>
- </constructor-arg>
- <constructor-arg>
- <value>1000</value>
- </constructor-arg>
- <constructor-arg>
- <value>1000</value>
- </constructor-arg>
- </bean>
-</beans>
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge1/raspi3/config.application.json.v1 b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge1/raspi3/config.application.json.v1
deleted file mode 100644
index 96c88be5bb..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge1/raspi3/config.application.json.v1
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "Edge 1 raspi3.v1",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge2/raspi2/config.application.json.v1 b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge2/raspi2/config.application.json.v1
deleted file mode 100644
index 1ed0dc380c..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge2/raspi2/config.application.json.v1
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "Edge 2 raspi2.v1",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge3/raspi3/config.application.json.v1 b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge3/raspi3/config.application.json.v1
deleted file mode 100644
index 6a97b5aa48..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-authoritative/files/edge3/raspi3/config.application.json.v1
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "encodingVersion": {
- "majorVersion": 2,
- "minorVersion": 0
- },
- "maxTimerDrivenThreadCount": 10,
- "registries": [],
- "parameterContexts": [],
- "parameterProviders": [],
- "controllerServices": [],
- "reportingTasks": [],
- "templates": [],
- "rootGroup": {
- "identifier": "c1b4e586-2011-3f81-a11e-8d669f084d1c",
- "instanceIdentifier": "29db3dbc-0188-1000-7025-4cab8b52d278",
- "name": "Edge 3 raspi3.v1",
- "comments": "",
- "position": {
- "x": 0.0,
- "y": 0.0
- },
- "processGroups": [],
- "remoteProcessGroups": [],
- "processors": [],
- "inputPorts": [],
- "outputPorts": [],
- "connections": [],
- "labels": [],
- "funnels": [],
- "controllerServices": [],
- "variables": {},
- "defaultFlowFileExpiration": "0 sec",
- "defaultBackPressureObjectThreshold": 10000,
- "defaultBackPressureDataSizeThreshold": "1 GB",
- "componentType": "PROCESS_GROUP",
- "flowFileConcurrency": "UNBOUNDED",
- "flowFileOutboundPolicy": "STREAM_WHEN_AVAILABLE"
- }
-}
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/c2.properties b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/c2.properties
deleted file mode 100644
index 1e073b7ce4..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/c2.properties
+++ /dev/null
@@ -1,27 +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.
-#
-
-minifi.c2.server.port=10090
-
-minifi.c2.server.secure=false
-minifi.c2.server.keystore=./conf/keystore.jks
-minifi.c2.server.keystoreType=JKS
-minifi.c2.server.keystorePasswd=badKeystorePass
-minifi.c2.server.keyPasswd=badKeystorePass
-minifi.c2.server.truststore=./conf/truststore.jks
-minifi.c2.server.truststoreType=JKS
-minifi.c2.server.truststorePasswd=badTrustPass
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/minifi-c2-context.xml b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/minifi-c2-context.xml
deleted file mode 100644
index 5dd27d916d..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/c2-edge2/conf/minifi-c2-context.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ 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.
- -->
-<beans default-lazy-init="true"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.1.xsd
- http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
-
- <bean id="configService" class="org.apache.nifi.minifi.c2.service.ConfigService" scope="singleton">
- <constructor-arg>
- <list>
- <bean class="org.apache.nifi.minifi.c2.provider.delegating.DelegatingConfigurationProvider">
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.cache.filesystem.FileSystemConfigurationCache">
- <constructor-arg>
- <value>./cache</value>
- </constructor-arg>
- <constructor-arg>
- <value>${class}/${class}</value>
- </constructor-arg>
- </bean>
- </constructor-arg>
- <constructor-arg>
- <value>https://c2-authoritative:10443</value>
- </constructor-arg>
- </bean>
- </list>
- </constructor-arg>
- <constructor-arg>
- <bean class="org.apache.nifi.minifi.c2.security.authorization.GrantedAuthorityAuthorizer">
- <constructor-arg value="classpath:authorizations.yaml"/>
- </bean>
- </constructor-arg>
- <constructor-arg>
- <value>1000</value>
- </constructor-arg>
- <constructor-arg>
- <value>1000</value>
- </constructor-arg>
- </bean>
-</beans>
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/bootstrap.conf b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/bootstrap.conf
deleted file mode 100644
index 81d7bd59bc..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/bootstrap.conf
+++ /dev/null
@@ -1,211 +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.
-#
-
-# Java command to use when running MiNiFi
-java=java
-
-# Username to use when running MiNiFi. This value will be ignored on Windows.
-run.as=
-
-# Configure where MiNiFi's lib and conf directories live
-# When running as a Windows service set full paths instead of relative paths
-lib.dir=./lib
-conf.dir=./conf
-
-# How long to wait after telling MiNiFi to shutdown before explicitly killing the Process
-graceful.shutdown.seconds=20
-
-# Disable JSR 199 so that we can use JSP's without running a JDK
-java.arg.1=-Dorg.apache.jasper.compiler.disablejsr199=true
-
-# JVM memory settings
-java.arg.2=-Xms256m
-java.arg.3=-Xmx256m
-
-# allowRestrictedHeaders is required for Cluster/Node communications to work properly
-java.arg.5=-Dsun.net.http.allowRestrictedHeaders=true
-java.arg.6=-Djava.protocol.handler.pkgs=sun.net.www.protocol
-
-# Sets the provider of SecureRandom to /dev/urandom to prevent blocking on VMs
-java.arg.7=-Djava.security.egd=file:/dev/urandom
-
-# Garbage Collector Algorithm
-java.arg.13=-XX:+UseG1GC
-
-#Set headless mode by default
-java.arg.14=-Djava.awt.headless=true
-
-# Enable Remote Debugging
-#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
-
-
-### MiNiFi Flow Config File
-nifi.minifi.flow.config=./conf/flow.json.gz
-
-
-### MiNiFi Security Properties
-nifi.minifi.security.keystore=
-nifi.minifi.security.keystoreType=
-nifi.minifi.security.keystorePasswd=
-nifi.minifi.security.keyPasswd=
-nifi.minifi.security.truststore=
-nifi.minifi.security.truststoreType=
-nifi.minifi.security.truststorePasswd=
-nifi.minifi.security.ssl.protocol=
-
-# Ignore all processor SSL controller services and use parent minifi SSL instead
-nifi.minifi.flow.use.parent.ssl=false
-
-
-### MiNiFi Sensitive Properties Settings
-nifi.minifi.sensitive.props.key=
-nifi.minifi.sensitive.props.algorithm=
-
-
-### MiNiFi Command & Control (C2) Configuration
-# Enabling C2 Uncomment each of the following options
-#c2.enable=true
-## heartbeat in milliseconds
-#c2.agent.heartbeat.period=5000
-## define parameters about your agent
-#c2.agent.class=
-# Optional. Defaults to a hardware based unique identifier
-#c2.agent.identifier=
-# If set to false heartbeat won't contain the manifest. Defaults to true.
-#c2.full.heartbeat=false
-## define protocol parameters
-# DEPRECATED: c2.rest.url and c2.rest.url.ack are deprecated in favor of c2.rest.path.* properties and are target to be removed in future release
-# The absolute url of the C2 server's heartbeat endpoint, eg.: http://localhost/c2-server/api/heartbeat
-#c2.rest.url=
-# The absolute url of the C2 server's acknowledge endpoint, eg.: http://localhost/c2-server/api/acknowledge
-#c2.rest.url.ack=
-# C2 Rest Path Properties
-# The base path of the C2 server's REST API, eg.: http://localhost/c2-server/api
-#c2.rest.path.base=
-# Relative url of the C2 server's heartbeat endpoint, eg.: /heartbeat
-#c2.rest.path.heartbeat=
-# Relative url of the C2 server's acknowledge endpoint, eg.: /acknowledge
-#c2.rest.path.acknowledge=
-## c2 timeouts
-#c2.rest.connectionTimeout=5 sec
-#c2.rest.readTimeout=5 sec
-#c2.rest.callTimeout=10 sec
-#c2.config.directory=./conf
-#c2.runtime.manifest.identifier=minifi
-#c2.runtime.type=minifi-java
-# Directory for storing assets downloaded via C2 update/asset command
-#c2.asset.directory=./asset
-## Define TLS security properties for C2 communications
-#c2.security.truststore.location=
-#c2.security.truststore.password=
-#c2.security.truststore.type=JKS
-#c2.security.keystore.location=
-#c2.security.keystore.password=
-#c2.security.keystore.type=JKS
-#c2.request.compression=none
-c2.rest.http.headers=Accept:application/json
-
-
-### MiNiFi Notifiers For Flow Updates
-# If C2 is enabled these should be disabled
-# Notifiers to use for the associated agent, comma separated list of class names, choose from the options below
-nifi.minifi.notifier.ingestors=org.apache.nifi.minifi.bootstrap.configuration.ingestors.PullHttpChangeIngestor
-
-# File change notifier configuration - org.apache.nifi.minifi.bootstrap.configuration.ingestors.FileChangeIngestor
-# Path of the file to monitor for changes. When these occur, the FileChangeNotifier, if configured, will begin the configuration reloading process
-#nifi.minifi.notifier.ingestors.file.config.path=
-# How frequently the file specified by 'nifi.minifi.notifier.file.config.path' should be evaluated for changes.
-#nifi.minifi.notifier.ingestors.file.polling.period.seconds=5
-
-# Rest change notifier configuration - org.apache.nifi.minifi.bootstrap.configuration.ingestors.RestChangeIngestor
-# Port on which the Jetty server will bind to, keep commented for a random open port
-#nifi.minifi.notifier.ingestors.receive.http.port=8338
-
-#Pull HTTP change notifier configuration - org.apache.nifi.minifi.bootstrap.configuration.ingestors.PullHttpChangeIngestor
-# Hostname on which to pull configurations from
-nifi.minifi.notifier.ingestors.pull.http.hostname=c2-authoritative
-# Port on which to pull configurations from
-nifi.minifi.notifier.ingestors.pull.http.port=10443
-# Path to pull configurations from
-nifi.minifi.notifier.ingestors.pull.http.path=/c2/config
-# Query string to pull configurations with
-nifi.minifi.notifier.ingestors.pull.http.query=net=edge1&class=raspi3
-# Period on which to pull configurations from, defaults to 5 minutes if commented out
-nifi.minifi.notifier.ingestors.pull.http.period.ms=3000
-# Comma separated list of HTTP headers, eg: Accept:application/json,Accept:application/yaml
-nifi.minifi.notifier.ingestors.pull.http.headers=Accept:application/json
-# Pull Ingestor Security Properties
-nifi.minifi.notifier.ingestors.pull.http.keystore.location=./conf/keystore.jks
-nifi.minifi.notifier.ingestors.pull.http.keystore.type=JKS
-nifi.minifi.notifier.ingestors.pull.http.keystore.password=badKeystorePass
-nifi.minifi.notifier.ingestors.pull.http.truststore.location=./conf/truststore.jks
-nifi.minifi.notifier.ingestors.pull.http.truststore.type=JKS
-nifi.minifi.notifier.ingestors.pull.http.truststore.password=badTrustPass
-
-
-### MiNiFi Status Reporter
-# Periodic Status Reporters to use for the associated agent, comma separated list of class names
-#nifi.minifi.status.reporter.components=org.apache.nifi.minifi.bootstrap.status.reporters.StatusLogger
-# Periodic Status Logger configuration
-# The FlowStatus query to submit to the MiNiFi instance
-#nifi.minifi.status.reporter.log.query=instance:health,bulletins
-# The log level at which the status will be logged
-#nifi.minifi.status.reporter.log.level=INFO
-# The period (in milliseconds) at which to log the status
-#nifi.minifi.status.reporter.log.period=60000
-
-
-### MiNiFi Provenance Reporting Properties
-#nifi.minifi.provenance.reporting.comment=
-#nifi.minifi.provenance.reporting.scheduling.strategy=
-#nifi.minifi.provenance.reporting.scheduling.period=
-#nifi.minifi.provenance.reporting.destination.url=
-#nifi.minifi.provenance.reporting.input.port.name=
-#nifi.minifi.provenance.reporting.instance.url=
-#nifi.minifi.provenance.reporting.batch.size=
-#nifi.minifi.provenance.reporting.communications.timeout=
-#nifi.minifi.provenance.reporting.compress.events=
-
-
-### NiFi Framework Properties
-# Core Properties
-nifi.flowcontroller.graceful.shutdown.period=10 sec
-nifi.flowservice.writedelay.interval=500 ms
-nifi.administrative.yield.duration=30 sec
-nifi.bored.yield.duration=10 millis
-# FlowFile Repository
-nifi.flowfile.repository.implementation=org.apache.nifi.controller.repository.WriteAheadFlowFileRepository
-nifi.flowfile.repository.checkpoint.interval=20 secs
-nifi.flowfile.repository.always.sync=false
-# Content Repository
-nifi.content.repository.implementation=org.apache.nifi.controller.repository.FileSystemRepository
-nifi.content.claim.max.appendable.size=50 KB
-nifi.content.repository.archive.max.retention.period=7 days
-nifi.content.repository.archive.max.usage.percentage=50%
-nifi.content.repository.archive.enabled=false
-# Provenance Repository
-nifi.provenance.repository.implementation=org.apache.nifi.provenance.NoOpProvenanceRepository
-nifi.provenance.repository.rollover.time=
-nifi.provenance.repository.index.shard.size=
-nifi.provenance.repository.max.storage.size=
-nifi.provenance.repository.max.storage.time=
-# Components Status Repository
-nifi.components.status.repository.implementation=org.apache.nifi.controller.status.history.VolatileComponentStatusRepository
-nifi.components.status.snapshot.frequency=1 min
-# Swap Manager
-nifi.swap.manager.implementation=org.apache.nifi.controller.FileSystemSwapManager
-nifi.queue.swap.threshold=20000
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/expected.json b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/expected.json
deleted file mode 100644
index 0737f438d7..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge1/expected.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "pattern": "ConfigurationChangeCoordinator Notifying Listeners of a change"
- },
- {
- "pattern": "MiNiFi has finished reloading successfully and applied the new flow configuration"
- }
-]
\ No newline at end of file
diff --git a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge2/bootstrap.conf b/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge2/bootstrap.conf
deleted file mode 100644
index 8ce374ece7..0000000000
--- a/minifi/minifi-integration-tests/src/test/resources/c2/hierarchical/minifi-edge2/bootstrap.conf
+++ /dev/null
@@ -1,204 +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.
-#
-
-# Java command to use when running MiNiFi
-java=java
-
-# Username to use when running MiNiFi. This value will be ignored on Windows.
-run.as=
-
-# Configure where MiNiFi's lib and conf directories live
-# When running as a Windows service set full paths instead of relative paths
-lib.dir=./lib
-conf.dir=./conf
-
-# How long to wait after telling MiNiFi to shutdown before explicitly killing the Process
-graceful.shutdown.seconds=20
-
-# Disable JSR 199 so that we can use JSP's without running a JDK
-java.arg.1=-Dorg.apache.jasper.compiler.disablejsr199=true
-
-# JVM memory settings
-java.arg.2=-Xms256m
-java.arg.3=-Xmx256m
-
-# allowRestrictedHeaders is required for Cluster/Node communications to work properly
-java.arg.5=-Dsun.net.http.allowRestrictedHeaders=true
-java.arg.6=-Djava.protocol.handler.pkgs=sun.net.www.protocol
-
-# Sets the provider of SecureRandom to /dev/urandom to prevent blocking on VMs
-java.arg.7=-Djava.security.egd=file:/dev/urandom
-
-# Garbage Collector Algorithm
-java.arg.13=-XX:+UseG1GC
-
-#Set headless mode by default
-java.arg.14=-Djava.awt.headless=true
-
-# Enable Remote Debugging
-#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
-
-
-### MiNiFi Flow Config File
-nifi.minifi.flow.config=./conf/flow.json.gz
-
-
-### MiNiFi Security Properties
-nifi.minifi.security.keystore=
-nifi.minifi.security.keystoreType=
-nifi.minifi.security.keystorePasswd=
-nifi.minifi.security.keyPasswd=
-nifi.minifi.security.truststore=
-nifi.minifi.security.truststoreType=
-nifi.minifi.security.truststorePasswd=
-nifi.minifi.security.ssl.protocol=
-
-# Ignore all processor SSL controller services and use parent minifi SSL instead
-nifi.minifi.flow.use.parent.ssl=false
-
-
-### MiNiFi Sensitive Properties Settings
-nifi.minifi.sensitive.props.key=
-nifi.minifi.sensitive.props.algorithm=
-
-
-### MiNiFi Command & Control (C2) Configuration
-# Enabling C2 Uncomment each of the following options
-#c2.enable=true
-## heartbeat in milliseconds
-#c2.agent.heartbeat.period=5000
-## define parameters about your agent
-#c2.agent.class=
-# Optional. Defaults to a hardware based unique identifier
-#c2.agent.identifier=
-# If set to false heartbeat won't contain the manifest. Defaults to true.
-#c2.full.heartbeat=false
-## define protocol parameters
-# DEPRECATED: c2.rest.url and c2.rest.url.ack are deprecated in favor of c2.rest.path.* properties and are target to be removed in future release
-# The absolute url of the C2 server's heartbeat endpoint, eg.: http://localhost/c2-server/api/heartbeat
-#c2.rest.url=
-# The absolute url of the C2 server's acknowledge endpoint, eg.: http://localhost/c2-server/api/acknowledge
-#c2.rest.url.ack=
-# C2 Rest Path Properties
-# The base path of the C2 server's REST API, eg.: http://localhost/c2-server/api
-#c2.rest.path.base=
-# Relative url of the C2 server's heartbeat endpoint, eg.: /heartbeat
-#c2.rest.path.heartbeat=
-# Relative url of the C2 server's acknowledge endpoint, eg.: /acknowledge
-#c2.rest.path.acknowledge=
-## c2 timeouts
-#c2.rest.connectionTimeout=5 sec
-#c2.rest.readTimeout=5 sec
-#c2.rest.callTimeout=10 sec
-#c2.config.directory=./conf
-#c2.runtime.manifest.identifier=minifi
-#c2.runtime.type=minifi-java
... 1848 lines suppressed ...