-
Notifications
You must be signed in to change notification settings - Fork 699
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
Create OmniAuthConfiguration object to build future OmniAuth strategies #1190
Create OmniAuthConfiguration object to build future OmniAuth strategies #1190
Conversation
aa98f9e
to
20b69c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍞
f53d0d8
to
20b69c3
Compare
@@ -81,6 +83,14 @@ def has_scripttags? | |||
def enable_same_site_none | |||
!Rails.env.test? && (@enable_same_site_none.nil? ? embedded_app? : @enable_same_site_none) | |||
end | |||
|
|||
def shop_access_scopes | |||
@shop_access_scopes || scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a little odd to return a singular item scope
when the method name implies a collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! However, the scope
attribute has been used to define a collection of scopes stored in a string for a while now. Changing this will be a breaking change for shopify_app developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, we can mark this as future work to update scope
to scopes
.
is this implementation still valid? I can't find any reference to OmniAuthConfiguration, I would like to modify ShopifyApp.configuration (and ShopifyAPI::Context.setup) in runtime |
This PR introduces the following:
OmniAuthConfiguration
objectShopifyApp.configuration
shop_access_scopes
: These default to the oldShopifyApp.configuration.scope
configuser_access_scopes
: These default to the oldShopifyApp.configuration.scope
configThe intent is to use this object in the future to help us define and build omniauth strategies. This will be especially important in upcoming changes related to scope changes.
Here's how partners can use this in their
omniauth.rb
files:For now, this class is not being used anywhere else in the library. A future PR will introduce default strategies for partners who use offline access tokens saved in their Shop records and online access tokens saved in their User records.
Based on the parent branch: https://github.com/Shopify/shopify_app/compare/scope-strategies
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.md
if the changes would impact usersREADME.md
, if appropriate.docs/
, if necessary