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

Add new method to construct host app URL #1002

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

mkevinosullivan
Copy link
Contributor

@mkevinosullivan mkevinosullivan commented Aug 5, 2022

Description

For performance soon we will be recommending that apps favour server redirects within the OAuth process. This will replace client side redirects using AppBridge. We want to control that code that constructs the URL for the app. That way it's easier for developers, and if that URL changes we can update the logic with a version bump.

This utility will be used to get the URL to redirect to when the store does not have a token for the app.

Ruby API equivalent of Shopify/shopify-api-js#419
Closes https://github.com/Shopify/first-party-library-planning/issues/392

What is this pull request doing?

Add a new utility called ShopifyAPI::Auth.embedded_app_url. This utility constructs the host URL for an embedded app.

How has this been tested?

Unit tests added to test green path as well as error paths.

Checklist:

  • My commit message follow the pattern described in here
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the project documentation.
  • I have added a changelog line.

@mkevinosullivan mkevinosullivan force-pushed the kos/add_auth_embedded_app_url branch from 8d49a90 to 310e24c Compare August 5, 2022 15:24
Use Base64.strict_encode64 (to avoid adding newlines), but
Base64.decode64 (using strict_decode64 breaks with what's provided by
Shopify)
@mkevinosullivan mkevinosullivan force-pushed the kos/add_auth_embedded_app_url branch from 310e24c to 6639607 Compare August 5, 2022 15:28
@mkevinosullivan mkevinosullivan changed the title [WIP] Add new method to construct host app URL Add new method to construct host app URL Aug 5, 2022
@mkevinosullivan mkevinosullivan marked this pull request as ready for review August 5, 2022 15:29
@mkevinosullivan mkevinosullivan requested a review from a team as a code owner August 5, 2022 15:29
Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

🔥

CHANGELOG.md Outdated Show resolved Hide resolved
lib/shopify_api/auth.rb Show resolved Hide resolved
@mkevinosullivan mkevinosullivan merged commit 61ec2e2 into main Aug 8, 2022
@mkevinosullivan mkevinosullivan deleted the kos/add_auth_embedded_app_url branch August 8, 2022 18:27
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems August 10, 2022 20:14 Inactive
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