@elastic.io/component-commons-library
Version:
Library for most common component development cases
16 lines (15 loc) • 605 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiKeyRestClient = void 0;
const NoAuthRestClient_1 = require("./NoAuthRestClient");
class ApiKeyRestClient extends NoAuthRestClient_1.NoAuthRestClient {
constructor(emitter, cfg) {
super(emitter, cfg);
this.apiKeyHeaderName = cfg.apiKeyHeaderName;
this.apiKeyHeaderValue = cfg.apiKeyHeaderValue;
}
addAuthenticationToRequestOptions(requestOptions) {
requestOptions.headers[this.apiKeyHeaderName] = this.apiKeyHeaderValue;
}
}
exports.ApiKeyRestClient = ApiKeyRestClient;