exceptionfactory commented on code in PR #7579:
URL: https://github.com/apache/nifi/pull/7579#discussion_r1286418161


##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -153,6 +154,7 @@ public class StandardOauth2AccessTokenProvider extends 
AbstractControllerService
         .required(true)
         .sensitive(true)
         .addValidator(StandardValidators.NON_BLANK_VALIDATOR)
+        .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)

Review Comment:
   ```suggestion
           .expressionLanguageSupported(ExpressionLanguageScope.NONE)
   ```



##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/test/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProviderTest.java:
##########
@@ -120,13 +123,13 @@ protected ComponentLog getLogger() {
         
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.GRANT_TYPE).getValue()).thenReturn(StandardOauth2AccessTokenProvider.RESOURCE_OWNER_PASSWORD_CREDENTIALS_GRANT_TYPE.getValue());
         
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.AUTHORIZATION_SERVER_URL).evaluateAttributeExpressions().getValue()).thenReturn(AUTHORIZATION_SERVER_URL);
         
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.USERNAME).evaluateAttributeExpressions().getValue()).thenReturn(USERNAME);
-        
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.PASSWORD).getValue()).thenReturn(PASSWORD);
+        
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.PASSWORD).evaluateAttributeExpressions().getValue()).thenReturn(PASSWORD);

Review Comment:
   ```suggestion
           
when(mockContext.getProperty(StandardOauth2AccessTokenProvider.PASSWORD).getValue()).thenReturn(PASSWORD);
   ```



##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -125,6 +125,7 @@ public class StandardOauth2AccessTokenProvider extends 
AbstractControllerService
         .required(true)
         .sensitive(true)
         .addValidator(StandardValidators.NON_BLANK_VALIDATOR)
+        .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)

Review Comment:
   Sensitive properties should not support Expression Language.
   ```suggestion
           .expressionLanguageSupported(ExpressionLanguageScope.NONE)
   ```



##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -258,12 +264,12 @@ public void onEnabled(ConfigurationContext context) {
         clientAuthenticationStrategy = 
ClientAuthenticationStrategy.valueOf(context.getProperty(CLIENT_AUTHENTICATION_STRATEGY).getValue());
         grantType = context.getProperty(GRANT_TYPE).getValue();
         username = 
context.getProperty(USERNAME).evaluateAttributeExpressions().getValue();
-        password = context.getProperty(PASSWORD).getValue();
+        password = 
context.getProperty(PASSWORD).evaluateAttributeExpressions().getValue();

Review Comment:
   ```suggestion
           password = context.getProperty(PASSWORD).getValue();
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to