@elastic.io/odata-library
Version:
Re-usable OData client library
18 lines (15 loc) • 456 B
JavaScript
/* eslint-disable no-param-reassign */
const NoAuthRestClient = require('./NoAuthRestClient.js');
module.exports = class BasicAuthRestClient extends NoAuthRestClient {
constructor(emitter, cfg) {
super(emitter, cfg);
this.username = cfg.username;
this.password = cfg.password;
}
_addAuthenticationToRequestOptions(requestOptions) {
requestOptions.auth = {
username: this.username,
password: this.password,
};
}
};