Skip to content

Commit

Permalink
feat: warning label for source:open (#231)
Browse files Browse the repository at this point in the history
* feat: warning label for source:open

* test: remote testProj
  • Loading branch information
mshanemc authored Sep 29, 2021
1 parent 6b6153b commit 62c7161
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion messages/open.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 2 additions & 0 deletions src/formatters/openResultFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 62c7161

Please sign in to comment.