[38/50] nifi git commit: NIFI-4920 Skipping sensitive properties when updating component properties from versioned component. This closes #2505.
NIFI-4920 Skipping sensitive properties when updating component properties from versioned component. This closes #2505. Signed-off-by: Mark Payne Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a8e519b6 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a8e519b6 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a8e519b6 Branch: refs/heads/HDF-3.1-maint Commit: a8e519b652340d68c3f23c25167e92af0d37867e Parents: 87ec87a Author: Bryan Bende Authored: Fri Mar 2 10:52:22 2018 -0500 Committer: Matt Gilman Committed: Tue Mar 6 09:44:39 2018 -0500 -- .../org/apache/nifi/groups/StandardProcessGroup.java | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/nifi/blob/a8e519b6/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java -- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java index ae9b43f..9fd5ad7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java @@ -4098,9 +4098,17 @@ public final class StandardProcessGroup implements ProcessGroup { private Map populatePropertiesMap(final Map currentProperties, final Map proposedProperties, final Map proposedDescriptors, final ProcessGroup group) { +// since VersionedPropertyDescriptor currently doesn't know if it is sensitive or not, +// keep track of which property descriptors are sensitive from the current properties +final Set sensitiveProperties = new HashSet<>(); + final Map fullPropertyMap = new HashMap<>(); for (final PropertyDescriptor property : currentProperties.keySet()) { -fullPropertyMap.put(property.getName(), null); +if (property.isSensitive()) { +sensitiveProperties.add(property.getName()); +} else { +fullPropertyMap.put(property.getName(), null); +} } if (proposedProperties != null) { @@ -4108,6 +4116,11 @@ public final class StandardProcessGroup implements ProcessGroup { final String propertyName = entry.getKey(); final VersionedPropertyDescriptor descriptor = proposedDescriptors.get(propertyName); +// skip any sensitive properties so we can retain whatever is currently set +if (sensitiveProperties.contains(propertyName)) { +continue; +} + String value; if (descriptor != null && descriptor.getIdentifiesControllerService()) { // Property identifies a Controller Service. So the value that we want to assign is not the value given.
nifi git commit: NIFI-4920 Skipping sensitive properties when updating component properties from versioned component. This closes #2505.
Repository: nifi Updated Branches: refs/heads/master 74bb341ab -> 179e967b4 NIFI-4920 Skipping sensitive properties when updating component properties from versioned component. This closes #2505. Signed-off-by: Mark Payne Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/179e967b Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/179e967b Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/179e967b Branch: refs/heads/master Commit: 179e967b47920173c013d81411c6086ac1bff326 Parents: 74bb341 Author: Bryan Bende Authored: Fri Mar 2 10:52:22 2018 -0500 Committer: Mark Payne Committed: Fri Mar 2 11:15:39 2018 -0500 -- .../org/apache/nifi/groups/StandardProcessGroup.java | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/nifi/blob/179e967b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java -- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java index c738737..4177917 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java @@ -4098,9 +4098,17 @@ public final class StandardProcessGroup implements ProcessGroup { private Map populatePropertiesMap(final Map currentProperties, final Map proposedProperties, final Map proposedDescriptors, final ProcessGroup group) { +// since VersionedPropertyDescriptor currently doesn't know if it is sensitive or not, +// keep track of which property descriptors are sensitive from the current properties +final Set sensitiveProperties = new HashSet<>(); + final Map fullPropertyMap = new HashMap<>(); for (final PropertyDescriptor property : currentProperties.keySet()) { -fullPropertyMap.put(property.getName(), null); +if (property.isSensitive()) { +sensitiveProperties.add(property.getName()); +} else { +fullPropertyMap.put(property.getName(), null); +} } if (proposedProperties != null) { @@ -4108,6 +4116,11 @@ public final class StandardProcessGroup implements ProcessGroup { final String propertyName = entry.getKey(); final VersionedPropertyDescriptor descriptor = proposedDescriptors.get(propertyName); +// skip any sensitive properties so we can retain whatever is currently set +if (sensitiveProperties.contains(propertyName)) { +continue; +} + String value; if (descriptor != null && descriptor.getIdentifiesControllerService()) { // Property identifies a Controller Service. So the value that we want to assign is not the value given.