File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ module.exports = (config = {}) => {
6969 client . pathPrefix = config . pathPrefix || process . env . VAULT_PREFIX || '' ;
7070 client . token = config . token || process . env . VAULT_TOKEN ;
7171 client . noCustomHTTPVerbs = config . noCustomHTTPVerbs || false ;
72+ client . namespace = config . namespace || process . env . VAULT_NAMESPACE ;
7273
7374 const requestSchema = {
7475 type : 'object' ,
@@ -94,6 +95,9 @@ module.exports = (config = {}) => {
9495 if ( typeof client . token === 'string' && client . token . length ) {
9596 options . headers [ 'X-Vault-Token' ] = options . headers [ 'X-Vault-Token' ] || client . token ;
9697 }
98+ if ( typeof client . namespace === 'string' && client . namespace . length ) {
99+ options . headers [ 'X-Vault-Namespace' ] = client . namespace ;
100+ }
97101 options . uri = uri ;
98102 debug ( options . method , uri ) ;
99103 if ( options . json ) debug ( options . json ) ;
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ describe('node-vault', () => {
125125 const vaultConfig = {
126126 endpoint : 'http://localhost:8200' ,
127127 token : '123' ,
128+ namespace : 'test' ,
128129 'request-promise' : {
129130 defaults : ( ) => request , // dependency injection of stub
130131 } ,
You can’t perform that action at this time.
0 commit comments