Skip to content

Commit 9f7c81b

Browse files
authored
Merge branch 'master' into master
2 parents 779a832 + 18597dd commit 9f7c81b

File tree

6 files changed

+66
-13
lines changed

6 files changed

+66
-13
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ Now you are able to run all of the other [examples]:
9393
node example/policies.js
9494
```
9595

96-
##Connecting to vault through a bastion host
96+
## Connecting to vault through a bastion host
97+
9798
To connect to a vault server in a private network with a bastion host, you'll need to first open a connection:
9899
```bash
99100
ssh -D <socks4Port> bastion.example.com
@@ -111,7 +112,9 @@ const options = {
111112

112113
const vault = require('node-vault')(options);
113114
```
115+
114116
[![Backers](https://opencollective.com/node-vault/tiers/backers.svg?avatarHeight=80&width=600)](https://opencollective.com/node-vault/contribute)
117+
115118
[examples]: https://github.com/kr1sp1n/node-vault/tree/master/example
116119
[docker-compose.yml]: https://github.com/kr1sp1n/node-vault/tree/master/docker-compose.yml
117120
[Vault]: https://vaultproject.io/

features.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
`POST /auth/{{mount_point}}{{^mount_point}}kubernetes{{/mount_point}}/login`
173173

174174

175+
## vault.awsIamLogin
176+
177+
`POST /auth/{{mount_point}}{{^mount_point}}aws{{/mount_point}}/login`
178+
179+
175180
## vault.userpassLogin
176181

177182
`POST /auth/{{mount_point}}{{^mount_point}}userpass{{/mount_point}}/login/{{username}}`

index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ declare namespace NodeVault {
6969
revoke(options?: Option): Promise<any>;
7070
revokePrefix(options?: Option): Promise<any>;
7171
rotate(options?: Option): Promise<any>;
72+
gcpLogin(options?: Option): Promise<any>;
7273
githubLogin(options?: Option): Promise<any>;
7374
userpassLogin(options?: Option): Promise<any>;
7475
kubernetesLogin(options?: Option): Promise<any>;
76+
awsIamLogin(options?: Option): Promise<any>;
7577
tokenAccessors(options?: Option): Promise<any>;
7678
tokenCreate(options?: Option): Promise<any>;
7779
tokenCreateOrphan(options?: Option): Promise<any>;
@@ -121,6 +123,9 @@ declare namespace NodeVault {
121123

122124
apiVersion?: string;
123125
endpoint?: string;
126+
namespace?: string;
127+
noCustomHTTPVerbs?: boolean;
128+
pathPrefix?: string;
124129
token?: string;
125130
requestOptions?: request.CoreOptions;
126131
}

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-vault",
3-
"version": "0.9.18",
3+
"version": "0.9.22",
44
"description": "Javascript client for HashiCorp's Vault",
55
"main": "./src/index.js",
66
"scripts": {
@@ -64,14 +64,17 @@
6464
"Charles Phillips (https://github.com/doublerebel)",
6565
"David Drewery (https://github.com/EXPEddrewery)",
6666
"Dustin (https://github.com/at88mph)",
67+
"Jason Nguyen (https://github.com/gofightnguyen)",
6768
"Jeff Sisson (https://github.com/saranrapjs)",
6869
"Jonathan Bastnagel (https://github.com/inkadnb)",
6970
"Julian Amelung (https://github.com/julianbei)",
7071
"Karthik Kumar Viswanathan (https://github.com/guilt)",
72+
"Kevin Stiehl (https://github.com/kstiehl)",
7173
"Konstantin Matsiushonak (https://github.com/kakoc)",
7274
"Mario Pareja (https://github.com/mpareja)",
7375
"Mark Frost (https://github.com/frostmar)",
7476
"Owen Farrell (https://github.com/owenfarrell)",
77+
"Parker Johansen (https://github.com/auroq)",
7578
"Patrick Rainier Juen (https://github.com/uLan08)",
7679
"Phred Lane (https://github.com/fearphage)",
7780
"Ryan Lewis (https://github.com/ryanlewis)",
@@ -84,7 +87,9 @@
8487
"Tom Vogel (https://github.com/tavogel)",
8588
"Trevor Robinson (https://github.com/trevorr)",
8689
"Vineet Bhatia (https://github.com/firefoxNX)",
87-
"Vladyslav Mashkin (https://github.com/jsdream)"
90+
"Vladyslav Mashkin (https://github.com/jsdream)",
91+
"Wes Novack (https://github.com/wes-novack)",
92+
"Zach Lintz (https://github.com/zlintz)"
8893
],
8994
"license": "MIT",
9095
"bugs": {

src/commands.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,41 @@ module.exports = {
474474
res: tokenResponse,
475475
},
476476
},
477+
awsIamLogin: {
478+
method: 'POST',
479+
path: '/auth/{{mount_point}}{{^mount_point}}aws{{/mount_point}}/login',
480+
tokenSource: true,
481+
schema: {
482+
req: {
483+
type: 'object',
484+
properties: {
485+
role: {
486+
type: 'string',
487+
},
488+
iam_http_request_method: {
489+
type: 'string',
490+
},
491+
iam_request_url: {
492+
type: 'string',
493+
},
494+
iam_request_body: {
495+
type: 'string',
496+
},
497+
iam_request_headers: {
498+
type: 'string',
499+
},
500+
},
501+
required: [
502+
'role',
503+
'iam_http_request_method',
504+
'iam_request_url',
505+
'iam_request_body',
506+
'iam_request_headers',
507+
],
508+
},
509+
res: tokenResponse,
510+
},
511+
},
477512
userpassLogin: {
478513
method: 'POST',
479514
path: '/auth/{{mount_point}}{{^mount_point}}userpass{{/mount_point}}/login/{{username}}',

src/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

3-
let debug = require('debug')('node-vault');
4-
let tv4 = require('tv4');
5-
let commands = require('./commands.js');
6-
let mustache = require('mustache');
7-
let rp = require('request-promise-native');
3+
const originalDebug = require('debug')('node-vault');
4+
const originalTv4 = require('tv4');
5+
const originalCommands = require('./commands.js');
6+
const originalMustache = require('mustache');
7+
const originalRp = require('request-promise-native');
88

99
class VaultError extends Error {}
1010

@@ -20,10 +20,10 @@ class ApiResponseError extends VaultError {
2020

2121
module.exports = (config = {}) => {
2222
// load conditional dependencies
23-
debug = config.debug || debug;
24-
tv4 = config.tv4 || tv4;
25-
commands = config.commands || commands;
26-
mustache = config.mustache || mustache;
23+
const debug = config.debug || originalDebug;
24+
const tv4 = config.tv4 || originalTv4;
25+
const commands = config.commands || originalCommands;
26+
const mustache = config.mustache || originalMustache;
2727

2828
const rpDefaults = {
2929
json: true,
@@ -38,7 +38,7 @@ module.exports = (config = {}) => {
3838
});
3939
}
4040

41-
rp = (config['request-promise'] || rp).defaults(rpDefaults);
41+
const rp = (config['request-promise'] || originalRp).defaults(rpDefaults);
4242
const client = {};
4343

4444
function handleVaultResponse(response) {

0 commit comments

Comments
 (0)