MINIFI-238 - MiNiFi Initial Command and Control Server Implementation This closes #75.
Signed-off-by: Aldrin Piri <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi/commit/f89f4150 Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi/tree/f89f4150 Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi/diff/f89f4150 Branch: refs/heads/master Commit: f89f415043a243925eec50b3b0dee1527fa34d1e Parents: 7ecf80e Author: Bryan Rosander <[email protected]> Authored: Wed Mar 1 17:06:11 2017 -0500 Committer: Aldrin Piri <[email protected]> Committed: Fri Mar 31 12:22:17 2017 -0400 ---------------------------------------------------------------------- .../ingestors/PullHttpChangeIngestor.java | 14 +- minifi-c2/minifi-c2-api/pom.xml | 46 ++ .../nifi/minifi/c2/api/Configuration.java | 45 ++ .../minifi/c2/api/ConfigurationProvider.java | 43 ++ .../c2/api/ConfigurationProviderException.java | 28 + .../c2/api/InvalidParameterException.java | 28 + .../minifi/c2/api/cache/ConfigurationCache.java | 37 ++ .../api/cache/ConfigurationCacheFileInfo.java | 53 ++ .../c2/api/cache/WriteableConfiguration.java | 29 + .../minifi/c2/api/properties/C2Properties.java | 89 +++ .../authorization/AuthorityGranter.java | 36 ++ .../authorization/AuthorizationException.java | 24 + .../api/security/authorization/Authorizer.java | 36 ++ .../c2/api/util/DelegatingOutputStream.java | 54 ++ .../apache/nifi/minifi/c2/api/util/Pair.java | 44 ++ minifi-c2/minifi-c2-assembly/LICENSE | 330 +++++++++++ minifi-c2/minifi-c2-assembly/NOTICE | 240 ++++++++ minifi-c2/minifi-c2-assembly/README.md | 97 ++++ minifi-c2/minifi-c2-assembly/pom.xml | 172 ++++++ .../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 | 30 + .../src/main/resources/conf/c2.properties | 27 + .../src/main/resources/conf/logback.xml | 38 ++ .../main/resources/conf/minifi-c2-context.xml | 70 +++ .../conf/minifi-c2-web-security-context.xml | 31 ++ .../src/main/resources/conf/webdefault.xml | 556 +++++++++++++++++++ .../main/resources/files/raspi3/config.yml.v1 | 63 +++ .../minifi-c2-cache-filesystem/pom.xml | 35 ++ .../filesystem/FileSystemCacheFileInfoImpl.java | 86 +++ .../FileSystemConfigurationCache.java | 80 +++ .../FileSystemWritableConfiguration.java | 94 ++++ minifi-c2/minifi-c2-cache/pom.xml | 31 ++ minifi-c2/minifi-c2-docker/README.md | 27 + .../minifi-c2-docker/dockerhub/.dockerignore | 19 + .../minifi-c2-docker/dockerhub/DockerBuild.sh | 31 ++ .../minifi-c2-docker/dockerhub/DockerImage.txt | 16 + .../minifi-c2-docker/dockerhub/DockerRun.sh | 19 + minifi-c2/minifi-c2-docker/dockerhub/Dockerfile | 49 ++ .../minifi-c2-docker/dockermaven/Dockerfile | 44 ++ minifi-c2/minifi-c2-docker/pom.xml | 73 +++ minifi-c2/minifi-c2-integration-tests/pom.xml | 128 +++++ .../c2/integration/test/AbstractTestSecure.java | 199 +++++++ .../integration/test/AbstractTestUnsecure.java | 107 ++++ .../test/FileSystemCacheProviderSecureTest.java | 69 +++ .../FileSystemCacheProviderUnsecureTest.java | 36 ++ ...NiFiRestConfigurationProviderSecureTest.java | 108 ++++ ...FiRestConfigurationProviderUnsecureTest.java | 39 ++ .../test/health/HttpStatusCodeHealthCheck.java | 55 ++ .../test/health/HttpsStatusCodeHealthCheck.java | 70 +++ .../c2-secure-rest/conf/minifi-c2-context.xml | 57 ++ .../resources/c2-secure/conf/authorities.yaml | 21 + .../c2-secure/conf/authorizations.yaml | 30 + .../test/resources/c2-secure/conf/c2.properties | 27 + .../c2-unsecure-rest/conf/minifi-c2-context.xml | 56 ++ .../resources/c2/files/raspi2/config.yml.v1 | 63 +++ .../resources/c2/files/raspi3/config.yml.v1 | 63 +++ .../resources/c2/files/raspi3/config.yml.v2 | 63 +++ ...ompose-FileSystemCacheProviderSecureTest.yml | 40 ++ ...r-compose-FileSystemProviderUnsecureTest.yml | 25 + ...-NiFiRestConfigurationProviderSecureTest.yml | 55 ++ ...iFiRestConfigurationProviderUnsecureTest.yml | 37 ++ .../test/resources/mocknifi-secure/server.py | 48 ++ .../test/resources/mocknifi-unsecure/server.py | 44 ++ .../mocknifi/www/nifi-api/flow/templates | 53 ++ .../download | 203 +++++++ .../download | 203 +++++++ .../download | 202 +++++++ .../src/test/resources/overlay.properties | 16 + .../src/test/resources/squid/squid.conf | 19 + minifi-c2/minifi-c2-jetty/pom.xml | 43 ++ .../nifi/minifi/c2/jetty/JettyServer.java | 142 +++++ .../minifi-c2-provider-cache/pom.xml | 40 ++ .../cache/CacheConfigurationProvider.java | 46 ++ .../cache/CacheConfigurationProviderTest.java | 65 +++ .../minifi-c2-provider-nifi-rest/pom.xml | 77 +++ .../rest/NiFiRestConfigurationProvider.java | 149 +++++ .../provider/nifi/rest/NiFiRestConnector.java | 80 +++ .../provider/nifi/rest/TemplatesIterator.java | 115 ++++ .../nifi/rest/TemplatesIteratorException.java | 31 ++ .../rest/NiFiRestConfigurationProviderTest.java | 66 +++ .../rest/TemplatesIteratorExceptionTest.java | 34 ++ .../nifi/rest/TemplatesIteratorTest.java | 108 ++++ .../src/test/resources/noTemplates.json | 1 + .../src/test/resources/oneTemplate.json | 21 + .../src/test/resources/twoTemplates.json | 37 ++ minifi-c2/minifi-c2-provider/pom.xml | 32 ++ minifi-c2/minifi-c2-service/pom.xml | 83 +++ .../minifi/c2/configuration/Configuration.java | 28 + .../c2/security/SecurityConfiguration.java | 91 +++ .../C2AnonymousAuthenticationFilter.java | 38 ++ .../authentication/C2AuthenticationToken.java | 51 ++ .../X509AuthenticationFilter.java | 70 +++ .../X509AuthenticationProvider.java | 49 ++ .../authentication/X509AuthenticationToken.java | 52 ++ .../GrantedAuthorityAuthorizer.java | 138 +++++ .../PrincipalStringAuthorityGranter.java | 54 ++ .../nifi/minifi/c2/service/ConfigService.java | 167 ++++++ .../nifi/minifi/c2/util/HttpRequestUtil.java | 41 ++ .../src/main/webapp/WEB-INF/web.xml | 51 ++ minifi-c2/pom.xml | 38 ++ .../src/main/resources/conf/bootstrap.conf | 4 + pom.xml | 6 + 105 files changed, 7309 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/PullHttpChangeIngestor.java ---------------------------------------------------------------------- diff --git a/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/PullHttpChangeIngestor.java b/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/PullHttpChangeIngestor.java index a8e7105..3ec26d0 100644 --- a/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/PullHttpChangeIngestor.java +++ b/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/PullHttpChangeIngestor.java @@ -27,6 +27,7 @@ import org.apache.nifi.minifi.bootstrap.ConfigurationFileHolder; import org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeNotifier; import org.apache.nifi.minifi.bootstrap.configuration.differentiators.WholeConfigDifferentiator; import org.apache.nifi.minifi.bootstrap.configuration.differentiators.interfaces.Differentiator; +import org.apache.nifi.minifi.commons.schema.common.StringUtil; import org.slf4j.LoggerFactory; import javax.net.ssl.KeyManagerFactory; @@ -71,6 +72,7 @@ public class PullHttpChangeIngestor extends AbstractPullChangeIngestor { public static final String PORT_KEY = PULL_HTTP_BASE_KEY + ".port"; public static final String HOST_KEY = PULL_HTTP_BASE_KEY + ".hostname"; public static final String PATH_KEY = PULL_HTTP_BASE_KEY + ".path"; + public static final String QUERY_KEY = PULL_HTTP_BASE_KEY + ".query"; public static final String TRUSTSTORE_LOCATION_KEY = PULL_HTTP_BASE_KEY + ".truststore.location"; public static final String TRUSTSTORE_PASSWORD_KEY = PULL_HTTP_BASE_KEY + ".truststore.password"; public static final String TRUSTSTORE_TYPE_KEY = PULL_HTTP_BASE_KEY + ".truststore.type"; @@ -86,6 +88,7 @@ public class PullHttpChangeIngestor extends AbstractPullChangeIngestor { private final AtomicReference<Integer> portReference = new AtomicReference<>(); private final AtomicReference<String> hostReference = new AtomicReference<>(); private final AtomicReference<String> pathReference = new AtomicReference<>(); + private final AtomicReference<String> queryReference = new AtomicReference<>(); private volatile Differentiator<ByteBuffer> differentiator; private volatile String connectionScheme; private volatile String lastEtag = ""; @@ -110,6 +113,7 @@ public class PullHttpChangeIngestor extends AbstractPullChangeIngestor { } final String path = properties.getProperty(PATH_KEY, "/"); + final String query = properties.getProperty(QUERY_KEY, ""); final String portString = (String) properties.get(PORT_KEY); final Integer port; @@ -122,6 +126,7 @@ public class PullHttpChangeIngestor extends AbstractPullChangeIngestor { portReference.set(port); hostReference.set(host); pathReference.set(path); + queryReference.set(query); final String useEtagString = (String) properties.getOrDefault(USE_ETAG_KEY, "false"); if ("true".equalsIgnoreCase(useEtagString) || "false".equalsIgnoreCase(useEtagString)){ @@ -175,10 +180,15 @@ public class PullHttpChangeIngestor extends AbstractPullChangeIngestor { public void run() { try { logger.debug("Attempting to pull new config"); - final HttpUrl url = new HttpUrl.Builder() + HttpUrl.Builder builder = new HttpUrl.Builder() .host(hostReference.get()) .port(portReference.get()) - .encodedPath(pathReference.get()) + .encodedPath(pathReference.get()); + String query = queryReference.get(); + if (!StringUtil.isNullOrEmpty(query)) { + builder = builder.encodedQuery(query); + } + final HttpUrl url = builder .scheme(connectionScheme) .build(); http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/pom.xml ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/pom.xml b/minifi-c2/minifi-c2-api/pom.xml new file mode 100644 index 0000000..4f1a397 --- /dev/null +++ b/minifi-c2/minifi-c2-api/pom.xml @@ -0,0 +1,46 @@ +<?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 http://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>0.2.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>javax.ws.rs</groupId> + <artifactId>jsr311-api</artifactId> + <version>1.1.1</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-util</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java new file mode 100644 index 0000000..a008f0a --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/Configuration.java @@ -0,0 +1,45 @@ +/* + * 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; + +/** + * Represents a MiNiFi configuration of a given version, format matches the format of the ConfigurationProvider + */ +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; +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java new file mode 100644 index 0000000..a743be3 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProvider.java @@ -0,0 +1,43 @@ +/* + * 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 type that this provider returns + * + * @return the content type that this provider returns + */ + String getContentType(); + + /** + * 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(Integer version, Map<String, List<String>> parameters) throws ConfigurationProviderException; +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java new file mode 100644 index 0000000..16b1ed2 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/ConfigurationProviderException.java @@ -0,0 +1,28 @@ +/* + * 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); + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java new file mode 100644 index 0000000..33f8aa0 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/InvalidParameterException.java @@ -0,0 +1,28 @@ +/* + * 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); + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java new file mode 100644 index 0000000..00c271e --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCache.java @@ -0,0 +1,37 @@ +/* + * 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.InvalidParameterException; + +import java.util.List; +import java.util.Map; + +/** + * 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 information on the entry + * @throws InvalidParameterException if there are illegal/invalid parameters + */ + ConfigurationCacheFileInfo getCacheFileInfo(Map<String, List<String>> parameters) throws InvalidParameterException; +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java new file mode 100644 index 0000000..73578ba --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/ConfigurationCacheFileInfo.java @@ -0,0 +1,53 @@ +/* + * 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; +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java new file mode 100644 index 0000000..20d2d2e --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/cache/WriteableConfiguration.java @@ -0,0 +1,29 @@ +/* + * 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(); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java new file mode 100644 index 0000000..2a8df3a --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/properties/C2Properties.java @@ -0,0 +1,89 @@ +/* + * 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 org.eclipse.jetty.util.ssl.SslContextFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +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 Logger logger = LoggerFactory.getLogger(C2Properties.class); + private static final C2Properties properties = initProperties(); + private static final String C2_SERVER_HOME = System.getenv("C2_SERVER_HOME"); + + 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 SslContextFactory getSslContextFactory() throws GeneralSecurityException, IOException { + if (!Boolean.valueOf(getProperty(MINIFI_C2_SERVER_SECURE, "false"))) { + return null; + } + + SslContextFactory sslContextFactory = new SslContextFactory(); + KeyStore keyStore = KeyStore.getInstance(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_TYPE)); + Path keyStorePath = Paths.get(C2_SERVER_HOME).resolve(properties.getProperty(MINIFI_C2_SERVER_KEYSTORE)).toAbsolutePath(); + logger.debug("keystore path: " + keyStorePath); + try (InputStream inputStream = Files.newInputStream(keyStorePath)) { + keyStore.load(inputStream, properties.getProperty(MINIFI_C2_SERVER_KEYSTORE_PASSWD).toCharArray()); + } + sslContextFactory.setKeyStore(keyStore); + sslContextFactory.setKeyManagerPassword(properties.getProperty(MINIFI_C2_SERVER_KEY_PASSWD)); + sslContextFactory.setWantClientAuth(true); + + String trustStorePath = Paths.get(C2_SERVER_HOME).resolve(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE)).toAbsolutePath().toFile().getAbsolutePath(); + logger.debug("truststore path: " + trustStorePath); + sslContextFactory.setTrustStorePath(trustStorePath); + sslContextFactory.setTrustStoreType(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_TYPE)); + sslContextFactory.setTrustStorePassword(properties.getProperty(MINIFI_C2_SERVER_TRUSTSTORE_PASSWD)); + try { + sslContextFactory.start(); + } catch (Exception e) { + throw new IOException(e); + } + return sslContextFactory; + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java new file mode 100644 index 0000000..2a7d913 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorityGranter.java @@ -0,0 +1,36 @@ +/* + * 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); +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java new file mode 100644 index 0000000..2c459e0 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/AuthorizationException.java @@ -0,0 +1,24 @@ +/* + * 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; + +public class AuthorizationException extends Exception { + public AuthorizationException(String message) { + super(message); + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java new file mode 100644 index 0000000..fbdf3f5 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/security/authorization/Authorizer.java @@ -0,0 +1,36 @@ +/* + * 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 javax.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; +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java new file mode 100644 index 0000000..a3f5254 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/DelegatingOutputStream.java @@ -0,0 +1,54 @@ +/* + * 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(); + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java new file mode 100644 index 0000000..edca7d0 --- /dev/null +++ b/minifi-c2/minifi-c2-api/src/main/java/org/apache/nifi/minifi/c2/api/util/Pair.java @@ -0,0 +1,44 @@ +/* + * 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 + + '}'; + } +} http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-assembly/LICENSE ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-assembly/LICENSE b/minifi-c2/minifi-c2-assembly/LICENSE new file mode 100644 index 0000000..a4b4e87 --- /dev/null +++ b/minifi-c2/minifi-c2-assembly/LICENSE @@ -0,0 +1,330 @@ + + 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 <[email protected]> + 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 http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-assembly/NOTICE ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-assembly/NOTICE b/minifi-c2/minifi-c2-assembly/NOTICE new file mode 100644 index 0000000..ebdfa69 --- /dev/null +++ b/minifi-c2/minifi-c2-assembly/NOTICE @@ -0,0 +1,240 @@ +Apache NiFi +Copyright 2014-2017 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +=========================================== +Apache Software License v2 +=========================================== + +The following binary components are provided under the Apache Software License v2 + + (ASLv2) Apache NiFi + The following NOTICE information applies: + Apache NiFi + Copyright 2014-2017 The Apache Software Foundation + + This product includes software developed at + The Apache Software Foundation (http://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 [email protected] + while at Mandiant http://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-2017 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 ([email protected]) + + =============================================================================== + + The content of package org.apache.commons.codec.language.bm has been translated + from the original php source code available at http://stevemorse.org/phoneticinfo.htm + with permission from the original authors. + Original source copyright: + Copyright (c) 2008 Alexander Beider & Stephen P. Morse. + + (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 ([email protected]), 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 (http://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 http://www.jcip.net + + (ASLv2) Apache Commons Logging + The following NOTICE information applies: + Apache Commons Logging + Copyright 2003-2014 The Apache Software Foundation + + (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 Framework 4.0.3.RELEASE + Copyright (c) 2002-2015 Pivotal, Inc. + + (ASLv2) Spring Framework + The following NOTICE information applies: + Spring Framework 4.1.4.RELEASE + Copyright (c) 2002-2015 Pivotal, Inc. + + (ASLv2) Quartz + The following NOTICE information applies: + Copyright Declaration: + Copyright © 2003-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. + + Trademark and Patent declaration + The name Software AG and all Software AG product names are either trademarks or registered trademarks of Software AG and/or Software AG USA Inc. and/or its subsidiaries and/or its affiliates + and/or their licensors. Other company and product names mentioned herein may be trademarks of their respective owners. + + Detailed information on trademarks and patents owned by Software AG and/or its subsidiaries is located at http://softwareag.com/licenses. + + Third Party declaration + This software may include portions of third-party products. For third-party copyright notices, license terms, additional rights or restrictions, please refer to "License Texts, Copyright + Notices and Disclaimers of Third Party Products". For certain specific third-party license restrictions, please refer to section E of the Legal Notices available under "License Terms and + Conditions for Use of Software AG Products / Copyright and Trademark Notices of Software AG Products". These documents are part of the product documentation, located at + http://softwareag.com/licenses and/or in the root installation directory of the licensed product(s). + + Confidentiality Disclaimer: + Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG. + Contact GitHub API Training Shop Blog About + + (ASLv2) Jasypt + The following NOTICE information applies: + Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) + + (ASLv2) Apache Commons IO + The following NOTICE information applies: + Apache Commons IO + Copyright 2002-2017 The Apache Software Foundation + + (ASLv2) Apache ZooKeeper + The following NOTICE information applies: + Apache ZooKeeper + Copyright 2009-2012 The Apache Software Foundation + + (ASLv2) Apache log4j + The following NOTICE information applies: + Apache log4j + Copyright 2007 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) JavaMail API (compat) (javax.mail:mail:jar:1.4.7 - http://kenai.com/projects/javamail/mail) + (CDDL 1.1) (GPL2 w/ CPE) jersey-json (com.sun.jersey:jersey-json:jar:1.19 - https://jersey.java.net/jersey-json/) + (CDDL 1.1) (GPL2 w/ CPE) Old JAXB Runtime (com.sun.xml.bind:jaxb-impl:jar:2.2.3-1 - http://jaxb.java.net/) + (CDDL 1.1) (GPL2 w/ CPE) Java Architecture For XML Binding (javax.xml.bind:jaxb-api:jar:2.2.2 - https://jaxb.dev.java.net/) + (CDDL 1.1) (GPL2 w/ CPE) aopalliance version 1.0 repackaged as a module (org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b25 - https://hk2.java.net/external/aopalliance-repackaged) + (CDDL 1.1) (GPL2 w/ CPE) jersey-client (com.sun.jersey:jersey-client:jar:1.19 - https://jersey.java.net/jersey-client/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-core (com.sun.jersey:jersey-core:jar:1.19 - https://jersey.java.net/jersey-core/) + + +************************ +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 - http://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 - http://www.eclipse.org/aspectj/) + (EPL 1.0)(LGPL 2.1) Logback Classic (ch.qos.logback:logback-classic:jar:1.1.3 - http://logback.qos.ch/) + (EPL 1.0)(LGPL 2.1) Logback Core (ch.qos.logback:logback-core:jar:1.1.3 - http://logback.qos.ch/) + (EPL 1.0)(MPL 2.0) H2 Database (com.h2database:h2:jar:1.3.176 - http://www.h2database.com/html/license.html) http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-assembly/README.md ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-assembly/README.md b/minifi-c2/minifi-c2-assembly/README.md new file mode 100644 index 0000000..c77e3e2 --- /dev/null +++ b/minifi-c2/minifi-c2-assembly/README.md @@ -0,0 +1,97 @@ +<!-- + 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 +* JRE 1.8 +* 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: [email protected] +([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 <http://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, Jasypt, 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 +http://www.jasypt.org/faq.html +http://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. http://git-wip-us.apache.org/repos/asf/nifi-minifi/blob/f89f4150/minifi-c2/minifi-c2-assembly/pom.xml ---------------------------------------------------------------------- diff --git a/minifi-c2/minifi-c2-assembly/pom.xml b/minifi-c2/minifi-c2-assembly/pom.xml new file mode 100644 index 0000000..957f8bd --- /dev/null +++ b/minifi-c2/minifi-c2-assembly/pom.xml @@ -0,0 +1,172 @@ +<?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 http://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>0.2.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>10080</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> + <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-provider-cache</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.nifi.minifi</groupId> + <artifactId>minifi-c2-provider-nifi-rest</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.eclipse.jetty</groupId> + <artifactId>jetty-server</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlet</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-webapp</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</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>com.sun.jersey.contribs</groupId> + <artifactId>jersey-spring</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <scope>compile</scope> + </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>javax.servlet</groupId> + <artifactId>javax.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> +</project>
