feat(authenticate): add approle auth method (#10)

* feat(authenticate): add approle auth method

* docs(readme): update readme

* fix: update index.js

* fix: update got to 10.2.2 to fix ncc

* chore: clean up code slightly

* chore: update tests to use got correctly

* chore(test): fix integration tests

* chore: streamline method logic

* chore: make role and secret required in approle

Co-authored-by: Sébastien FAUVART <sebastien.fauvart@gmail.com>
Co-authored-by: Richard Simpson <richardsimpson@outlook.com>
This commit is contained in:
Antoine Méausoone 2020-01-29 02:10:19 +01:00 committed by GitHub
parent 7a9634236c
commit 3b9239de79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 2981 additions and 2159 deletions

View file

@ -14,12 +14,11 @@ const got = require('got');
headers: {
'X-Vault-Token': 'testtoken',
},
body: {
json: {
data: {
secret: 'SUPERSECRET',
},
},
json: true,
});
await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/data/nested/test`, {
@ -27,12 +26,11 @@ const got = require('got');
headers: {
'X-Vault-Token': 'testtoken',
},
body: {
json: {
data: {
otherSecret: 'OTHERSUPERSECRET',
},
},
json: true,
});
} catch (error) {
console.log(error);