private HttpHeaders getHttpHeaders() {
        HttpHeaders headers = new HttpHeaders();
        headers.add(CONTENT_TYPE_KEY, CONTENT_TYPE_VALUE);
        if (esConfig.getAuthEnable()) {
            if (StringUtils.isNotEmpty(esConfig.getUsername()) && StringUtils.isNotEmpty(esConfig.getPassword())) {
                String tokenStr = esConfig.getUsername() + ":" + esConfig.getPassword();
                String token = base64Encoder.encodeToString(tokenStr.getBytes(StandardCharsets.UTF_8));
                headers.add("Authorization", "Basic " + token);
            }
        }
        return headers;
    }
Get http headers by token.

@return http header infos
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/es/ElasticsearchApi.java