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: add hyperforce jwt exception #805

Merged
merged 19 commits into from
Dec 5, 2023
Merged

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Nov 27, 2023

requires forcedotcom/sfdx-core#1000.

What does this PR do?

When using hyperforce and JWT, you can't use org create user because (something about a user table replication in core that doesn't happen in hyperforce)

This now warns the user before trying to create a user that isn't auth-able.

What issues does this PR fix or reference?

@W-14542428@

@mshanemc mshanemc requested a review from a team as a code owner November 27, 2023 13:42
messages/create.md Outdated Show resolved Hide resolved
messages/create.md Outdated Show resolved Hide resolved
messages/create.md Outdated Show resolved Hide resolved
@mshanemc mshanemc changed the title Sm/jwt hyperforce exception feat: add hyperforce jwt exception Dec 4, 2023
if (
conn.getAuthInfo().isJwt() &&
// hyperforce sandbox instances end in S like USA254S
targetOrg.getField<string>(Org.Fields.CREATED_ORG_INSTANCE).endsWith('S')
Copy link
Contributor

Choose a reason for hiding this comment

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

So we can always trust that this will be accurate for all hyperforce instances?

@shetzel
Copy link
Contributor

shetzel commented Dec 5, 2023

QA:
Without changes:

sf org create user -o falcon-scratch2
Warning: The --target-dev-hub flag is deprecated and is no longer used by this command. The flag will be removed in API version 57.0 or later.
Error (1): Error authenticating with JWT.
Errors encountered:
user hasn't approved this consumer

With changes:

~/dev/salesforcecli/plugin-user/bin/dev.js org create user -o falcon-scratch2
Warning: The --target-dev-hub flag is deprecated and is no longer used by this command. The flag will be removed in API version 57.0 or later.
Error (1): This command doesn't work when authorizing an org using the JWT flow if the org is on Hyperforce.

Try this:

Authorize your Dev Hub with either the `org login web` or `org login sfdx-url` command. You can then successfully use the `org create user` command on scratch orgs that you create with your Dev Hub.

@shetzel shetzel merged commit 4d168a1 into main Dec 5, 2023
10 checks passed
@shetzel shetzel deleted the sm/jwt-hyperforce-exception branch December 5, 2023 19:20
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.

3 participants