[nifi] branch main updated: NIFI-7672 Remove filtering of invalid components when getting service ids to enable, lower layers will already skip enabling invalid services, so we want to include service

2020-08-10 Thread markap14
This is an automated email from the ASF dual-hosted git repository.

markap14 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 cea5691  NIFI-7672 Remove filtering of invalid components when getting 
service ids to enable, lower layers will already skip enabling invalid 
services, so we want to include services that may become valid when enabling 
their dependent services
cea5691 is described below

commit cea569169f22113e1242dd8ef9b0eb2684156d29
Author: Bryan Bende 
AuthorDate: Fri Jul 24 12:00:43 2020 -0400

NIFI-7672 Remove filtering of invalid components when getting service ids 
to enable, lower layers will already skip enabling invalid services, so we want 
to include services that may become valid when enabling their dependent services
---
 .../src/main/java/org/apache/nifi/web/api/FlowResource.java| 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
index 5fe850a..3483bd3 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
@@ -37,7 +37,6 @@ import 
org.apache.nifi.cluster.coordination.ClusterCoordinator;
 import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
 import org.apache.nifi.cluster.manager.NodeResponse;
 import org.apache.nifi.cluster.protocol.NodeIdentifier;
-import org.apache.nifi.components.validation.ValidationStatus;
 import org.apache.nifi.connectable.Port;
 import org.apache.nifi.controller.ProcessorNode;
 import org.apache.nifi.controller.ScheduledState;
