NIFI-13025 Removed custom validation from NifiRegistryFlowRegistryClient

- NiFi Registry REST API enforces TLS handshake requirements

This closes #8629

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Pierre Villard 2024-04-11 09:26:53 +02:00 committed by exceptionfactory
parent 2cae3fec11
commit cc7af91f97
No known key found for this signature in database
1 changed files with 0 additions and 21 deletions

View File

@ -17,8 +17,6 @@
package org.apache.nifi.registry.flow;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationContext;
import org.apache.nifi.components.ValidationResult;
import org.apache.nifi.flow.VersionedFlowCoordinates;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.registry.bucket.Bucket;
@ -40,8 +38,6 @@ import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
@ -128,23 +124,6 @@ public class NifiRegistryFlowRegistryClient extends AbstractFlowRegistryClient {
this.registryClient = null;
}
protected Collection<ValidationResult> customValidate(final ValidationContext context) {
final Collection<ValidationResult> result = new HashSet<>();
if (context.getProperty(SSL_CONTEXT_SERVICE).isSet()) {
final SSLContextService sslContextService = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
if (sslContextService.isTrustStoreConfigured() ^ sslContextService.isKeyStoreConfigured()) {
result.add(new ValidationResult.Builder().subject(this.getClass().getSimpleName())
.valid(false)
.explanation("It is expected to either set all the properties for the SSLContext or set none")
.build());
}
}
return result;
}
private String extractIdentity(final FlowRegistryClientConfigurationContext context) {
return context.getNiFiUserIdentity().orElse(null);
}