Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.15.3
v10.23.0
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@ const CFError = require('cf-errors');
const cmd = require('../base.cmd');
const { sdk } = require('../../../../../../../logic');

function buildAuthObject({ token, username, password, roleId, secretId, loginPath, gcpRole, kubernetesRole, kubernetesJwt }) {
const mountPoint = loginPath ? { mount_point: loginPath } : {};
function buildAuthObject({ loginPath, namespace, token, username, password, roleId, secretId, gcpRole, kubernetesRole, kubernetesJwt }) {
const baseAuth = {
...(loginPath && { mount_point: loginPath }),
...(namespace && { namespace }),
};
if (token) {
return { type: 'token', token, ...mountPoint };
return { type: 'token', token, ...baseAuth };
}

if (username && password) {
return { type: 'userpass', username, password, ...mountPoint };
return { type: 'userpass', username, password, ...baseAuth };
}

if (roleId && secretId) {
return { type: 'approle', role_id: roleId, secret_id: secretId, ...mountPoint };
return { type: 'approle', role_id: roleId, secret_id: secretId, ...baseAuth };
}

if (gcpRole) {
return { type: 'gcp', roleType: 'gce', role: gcpRole, ...mountPoint };
return { type: 'gcp', roleType: 'gce', role: gcpRole, ...baseAuth };
}

if (kubernetesRole) {
return {
type: 'kubernetes',
role: kubernetesRole,
...(kubernetesJwt && { jwt: kubernetesJwt }),
...mountPoint,
...baseAuth,
};
}

Expand Down Expand Up @@ -61,6 +64,11 @@ const command = new Command({
describe: 'Path for given auth method. Leave out to use the default path for the type.',
type: 'string',
})
.option('namespace', {
alias: 'n',
describe: 'Namespace is only valid for Vault Enterprise instances',
type: 'string',
})
.option('token', {
alias: 't',
describe: 'Token',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.75.12",
"version": "0.75.13",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down