Skip to content

Commit 38a64d0

Browse files
chore: changes to clearargs (#2010)
1 parent 09b2851 commit 38a64d0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/cli/src/__tests__/utils.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,19 @@ describe('cleanArgs', () => {
545545
config: './fixtures/redocly.yaml',
546546
apis: ['main@v1', 'fixtures/openapi.yaml', 'http://some.url/openapi.yaml'],
547547
format: 'codeframe',
548+
input: 'some-input',
549+
'client-cert': 'some-client-cert',
550+
'client-key': 'some-client-key',
551+
'ca-cert': 'some-ca-cert',
548552
};
549553
expect(cleanArgs(testArgs)).toEqual({
550554
config: 'file-yaml',
551555
apis: ['api-name@api-version', 'file-yaml', 'http://url'],
552556
format: 'codeframe',
557+
input: '***',
558+
'client-cert': '***',
559+
'client-key': '***',
560+
'ca-cert': '***',
553561
});
554562
});
555563
it('should remove potentially sensitive data from a push destination', () => {

packages/cli/src/utils/miscellaneous.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ function cleanString(value?: string): string | undefined {
647647
}
648648

649649
export function cleanArgs(args: CommandOptions) {
650-
const keysToClean = ['organization', 'o'];
650+
const keysToClean = ['organization', 'o', 'input', 'i', 'client-cert', 'client-key', 'ca-cert'];
651651

652652
const result: Record<string, unknown> = {};
653653
for (const [key, value] of Object.entries(args)) {
@@ -661,6 +661,7 @@ export function cleanArgs(args: CommandOptions) {
661661
result[key] = value;
662662
}
663663
}
664+
664665
return result;
665666
}
666667

0 commit comments

Comments
 (0)