Skip to content

Commit 922f70c

Browse files
tegefaulkesCMCDragonkai
authored andcommitted
fix: polykey secrets get command was not returning the secret's contents
[ci skip]
1 parent 47cc3a9 commit 922f70c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bin/secrets/CommandGet.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class CommandGet extends CommandPolykey {
6464
(auth) => pkClient.grpcClient.vaultsSecretsGet(secretMessage, auth),
6565
meta,
6666
);
67+
const secretContent = Buffer.from(response.getSecretContent_asU8())
68+
.toString('utf-8')
69+
.trim();
6770
if (isEnv) {
6871
process.stdout.write(
6972
binUtils.outputFormatter({
@@ -72,17 +75,15 @@ class CommandGet extends CommandPolykey {
7275
`Export ${secretMessage
7376
.getSecretName()
7477
.toUpperCase()
75-
.replace('-', '_')}='${response.getSecretName()}`,
78+
.replace('-', '_')}='${secretContent}'`,
7679
],
7780
}),
7881
);
7982
} else {
8083
process.stdout.write(
8184
binUtils.outputFormatter({
8285
type: options.format === 'json' ? 'json' : 'list',
83-
data: [
84-
`${secretMessage.getSecretName()}:\t\t${response.getSecretName()}`,
85-
],
86+
data: [`${secretMessage.getSecretName()}: ${secretContent}`],
8687
}),
8788
);
8889
}

0 commit comments

Comments
 (0)