Skip to content

Commit

Permalink
feat: add security warning (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc authored Sep 29, 2021
1 parent 9f5bdeb commit a4e35f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion messages/display.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"description": "displays information about a user of a scratch org\nOutput includes the profile name, org ID, access token, instance URL, login URL, and alias if applicable.",
"examples": ["sfdx force:user:display", "sfdx force:user:display -u [email protected] --json"],
"accessTokenError": "This command doesn't accept an access token for a username.",
"accessTokenAction": "Specify a username or an alias."
"accessTokenAction": "Specify a username or an alias.",
"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/commands/force/user/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export class UserDisplayCommand extends SfdxCommand {
result.password = userAuthData.password;
}

this.ux.warn(messages.getMessage('securityWarning'));
this.ux.log('');
this.print(result);

return result;
Expand Down

0 comments on commit a4e35f9

Please sign in to comment.