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: detect if org is a devhub at auth time #560

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Conversation

cristiand391
Copy link
Member

@cristiand391 cristiand391 commented Apr 18, 2022

What does this PR do?

Updates AuthInfo class to always setisDevHub field based on a server-check.

Before:
It was up to consumers to set the field based on a server-check or anything else like passing a flag in a plugin

After:
sfdx-core will do a server-side check and set the field to either true or false.

QA steps:

  1. Clone plugin-auth
  2. yarn link @salesforce/core into ⬆️
  3. test all auth commands both with/without --setdefaultdevhubusername
  4. Even without passing --setdefaultdevhubusername , you should see the isDevHub field in the authfile.

What issues does this PR fix or reference?

@W-10999290@

@salesforce-cla
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): SF-CLI-BOT <s***@g***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce.com Contributor License Agreement and this Pull Request will be revalidated.

@cristiand391 cristiand391 changed the base branch from main to v3 April 18, 2022 21:54
src/org/authInfo.ts Outdated Show resolved Hide resolved
@cristiand391 cristiand391 marked this pull request as ready for review April 19, 2022 17:04
@cristiand391 cristiand391 changed the title [WIP] feat: detect if org is a devhub at auth time feat: detect if org is a devhub at auth time Apr 19, 2022
src/org/authInfo.ts Show resolved Hide resolved
@peternhale peternhale self-requested a review April 20, 2022 17:19
@peternhale
Copy link
Contributor

peternhale commented Apr 20, 2022

QA Notes:

Using testing dev hub, ran the auth commands below, logging out between attempts.
Success for the test is finding property isDevHub set to true in the resulting auth config file for the user.
Also confirmed that previous version of core DID NOT set isDevHub property in auth files prior to start of testing.

  • auth:jwt:grant
  • auth:web:login
  • auth:sfdxurl:store
  • auth:access:token:store

All of the commands properly set the isDevHiub and also set alias and set org to default devhub username when requested.

Tested non-devhub org with web login, yielding isDevHub property value of false.

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.

2 participants