Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Remove Passwords generate
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam.abdulsalam committed Jan 15, 2021
1 parent fd0ee01 commit 62eab25
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 60 deletions.
2 changes: 1 addition & 1 deletion packages/sfpowerscripts-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sfpowerscripts-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dxatscale/sfpowerscripts",
"description": "Simple wrappers around sfdx commands to help set up CI/CD quickly",
"version": "1.6.9",
"version": "1.6.10",
"author": "dxatscale",
"bin": {
"readVars": "./scripts/readVars.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function loadSFDX() {
let user_plugin_path="";
try {
salesforce_alm_path = path.dirname(require.resolve("salesforce-alm"));
user_plugin_path=path.dirname(path.join(__dirname,`../../../../node_modules/@salesforce/plugin-user/lib/package.json`));
} catch (error) {
console.log(error);
throw error;
Expand All @@ -17,9 +16,5 @@ export function loadSFDX() {
namespace: "force"
});

registerNamespace({
commandsDir: path.join(user_plugin_path, "commands"),
namespace: "force",
additionalNameSpace:"userplugin"
});

}
Original file line number Diff line number Diff line change
Expand Up @@ -154,59 +154,10 @@ export default class ScratchOrgUtils {
scratchOrg.username
);

//Generate Password
let passwordResult = await sfdx.userplugin.user.password.generate({
quiet: true,
targetusername: scratchOrg.username,
targetdevhubusername: hubOrg.getUsername(),
});
scratchOrg.password = passwordResult.password;


return scratchOrg;
}

public static async shareScratchOrgThroughEmail(
emailId: string,
scratchOrg: ScratchOrg,
hubOrg: Org
) {
let hubOrgUserName = hubOrg.getUsername();
let body = `${hubOrgUserName} has fetched a new scratch org from the Scratch Org Pool!\n
All the post scratch org scripts have been succesfully completed in this org!\n
The Login url for this org is : ${scratchOrg.loginURL}\n
Username: ${scratchOrg.username}\n
Password: ${scratchOrg.password}\n
Please use sfdx force:auth:web:login -r ${scratchOrg.loginURL} -a <alias> command to authenticate against this Scratch org</p>
Thank you for using sfpowerkit!`;

const options = {
method: "post",
body: JSON.stringify({
inputs: [
{
emailBody: body,
emailAddresses: emailId,
emailSubject: `${hubOrgUserName} created you a new Salesforce org`,
senderType: "CurrentUser",
},
],
}),
url: "/services/data/v50.0/actions/standard/emailSimple",
};

await retry(
async (bail) => {
await hubOrg.getConnection().request(options);
},
{ retries: 3, minTimeout: 30000 }
);

SFPLogger.log(
`Succesfully send email to ${emailId} for ${scratchOrg.username}`
);
}


public static async getScratchOrgRecordId(
scratchOrgs: ScratchOrg[],
hubOrg: Org
Expand Down
3 changes: 1 addition & 2 deletions packages/sfpowerscripts-cli/src/impl/prepare/PrepareImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,7 @@ export default class PrepareImpl {
Pooltag__c: this.poolConfig.pool.tag,
Allocation_status__c: ScratchOrgUtils.isNewVersionCompatible
? "Available"
: "",
Password__c: scratchOrg.password,
: ""
},
this.hubOrg
);
Expand Down

0 comments on commit 62eab25

Please sign in to comment.