From 626eb2a7259358d5fc358ba0169874135556cb6e Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 29 Sep 2021 08:44:57 -0500 Subject: [PATCH 1/2] feat: warning label for source:open --- messages/open.json | 3 ++- src/formatters/openResultFormatter.ts | 2 ++ testProj2 | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 160000 testProj2 diff --git a/messages/open.json b/messages/open.json index 0b58e04bf..478d967b7 100644 --- a/messages/open.json +++ b/messages/open.json @@ -13,5 +13,6 @@ "SourceOpenPathDescription": "generate a navigation URL; don’t launch the editor", "SourceOpenCommandHumanSuccess": "Access org %s as user %s with the following URL: %s", "SourceOpenCommandTimeoutError": "Timeout error", - "SourceOpenCommandError": "Open failed" + "SourceOpenCommandError": "Open failed", + "SecurityWarning": "This command will expose sensitive information that allows for subsequent activity using your current authenticated session.\nSharing this information is equivalent to logging someone in under the current credential, resulting in unintended access and escalation of privilege.\nFor additional information, please review the authorization section of the https://developer.salesforce.com/docs/atlas.en-us.234.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm" } diff --git a/src/formatters/openResultFormatter.ts b/src/formatters/openResultFormatter.ts index 1b1090719..ffd601a59 100644 --- a/src/formatters/openResultFormatter.ts +++ b/src/formatters/openResultFormatter.ts @@ -32,6 +32,8 @@ export class OpenResultFormatter extends ResultFormatter { public display(): void { if (this.isSuccess()) { + this.ux.warn(messages.getMessage('SecurityWarning')); + this.ux.log(); const { orgId, username, url } = this.result; this.ux.log(messages.getMessage('SourceOpenCommandHumanSuccess', [orgId, username, url])); } else { diff --git a/testProj2 b/testProj2 new file mode 160000 index 000000000..b6239047d --- /dev/null +++ b/testProj2 @@ -0,0 +1 @@ +Subproject commit b6239047d6e3cf9f747c72ba6679ac49dd628c1d From f4a4de02569dd4ed42b26586d9f048d4b3c40bab Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 29 Sep 2021 08:59:42 -0500 Subject: [PATCH 2/2] test: remote testProj --- testProj2 | 1 - 1 file changed, 1 deletion(-) delete mode 160000 testProj2 diff --git a/testProj2 b/testProj2 deleted file mode 160000 index b6239047d..000000000 --- a/testProj2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b6239047d6e3cf9f747c72ba6679ac49dd628c1d