Deprecate ShopifyAPI::Context in favour of instance-based configuration #1188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an experiment to allow all methods that use ShopifyAPI::Context to use an instance-based configuration instead. There is an attempt to maintain backwards-compatibility as all method parameters still default to ShopifyAPI::Context
At time of writing, these are the impacted methods:
ShopifyAPI::Auth.embedded_app_url
ShopifyAPI::Auth::JwTPayload.new
ShopifyAPI::Auth::Oauth.begin_auth
ShopifyAPI::Auth::Oauth.validate_auth_callback
ShopifyAPI::Auth::Session.temp
ShopifyAPI::Clients::Graphql::Admin.new
ShopifyAPI::Clients::Graphql::Client.new
ShopifyAPI::Clients::HttpClient.new
ShopifyAPI::Clients::Rest::Admin.new
ShopifyAPI::Rest::Base.new
ShopifyAPI::Utils::GraphqlProxy.proxy_query
ShopifyAPI::Utils::HmacValidator.validate
ShopifyAPI::Utils::SessionUtils.current_session_id
ShopifyAPI::Webhooks::Registration.new
ShopifyAPI::Webhooks::Registrations::Http.new
ShopifyAPI::Webhooks::Registry.add_registration
ShopifyAPI::Webhooks::Registry.process
ShopifyAPI::Logger.debug
ShopifyAPI::Logger.info
ShopifyAPI::Logger.warn
ShopifyAPI::Logger.error
ShopifyAPI::Logger.deprecated
Please, include a summary of what the PR is for:
There is a desire/need to create more than one Shopify App within a single Rails application.
What is the context of these changes?
What is the impact of this PR?
We are attempting to have zero-impact on current users other than potentially a deprecation notification.
How has this been tested?
All existing tests continue to function.
We added configuration parameter options to all tests as well.
We also top-hatted these changes by using this branch to create and install a new Shopify App
Checklist: