UNPKG

@elastic.io/odata-library

Version:
18 lines (15 loc) 456 B
/* 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, }; } };