Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update generate password functionality #432

Merged
merged 11 commits into from
Jul 13, 2021
Merged

Conversation

vamsimundra
Copy link
Contributor

What does this PR do?
Changed the functionality of password:generate command. Now generating the password with the Profile Password policies and Organization Password Policies

What issues does this PR fix or reference?
@W-5829533@

src/user.ts Outdated
public static generatePasswordUtf8(): SecureBuffer<void> {
// one character of each of the 4 types followed by the remaining random characters, then quasi-randomize
public static generatePasswordUtf8(
passwordCondition: PasswordConditions = { length: 10, complexity: 1 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current behavior: passwordLength is 13 (it was 10 at the time the issue was filed). Let's leave it at 13 to avoid breaking changes.

src/user.ts Outdated
// one character of each of the 4 types followed by the remaining random characters, then quasi-randomize
public static generatePasswordUtf8(
passwordCondition: PasswordConditions = { length: 10, complexity: 1 }
): SecureBuffer<void> {
const ALLCHARS = UPPER.concat(LOWER, NUMBERS, SYMBOLS.join(''));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllChars was originally created to satisfy the maximum password complexity. But, in the new model, if they only need lowercase letters, then ALLCHARS shouldn't include any UPPERS/NUMBERS/SYMBOLS.

In fact, since the complexity-based arrays are meeting the minimum complexity requirement, we could use a bunch of lowercase letters to complete the remaining length requirement and still have an acceptable password.

this line

.map(() => ALLCHARS[rand(ALLCHARS)])

could just use LOWER instead.

src/user.ts Outdated
Array(PASSWORD_LENGTH - 4)
let password: string[] = [];

// Required number of Lower letter characters. one character of each of the 4 types followed by the remaining random characters, then quasi-randomize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this feels like it could be simpler with booleans. They all require 1 or 0, nothing higher than 1.

So, for example

if (PASSWORD_COMPLEXITY[passwordCondition.complexity].LOWER) {
    password.push(LOWER[rand(LOWER)])
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another idea would be to iterate the types to avoid the repetition, something like

[SYMBOLS,NUMBERS,UPPER,LOWER].forEach( charSet => {
    if (PASSWORD_COMPLEXITY[passwordCondition.complexity][charSet]) {
        password.push(charType[rand(charSet)])
    }
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally, we could generate the right length of password from the start (length randow lowercase characters) then overwrite it with whatever other characters are requied and then shuffle that.

Then there's a chance (for cases 0 and 1) where no changes have to be made at all (all the requirements were false)

src/user.ts Outdated
}

const PASSWORD_COMPLEXITY: { [index: string]: Complexity } = {
'0': { LOWER: 0, UPPER: 0, NUMBERS: 0, SYMBOLS: 0 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely feels like booleans

src/user.ts Outdated
const LOWER = 'abcdefghijklmnopqrstuvwxyz';
const UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const NUMBERS = '1234567890';
const SYMBOLS = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '[', ']', '|', '-'];

const rand = (len: Many<string>): number => Math.floor(Math.random() * len.length);

interface Complexity {
LOWER: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also make these all optional unless true. So 1 could be { LOWER: true } and 5 would be { LOWER:true, NUMBERS:true, SYMBOLS:true }

"missingId": "The Salesforce id for the user is required.",
"problemsDescribingTheUserObject": "Problems occurred while attempting to describe the user object",
"permsetNamesAreRequired": "The permission set names are missing but required.",
"complexityOutOffBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"
Copy link
Contributor

@jshackell-sfdc jshackell-sfdc Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"complexityOutOffBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"
"complexityOutOffBound": "Invalid complexity value. Specify a value between 0 and 5, inclusive. "

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is there a reason this error message is in sfdx-core and not plugin-user, together with lengthOutOfBound? If possible I think it's better to keep them all together, unless there's a good reason not to.

Finally, maybe name the variable complexityOutOfBound? (just one "f").

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function seems good, message needs help.

Thinking about the tests...definitely add one to test the complexity boundary error (ex: 9).

what are the boundaries of the password length? n >=8 ? Writing a test with length=6 that you expect to fail would be a good.

src/user.ts Outdated

// Concatinating remaining length randomly with all available characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment is no longer true (it's just going to be lowers).

"missingId": "The Salesforce id for the user is required.",
"problemsDescribingTheUserObject": "Problems occurred while attempting to describe the user object",
"permsetNamesAreRequired": "The permission set names are missing but required.",
"complexityOutOffBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"complexityOutOffBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"
"complexityOutOfBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also get Juliet to check the wording/format of this message. The rest of the messages are complete sentences ending in a . so try to make it like that.

const passwordAsArrayOfCharacters = buffer.toString('utf8').split('');
expect(passwordAsArrayOfCharacters.length).to.be.equal(12);
expect(
passwordAsArrayOfCharacters.some((char) => ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regex \d ?

const passwordAsArrayOfCharacters = buffer.toString('utf8').split('');
expect(passwordAsArrayOfCharacters.length).to.be.equal(12);
expect(
passwordAsArrayOfCharacters.some((char) => ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be cleaner with regex, too.

Copy link
Member

@WillieRuemmele WillieRuemmele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality looks good, tests could use some work

"missingId": "The Salesforce id for the user is required.",
"problemsDescribingTheUserObject": "Problems occurred while attempting to describe the user object",
"permsetNamesAreRequired": "The permission set names are missing but required.",
"complexityOutOffBound": "INVALID_COMPLEXITY: valid values are between 0 and 5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to include INVALID_COMPLEXITY can we make it less server-like, and more friendly? Have you worked with Juliet on this message?

expect(
passwordAsArrayOfCharacters.some((char) => ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char))
);
expect(passwordAsArrayOfCharacters.some((char) => char.toLowerCase() !== char.toLowerCase()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is char.toLowerCase() !== char.toLowerCase() correct? seems like you're comparing the same thing to itself

Comment on lines 144 to 153
const passwordCondition = { length: 12, complexity: 1 };
const password: SecureBuffer<void> = User.generatePasswordUtf8(passwordCondition);
password.value((buffer: Buffer): void => {
const passwordAsArrayOfCharacters = buffer.toString('utf8').split('');
expect(passwordAsArrayOfCharacters.length).to.be.equal(12);
expect(
passwordAsArrayOfCharacters.some((char) => ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char))
);
expect(passwordAsArrayOfCharacters.some((char) => char.toLowerCase() !== char.toLowerCase()));
expect(passwordAsArrayOfCharacters.some((char) => char.toLowerCase() !== char.toLowerCase()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test says it is testing length 14, complexity 3. But the test is testing 12/1

expect(
passwordAsArrayOfCharacters.some((char) => ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char))
);
expect(passwordAsArrayOfCharacters.some((char) => char.toLowerCase() !== char.toLowerCase()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

'2': { LOWER: true, SYMBOLS: true },
'3': { LOWER: true, UPPER: true, NUMBERS: true },
'4': { LOWER: true, NUMBERS: true, SYMBOLS: true },
'5': { LOWER: true, UPPER: true, NUMBERS: true, SYMBOLS: true },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 4 or 5 the most complex? We need to standardize on the server options

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, Vamsi originally had 4 and 5 switched (at least that's what he showed me when I worked on the description) and I asked the same question! I think he switched it. But did I steer him wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more logical sense to have higher number = more security, but I thought the server had 4 as the most secure option... we need to make a note of what we're doing, and what the server is expecting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vamsimundra , please go with what the devs are saying! Like I said earlier, to me the order you originally showed me looked wrong, which is why I flagged it, but I should really stay out of it. But please make sure that whatever you decide is accurately reflected in the --help output. Thanks

src/user.ts Outdated
if (!PASSWORD_COMPLEXITY[passwordCondition.complexity]) {
throw SfdxError.create('@salesforce/core', 'user', 'complexityOutOfBound');
}
if (passwordCondition.length < 8 || passwordCondition.length > 1000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: feel free to ignore this, but can we add {} for the second if statement? can we also add a new line between the error handling/throwing section, and the let password?

@mshanemc mshanemc merged commit ed65e83 into main Jul 13, 2021
@mshanemc mshanemc deleted the update-password-generation branch July 13, 2021 13:10
mdonnalley added a commit that referenced this pull request Jul 14, 2021
* fix: works with TS4+ and jsforce types (#413)

* fix: works with TS4+ and jsforce types

* style: remove no-longer-applicable comment

* fix: latest dev-packages for sinon/types

* chore(release): 2.23.4 [ci skip]

* fix: w-9299422 (login url from config) and fs-parallelization

* style: use the enum for prod url

* test: some UT for config resolution

* chore(release): 2.23.5 [ci skip]

* feat: exported function checkLightningDomain() (#415)

* feat: exported function checkLightningDomain()

* chore: clean stubs

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.24.0 [ci skip]

* style: attempt as a copy/paste

* chore: better library

* fix: rewrite polling client

* test: it really waits on requests to complete before making the next

* fix: puts some types back in dependencies

* chore: fix link to logger docs

* chore(release): 2.24.1 [ci skip]

* chore(release): 2.24.2 [ci skip]

* chore: sync git2gus.json (#428) [skip ci]

* feat: @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var (#429)

Fixes #427

* chore(release): 2.25.0 [ci skip]

* fix: set retries to INFINITELY for polling client

* chore(release): 2.25.1 [ci skip]

* feat: update generate password functionality (#432)

* feat: update generate password functionality

@W-5829533@

* chore: refactoring the code

@W-5829533@

* chore: updating test case

* chore: code refactoring and error handling

* chore: refactoring the code based on the comments

* chore: test case changes

* chore: updating test case

* chore: adding test case for length

* chore: updated test cases

* chore: code refactoring

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.26.0 [ci skip]

* chore: resolve merge conflicts

* fix: resolve more conflicts and linting

* chore: fix linting

Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: SF-CLI-BOT <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Vamsi-Mundra-Salesforce <[email protected]>
Co-authored-by: jfeng-salesforce <[email protected]>
Co-authored-by: jayree <[email protected]>
Co-authored-by: vamsimundra <[email protected]>
mdonnalley added a commit that referenced this pull request Sep 3, 2021
* fix: works with TS4+ and jsforce types (#413)

* fix: works with TS4+ and jsforce types

* style: remove no-longer-applicable comment

* fix: latest dev-packages for sinon/types

* chore(release): 2.23.4 [ci skip]

* fix: w-9299422 (login url from config) and fs-parallelization

* style: use the enum for prod url

* test: some UT for config resolution

* chore(release): 2.23.5 [ci skip]

* feat: exported function checkLightningDomain() (#415)

* feat: exported function checkLightningDomain()

* chore: clean stubs

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.24.0 [ci skip]

* style: attempt as a copy/paste

* chore: better library

* fix: rewrite polling client

* test: it really waits on requests to complete before making the next

* fix: puts some types back in dependencies

* chore: fix link to logger docs

* chore(release): 2.24.1 [ci skip]

* chore(release): 2.24.2 [ci skip]

* chore: sync git2gus.json (#428) [skip ci]

* feat: @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var (#429)

Fixes #427

* chore(release): 2.25.0 [ci skip]

* fix: set retries to INFINITELY for polling client

* chore(release): 2.25.1 [ci skip]

* feat: update generate password functionality (#432)

* feat: update generate password functionality

@W-5829533@

* chore: refactoring the code

@W-5829533@

* chore: updating test case

* chore: code refactoring and error handling

* chore: refactoring the code based on the comments

* chore: test case changes

* chore: updating test case

* chore: adding test case for length

* chore: updated test cases

* chore: code refactoring

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.26.0 [ci skip]

* fix: force:org:open force:org:open --urlonly display bug (#439)

* fix: modified regex used for finding access tokens

@W-6336711@

* chore: test case changes

* chore(release): 2.26.1 [ci skip]

* feat: Core URL class SfdcUrl (#420)

* feat: new class SfdcUrl (skeleton)

* chore: test emitWarning on insecure url

* chore: add lookup optionally createdOrgInstance and more tests

* chore: allow URL input in constructor

* chore: add domain cache to warnings

* chore: cache as a module

* chore: add method description

* chore: refactor with SfdcUrl class

* chore: add test for warning signal cache

* chore: remove unused from sfdc

* chore: defaults to Prod + use Env from kit in tests

* chore: test cleanup + better comments + typos

* chore: fix comment

* chore: use type safe functions + add tests for lookup error

* chore: better document methods

* chore: remove unused stub

* chore: simplify stub with a throw

* chore: use process.emitWarning

* chore: remove unused + make cache private

* chore: cnames don't have protocol add one for a proper url

* fix: keep backward compatibility for getJwtAudienceUrl exported fx

* chore: unset env var afterEach

* chore: add isInternalUrl to sfdc

* test: nuts for core

* test: run nuts

* test: add nuts

* test: rename required nut

* test: don't require nuts yet

* test: skip config (known messages issue)

* test: auth env checks

* test: nuts will be on their own branch

* test: no nuts

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.27.0 [ci skip]

* fix: dont fail when trying to unset sf config keys (#456)

* chore(release): 2.27.1 [ci skip]

* fix: improve error handling while removing config props

* chore(release): 2.27.2 [ci skip]

* test: sm/external-nuts-from-orb (#460)

* chore: add deprecations (#470)

* chore: add deprecations

* chore: deprecate fs

* chore: fix merge

* chore: update list of plugins in external-nuts job

* fix: use ConfigAggregator in AuthRemover

Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: SF-CLI-BOT <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Vamsi-Mundra-Salesforce <[email protected]>
Co-authored-by: jfeng-salesforce <[email protected]>
Co-authored-by: jayree <[email protected]>
Co-authored-by: vamsimundra <[email protected]>
mdonnalley added a commit that referenced this pull request Sep 10, 2021
* fix: works with TS4+ and jsforce types (#413)

* fix: works with TS4+ and jsforce types

* style: remove no-longer-applicable comment

* fix: latest dev-packages for sinon/types

* chore(release): 2.23.4 [ci skip]

* fix: w-9299422 (login url from config) and fs-parallelization

* style: use the enum for prod url

* test: some UT for config resolution

* chore(release): 2.23.5 [ci skip]

* feat: exported function checkLightningDomain() (#415)

* feat: exported function checkLightningDomain()

* chore: clean stubs

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.24.0 [ci skip]

* style: attempt as a copy/paste

* chore: better library

* fix: rewrite polling client

* test: it really waits on requests to complete before making the next

* fix: puts some types back in dependencies

* chore: fix link to logger docs

* chore(release): 2.24.1 [ci skip]

* chore(release): 2.24.2 [ci skip]

* chore: sync git2gus.json (#428) [skip ci]

* feat: @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var (#429)

Fixes #427

* chore(release): 2.25.0 [ci skip]

* fix: set retries to INFINITELY for polling client

* chore(release): 2.25.1 [ci skip]

* feat: update generate password functionality (#432)

* feat: update generate password functionality

@W-5829533@

* chore: refactoring the code

@W-5829533@

* chore: updating test case

* chore: code refactoring and error handling

* chore: refactoring the code based on the comments

* chore: test case changes

* chore: updating test case

* chore: adding test case for length

* chore: updated test cases

* chore: code refactoring

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.26.0 [ci skip]

* fix: force:org:open force:org:open --urlonly display bug (#439)

* fix: modified regex used for finding access tokens

@W-6336711@

* chore: test case changes

* chore(release): 2.26.1 [ci skip]

* feat: Core URL class SfdcUrl (#420)

* feat: new class SfdcUrl (skeleton)

* chore: test emitWarning on insecure url

* chore: add lookup optionally createdOrgInstance and more tests

* chore: allow URL input in constructor

* chore: add domain cache to warnings

* chore: cache as a module

* chore: add method description

* chore: refactor with SfdcUrl class

* chore: add test for warning signal cache

* chore: remove unused from sfdc

* chore: defaults to Prod + use Env from kit in tests

* chore: test cleanup + better comments + typos

* chore: fix comment

* chore: use type safe functions + add tests for lookup error

* chore: better document methods

* chore: remove unused stub

* chore: simplify stub with a throw

* chore: use process.emitWarning

* chore: remove unused + make cache private

* chore: cnames don't have protocol add one for a proper url

* fix: keep backward compatibility for getJwtAudienceUrl exported fx

* chore: unset env var afterEach

* chore: add isInternalUrl to sfdc

* test: nuts for core

* test: run nuts

* test: add nuts

* test: rename required nut

* test: don't require nuts yet

* test: skip config (known messages issue)

* test: auth env checks

* test: nuts will be on their own branch

* test: no nuts

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.27.0 [ci skip]

* fix: dont fail when trying to unset sf config keys (#456)

* chore(release): 2.27.1 [ci skip]

* fix: improve error handling while removing config props

* chore(release): 2.27.2 [ci skip]

* test: sm/external-nuts-from-orb (#460)

* chore: add deprecations (#470)

* chore: add deprecations

* chore: deprecate fs

* chore: regenerate yarn.lock

Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: SF-CLI-BOT <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Vamsi-Mundra-Salesforce <[email protected]>
Co-authored-by: jfeng-salesforce <[email protected]>
Co-authored-by: jayree <[email protected]>
Co-authored-by: vamsimundra <[email protected]>
mdonnalley added a commit that referenced this pull request Oct 8, 2021
* fix: works with TS4+ and jsforce types (#413)

* fix: works with TS4+ and jsforce types

* style: remove no-longer-applicable comment

* fix: latest dev-packages for sinon/types

* chore(release): 2.23.4 [ci skip]

* fix: w-9299422 (login url from config) and fs-parallelization

* style: use the enum for prod url

* test: some UT for config resolution

* chore(release): 2.23.5 [ci skip]

* feat: exported function checkLightningDomain() (#415)

* feat: exported function checkLightningDomain()

* chore: clean stubs

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.24.0 [ci skip]

* style: attempt as a copy/paste

* chore: better library

* fix: rewrite polling client

* test: it really waits on requests to complete before making the next

* fix: puts some types back in dependencies

* chore: fix link to logger docs

* chore(release): 2.24.1 [ci skip]

* chore(release): 2.24.2 [ci skip]

* chore: sync git2gus.json (#428) [skip ci]

* feat: @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var (#429)

Fixes #427

* chore(release): 2.25.0 [ci skip]

* fix: set retries to INFINITELY for polling client

* chore(release): 2.25.1 [ci skip]

* feat: update generate password functionality (#432)

* feat: update generate password functionality

@W-5829533@

* chore: refactoring the code

@W-5829533@

* chore: updating test case

* chore: code refactoring and error handling

* chore: refactoring the code based on the comments

* chore: test case changes

* chore: updating test case

* chore: adding test case for length

* chore: updated test cases

* chore: code refactoring

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.26.0 [ci skip]

* fix: force:org:open force:org:open --urlonly display bug (#439)

* fix: modified regex used for finding access tokens

@W-6336711@

* chore: test case changes

* chore(release): 2.26.1 [ci skip]

* feat: Core URL class SfdcUrl (#420)

* feat: new class SfdcUrl (skeleton)

* chore: test emitWarning on insecure url

* chore: add lookup optionally createdOrgInstance and more tests

* chore: allow URL input in constructor

* chore: add domain cache to warnings

* chore: cache as a module

* chore: add method description

* chore: refactor with SfdcUrl class

* chore: add test for warning signal cache

* chore: remove unused from sfdc

* chore: defaults to Prod + use Env from kit in tests

* chore: test cleanup + better comments + typos

* chore: fix comment

* chore: use type safe functions + add tests for lookup error

* chore: better document methods

* chore: remove unused stub

* chore: simplify stub with a throw

* chore: use process.emitWarning

* chore: remove unused + make cache private

* chore: cnames don't have protocol add one for a proper url

* fix: keep backward compatibility for getJwtAudienceUrl exported fx

* chore: unset env var afterEach

* chore: add isInternalUrl to sfdc

* test: nuts for core

* test: run nuts

* test: add nuts

* test: rename required nut

* test: don't require nuts yet

* test: skip config (known messages issue)

* test: auth env checks

* test: nuts will be on their own branch

* test: no nuts

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.27.0 [ci skip]

* fix: dont fail when trying to unset sf config keys (#456)

* chore(release): 2.27.1 [ci skip]

* fix: improve error handling while removing config props

* chore(release): 2.27.2 [ci skip]

* test: sm/external-nuts-from-orb (#460)

* feat: add custom templates config

* feat: add validator for custom templates config

* chore: add deprecations (#470)

* chore: add deprecations

* chore: deprecate fs

* feat: update config name

* docs: doc feedback

* chore(release): 2.28.0 [ci skip]

* fix: crmforce.mil

* chore(release): 2.28.1 [ci skip]

* chore: merge cleanup

* chore: merge cleanup continued

Co-authored-by: peternhale <[email protected]>
Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: SF-CLI-BOT <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Vamsi-Mundra-Salesforce <[email protected]>
Co-authored-by: jfeng-salesforce <[email protected]>
Co-authored-by: jayree <[email protected]>
Co-authored-by: vamsimundra <[email protected]>
Co-authored-by: Xiaoyi Chen <[email protected]>
mdonnalley added a commit that referenced this pull request Dec 16, 2021
* fix: works with TS4+ and jsforce types (#413)

* fix: works with TS4+ and jsforce types

* style: remove no-longer-applicable comment

* fix: latest dev-packages for sinon/types

* chore(release): 2.23.4 [ci skip]

* fix: w-9299422 (login url from config) and fs-parallelization

* style: use the enum for prod url

* test: some UT for config resolution

* chore(release): 2.23.5 [ci skip]

* feat: exported function checkLightningDomain() (#415)

* feat: exported function checkLightningDomain()

* chore: clean stubs

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.24.0 [ci skip]

* style: attempt as a copy/paste

* chore: better library

* fix: rewrite polling client

* test: it really waits on requests to complete before making the next

* fix: puts some types back in dependencies

* chore: fix link to logger docs

* chore(release): 2.24.1 [ci skip]

* chore(release): 2.24.2 [ci skip]

* chore: sync git2gus.json (#428) [skip ci]

* feat: @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var (#429)

Fixes #427

* chore(release): 2.25.0 [ci skip]

* fix: set retries to INFINITELY for polling client

* chore(release): 2.25.1 [ci skip]

* feat: update generate password functionality (#432)

* feat: update generate password functionality

@W-5829533@

* chore: refactoring the code

@W-5829533@

* chore: updating test case

* chore: code refactoring and error handling

* chore: refactoring the code based on the comments

* chore: test case changes

* chore: updating test case

* chore: adding test case for length

* chore: updated test cases

* chore: code refactoring

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.26.0 [ci skip]

* fix: force:org:open force:org:open --urlonly display bug (#439)

* fix: modified regex used for finding access tokens

@W-6336711@

* chore: test case changes

* chore(release): 2.26.1 [ci skip]

* feat: Core URL class SfdcUrl (#420)

* feat: new class SfdcUrl (skeleton)

* chore: test emitWarning on insecure url

* chore: add lookup optionally createdOrgInstance and more tests

* chore: allow URL input in constructor

* chore: add domain cache to warnings

* chore: cache as a module

* chore: add method description

* chore: refactor with SfdcUrl class

* chore: add test for warning signal cache

* chore: remove unused from sfdc

* chore: defaults to Prod + use Env from kit in tests

* chore: test cleanup + better comments + typos

* chore: fix comment

* chore: use type safe functions + add tests for lookup error

* chore: better document methods

* chore: remove unused stub

* chore: simplify stub with a throw

* chore: use process.emitWarning

* chore: remove unused + make cache private

* chore: cnames don't have protocol add one for a proper url

* fix: keep backward compatibility for getJwtAudienceUrl exported fx

* chore: unset env var afterEach

* chore: add isInternalUrl to sfdc

* test: nuts for core

* test: run nuts

* test: add nuts

* test: rename required nut

* test: don't require nuts yet

* test: skip config (known messages issue)

* test: auth env checks

* test: nuts will be on their own branch

* test: no nuts

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.27.0 [ci skip]

* fix: improve error message when providing an invalid username

* fix: dont fail when trying to unset sf config keys (#456)

* chore(release): 2.27.1 [ci skip]

* fix: improve error handling while removing config props

* chore(release): 2.27.2 [ci skip]

* test: sm/external-nuts-from-orb (#460)

* chore: improve error msg

* feat: add custom templates config

* feat: add validator for custom templates config

* chore: add deprecations (#470)

* chore: add deprecations

* chore: deprecate fs

* feat: update config name

* docs: doc feedback

* chore(release): 2.28.0 [ci skip]

* fix: crmforce.mil

* chore(release): 2.28.1 [ci skip]

* fix: support for .mil sandboxes

* test: confirm trailing slash behavior

* Updated/Added CODEOWNERS with ECCN

* chore(release): 2.28.2 [ci skip]

* Update messages/core.json

Co-authored-by: Juliet Shackell <[email protected]>

* Update messages/core.json

Co-authored-by: Juliet Shackell <[email protected]>

* Update messages/core.json

Co-authored-by: Juliet Shackell <[email protected]>

* fix: fix unit test

* fix: force new release

* chore(release): 2.28.3 [ci skip]

* feat: warning and telemetry events

* feat: warning and telemetry events

* test: warning and telemetry events, support for --watch

* feat: use warnings instead of process in sfdx-core

* chore: also allow json import for docs

* fix: transfer listeners when upgrading the global instance to newer version

* feat: cleans up old listeners from upgraded instance

* test: no only UT

* chore: bump dev-scripts

* chore: don't export lib/src

* chore: a few return types

* chore: ts record type instead of anyjson for objects

* chore: re-enable plugin-config NUTs (#494)

* fix: bump jsforce types and run unit tests on Windows (#485)

* chore: run unit tests on Windows

* chore: fix scripts

* chore: bump @salesforce/prettier-config

* chore: bump @salesforce/dev-scripts

* chore: skip keychain UT on windows

* chore: fix fs UTs on windows

* chore: use os.EOL instead of hardcoded newline char

* chore: fix UT that was causing a mem leak on windows

* chore: fix project UTs on windows

* chore: add plugin-data to external-nut job

* chore: bump @types/jsforce

Co-authored-by: Shane McLaughlin <[email protected]>

* chore(release): 2.28.4 [ci skip]

* chore: jsdoc public method

* docs: jsdoc for public method

* chore: linter (return types)

* chore: remove Bunyan return type from method in attempt to fix NUTs

* chore(release): 2.29.0 [ci skip]

* feat: delete scratch orgs and sandboxes (#491)

* fix: scratch org delete logic & tests

* chore: add comments, jsdoc

* chore: add error if no devhub found

* chore: delete sandboxes

* chore: small cleanup

* chore: add sandboxProcessNotFoundByOrgId error

* feat: new guards for props on messages (type: unknown)

* refactor: error guards and fewer conditionals

* refactor: reduce var scoping

* feat: isSandbox and no guards

* test: dry createOrg method

* refactor: improvements from review

* fix: message renaming

* chore: bump sinon/types

Co-authored-by: mshanemc <[email protected]>
Co-authored-by: Cristian Dominguez <[email protected]>

* chore(release): 2.30.0 [ci skip]

* chore(deps): bump path-parse from 1.0.6 to 1.0.7 in /examples (#463)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump semver-regex from 3.1.2 to 3.1.3 (#481)

Bumps [semver-regex](https://github.com/sindresorhus/semver-regex) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/sindresorhus/semver-regex/releases)
- [Commits](https://github.com/sindresorhus/semver-regex/commits)

---
updated-dependencies:
- dependency-name: semver-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shane McLaughlin <[email protected]>

* fix: better output for authUrl errors

* chore(release): 2.30.1 [ci skip]

* feat: bump version of jsforce

* chore(release): 2.31.0 [ci skip]

* chore: bump dev-scripts to v1 (#496)

* chore: bump dev-scripts to v1

* chore: bump dev-scripts

Co-authored-by: mshanemc <[email protected]>

* Update config.json

* chore(release): 2.31.1 [ci skip]

* fix: no maxquery warning when records.length is 0

* test: ut for warnings

* feat: switch sfdx-faye with faye

* test: resovles instead of return a promise function

* Update package.json

Bumping version for release.  @W-0@

* chore(release): 2.32.0 [ci skip]

* feat: sandbox creation

* fix: sandbox create, UT, auth failing

* chore: minor refactor for lifecycle

* chore: clean up UTs

* chore: code review I

* chore: create and export listener types

* chore: hook emitting sandbox auth info

* chore(release): 2.33.0 [ci skip]

* chore: finish merge

* chore: linting

* chore: fix windows tests

* fix: faye doesn't use custom stuff passed it

* chore: code review

* chore(release): 2.33.1 [ci skip]

* chore: remove sfdx-faye

Co-authored-by: peternhale <[email protected]>
Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: SF-CLI-BOT <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Vamsi-Mundra-Salesforce <[email protected]>
Co-authored-by: jfeng-salesforce <[email protected]>
Co-authored-by: jayree <[email protected]>
Co-authored-by: vamsimundra <[email protected]>
Co-authored-by: Cristian Dominguez <[email protected]>
Co-authored-by: Cristian Dominguez <[email protected]>
Co-authored-by: Xiaoyi Chen <[email protected]>
Co-authored-by: svc-scm <[email protected]>
Co-authored-by: Juliet Shackell <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Willie Ruemmele <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants