mirror of https://github.com/apache/nifi.git
NIFI-1415: Do not enfoce that a password or Private Key Passphrase is set
Signed-off-by: Aldrin Piri <aldrin@apache.org>
This commit is contained in:
parent
a7d3f8d75f
commit
93e2c52195
|
@ -18,8 +18,6 @@
|
||||||
package org.apache.nifi.processors.standard;
|
package org.apache.nifi.processors.standard;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||||
|
@ -30,8 +28,6 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||||
import org.apache.nifi.annotation.documentation.SeeAlso;
|
import org.apache.nifi.annotation.documentation.SeeAlso;
|
||||||
import org.apache.nifi.annotation.documentation.Tags;
|
import org.apache.nifi.annotation.documentation.Tags;
|
||||||
import org.apache.nifi.components.PropertyDescriptor;
|
import org.apache.nifi.components.PropertyDescriptor;
|
||||||
import org.apache.nifi.components.ValidationContext;
|
|
||||||
import org.apache.nifi.components.ValidationResult;
|
|
||||||
import org.apache.nifi.processor.ProcessContext;
|
import org.apache.nifi.processor.ProcessContext;
|
||||||
import org.apache.nifi.processors.standard.util.FileTransfer;
|
import org.apache.nifi.processors.standard.util.FileTransfer;
|
||||||
import org.apache.nifi.processors.standard.util.SFTPTransfer;
|
import org.apache.nifi.processors.standard.util.SFTPTransfer;
|
||||||
|
@ -73,20 +69,6 @@ public class FetchSFTP extends FetchFileTransfer {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) {
|
|
||||||
if (!validationContext.getProperty(SFTPTransfer.PASSWORD).isSet() && !(validationContext.getProperty(SFTPTransfer.PRIVATE_KEY_PASSPHRASE).isSet()
|
|
||||||
&& validationContext.getProperty(SFTPTransfer.PRIVATE_KEY_PATH).isSet())) {
|
|
||||||
return Collections.singleton(new ValidationResult.Builder()
|
|
||||||
.subject("Password")
|
|
||||||
.valid(false)
|
|
||||||
.explanation("Must set either password or Private Key Path & Passphrase")
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected FileTransfer createFileTransfer(final ProcessContext context) {
|
protected FileTransfer createFileTransfer(final ProcessContext context) {
|
||||||
return new SFTPTransfer(context, getLogger());
|
return new SFTPTransfer(context, getLogger());
|
||||||
|
|
Loading…
Reference in New Issue