Skip to content

Commit 0bec1be

Browse files
authored
CR-4721 - support Vault namespace (#650)
* add namespace flag to vault creation * updated package version to 0.75.13
1 parent 7077622 commit 0bec1be

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v10.15.3
1+
v10.23.0

lib/interface/cli/commands/context/create/secret-store/types/hashicorp-vault.cmd.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,33 @@ const CFError = require('cf-errors');
33
const cmd = require('../base.cmd');
44
const { sdk } = require('../../../../../../../logic');
55

6-
function buildAuthObject({ token, username, password, roleId, secretId, loginPath, gcpRole, kubernetesRole, kubernetesJwt }) {
7-
const mountPoint = loginPath ? { mount_point: loginPath } : {};
6+
function buildAuthObject({ loginPath, namespace, token, username, password, roleId, secretId, gcpRole, kubernetesRole, kubernetesJwt }) {
7+
const baseAuth = {
8+
...(loginPath && { mount_point: loginPath }),
9+
...(namespace && { namespace }),
10+
};
811
if (token) {
9-
return { type: 'token', token, ...mountPoint };
12+
return { type: 'token', token, ...baseAuth };
1013
}
1114

1215
if (username && password) {
13-
return { type: 'userpass', username, password, ...mountPoint };
16+
return { type: 'userpass', username, password, ...baseAuth };
1417
}
1518

1619
if (roleId && secretId) {
17-
return { type: 'approle', role_id: roleId, secret_id: secretId, ...mountPoint };
20+
return { type: 'approle', role_id: roleId, secret_id: secretId, ...baseAuth };
1821
}
1922

2023
if (gcpRole) {
21-
return { type: 'gcp', roleType: 'gce', role: gcpRole, ...mountPoint };
24+
return { type: 'gcp', roleType: 'gce', role: gcpRole, ...baseAuth };
2225
}
2326

2427
if (kubernetesRole) {
2528
return {
2629
type: 'kubernetes',
2730
role: kubernetesRole,
2831
...(kubernetesJwt && { jwt: kubernetesJwt }),
29-
...mountPoint,
32+
...baseAuth,
3033
};
3134
}
3235

@@ -61,6 +64,11 @@ const command = new Command({
6164
describe: 'Path for given auth method. Leave out to use the default path for the type.',
6265
type: 'string',
6366
})
67+
.option('namespace', {
68+
alias: 'n',
69+
describe: 'Namespace is only valid for Vault Enterprise instances',
70+
type: 'string',
71+
})
6472
.option('token', {
6573
alias: 't',
6674
describe: 'Token',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.75.12",
3+
"version": "0.75.13",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)