Skip to content

Commit 7fcfac4

Browse files
committed
fix: Add namespace support for AppRole auth
Signed-off-by: Hiram J. Pérez <hi@worg.xyz>
1 parent 2fe0ec9 commit 7fcfac4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/auth/VaultAppRoleAuth.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@ class VaultAppRoleAuth extends VaultBaseAuth {
1616

1717
this.__roleId = config.role_id;
1818
this.__secretId = config.secret_id;
19+
this.__namespace = config.namespace;
1920
}
2021

2122
_authenticate() {
2223
this._log.info(
2324
'making authentication request: role_id=%s',
2425
this.__roleId
2526
);
27+
28+
const headers = {};
29+
if (this.__namespace) {
30+
headers['X-Vault-Namespace'] = this.__namespace;
31+
}
32+
2633
return this.__apiClient.makeRequest('POST', `/auth/${this._mount}/login`, {
2734
role_id: this.__roleId,
2835
secret_id: this.__secretId,
29-
}).then(res => {
36+
}, headers).then(res => {
3037
this._log.debug(
3138
'receive token: %s',
3239
res.auth.client_token

0 commit comments

Comments
 (0)