Skip to content

Commit 851ac03

Browse files
authored
Merge pull request #200 from salesforcecli/sm/security-warnings
Sm/security-warnings
2 parents a7bdcb3 + e6f6ac2 commit 851ac03

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

messages/messages.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
"AlphaNumericNameError": "Name must contain only alphanumeric characters.",
1919
"NameMustStartWithLetterError": "Name must start with a letter.",
2020
"EndWithUnderscoreError": "Name can't end with an underscore.",
21-
"DoubleUnderscoreError": "Name can't contain 2 consecutive underscores."
21+
"DoubleUnderscoreError": "Name can't contain 2 consecutive underscores.",
22+
23+
"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"
2224
}

src/commands/force/org/display.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { OrgListUtil } from '../../../shared/orgListUtil';
1717

1818
Messages.importMessagesDirectory(__dirname);
1919
const messages = Messages.loadMessages('@salesforce/plugin-org', 'display');
20-
20+
const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
2121
export class OrgDisplayCommand extends SfdxCommand {
2222
public static readonly description = messages.getMessage('description');
2323
public static readonly examples = messages.getMessage('examples').split(os.EOL);
@@ -68,6 +68,8 @@ export class OrgDisplayCommand extends SfdxCommand {
6868
}
6969

7070
private print(result: OrgDisplayReturn): void {
71+
this.ux.warn(sharedMessages.getMessage('SecurityWarning'));
72+
this.ux.log('');
7173
const columns = {
7274
columns: [
7375
{ key: 'key', label: 'KEY' },

src/commands/force/org/open.ts

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { openUrl } from '../../../shared/utils';
1313

1414
Messages.importMessagesDirectory(__dirname);
1515
const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
16+
const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
17+
1618
export class OrgOpenCommand extends SfdxCommand {
1719
public static readonly description = messages.getMessage('description');
1820
public static readonly examples = messages.getMessage('examples').split(EOL);
@@ -37,6 +39,9 @@ export class OrgOpenCommand extends SfdxCommand {
3739
const username = this.org.getUsername();
3840
const output = { orgId, url, username };
3941

42+
this.ux.warn(sharedMessages.getMessage('SecurityWarning'));
43+
this.ux.log('');
44+
4045
if (new Env().getBoolean('SFDX_CONTAINER_MODE')) {
4146
// instruct the user that they need to paste the URL into the browser
4247
this.ux.styledHeader('Action Required!');

0 commit comments

Comments
 (0)