@@ -861,7 +860,7 @@ public class FlowResource extends ApplicationResource {
 
 final Predicate filter;
 if (ControllerServiceState.ENABLED.equals(desiredState)) {
-filter = service -> !service.isActive() && 
service.getValidationStatus() == ValidationStatus.VALID;
+filter = service -> !service.isActive();
 } else {
 filter = ControllerServiceNode::isActive;
 }



[nifi] branch main updated: NIFI-7715 This closes #4456. Added IntelliJ generated `.ipr` to `.gitignore`

2020-08-10 Thread joewitt
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 5470de9  NIFI-7715 This closes #4456. Added IntelliJ generated `.ipr` 
to `.gitignore`
5470de9 is described below

commit 5470de949e72459f84de5a468d576c1817eff66d
Author: ben 
AuthorDate: Thu Aug 6 12:23:50 2020 +0100

NIFI-7715 This closes #4456. Added IntelliJ generated `.ipr` to `.gitignore`

- IntelliJ generates a `.ipr` Project File when exec the `mvn` goals
`mvn idea:idea` and `mvn idea:project`
  - [Maven `idea` 
Doc](https://maven.apache.org/plugins/maven-idea-plugin/usage.html)

Signed-off-by: ben 
Signed-off-by: Joe Witt 
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 1e9336f..2548f5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ nb-configuration.xml
 .idea/
 *.iml
 *.iws
+*.ipr
 *~
 
 .vscode/



[nifi] 02/02: NIFI-7338 This closes #4169. Added comment about com.hierynomus.smbj.SMBClient syncronicity

2020-08-10 Thread joewitt
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

commit 51091a5fca8dde3116c46e3135de14c658140c1e
Author: bibistroc 
AuthorDate: Wed Aug 5 12:17:21 2020 +0300

NIFI-7338 This closes #4169. Added comment about 
com.hierynomus.smbj.SMBClient syncronicity

- added file.size attribute on GetSmbFile

Signed-off-by: Joe Witt 
---
 .../src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java| 5 -
 .../src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java| 2 +-
 .../test/java/org/apache/nifi/processors/smb/GetSmbFileTest.java| 6 ++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java
 
b/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java
index 0aac011..f7caa21 100644
--- 
a/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java
+++ 
b/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java
@@ -203,6 +203,7 @@ public class GetSmbFile extends AbstractProcessor {
 public static final String FILE_CREATION_TIME_ATTRIBUTE = 
"file.creationTime";
 public static final String FILE_LAST_MODIFY_TIME_ATTRIBUTE = 
"file.lastModifiedTime";
 public static final String FILE_LAST_ACCESS_TIME_ATTRIBUTE = 
"file.lastAccessTime";
+public static final String FILE_SIZE_ATTRIBUTE = "file.size";
 
 public static final String FILE_MODIFY_DATE_ATTR_FORMAT = 
"-MM-dd'T'HH:mm:ssZ";
 final static DateFormat dateFormatter = new 
SimpleDateFormat(FILE_MODIFY_DATE_ATTR_FORMAT, Locale.US);
@@ -222,7 +223,7 @@ public class GetSmbFile extends AbstractProcessor {
 
 private final AtomicLong queueLastUpdated = new AtomicLong(0L);
 
-private SMBClient smbClient = null;
+private SMBClient smbClient = null; // this gets synchronized when the 
`connect` method is called
 
 private Pattern filePattern;
 private Pattern pathPattern;
@@ -468,6 +469,7 @@ public class GetSmbFile extends AbstractProcessor {
 final long importMillis = 
TimeUnit.MILLISECONDS.convert(importNanos, TimeUnit.NANOSECONDS);
 final FileAllInformation fileInfo = 
f.getFileInformation();
 final FileBasicInformation fileBasicInfo = 
fileInfo.getBasicInformation();
+final long fileSize = 
fileInfo.getStandardInformation().getEndOfFile();
 
 flowFile = session.putAttribute(flowFile, 
CoreAttributes.FILENAME.key(), filename);
 flowFile = session.putAttribute(flowFile, 
CoreAttributes.PATH.key(), filePath);
@@ -475,6 +477,7 @@ public class GetSmbFile extends AbstractProcessor {
 flowFile = session.putAttribute(flowFile, 
FILE_CREATION_TIME_ATTRIBUTE, 
dateFormatter.format(fileBasicInfo.getCreationTime().toDate()));
 flowFile = session.putAttribute(flowFile, 
FILE_LAST_ACCESS_TIME_ATTRIBUTE, 
dateFormatter.format(fileBasicInfo.getLastAccessTime().toDate()));
 flowFile = session.putAttribute(flowFile, 
FILE_LAST_MODIFY_TIME_ATTRIBUTE, 
dateFormatter.format(fileBasicInfo.getLastWriteTime().toDate()));
+flowFile = session.putAttribute(flowFile, 
FILE_SIZE_ATTRIBUTE, String.valueOf(fileSize));
 flowFile = session.putAttribute(flowFile, 
HOSTNAME.getName(), hostname);
 flowFile = session.putAttribute(flowFile, 
SHARE.getName(), shareName);
 session.getProvenanceReporter().receive(flowFile, 
uri.toString(), importMillis);
diff --git 
a/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
 
b/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
index 64c528f..1d8a9e0 100644
--- 
a/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
+++ 
b/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
@@ -162,7 +162,7 @@ public class PutSmbFile extends AbstractProcessor {
 
 private Set relationships;
 
-private SMBClient smbClient = null;
+private SMBClient smbClient = null; // this gets synchronized when the 
`connect` method is called
 private Set sharedAccess;
 
 @Override
diff --git 
a/nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/test/java/org/apache/nifi/processors/smb/GetSmbFileTest.java
 

[nifi] 01/02: NIFI-7338 fixed provenance, top level dir, chatty smbj log, pw validation update accessmask to be more restrictive

2020-08-10 Thread joewitt
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

commit 71d155e874e98d5904c11ce1972b566fb77f523b
Author: si 
AuthorDate: Mon Mar 30 11:20:23 2020 +0200

NIFI-7338 fixed provenance, top level dir,
chatty smbj log, pw validation
update accessmask to be more restrictive

Author:si 

Signed-off-by: Joe Witt 
---
 nifi-assembly/LICENSE  |  38 +-
 nifi-assembly/NOTICE   |  11 +-
 nifi-assembly/pom.xml  |   6 +
 .../src/main/resources/conf/logback.xml|   3 +
 .../nifi-smb-bundle/nifi-smb-nar/pom.xml   |  41 ++
 .../src/main/resources/META-INF/LICENSE| 280 +++
 .../src/main/resources/META-INF/NOTICE |  19 +
 .../nifi-smb-bundle/nifi-smb-processors/pom.xml|  60 +++
 .../org/apache/nifi/processors/smb/GetSmbFile.java | 541 +
 .../org/apache/nifi/processors/smb/PutSmbFile.java | 334 +
 .../services/org.apache.nifi.processor.Processor   |  16 +
 .../apache/nifi/processors/smb/GetSmbFileTest.java | 290 +++
 .../apache/nifi/processors/smb/PutSmbFileTest.java | 224 +
 nifi-nar-bundles/nifi-smb-bundle/pom.xml   |  35 ++
 nifi-nar-bundles/pom.xml   |   1 +
 .../resources/conf/clustered/node1/logback.xml |   3 +
 .../resources/conf/clustered/node2/logback.xml |   3 +
 .../src/test/resources/conf/default/logback.xml|   3 +
 18 files changed, 1902 insertions(+), 6 deletions(-)

diff --git a/nifi-assembly/LICENSE b/nifi-assembly/LICENSE
index 96872ae..279ab0d 100644
--- a/nifi-assembly/LICENSE
+++ b/nifi-assembly/LICENSE
@@ -951,7 +951,7 @@ The binary distribution of this product bundles 'ANTLR 2'
   The binary distribution of this product bundles 'Bouncy Castle JDK 1.5'
   under an MIT style license.
 
-Copyright (c) 2000 - 2015 The Legion of the Bouncy Castle Inc. 
(http://www.bouncycastle.org)
+Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. 
(http://www.bouncycastle.org)
 
 Permission is hereby granted, free of charge, to any person obtaining a 
copy
 of this software and associated documentation files (the "Software"), to 
deal
@@ -1005,7 +1005,7 @@ The binary distribution of this product bundles 'ANTLR 2'
   The binary distribution of this product bundles 'Slf4j' which is available 
under
   an MIT license.
 
-Copyright (c) 2004-2013 QOS.ch
+Copyright (c) 2004-2017 QOS.ch
  All rights reserved.
 
  Permission is hereby granted, free  of charge, to any person obtaining
@@ -2985,6 +2985,29 @@ The binary distribution of this product bundles 'Project 
Lombok 1.18.6' which is
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 
+The binary distribution of this product bundles 'mbassador' under an MIT style
+  license.
+
+Copyright (c) 2012 Benjamin Diedrichsen
+
+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 'Extensions on qpid-proton-j 
library 1.2.2' which is available under an MIT license.
 
 Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3016,8 +3039,10 @@ The binary distribution of this product bundles 'Jakarta 
Activation API 1.2.1' a
 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 

[nifi] branch main updated (58e324e -> 51091a5)

2020-08-10 Thread joewitt
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git.


from 58e324e  NIFI-7522 bumping from Apache Kafka 2.5 to Apache Kafka 2.6
 new 71d155e  NIFI-7338 fixed provenance, top level dir, chatty smbj log, 
pw validation update accessmask to be more restrictive
 new 51091a5  NIFI-7338 This closes #4169. Added comment about 
com.hierynomus.smbj.SMBClient syncronicity

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nifi-assembly/LICENSE  |  38 +-
 nifi-assembly/NOTICE   |  11 +-
 nifi-assembly/pom.xml  |   6 +
 .../src/main/resources/conf/logback.xml|   3 +
 .../nifi-smb-nar}/pom.xml  |   6 +-
 .../src/main/resources/META-INF/LICENSE|  93 ++--
 .../src/main/resources/META-INF}/NOTICE|  13 +-
 .../nifi-smb-bundle/nifi-smb-processors}/pom.xml   |  17 +-
 .../org/apache/nifi/processors/smb/GetSmbFile.java | 544 +
 .../org/apache/nifi/processors/smb/PutSmbFile.java | 334 +
 .../services/org.apache.nifi.processor.Processor   |   3 +-
 .../apache/nifi/processors/smb/GetSmbFileTest.java | 296 +++
 .../apache/nifi/processors/smb/PutSmbFileTest.java | 224 +
 .../{nifi-poi-bundle => nifi-smb-bundle}/pom.xml   |   6 +-
 nifi-nar-bundles/pom.xml   |   1 +
 .../resources/conf/clustered/node1/logback.xml |   3 +
 .../resources/conf/clustered/node2/logback.xml |   3 +
 .../src/test/resources/conf/default/logback.xml|   3 +
 18 files changed, 1533 insertions(+), 71 deletions(-)
 copy nifi-nar-bundles/{nifi-tcp-bundle/nifi-tcp-nar => 
nifi-smb-bundle/nifi-smb-nar}/pom.xml (91%)
 copy nifi-nar-bundles/{nifi-email-bundle/nifi-email-nar => 
nifi-smb-bundle/nifi-smb-nar}/src/main/resources/META-INF/LICENSE (84%)
 copy 
nifi-nar-bundles/{nifi-rules-action-handler-bundle/nifi-rules-action-handler-nar/src/main/resources
 => nifi-smb-bundle/nifi-smb-nar/src/main/resources/META-INF}/NOTICE (55%)
 copy 
{nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors
 => nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors}/pom.xml (81%)
 create mode 100644 
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/GetSmbFile.java
 create mode 100644 
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/main/java/org/apache/nifi/processors/smb/PutSmbFile.java
 copy 
{nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors
 => 
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors}/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
 (90%)
 create mode 100644 
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/test/java/org/apache/nifi/processors/smb/GetSmbFileTest.java
 create mode 100644 
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-processors/src/test/java/org/apache/nifi/processors/smb/PutSmbFileTest.java
 copy nifi-nar-bundles/{nifi-poi-bundle => nifi-smb-bundle}/pom.xml (91%)



[nifi-registry] branch main updated: NIFIREG-410 Add integration tests that cover the new Database UserGroupProvider and AccessPolicyProvider

2020-08-10 Thread kdoran
This is an automated email from the ASF dual-hosted git repository.

kdoran pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-registry.git


The following commit(s) were added to refs/heads/main by this push:
 new 85a3243  NIFIREG-410 Add integration tests that cover the new Database 
UserGroupProvider and AccessPolicyProvider
85a3243 is described below

commit 85a3243ca0cfa3244d8852a636fd667715e7412d
Author: Bryan Bende 
AuthorDate: Mon Aug 10 11:19:10 2020 -0400

NIFIREG-410 Add integration tests that cover the new Database 
UserGroupProvider and AccessPolicyProvider

This closes #294.

Signed-off-by: Kevin Doran 
---
 .../nifi/registry/web/api/SecureDatabaseIT.java| 238 +
 .../application-ITSecureDatabase.properties|  36 
 .../resources/conf/secure-database/authorizers.xml |  80 +++
 .../nifi-registry-client.properties|  25 +++
 .../conf/secure-database/nifi-registry.properties  |  33 +++
 .../src/test/resources/db/clearDB.sql  |   2 +
 6 files changed, 414 insertions(+)

diff --git 
a/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
 
b/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
new file mode 100644
index 000..3b7ce60
--- /dev/null
+++ 
b/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
@@ -0,0 +1,238 @@
+/*
+ * 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.registry.web.api;
+
+import org.apache.nifi.registry.NiFiRegistryTestApiApplication;
+import org.apache.nifi.registry.authorization.AccessPolicy;
+import org.apache.nifi.registry.authorization.User;
+import org.apache.nifi.registry.authorization.UserGroup;
+import org.apache.nifi.registry.bucket.Bucket;
+import org.apache.nifi.registry.client.BucketClient;
+import org.apache.nifi.registry.client.NiFiRegistryClient;
+import org.apache.nifi.registry.client.NiFiRegistryClientConfig;
+import org.apache.nifi.registry.client.PoliciesClient;
+import org.apache.nifi.registry.client.TenantsClient;
+import org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient;
+import org.apache.nifi.registry.revision.entity.RevisionInfo;
+import org.apache.nifi.registry.security.authorization.RequestAction;
+import 
org.apache.nifi.registry.security.authorization.resource.ResourceFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.jdbc.Sql;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(
+classes = NiFiRegistryTestApiApplication.class,
+webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+properties = "spring.profiles.include=ITSecureDatabase")
+@Import(SecureITClientConfiguration.class)
+@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = 
{"classpath:db/clearDB.sql"})
+public class SecureDatabaseIT extends IntegrationTestBase {
+
+private static final Logger LOGGER = 
LoggerFactory.getLogger(SecureDatabaseIT.class);
+
+private static final String INITIAL_ADMIN_IDENTITY = "CN=user1, OU=nifi";
+private static final String OTHER_USER_IDENTITY = "CN=user2, OU=nifi";
+
+private NiFiRegistryClient client;
+
+@Before
+public void setup() {
+final String baseUrl = createBaseURL();
+LOGGER.info("Using base url = " + baseUrl);
+
+final NiFiRegistryClientConfig clientConfig = 
createClientConfig(baseUrl);
+Assert.assertNotNull(clientConfig);
+
+final NiFiRegistryClient client = new 

[nifi-registry] branch main updated: NIFIREG-410 Add integration tests that cover the new Database UserGroupProvider and AccessPolicyProvider

2020-08-10 Thread kdoran
This is an automated email from the ASF dual-hosted git repository.

kdoran pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-registry.git


The following commit(s) were added to refs/heads/main by this push:
 new 85a3243  NIFIREG-410 Add integration tests that cover the new Database 
UserGroupProvider and AccessPolicyProvider
85a3243 is described below

commit 85a3243ca0cfa3244d8852a636fd667715e7412d
Author: Bryan Bende 
AuthorDate: Mon Aug 10 11:19:10 2020 -0400

NIFIREG-410 Add integration tests that cover the new Database 
UserGroupProvider and AccessPolicyProvider

This closes #294.

Signed-off-by: Kevin Doran 
---
 .../nifi/registry/web/api/SecureDatabaseIT.java| 238 +
 .../application-ITSecureDatabase.properties|  36 
 .../resources/conf/secure-database/authorizers.xml |  80 +++
 .../nifi-registry-client.properties|  25 +++
 .../conf/secure-database/nifi-registry.properties  |  33 +++
 .../src/test/resources/db/clearDB.sql  |   2 +
 6 files changed, 414 insertions(+)

diff --git 
a/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
 
b/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
new file mode 100644
index 000..3b7ce60
--- /dev/null
+++ 
b/nifi-registry-core/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureDatabaseIT.java
@@ -0,0 +1,238 @@
+/*
+ * 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.registry.web.api;
+
+import org.apache.nifi.registry.NiFiRegistryTestApiApplication;
+import org.apache.nifi.registry.authorization.AccessPolicy;
+import org.apache.nifi.registry.authorization.User;
+import org.apache.nifi.registry.authorization.UserGroup;
+import org.apache.nifi.registry.bucket.Bucket;
+import org.apache.nifi.registry.client.BucketClient;
+import org.apache.nifi.registry.client.NiFiRegistryClient;
+import org.apache.nifi.registry.client.NiFiRegistryClientConfig;
+import org.apache.nifi.registry.client.PoliciesClient;
+import org.apache.nifi.registry.client.TenantsClient;
+import org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient;
+import org.apache.nifi.registry.revision.entity.RevisionInfo;
+import org.apache.nifi.registry.security.authorization.RequestAction;
+import 
org.apache.nifi.registry.security.authorization.resource.ResourceFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.jdbc.Sql;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(
+classes = NiFiRegistryTestApiApplication.class,
+webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+properties = "spring.profiles.include=ITSecureDatabase")
+@Import(SecureITClientConfiguration.class)
+@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = 
{"classpath:db/clearDB.sql"})
+public class SecureDatabaseIT extends IntegrationTestBase {
+
+private static final Logger LOGGER = 
LoggerFactory.getLogger(SecureDatabaseIT.class);
+
+private static final String INITIAL_ADMIN_IDENTITY = "CN=user1, OU=nifi";
+private static final String OTHER_USER_IDENTITY = "CN=user2, OU=nifi";
+
+private NiFiRegistryClient client;
+
+@Before
+public void setup() {
+final String baseUrl = createBaseURL();
+LOGGER.info("Using base url = " + baseUrl);
+
+final NiFiRegistryClientConfig clientConfig = 
createClientConfig(baseUrl);
+Assert.assertNotNull(clientConfig);
+
+final NiFiRegistryClient client = new 

[nifi] branch main updated: NIFI-7522 bumping from Apache Kafka 2.5 to Apache Kafka 2.6

2020-08-10 Thread pvillard
This is an automated email from the ASF dual-hosted git repository.

pvillard 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 58e324e  NIFI-7522 bumping from Apache Kafka 2.5 to Apache Kafka 2.6
58e324e is described below

commit 58e324e9f1414ebdbe3d295645d38f4b6692864d
Author: Joe Witt 
AuthorDate: Fri Aug 7 09:56:25 2020 -0700

NIFI-7522 bumping from Apache Kafka 2.5 to Apache Kafka 2.6

Signed-off-by: Pierre Villard 

This closes #4462.
---
 nifi-assembly/pom.xml  |  2 +-
 .../pom.xml|  4 +-
 .../src/main/resources/META-INF/LICENSE|  0
 .../src/main/resources/META-INF/NOTICE |  0
 .../pom.xml|  8 +--
 .../kafka/pubsub/ConsumeKafkaRecord_2_6.java}  | 14 ++--
 .../processors/kafka/pubsub/ConsumeKafka_2_6.java} | 16 ++---
 .../processors/kafka/pubsub/ConsumerLease.java |  4 +-
 .../nifi/processors/kafka/pubsub/ConsumerPool.java |  0
 .../kafka/pubsub/InFlightMessageTracker.java   |  0
 .../kafka/pubsub/KafkaProcessorUtils.java  |  0
 .../nifi/processors/kafka/pubsub/Partitioners.java |  0
 .../kafka/pubsub/PublishKafkaRecord_2_6.java}  |  6 +-
 .../processors/kafka/pubsub/PublishKafka_2_6.java} |  4 +-
 .../processors/kafka/pubsub/PublishResult.java |  0
 .../processors/kafka/pubsub/PublisherLease.java|  0
 .../processors/kafka/pubsub/PublisherPool.java |  0
 .../record/sink/kafka/KafkaRecordSink_2_6.java}|  4 +-
 .../org.apache.nifi.controller.ControllerService   |  2 +-
 .../services/org.apache.nifi.processor.Processor   |  8 +--
 .../additionalDetails.html |  2 +-
 .../additionalDetails.html |  2 +-
 .../additionalDetails.html |  2 +-
 .../additionalDetails.html |  2 +-
 .../processors/kafka/pubsub/ConsumerPoolTest.java  |  0
 .../kafka/pubsub/ITConsumeKafka_2_6.java}  | 28 
 .../kafka/pubsub/KafkaProcessorUtilsTest.java  |  0
 .../kafka/pubsub/TestConsumeKafkaRecord_2_6.java}  | 76 +++---
 .../kafka/pubsub/TestConsumeKafka_2_6.java}| 32 -
 .../kafka/pubsub/TestInFlightMessageTracker.java   |  0
 .../kafka/pubsub/TestPublishKafkaRecord_2_6.java}  | 44 ++---
 .../kafka/pubsub/TestPublishKafka_2_6.java}| 30 -
 .../kafka/pubsub/TestPublisherLease.java   |  0
 .../processors/kafka/pubsub/TestPublisherPool.java |  0
 .../kafka/pubsub/util/MockRecordParser.java|  0
 .../sink/kafka/TestKafkaRecordSink_2_6.java}   | 32 -
 .../src/test/resources/log4j.properties|  0
 .../src/test/resources/server.properties   |  0
 .../src/test/resources/zookeeper.properties|  0
 nifi-nar-bundles/nifi-kafka-bundle/pom.xml |  8 +--
 40 files changed, 165 insertions(+), 165 deletions(-)

diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml
index ab5a3ad..a13d9a4 100644
--- a/nifi-assembly/pom.xml
+++ b/nifi-assembly/pom.xml
@@ -213,7 +213,7 @@ language governing permissions and limitations under the 
License. -->
 
 
 org.apache.nifi
-nifi-kafka-2-5-nar
+nifi-kafka-2-6-nar
 1.12.0-SNAPSHOT
 nar
 
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/pom.xml 
b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/pom.xml
similarity index 94%
rename from nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/pom.xml
rename to nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/pom.xml
index 8fc06b0..dddb7c1 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/pom.xml
@@ -19,7 +19,7 @@
 nifi-kafka-bundle
 1.12.0-SNAPSHOT
 
-nifi-kafka-2-5-nar
+nifi-kafka-2-6-nar
 nar
 NiFi NAR for interacting with Apache Kafka 2.5
 
@@ -29,7 +29,7 @@
 
 
 org.apache.nifi
-nifi-kafka-2-5-processors
+nifi-kafka-2-6-processors
 
 
 org.apache.nifi
diff --git 
a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/src/main/resources/META-INF/LICENSE
 
b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/src/main/resources/META-INF/LICENSE
similarity index 100%
rename from 
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/src/main/resources/META-INF/LICENSE
rename to 
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/src/main/resources/META-INF/LICENSE
diff --git 
a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-5-nar/src/main/resources/META-INF/NOTICE
 
b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-nar/src/main/resources/META-INF/NOTICE
similarity index 100%
rename from