simonbence commented on a change in pull request #4348:
URL: https://github.com/apache/nifi/pull/4348#discussion_r443675238
##########
File path:
nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/main/java/org/apache/nifi/atlas/security/Kerberos.java
##########
@@ -49,22 +49,24 @@
final KerberosCredentialsService credentialsService =
context.getProperty(ReportLineageToAtlas.KERBEROS_CREDENTIALS_SERVICE).asControllerService(KerberosCredentialsService.class);
- final String resolvedPrincipal;
- final String resolvedKeytab;
- if (credentialsService == null) {
- resolvedPrincipal = explicitPrincipal;
- resolvedKeytab = explicitKeytab;
- } else {
- resolvedPrincipal = credentialsService.getPrincipal();
- resolvedKeytab = credentialsService.getKeytab();
- }
-
- if (resolvedPrincipal == null || resolvedKeytab == null) {
- problems.add(new ValidationResult.Builder()
- .subject("Kerberos Credentials")
- .valid(false)
- .explanation("Both the Principal and the Keytab must be
specified when using Kerberos authentication, either via the explicit
properties or the Kerberos Credentials Service.")
- .build());
+ if (credentialsService == null ||
context.getControllerServiceLookup().isControllerServiceEnabled(credentialsService))
{
Review comment:
This looks very similar to the added validation in ReportLineageToAtlas.
Would it make sense to extract?
##########
File path:
nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/main/java/org/apache/nifi/atlas/reporting/ReportLineageToAtlas.java
##########
@@ -632,10 +667,37 @@ private void setValue(Consumer<String> setter, Runnable
emptyHandler, PropertyVa
}
}
- private void checkAtlasUrls(List<String> urlStrings, ConfigurationContext
context) {
- if (urlStrings.isEmpty()) {
- throw new ProcessException("No Atlas URL has been specified! Set
either the '" + ATLAS_URLS.getDisplayName() + "' " +
- "property on the processor or the 'atlas.rest.address'
porperty in the atlas configuration file.");
+ private void setAtlasSSLConfig(Properties atlasProperties,
ConfigurationContext context, List<String> urls, File confDir) throws
IOException {
+ boolean isAtlasApiSecure = urls.stream().anyMatch(url ->
url.toLowerCase().startsWith("https"));
Review comment:
Is not that necessary to use allMatch? (I am not 100% sure though)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]