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


##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientServiceImpl.java:
##########
@@ -275,6 +318,12 @@ private CredentialsProvider addCredentials(final 
CredentialsProvider credentials
         return cp;
     }
 
+    private BasicHeader createApiKeyAuthorizationHeader(String apiKeyId, 
String apiKey) {
+        final String apiKeyCredentials = String.format("%s:%s", apiKeyId, 
apiKey);
+        final String apiKeyAuth = 
Base64.getEncoder().encodeToString((apiKeyCredentials).getBytes(StandardCharsets.UTF_8));

Review Comment:
   The `id` and `key` would be the values returned by Elasticsearch when you 
[create an api 
key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html#security-api-create-api-key-example)
 - NiFi requires both of these to construct the `Authorization` (ApiKey) header
   
   From your description, it sounds like you are applying the `encoded` field 
from the Elasticsearch response (which is the Base64 encoded `id` & `key`) - 
NiFi doesn't currently use that in its approach - if you require that, you 
could raise a Jira to request it be added (submit a PR of your able) to make 
that an alternative to providing these existing fields



-- 
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-unsubscr...@nifi.apache.org

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

Reply via email to