You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/01 14:27:45 UTC

[GitHub] [nifi] exceptionfactory opened a new pull request, #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

exceptionfactory opened a new pull request, #6743:
URL: https://github.com/apache/nifi/pull/6743

   # Summary
   
   [NIFI-10919](https://issues.apache.org/jira/browse/NIFI-10919) Corrects Kafka component handling of `SCRAM-SHA-256` and `SCRAM-SHA-512` SASL Mechanism property handling as a result of changes introduced in [NIFI-10819](https://issues.apache.org/jira/browse/NIFI-10819).
   
   The changes replace the use of `SaslMechanism.valueOf()` with `SaslMechanism.getSaslMechanism()` to find the matching property value instead of the enumeration name, which does not match property values. Additional changes include new unit tests to validate property handling in referencing classes.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 8
     - [ ] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 commented on a diff in pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
greyp9 commented on code in PR #6743:
URL: https://github.com/apache/nifi/pull/6743#discussion_r1037282814


##########
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-shared/src/main/java/org/apache/nifi/kafka/shared/property/provider/StandardKafkaPropertyNameProvider.java:
##########
@@ -58,9 +59,12 @@ private static Set<String> getCommonPropertyNames() {
         final Set<String> propertyNames = new LinkedHashSet<>();
 
         for (final String propertyClassName : PROPERTY_CLASSES) {
-            final Class<?> propertyClass = getClass(propertyClassName);
-            final Set<String> classPropertyNames = getStaticStringPropertyNames(propertyClass);
-            propertyNames.addAll(classPropertyNames);
+            final Optional<Class<?>> propertyClassFound = findClass(propertyClassName);
+            if (propertyClassFound.isPresent()) {
+                final Class<?> propertyClass = propertyClassFound.get();
+                final Set<String> classPropertyNames = getStaticStringPropertyNames(propertyClass);
+                propertyNames.addAll(classPropertyNames);
+            }

Review Comment:
   should there be an else clause here to flag the bad value (logger::warn)?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 commented on pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
greyp9 commented on PR #6743:
URL: https://github.com/apache/nifi/pull/6743#issuecomment-1334027466

   ```
   ...
   	sasl.login.refresh.window.factor = 0.8
   	sasl.login.refresh.window.jitter = 0.05
   	sasl.mechanism = GSSAPI
   	security.protocol = PLAINTEXT
   	security.providers = null
   ...
   	sasl.login.refresh.window.factor = 0.8
   	sasl.login.refresh.window.jitter = 0.05
   	sasl.mechanism = SCRAM-SHA-256
   	security.protocol = PLAINTEXT
   	security.providers = null
   ...
   	sasl.login.refresh.window.factor = 0.8
   	sasl.login.refresh.window.jitter = 0.05
   	sasl.mechanism = SCRAM-SHA-512
   	security.protocol = PLAINTEXT
   	security.providers = null
   ...
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 closed pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
greyp9 closed pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components
URL: https://github.com/apache/nifi/pull/6743


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on code in PR #6743:
URL: https://github.com/apache/nifi/pull/6743#discussion_r1037308056


##########
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-shared/src/main/java/org/apache/nifi/kafka/shared/property/provider/StandardKafkaPropertyNameProvider.java:
##########
@@ -58,9 +59,12 @@ private static Set<String> getCommonPropertyNames() {
         final Set<String> propertyNames = new LinkedHashSet<>();
 
         for (final String propertyClassName : PROPERTY_CLASSES) {
-            final Class<?> propertyClass = getClass(propertyClassName);
-            final Set<String> classPropertyNames = getStaticStringPropertyNames(propertyClass);
-            propertyNames.addAll(classPropertyNames);
+            final Optional<Class<?>> propertyClassFound = findClass(propertyClassName);
+            if (propertyClassFound.isPresent()) {
+                final Class<?> propertyClass = propertyClassFound.get();
+                final Set<String> classPropertyNames = getStaticStringPropertyNames(propertyClass);
+                propertyNames.addAll(classPropertyNames);
+            }

Review Comment:
   This is a best effort approach, based on Kafka classes available at runtime. This influences the custom property validation, so any issues would be flagged as validation problems. For that reason, adding logging here seems unnecessary.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] Kagee commented on pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
Kagee commented on PR #6743:
URL: https://github.com/apache/nifi/pull/6743#issuecomment-1333901550

   No need to check for Java 8 since it is deprecated for 1.19?
   > Support for Java 8 is deprecated: Java 11.0.16 is the minimum recommended version
   > https://cwiki.apache.org/confluence/display/NIFI/Release+Notes#ReleaseNotes-Version1.19.0


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory commented on pull request #6743: NIFI-10919 Correct SCRAM SASL Mechanism for Kafka Components

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on PR #6743:
URL: https://github.com/apache/nifi/pull/6743#issuecomment-1333917723

   @Kagee NiFi version 1 releases continue to support Java 8, although support is deprecated in 1.19.0. NiFi 2.0 will remove support for Java 8, but it remains supported for now.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org