Skip to content

Commit

Permalink
Add placeholder authorization headers
Browse files Browse the repository at this point in the history
  • Loading branch information
f-galland committed Jan 28, 2025
1 parent 58cb592 commit 310d7b8
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@
*/
package com.wazuh.contentmanager.rest;

import org.apache.hc.core5.http.message.BasicHeader;
import org.opensearch.client.node.NodeClient;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.RestRequest;

import java.io.IOException;
import java.net.URI;
import java.util.List;
import java.util.Locale;

import com.wazuh.contentmanager.PluginSettings;
import com.wazuh.contentmanager.http.GetClient;

import static org.opensearch.rest.RestRequest.Method.GET;

public class GetHandler extends BaseRestHandler {
Expand All @@ -47,6 +52,12 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
throws IOException {
switch (request.method()) {
case GET:
GetClient.getInstance()
.get(
URI.create(PluginSettings.getInstance().getUri()),
null,
new BasicHeader("authorization", "Bearer: API-TOKEN"));

return null;
default:
throw new IllegalArgumentException(
Expand Down

0 comments on commit 310d7b8

Please sign in to comment.