nandorsoma commented on code in PR #6619:
URL: https://github.com/apache/nifi/pull/6619#discussion_r1014952186


##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java:
##########
@@ -52,23 +54,63 @@ public interface ElasticSearchClientService extends 
ControllerService {
             .addValidator(Validator.VALID)
             .build();
     PropertyDescriptor PROXY_CONFIGURATION_SERVICE = 
ProxyConfiguration.createProxyConfigPropertyDescriptor(false, ProxySpec.HTTP);
+
+    AllowableValue ALLOWABLE_VALUE_BASIC_AUTH = new 
AllowableValue(AuthorizationScheme.BASIC.name(), 
AuthorizationScheme.BASIC.getDisplayName());
+    AllowableValue ALLOWABLE_VALUE_API_KEY = new 
AllowableValue(AuthorizationScheme.API_KEY.name(), 
AuthorizationScheme.API_KEY.getDisplayName());
+
+    PropertyDescriptor AUTHORIZATION_SCHEME = new PropertyDescriptor.Builder()
+            .name("authorization-scheme")
+            .displayName("Authorization Scheme")
+            .description("Authorization Scheme used for the authorization.")
+            .allowableValues(ALLOWABLE_VALUE_BASIC_AUTH, 
ALLOWABLE_VALUE_API_KEY)
+            .defaultValue(ALLOWABLE_VALUE_BASIC_AUTH.getValue())
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
     PropertyDescriptor USERNAME = new PropertyDescriptor.Builder()
             .name("el-cs-username")
             .displayName("Username")
             .description("The username to use with XPack security.")
+            .dependsOn(AUTHORIZATION_SCHEME, ALLOWABLE_VALUE_BASIC_AUTH)
             .required(false)
             
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
+
     PropertyDescriptor PASSWORD = new PropertyDescriptor.Builder()
             .name("el-cs-password")
             .displayName("Password")
             .description("The password to use with XPack security.")
+            .dependsOn(AUTHORIZATION_SCHEME, ALLOWABLE_VALUE_BASIC_AUTH)
             .required(false)
             .sensitive(true)
             
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
+
+    PropertyDescriptor API_KEY_ID = new PropertyDescriptor.Builder()
+            .name("api-key-id")
+            .displayName("API key id")
+            .description("Unique id of the API key")
+            .dependsOn(AUTHORIZATION_SCHEME, ALLOWABLE_VALUE_API_KEY)
+            .required(false)
+            .sensitive(false)
+            
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    PropertyDescriptor API_KEY = new PropertyDescriptor.Builder()
+            .name("api-key")
+            .displayName("API key")
+            .description("API key")
+            .dependsOn(AUTHORIZATION_SCHEME, ALLOWABLE_VALUE_API_KEY)
+            .required(false)
+            .sensitive(true)
+            
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)

Review Comment:
   I added that because username/password supports that, and I thought it's 
better not to make a difference to avoid confusion. But I accept!



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