NIFI-10668 Persist proxy password in remote process group (#6557)

* NIFI-10668 Persist proxy password in remote process group
This commit is contained in:
Nandor Soma Abonyi 2022-10-21 17:44:12 +02:00 committed by GitHub
parent 91e267e6e3
commit 2049268372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class VersionedProcessGroup extends VersionedComponent {
public class VersionedProcessGroup extends VersionedComponent {
private Set<VersionedProcessGroup> processGroups = new HashSet<>();
private Set<VersionedRemoteProcessGroup> remoteProcessGroups = new HashSet<>();

View File

@ -32,6 +32,7 @@ public class VersionedRemoteProcessGroup extends VersionedComponent {
private String proxyHost;
private Integer proxyPort;
private String proxyUser;
private String proxyPassword;
private Set<VersionedRemoteGroupPort> inputPorts;
private Set<VersionedRemoteGroupPort> outputPorts;
@ -157,6 +158,14 @@ public class VersionedRemoteProcessGroup extends VersionedComponent {
this.proxyUser = proxyUser;
}
public String getProxyPassword() {
return proxyPassword;
}
public void setProxyPassword(String proxyPassword) {
this.proxyPassword = proxyPassword;
}
@Override
public ComponentType getComponentType() {
return ComponentType.REMOTE_PROCESS_GROUP;

View File

@ -2918,6 +2918,7 @@ public class StandardVersionedComponentSynchronizer implements VersionedComponen
rpg.setProxyHost(proposed.getProxyHost());
rpg.setProxyPort(proposed.getProxyPort());
rpg.setProxyUser(proposed.getProxyUser());
rpg.setProxyPassword(decrypt(proposed.getProxyPassword(), syncOptions.getPropertyDecryptor()));
rpg.setTransportProtocol(SiteToSiteTransportProtocol.valueOf(proposed.getTransportProtocol()));
rpg.setYieldDuration(proposed.getYieldDuration());

View File

@ -782,6 +782,9 @@ public class NiFiRegistryFlowMapper {
rpg.setProxyHost(remoteGroup.getProxyHost());
rpg.setProxyPort(remoteGroup.getProxyPort());
rpg.setProxyUser(remoteGroup.getProxyUser());
if (flowMappingOptions.isMapSensitiveConfiguration()) {
rpg.setProxyPassword(encrypt(remoteGroup.getProxyPassword()));
}
rpg.setTargetUri(remoteGroup.getTargetUri());
rpg.setTargetUris(remoteGroup.getTargetUris());
rpg.setTransportProtocol(remoteGroup.getTransportProtocol().name());