Skip to content

Commit c55e043

Browse files
yaroslav-codefreshpasha-codefresh
authored andcommitted
Revert "decrypt option added (#230)" (#232)
This reverts commit c6c2bf6
1 parent f979cd7 commit c55e043

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

lib/interface/cli/commands/context/get.cmd.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ const command = new Command({
2727
describe: 'Context type',
2828
choices: ['config', 'secret', 'helm-repository', 'yaml', 'secret-yaml', 'git'],
2929
})
30-
.option('decrypt', {
31-
describe: 'Either to show decoded credentials or not',
32-
})
3330
.example('codefresh get context NAME', 'Get context NAME')
3431
.example('codefresh get contexts', 'Get all contexts')
35-
.example('codefresh get context --decrypt', 'Get all contexts with credentials decrypted')
3632
.example('codefresh get context --type secret', 'Get all secret contexts')
3733
.example('codefresh get context --type git.github', 'Get all git based contexts for github kind')
3834
.example('codefresh get context --type helm-repository', 'Get all helm-repository contexts');
@@ -43,12 +39,11 @@ const command = new Command({
4339
if (argv.type) {
4440
data.type = argv.type;
4541
}
46-
data.decrypt = argv.decrypt;
4742

4843
let contexts = [];
4944
if (!_.isEmpty(names)) {
5045
for (const name of names) {
51-
const currContext = await context.getContextByName(name, data.decrypt);
46+
const currContext = await context.getContextByName(name);
5247
contexts.push(currContext);
5348
}
5449
} else {

lib/interface/functional/context/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ const TYPE_CHOICES = [
1919
'secret-yaml',
2020
];
2121

22-
const getContext = async (name, decrypt = false) => {
22+
const getContext = async (name) => {
2323
if (!name) {
2424
throw new CFError('Name must be provided');
2525
}
2626

2727
try {
28-
return context.getContextByName(name, decrypt);
28+
return context.getContextByName(name);
2929
} catch (err) {
3030
throw new CFError({
3131
cause: err,
@@ -34,8 +34,8 @@ const getContext = async (name, decrypt = false) => {
3434
}
3535
};
3636

37-
const getAllContexts = async (type = null, decrypt = false) => {
38-
const data = { decrypt };
37+
const getAllContexts = async (type = null) => {
38+
const data = {};
3939
if (type) {
4040
data.type = type;
4141
}

lib/logic/api/context.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ const applyByName = async (name, data) => {
4646
return sendHttpRequest(options);
4747
};
4848

49-
const getContextByName = async (name, decrypt) => {
49+
const getContextByName = async (name) => {
5050
const options = {
5151
url: `/api/contexts/${name}`,
5252
method: 'GET',
53-
qs: { decrypt: decrypt || undefined }, // falsy resolves to decryption, undefined not
5453
};
5554

5655
const context = await sendHttpRequest(options);
@@ -62,10 +61,7 @@ const getContexts = async (info) => {
6261
const userOptions = {
6362
url: '/api/contexts',
6463
method: 'GET',
65-
qs: {
66-
type: info.type,
67-
decrypt: info.decrypt || undefined, // falsy resolves to decryption, undefined not
68-
},
64+
qs: _.pick(info, 'type'),
6965
};
7066

7167
const result = await sendHttpRequest(userOptions);

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.8.85",
3+
"version": "0.8.87",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)