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

Make device auth the default authentication method #4092

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

shauns
Copy link
Contributor

@shauns shauns commented Jun 19, 2024

WHY are these changes introduced?

Closes https://github.com/Shopify/develop-app-inner-loop/issues/1835

WHAT is this pull request doing?

Device auth is now the default, with an opt-out via an environment variable

How to test your changes?

Log out of the CLI (shopify auth logout), and start using normal commands.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

@shauns shauns self-assigned this Jun 19, 2024
Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-management

Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/constants.d.ts
@@ -3,6 +3,7 @@ export declare const environmentVariables: {
     alwaysLogAnalytics: string;
     alwaysLogMetrics: string;
     deviceAuth: string;
+    accessCodeAuth: string;
     enableCliRedirect: string;
     env: string;
     firstPartyDev: string;
packages/cli-kit/dist/public/node/environment.d.ts
@@ -35,7 +35,7 @@ export declare function getOrganization(): string | undefined;
  */
 export declare function getBackendPort(): number | undefined;
 /**
- * Returns the information of the identity token.
+ * Returns the information of the identity & refresh tokens, provided by environment variables.
  *
  * @returns The identity token information in case it exists.
  */
packages/cli-kit/dist/public/node/context/local.d.ts
@@ -74,6 +74,8 @@ export declare function firstPartyDev(env?: NodeJS.ProcessEnv): boolean;
 /**
  * Returns true if the CLI should use device auth.
  *
+ * Device auth can be opted out by using SHOPIFY_CLI_ACCESS_CODE_AUTH.
+ *
  * @param env - The environment variables from the environment of the current process.
  * @returns True if SHOPIFY_CLI_DEVICE_AUTH is truthy or the CLI is run from a cloud environment.
  */

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.49% (-0.02% 🔻)
7419/10234
🟡 Branches
69.05% (-0.03% 🔻)
3638/5269
🟡 Functions 71.6% 1966/2746
🟡 Lines
72.83% (-0.02% 🔻)
7005/9618
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.39% (-1.61% 🔻)
90.91% (-4.55% 🔻)
100%
98.33% (-1.67% 🔻)
🟡
... / local.ts
64.71% (-1.96% 🔻)
50.98% (-1.02% 🔻)
54.55%
64.71% (-1.96% 🔻)

Test suite run success

1712 tests passing in 794 suites.

Report generated by 🧪jest coverage report action from f76debd

@shauns shauns requested a review from isaacroldan June 19, 2024 15:42
@isaacroldan isaacroldan added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit 140868e Jul 5, 2024
37 checks passed
@isaacroldan isaacroldan deleted the device-auth-by-default branch July 5, 2024 08:19
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.

None yet

2 participants