Skip to content

Commit

Permalink
Fix K8S auth (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Lototskiy <[email protected]>
  • Loading branch information
maltez authored and vzholudev committed Nov 21, 2019
1 parent 1d6ebd4 commit 7560236
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/VaultClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class VaultClient {
api,
this.__log,
authConfig.config,
authConfig.mount,
authConfig.mount
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/auth/VaultKubernetesAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
4 changes: 3 additions & 1 deletion src/utils/readFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
});
};

0 comments on commit 7560236

Please sign in to comment.