-
Notifications
You must be signed in to change notification settings - Fork 70
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
Core URL class SfdcUrl #420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA notes Repro set all the required envs
You can verify that the NUTs are passing on regular core by doing
|
QA Notes: plugin-org (open, myDomainResolver stuff) NUTs worked fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA notes:
good: plugin config is catching bad URLs.
bad: toolbelt still has an import of jwtAudienceUrl until this merges: https://github.com/salesforcecli/toolbelt/pull/74
I didn't catch this in review, only noticed it while getting read to QA stuff. That would be a breaking change. Let's avoid that...it'll be a nice puzzle.
checkLightningDomain has the same problem, but I don't think anyone is using that one that I could find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice tests!
… into bm/W-9457855
* 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]>
* 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]>
* 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]>
* 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]>
WIP
What does this PR do?
A new
SfdcUrl
class derived from WHATWG URL API with some extensions that consolidate a lot of url utilities into a single class.What functionality is included in this class ?
getJwtAudienceUrl
isSandboxUrl
isSalesforceDomain
isInternalUrl
isLocalUrl
checkLightningDomain
lookup
Backward compatibility:
getJwtAudienceUrl
sfdc.isInternalUrl
Want to include a new feature ? please refer to the original spike doc here
What issues does this PR fix or reference?
@W-9457855@