Skip to content

Commit ae393c3

Browse files
AST-180812 - Remove clearApiKey so sign-out uses auth logout
An empty configure set is not the CLI logout. authLogout already runs cx auth logout, which clears the stored login. Signed-off-by: Rahul Pidde <206018639+cx-rahul-pidde@users.noreply.github.com>
1 parent a12f426 commit ae393c3

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

‎src/main/wrapper/CxWrapper.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ export class CxWrapper {
126126
return this.setApiKeyProperty(apiKey);
127127
}
128128

129-
/** Removes the CLI's own login by setting cx_apikey to an empty value. */
130-
async clearApiKey(): Promise<CxCommandOutput> {
131-
return this.setApiKeyProperty("");
132-
}
133-
134129
private async setApiKeyProperty(value: string): Promise<CxCommandOutput> {
135130
const commands: string[] = [
136131
CxConstants.CMD_CONFIGURE,

‎src/tests/ConfigureApiKeyTest.test.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ describe("Configure API key", () => {
3636
["configure", "set", "--prop-name", "cx_apikey", "--prop-value", secret]);
3737
});
3838

39-
it('clearApiKey sets cx_apikey to an empty value', async () => {
40-
const spy = stubSensitiveCommands();
41-
42-
await wrapper().clearApiKey();
43-
44-
expect(spy).toHaveBeenCalledWith(process.execPath,
45-
["configure", "set", "--prop-name", "cx_apikey", "--prop-value", ""]);
46-
});
47-
4839
it('authLogout runs auth logout without credentials', async () => {
4940
const done = new CxCommandOutput();
5041
done.exitCode = 0;

0 commit comments

Comments
 (0)