Skip to content

Commit

Permalink
WIP: auth typo
Browse files Browse the repository at this point in the history
  • Loading branch information
myoung34 committed Sep 26, 2017
1 parent 0566dfd commit 966fcc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions handlers/shipElasticsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ exports.process = function(config) {
host: config.elasticsearch.host
};

if (config.elasticsearch.httpAuth) {
esConfig.httpAuth = config.elasticsearch.httpAuth;
if (config.elasticsearch.auth) {
esConfig.auth = config.elasticsearch.auth;
}

if (config.elasticsearch.protocol) {
Expand Down
8 changes: 4 additions & 4 deletions test/shipElasticsearch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('handler/shipElasticsearch.js', function() {
function(done) {
var config = {
elasticsearch: {
httpAuth: 'asdf:wut',
auth: 'asdf:wut',
protocol: 'https',
port: '9200',
index: 'index',
Expand All @@ -34,8 +34,8 @@ describe('handler/shipElasticsearch.js', function() {
};
var es = require('elasticsearch');
es.Client = function(config) {
assert.strictEqual(config.httpAuth, 'asdf:wut',
'httpAuth param provided');
assert.strictEqual(config.auth, 'asdf:wut',
'auth param provided');
assert.strictEqual(config.protocol, 'https',
'protocol param provided');
assert.strictEqual(config.port, '9200',
Expand All @@ -52,7 +52,7 @@ describe('handler/shipElasticsearch.js', function() {
var es = require('elasticsearch');
es.Client = function(config) {
assert.strictEqual(config.host, 'http://mock', 'host param provided');
assert.strictEqual(config.httpAuth, undefined);
assert.strictEqual(config.auth, undefined);
assert.strictEqual(config.port, undefined);
assert.strictEqual(config.protocol, undefined);
return {
Expand Down

0 comments on commit 966fcc2

Please sign in to comment.