diff --git a/src/VaultClient.js b/src/VaultClient.js index 5ccb82e..a2ae3a2 100644 --- a/src/VaultClient.js +++ b/src/VaultClient.js @@ -147,7 +147,7 @@ class VaultClient { api, this.__log, authConfig.config, - authConfig.mount, + authConfig.mount ); } diff --git a/src/auth/VaultKubernetesAuth.js b/src/auth/VaultKubernetesAuth.js index ade36f7..bbc8819 100644 --- a/src/auth/VaultKubernetesAuth.js +++ b/src/auth/VaultKubernetesAuth.js @@ -24,7 +24,7 @@ class VaultKubernetesAuth extends VaultBaseAuth { return readFile(this.__filePath) .then((jwt) => { - this.__apiClient.makeRequest('POST', `/auth/${this._mount}/login`, { + return this.__apiClient.makeRequest('POST', `/auth/${this._mount}/login`, { role: this.__role, jwt, }); diff --git a/src/utils/readFile.js b/src/utils/readFile.js index 35c20b6..93a29ca 100644 --- a/src/utils/readFile.js +++ b/src/utils/readFile.js @@ -2,6 +2,8 @@ const { readFile } = require('fs'); module.exports = function (filePath) { return new Promise((resolve, reject) => { - readFile(filePath, (err, data) => (err ? reject(err) : resolve(data))); + readFile(filePath, (err, data) => { + return err ? reject(err) : resolve(data.toString()); + }); }); };