Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

[BETA] Enable Theme Kit Access passwords#2664

Merged
gonzaloriestra merged 1 commit intomainfrom
enable-themekit-access-passwords
Oct 19, 2022
Merged

[BETA] Enable Theme Kit Access passwords#2664
gonzaloriestra merged 1 commit intomainfrom
enable-themekit-access-passwords

Conversation

@gonzaloriestra
Copy link
Contributor

@gonzaloriestra gonzaloriestra commented Oct 19, 2022

WHY are these changes introduced?

First step for https://github.com/Shopify/shopify-cli-planning/issues/332
Fixes https://github.com/Shopify/shopify-cli-planning/issues/365

A very similar PR was merged and then reverted, as we wanted to finish other related work first.

⚠️ We are still testing this functionality, it will be ready to use for everyone when we properly announce it and publish the documentation.

WHAT is this pull request doing?

  • Enable Theme Kit Access passwords through env variable. When SHOPIFY_CLI_ADMIN_AUTH_TOKEN contains a Theme Kit Access password, the theme requests will go through Theme Kit Access API instead of Admin API, so the password is validated. As the login is not required, it also requires passing the store URL through SHOPIFY_SHOP.
  • Rename SHOPIFY_CLI_STORE to SHOPIFY_SHOP, which was already existing. It was added recently to be used from the CLI3. I'll update the CLI3 as well to use SHOPIFY_SHOP.

How to test your changes?

Check that theme commands work the same way when logged in (by using the Admin API):

  • bin/shopify login
  • DEBUG=1 bin/shopify theme list

Check that they also work with a Theme Kit Access password (by using Theme Access Kit API):

  • Install Theme Kit Access app and generate a new password
  • bin/shopify logout
  • DEBUG=1 SHOPIFY_SHOP=your-shop.myshopify.com SHOPIFY_CLI_ADMIN_AUTH_TOKEN=your-password bin/shopify theme list

Update checklist

  • I've added a CHANGELOG entry for this PR (if the change is public-facing)
  • I've considered possible cross-platform impacts (Mac, Linux, Windows).
  • I've left the version number as is (we'll handle incrementing this when releasing).
  • I've included any post-release steps in the section above (if needed).

@gonzaloriestra gonzaloriestra force-pushed the enable-themekit-access-passwords branch 2 times, most recently from b6d8d19 to 079d64e Compare October 19, 2022 13:16
@gonzaloriestra gonzaloriestra force-pushed the enable-themekit-access-passwords branch from 079d64e to a5821af Compare October 19, 2022 13:21
@gonzaloriestra gonzaloriestra marked this pull request as ready for review October 19, 2022 13:24
@gonzaloriestra gonzaloriestra requested review from a team October 19, 2022 13:24
Copy link
Contributor

@alvaro-shopify alvaro-shopify left a comment

Choose a reason for hiding this comment

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

Tophated and works like a charm!. Code LGTM

@gonzaloriestra gonzaloriestra merged commit 8c25ffa into main Oct 19, 2022
@gonzaloriestra gonzaloriestra deleted the enable-themekit-access-passwords branch October 19, 2022 13:59
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems October 19, 2022 14:24 Inactive
@lesterdefreitas
Copy link

Hey guys, can someone please explain how this works, it sounds super useful. Is this a way to store credentials for each store and not have to manually log in / out between stores? @gonzaloriestra @alvaro-shopify

@gonzaloriestra
Copy link
Contributor Author

@lesterdefreitas you can now use CLI 3.x for theme development. And you can easily switch the store by passing --store (unless it belongs to a different account). Or just use a Theme Access password from a specific store.

More info:

@lesterdefreitas
Copy link

@gonzaloriestra oh awesome, thanks for this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants