shopify_app 13.1.0 → 13.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +6 -0
  3. data/.github/workflows/rubocop.yml +28 -0
  4. data/.rubocop.yml +1 -0
  5. data/CHANGELOG.md +23 -0
  6. data/Gemfile +3 -1
  7. data/README.md +13 -16
  8. data/SECURITY.md +59 -0
  9. data/app/controllers/concerns/shopify_app/authenticated.rb +1 -0
  10. data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
  11. data/app/controllers/shopify_app/callback_controller.rb +40 -9
  12. data/app/controllers/shopify_app/extension_verification_controller.rb +2 -7
  13. data/app/controllers/shopify_app/sessions_controller.rb +1 -1
  14. data/app/controllers/shopify_app/webhooks_controller.rb +1 -1
  15. data/config/locales/nl.yml +1 -1
  16. data/docs/Quickstart.md +7 -17
  17. data/docs/Releasing.md +1 -0
  18. data/lib/generators/shopify_app/install/templates/flash_messages.js +0 -2
  19. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +1 -1
  20. data/lib/shopify_app.rb +5 -1
  21. data/lib/shopify_app/controller_concerns/app_proxy_verification.rb +0 -1
  22. data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
  23. data/lib/shopify_app/controller_concerns/login_protection.rb +7 -10
  24. data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
  25. data/lib/shopify_app/controller_concerns/webhook_verification.rb +1 -17
  26. data/lib/shopify_app/engine.rb +4 -0
  27. data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
  28. data/lib/shopify_app/version.rb +1 -1
  29. data/package-lock.json +4 -72
  30. data/package.json +1 -1
  31. data/shopify_app.gemspec +3 -2
  32. data/yarn.lock +3 -3
  33. metadata +27 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8f69498c3370637fc886cc8ca40f4a83262f6965249b703964eb79fff2d8bbf
4
- data.tar.gz: 1d2e06d998ecdc4f864de34bb85b81354418af9c2c361d415a19757a29651962
3
+ metadata.gz: b658d15c37ab3bf556566d5608a0b778a9f72448c4e8cdc6363c52e31dcf5ff5
4
+ data.tar.gz: 42c4e4dd1377bbdbb8b627f5a56b81c58559133158f1d0c7cc212aff2e7da634
5
5
  SHA512:
6
- metadata.gz: c6972f6068811592085cf2dcb2dadfefd6f7a95f7e1c46121e2c904fac5ab3d4527f5077cb223587be1704b271fccff483a859111bc66e390097953f0604c31b
7
- data.tar.gz: d74aade09cf4bafaac2f4c4d7b9658738fbb469e5c02f6b9c7ee21dbd8ca427e94e9d5e737aa92aadab1deadf2707e6521e5e51f7786a542cfa8d7ae89f171b1
6
+ metadata.gz: 9753dddbdda3d31395e154f640bc4043312b160c72140525c32f839b96498db1bfae024daab4027b1b003b7206a7ba47106338369240e9437ac060682e594290
7
+ data.tar.gz: d5f6fb4fe5c753280b7c3d0d3f8b58b152ce395c19f6cc6131e63e90aa233e95abfbe2598b418d6828586462eb9e7cb48ab7bad0ccdeacc71b5445a83c6aa70e
@@ -0,0 +1,6 @@
1
+ Before submitting the PR, please consider if any of the following are needed:
2
+
3
+ - [ ] Update `CHANGELOG.md` if the changes would impact users
4
+ - [ ] Update `README.md`, if appropriate.
5
+ - [ ] Update any relevant pages in `docs/`, if necessary
6
+ - [ ] For security fixes, the [Disclosure Policy](https://github.com/Shopify/shopify_app/blob/master/SECURITY.md#disclosure-policy) must be followed.
@@ -0,0 +1,28 @@
1
+ name: RuboCop
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - name: Set up Ruby 2.7
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.7
15
+ - name: Cache gems
16
+ uses: actions/cache@v1
17
+ with:
18
+ path: vendor/bundle
19
+ key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
20
+ restore-keys: |
21
+ ${{ runner.os }}-rubocop-
22
+ - name: Install gems
23
+ run: |
24
+ bundle config path vendor/bundle
25
+ bundle config set without 'default development test'
26
+ bundle install --jobs 4 --retry 3
27
+ - name: Run RuboCop
28
+ run: bundle exec rubocop --parallel
@@ -5,6 +5,7 @@ AllCops:
5
5
  TargetRubyVersion: 2.7
6
6
  Exclude:
7
7
  - 'test/tmp/**/*'
8
+ - 'vendor/bundle/**/*'
8
9
 
9
10
  Style/MethodCallWithArgsParentheses:
10
11
  Exclude:
@@ -1,3 +1,26 @@
1
+ 13.4.1
2
+ ------
3
+ * Fix the version checks for the dependency on `shopify_api` to allow all of v9.X
4
+
5
+ 13.4.0
6
+ ------
7
+ * Skip CSRF protection if a valid signed JWT token is present as we trust Shopify to be the only source that can sign it securely. [#994](https://github.com/Shopify/shopify_app/pull/994)
8
+
9
+ 13.3.0
10
+ ------
11
+ * Added Payload Verification module [#992](https://github.com/Shopify/shopify_app/pull/992)
12
+ * Add concern to check for valid shop domains in the unauthenticated controller
13
+
14
+ 13.2.0
15
+ ------
16
+ * Get current shop domain from JWT header
17
+ * Validate that the omniauth data matches the JWT data
18
+ * Persist the token information to the session store
19
+
20
+ 13.1.1
21
+ ------
22
+ * Update browser_sniffer to 1.2.2
23
+
1
24
  13.1.0
2
25
  ------
3
26
  * Adds the shop URL as a parameter when redirecting after the callback
data/Gemfile CHANGED
@@ -6,4 +6,6 @@ gemspec
6
6
 
7
7
  gem 'rails-controller-testing', group: :test
8
8
 
9
- gem 'rubocop-shopify', require: false
9
+ group :rubocop do
10
+ gem 'rubocop-shopify', require: false
11
+ end
data/README.md CHANGED
@@ -32,7 +32,7 @@ Table of Contents
32
32
 
33
33
  Introduction
34
34
  -----------
35
- Get started with the [Shopify Admin API](https://help.shopify.com/en/api/getting-started) faster; This gem includes a Rails Engine and generators for writing Rails applications using the Shopify API. The Engine provides a SessionsController and all the required code for authenticating with a shop via Oauth (other authentication methods are not supported).
35
+ Get started with the [Shopify Admin API](https://help.shopify.com/en/api/getting-started) faster; This gem includes a Rails Engine and generators for writing Rails applications using the Shopify API. The Engine provides a SessionsController and all the required code for authenticating with a shop via OAuth (other authentication methods are not supported).
36
36
 
37
37
  *Note: It's recommended to use this on a new Rails project so that the generator won't overwrite/delete your files.*
38
38
 
@@ -58,8 +58,7 @@ $ rails new my_shopify_app
58
58
  $ cd my_shopify_app
59
59
 
60
60
  # Add the gem shopify_app to your Gemfile
61
- $ echo "gem 'shopify_app'" >> Gemfile
62
- $ bundle install
61
+ $ bundle add shopify_app
63
62
  ```
64
63
 
65
64
  Now we are ready to run any of the [generators](#generators) included with `shopify_app`. The following section explains the generators and what you can do with them.
@@ -99,16 +98,12 @@ These values can be found on the "App Setup" page in the [Shopify Partners Dashb
99
98
  ### Install Generator
100
99
 
101
100
  ```sh
102
- $ rails generate shopify_app:install
103
-
104
- # or optionally with arguments:
105
-
106
101
  $ rails generate shopify_app:install
107
102
  ```
108
103
 
109
- Other options include:
104
+ Options include:
110
105
  * `application_name` - the name of your app, it can be supplied with or without double-quotes if a whitespace is present. (e.g. `--application_name Example App` or `--application_name "Example App"`)
111
- * `scope` - the Oauth access scope required for your app, e.g. **read_products, write_orders**. *Multiple options* need to be delimited by a comma-space and can be supplied with or without double-quotes
106
+ * `scope` - the OAuth access scope required for your app, e.g. **read_products, write_orders**. *Multiple options* need to be delimited by a comma-space and can be supplied with or without double-quotes
112
107
  (e.g. `--scope read_products, write_orders, write_products` or `--scope "read_products, write_orders, write_products"`)
113
108
  For more information, refer the [docs](http://docs.shopify.com/api/tutorials/oauth).
114
109
  * `embedded` - the default is to generate an [embedded app](http://docs.shopify.com/embedded-app-sdk), if you want a legacy non-embedded app then set this to false, `--embedded false`
@@ -143,7 +138,7 @@ This optional generator, not included with the default generator, creates the ap
143
138
  $ rails generate shopify_app:add_marketing_activity_extension
144
139
  ```
145
140
 
146
- This will create a controller with the endpoints required to build a [marketing activities extension](https://help.shopify.com/en/api/embedded-apps/app-extensions/shopify-admin/marketing-activities). The extension will be generated with a base url at `/marketing_activities`, which should also be configured in partners.
141
+ This will create a controller with the endpoints required to build a [marketing activities extension](https://help.shopify.com/en/api/embedded-apps/app-extensions/shopify-admin/marketing-activities). The extension will be generated with a base URL at `/marketing_activities`, which should also be configured in partners.
147
142
 
148
143
  ### Controllers, Routes and Views
149
144
 
@@ -324,7 +319,7 @@ ShopifyApp.configure do |config|
324
319
  end
325
320
  ```
326
321
 
327
- When the oauth callback is completed successfully, ShopifyApp will queue a background job which will ensure all the specified webhooks exist for that shop. Because this runs on every oauth callback, it means your app will always have the webhooks it needs even if the user uninstalls and re-installs the app.
322
+ When the OAuth callback is completed successfully, ShopifyApp will queue a background job which will ensure all the specified webhooks exist for that shop. Because this runs on every OAuth callback, it means your app will always have the webhooks it needs even if the user uninstalls and re-installs the app.
328
323
 
329
324
  ShopifyApp also provides a WebhooksController that receives webhooks and queues a job based on the received topic. For example, if you register the webhook from above, then all you need to do is create a job called `CartsUpdateJob`. The job will be queued with 2 params: `shop_domain` and `webhook` (which is the webhook body).
330
325
 
@@ -368,7 +363,7 @@ end
368
363
 
369
364
  The module skips the `verify_authenticity_token` before_action and adds an action to verify that the webhook came from Shopify. You can now add a post route to your application, pointing to the controller and action to accept the webhook data from Shopify.
370
365
 
371
- The WebhooksManager uses ActiveJob. If ActiveJob is not configured then by default Rails will run the jobs inline. However, it is highly recommended to configure a proper background processing queue like sidekiq or resque in production.
366
+ The WebhooksManager uses ActiveJob. If ActiveJob is not configured then by default Rails will run the jobs inline. However, it is highly recommended to configure a proper background processing queue like Sidekiq or Resque in production.
372
367
 
373
368
  ShopifyApp can create webhooks for you using the `add_webhook` generator. This will add the new webhook to your config and create the required job class for you.
374
369
 
@@ -459,7 +454,7 @@ class ReviewsController < ApplicationController
459
454
  end
460
455
  ```
461
456
 
462
- Create your app proxy url in the [Shopify Partners' Dashboard][dashboard], making sure to point it to `https://your_app_website.com/app_proxy`.
457
+ Create your app proxy URL in the [Shopify Partners' Dashboard][dashboard], making sure to point it to `https://your_app_website.com/app_proxy`.
463
458
  ![Creating an App Proxy](/images/app-proxy-screenshot.png)
464
459
 
465
460
  App Bridge
@@ -529,8 +524,10 @@ change to how session stores work. Here are the steps to migrate to 13.x
529
524
  ### Changes to `ShopifyApp::LoginProtection`
530
525
  `ShopifyApp::LoginProtection`
531
526
 
532
- if you are using `ShopifyApp::LoginProtection#shop_session` in your code, it will need to be
527
+ - CHANGE if you are using `ShopifyApp::LoginProtection#shopify_session` in your code, it will need to be
533
528
  changed to `ShopifyApp::LoginProtection#activate_shopify_session`
529
+ - CHANGE if you are using `ShopifyApp::LoginProtection#clear_shop_session` in your code, it will need to be
530
+ changed to `ShopifyApp::LoginProtection#clear_shopify_session`
534
531
 
535
532
  ### Notes
536
533
  You do not need a user model; a shop session is fine for most applications.
@@ -571,7 +568,7 @@ Upgrading from 8.6 to 9.0.0
571
568
 
572
569
  ### Configuration change
573
570
 
574
- Add an api version configuration in `config/initializers/shopify_app.rb`
571
+ Add an API version configuration in `config/initializers/shopify_app.rb`
575
572
  Set this to the version you want to run against by default. See [Shopify API docs](https://help.shopify.com/en/api/versioning) for versions available.
576
573
  ```ruby
577
574
  config.api_version = '2019-04'
@@ -617,7 +614,7 @@ is changed to
617
614
 
618
615
  ### ShopifyAPI changes
619
616
 
620
- You will need to also follow the ShopifyAPI [upgrade guide](https://github.com/Shopify/shopify_api/blob/master/README.md#-breaking-change-notice-for-version-700-) to ensure your app is ready to work with api versioning.
617
+ You will need to also follow the ShopifyAPI [upgrade guide](https://github.com/Shopify/shopify_api/blob/master/README.md#-breaking-change-notice-for-version-700-) to ensure your app is ready to work with API versioning.
621
618
 
622
619
  [dashboard]:https://partners.shopify.com
623
620
  [app-bridge]:https://help.shopify.com/en/api/embedded-apps/app-bridge
@@ -0,0 +1,59 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ ### New features
6
+
7
+ New features will only be added to the master branch and will not be made available in point releases.
8
+
9
+ ### Bug fixes
10
+
11
+ Only the latest release series will receive bug fixes. When enough bugs are fixed and its deemed worthy to release a new gem, this is the branch it happens from.
12
+
13
+ ### Security issues
14
+
15
+ Only the latest release series will receive patches and new versions in case of a security issue.
16
+
17
+ ### Severe security issues
18
+
19
+ For severe security issues we will provide new versions as above, and also the last major release series will receive patches and new versions. The classification of the security issue is judged by the core team.
20
+
21
+ ### Unsupported Release Series
22
+
23
+ When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. If you are not comfortable maintaining your own versions, you should upgrade to a supported version.
24
+
25
+ ## Reporting a bug
26
+
27
+ All security bugs in shopify repositories should be reported to [our hackerone program](https://hackerone.com/shopify)
28
+ Shopify's whitehat program is our way to reward security researchers for finding serious security vulnerabilities in the In Scope properties listed at the bottom of this page, including our core application (all functionality associated with a Shopify store, particularly your-store.myshopify.com/admin) and certain ancillary applications.
29
+
30
+ ## Disclosure Policy
31
+
32
+ We look forward to working with all security researchers and strive to be respectful, always assume the best and treat others as peers. We expect the same in return from all participants. To achieve this, our team strives to:
33
+
34
+ - Reply to all reports within one business day and triage within two business days (if applicable)
35
+ - Be as transparent as possible, answering all inquires about our report decisions and adding hackers to duplicate HackerOne reports
36
+ - Award bounties within a week of resolution (excluding extenuating circumstances)
37
+ - Only close reports as N/A when the issue reported is included in Known Issues, Ineligible Vulnerabilities Types or lacks evidence of a vulnerability
38
+
39
+ **The following rules must be followed in order for any rewards to be paid:**
40
+
41
+ - You may only test against shops you have created which include your HackerOne YOURHANDLE @ wearehackerone.com registered email address.
42
+ - You must not attempt to gain access to, or interact with, any shops other than those created by you.
43
+ - The use of commercial scanners is prohibited (e.g., Nessus).
44
+ - Rules for reporting must be followed.
45
+ - Do not disclose any issues publicly before they have been resolved.
46
+ - Shopify reserves the right to modify the rules for this program or deem any submissions invalid at any time. Shopify may cancel the whitehat program without notice at any time.
47
+ - Contacting Shopify Support over chat, email or phone about your HackerOne report is not allowed. We may disqualify you from receiving a reward, or from participating in the program altogether.
48
+ - You are not an employee of Shopify; employees should report bugs to the internal bug bounty program.
49
+ - You hereby represent, warrant and covenant that any content you submit to Shopify is an original work of authorship and that you are legally entitled to grant the rights and privileges conveyed by these terms. You further represent, warrant and covenant that the consent of no other person or entity is or will be necessary for Shopify to use the submitted content.
50
+ - By submitting content to Shopify, you irrevocably waive all moral rights which you may have in the content.
51
+ - All content submitted by you to Shopify under this program is licensed under the MIT License.
52
+ - You must report any discovered vulnerability to Shopify as soon as you have validated the vulnerability.
53
+ - Failure to follow any of the foregoing rules will disqualify you from participating in this program.
54
+
55
+ ** Please see our [Hackerone Profile](https://hackerone.com/shopify) for full details
56
+
57
+ ## Receiving Security Updates
58
+
59
+ To recieve all general updates to vulnerabilities, please subscribe to our hackerone [Hacktivity](https://hackerone.com/shopify/hacktivity)
@@ -7,6 +7,7 @@ module ShopifyApp
7
7
  included do
8
8
  include ShopifyApp::Localization
9
9
  include ShopifyApp::LoginProtection
10
+ include ShopifyApp::CsrfProtection
10
11
  include ShopifyApp::EmbeddedApp
11
12
  before_action :login_again_if_different_user_or_shop
12
13
  around_action :activate_shopify_session
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ShopifyApp
4
+ module RequireKnownShop
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ before_action :check_shop_domain
9
+ before_action :check_shop_known
10
+ end
11
+
12
+ def current_shopify_domain
13
+ return if params[:shop].blank?
14
+ @shopify_domain ||= ShopifyApp::Utils.sanitize_shop_domain(params[:shop])
15
+ end
16
+
17
+ private
18
+
19
+ def check_shop_domain
20
+ redirect_to(ShopifyApp.configuration.login_url) unless current_shopify_domain
21
+ end
22
+
23
+ def check_shop_known
24
+ @shop = SessionRepository.retrieve_shop_session_by_shopify_domain(current_shopify_domain)
25
+ redirect_to(shop_login) unless @shop
26
+ end
27
+
28
+ def shop_login
29
+ url = URI(ShopifyApp.configuration.login_url)
30
+
31
+ url.query = URI.encode_www_form(
32
+ shop: params[:shop],
33
+ return_to: request.fullpath,
34
+ )
35
+
36
+ url.to_s
37
+ end
38
+ end
39
+ end
@@ -6,10 +6,22 @@ module ShopifyApp
6
6
  include ShopifyApp::LoginProtection
7
7
 
8
8
  def callback
9
- if auth_hash
10
- login_shop
9
+ unless auth_hash
10
+ return respond_with_error
11
+ end
12
+
13
+ if jwt_request? && !valid_jwt_auth?
14
+ return respond_with_error
15
+ end
16
+
17
+ if jwt_request?
18
+ set_shopify_session
19
+ head(:ok)
20
+ else
21
+ reset_session_options
22
+ set_shopify_session
11
23
 
12
- if ShopifyApp::SessionRepository.user_storage.present? && user_session.blank?
24
+ if redirect_for_user_token?
13
25
  return redirect_to(login_url_with_optional_shop)
14
26
  end
15
27
 
@@ -18,17 +30,30 @@ module ShopifyApp
18
30
  perform_after_authenticate_job
19
31
 
20
32
  redirect_to(return_address)
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def respond_with_error
39
+ if jwt_request?
40
+ head(:unauthorized)
21
41
  else
22
42
  flash[:error] = I18n.t('could_not_log_in')
23
43
  redirect_to(login_url_with_optional_shop)
24
44
  end
25
45
  end
26
46
 
27
- private
47
+ def redirect_for_user_token?
48
+ ShopifyApp::SessionRepository.user_storage.present? && user_session.blank?
49
+ end
28
50
 
29
- def login_shop
30
- reset_session_options
31
- set_shopify_session
51
+ def jwt_request?
52
+ jwt_shopify_domain || jwt_shopify_user_id
53
+ end
54
+
55
+ def valid_jwt_auth?
56
+ auth_hash && jwt_shopify_domain == shop_name && jwt_shopify_user_id == associated_user_id
32
57
  end
33
58
 
34
59
  def auth_hash
@@ -40,9 +65,13 @@ module ShopifyApp
40
65
  end
41
66
 
42
67
  def associated_user
43
- return unless auth_hash['extra'].present?
68
+ return unless auth_hash.dig('extra', 'associated_user').present?
69
+
70
+ auth_hash['extra']['associated_user'].merge('scope' => auth_hash['extra']['associated_user_scope'])
71
+ end
44
72
 
45
- auth_hash['extra']['associated_user']
73
+ def associated_user_id
74
+ associated_user && associated_user['id']
46
75
  end
47
76
 
48
77
  def token
@@ -63,9 +92,11 @@ module ShopifyApp
63
92
 
64
93
  session[:shopify_user] = associated_user
65
94
  if session[:shopify_user].present?
95
+ session[:shop_id] = nil if shop_session && shop_session.domain != shop_name
66
96
  session[:user_id] = ShopifyApp::SessionRepository.store_user_session(session_store, associated_user)
67
97
  else
68
98
  session[:shop_id] = ShopifyApp::SessionRepository.store_shop_session(session_store)
99
+ session[:user_id] = nil if user_session && user_session.domain != shop_name
69
100
  end
70
101
  session[:shopify_domain] = shop_name
71
102
  session[:user_session] = auth_hash&.extra&.session
@@ -2,19 +2,14 @@
2
2
 
3
3
  module ShopifyApp
4
4
  class ExtensionVerificationController < ActionController::Base
5
+ include ShopifyApp::PayloadVerification
5
6
  protect_from_forgery with: :null_session
6
7
  before_action :verify_request
7
8
 
8
9
  private
9
10
 
10
11
  def verify_request
11
- hmac_header = request.headers['HTTP_X_SHOPIFY_HMAC_SHA256']
12
- request_body = request.body.read
13
- secret = ShopifyApp.configuration.secret
14
- digest = OpenSSL::Digest.new('sha256')
15
-
16
- expected_hmac = Base64.strict_encode64(OpenSSL::HMAC.digest(digest, secret, request_body))
17
- head(:unauthorized) unless ActiveSupport::SecurityUtils.secure_compare(expected_hmac, hmac_header)
12
+ head(:unauthorized) unless hmac_valid?(request.body.read)
18
13
  end
19
14
  end
20
15
  end
@@ -125,7 +125,7 @@ module ShopifyApp
125
125
  end
126
126
 
127
127
  def copy_return_to_param_to_session
128
- session[:return_to] = params[:return_to] if params[:return_to]
128
+ session[:return_to] = RedirectSafely.make_safe(params[:return_to], '/') if params[:return_to]
129
129
  end
130
130
 
131
131
  def render_invalid_shop_error
@@ -9,7 +9,7 @@ module ShopifyApp
9
9
  params.permit!
10
10
  job_args = { shop_domain: shop_domain, webhook: webhook_params.to_h }
11
11
  webhook_job_klass.perform_later(job_args)
12
- head(:no_content)
12
+ head(:ok)
13
13
  end
14
14
 
15
15
  private
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  nl:
3
- logged_out: je bentafgemeld
3
+ logged_out: Je bent afgemeld
4
4
  could_not_log_in: Kon niet aanmelden bij Shopify-winkel
5
5
  invalid_shop_url: Ongeldig winkeldomein
6
6
  enable_cookies_heading: Schakel cookies in van %{app}
@@ -1,7 +1,8 @@
1
1
  Quickstart
2
2
  ==========
3
3
 
4
- Get started building and deploying a new Shopify App to Heroku in just a few minutes. This guide assumes you have Ruby/Rails installed on your computer already; if you haven't done that already start with [this guide.](https://guides.rubyonrails.org/v5.0/getting_started.html#installing-rails)
4
+ Get started building and deploying a new Shopify App to Heroku in just a few minutes.
5
+ This guide assumes you have Ruby, Rails and PostgreSQL installed on your computer already; if you haven't done that already start with [this guide.](https://guides.rubyonrails.org/v5.0/getting_started.html#installing-rails)
5
6
 
6
7
  1. New Rails App (with postgres)
7
8
  --------------------------------
@@ -26,15 +27,6 @@ Head to the Heroku dashboard and create a new app, or run the following commands
26
27
  CLI:
27
28
  ```sh
28
29
  $ heroku create name
29
- $ heroku git:remote -a name
30
- ```
31
-
32
- Once you have created an app on Heroku, we need to let Git know where the Heroku server is so we can deploy to it later. Copy the app's name from your Heroku dashboard and substitute `appname.git` with the name you chose earlier:
33
-
34
- web:
35
- ```sh
36
- # https://dashboard.heroku.com/new
37
- $ git remote add heroku git@heroku.com:appname.git
38
30
  ```
39
31
 
40
32
  3. Create a new App in the Shopify Partner dashboard
@@ -48,11 +40,10 @@ $ git remote add heroku git@heroku.com:appname.git
48
40
  4. Add ShopifyApp to Gemfile
49
41
  ----------------------------
50
42
 
51
- Run these commands to add the `shopify_app` Gem to your app:
43
+ Run this command to add the `shopify_app` Gem to your app:
52
44
 
53
45
  ```sh
54
- $ echo "gem 'shopify_app'" >> Gemfile
55
- $ bundle install
46
+ $ bundle add shopify_app
56
47
  ```
57
48
 
58
49
  **Note:** we recommend using the latest version of Shopify Gem. Check the [Git tags](https://github.com/Shopify/shopify_app/tags) to see the latest release version and then add it to your Gemfile e.g `gem 'shopify_app', '~> 7.0.0'`
@@ -64,14 +55,13 @@ Generate the code for your app by running these commands:
64
55
 
65
56
  ```sh
66
57
  # Use the keys from your app you created in the partners area
67
- $ rails generate shopify_app --api_key <shopify_api_key> --secret <shopify_api_secret>
58
+ $ rails generate shopify_app
68
59
  $ git add .
69
60
  $ git commit -m 'generated shopify app'
70
61
  ```
71
62
 
72
- If you forget to set your keys or redirect uri above, you will find them in the shopify_app initializer at: `/config/initializers/shopify_app.rb`.
73
-
74
- We recommend adding a gem or utilizing environment variables (`.env`) to handle your keys before releasing your app. [Learn more about using environment variables.](https://www.honeybadger.io/blog/ruby-guide-environment-variables/)
63
+ Your API key and secret are read from environment variables. Refer to the main
64
+ README for further details on how to set this up.
75
65
 
76
66
  6. Deploy your app
77
67
  ---------
@@ -3,6 +3,7 @@ Releasing ShopifyApp
3
3
  1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
4
  2. Create a pull request with the following changes:
5
5
  * Update the version of ShopifyApp in lib/shopify_app/version.rb
6
+ * Update the version of shopify_app in package.json
6
7
  * Add a CHANGELOG entry for the new release with the date
7
8
  * Change the title of the PR to something like: "Packaging for release X.Y.Z"
8
9
  3. Merge your pull request
@@ -20,7 +20,5 @@ if (!document.documentElement.hasAttribute("data-turbolinks-preview")) {
20
20
  isError: true,
21
21
  }).dispatch(Toast.Action.SHOW);
22
22
  }
23
-
24
- document.removeEventListener(eventName, flash)
25
23
  });
26
24
  }
@@ -8,7 +8,7 @@ ShopifyApp.configure do |config|
8
8
  config.embedded_app = <%= embedded_app? %>
9
9
  config.after_authenticate_job = false
10
10
  config.api_version = "<%= @api_version %>"
11
- config.shop_session_repository = 'ShopifyApp::InMemoryShopSessionStore'
11
+ config.shop_session_repository = 'Shop'
12
12
  end
13
13
 
14
14
  # ShopifyApp::Utils.fetch_known_api_versions # Uncomment to fetch known api versions from shopify servers on boot
@@ -4,6 +4,7 @@ require 'shopify_app/version'
4
4
  # deps
5
5
  require 'shopify_api'
6
6
  require 'omniauth-shopify-oauth2'
7
+ require 'redirect_safely'
7
8
 
8
9
  module ShopifyApp
9
10
  def self.rails6?
@@ -26,12 +27,14 @@ module ShopifyApp
26
27
  require 'shopify_app/utils'
27
28
 
28
29
  # controller concerns
30
+ require 'shopify_app/controller_concerns/csrf_protection'
29
31
  require 'shopify_app/controller_concerns/localization'
30
32
  require 'shopify_app/controller_concerns/itp'
31
33
  require 'shopify_app/controller_concerns/login_protection'
32
34
  require 'shopify_app/controller_concerns/embedded_app'
33
- require 'shopify_app/controller_concerns/webhook_verification'
35
+ require 'shopify_app/controller_concerns/payload_verification'
34
36
  require 'shopify_app/controller_concerns/app_proxy_verification'
37
+ require 'shopify_app/controller_concerns/webhook_verification'
35
38
 
36
39
  # jobs
37
40
  require 'shopify_app/jobs/webhooks_manager_job'
@@ -42,6 +45,7 @@ module ShopifyApp
42
45
  require 'shopify_app/managers/scripttags_manager'
43
46
 
44
47
  # middleware
48
+ require 'shopify_app/middleware/jwt_middleware'
45
49
  require 'shopify_app/middleware/same_site_cookie_middleware'
46
50
 
47
51
  # session
@@ -2,7 +2,6 @@
2
2
  module ShopifyApp
3
3
  module AppProxyVerification
4
4
  extend ActiveSupport::Concern
5
-
6
5
  included do
7
6
  skip_before_action :verify_authenticity_token, raise: false
8
7
  before_action :verify_proxy_request
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyApp
3
+ module CsrfProtection
4
+ extend ActiveSupport::Concern
5
+ included do
6
+ protect_from_forgery with: :exception, unless: :valid_session_token?
7
+ end
8
+
9
+ private
10
+
11
+ def valid_session_token?
12
+ request.env['jwt.shopify_domain']
13
+ end
14
+ end
15
+ end
@@ -83,17 +83,11 @@ module ShopifyApp
83
83
  protected
84
84
 
85
85
  def jwt_shopify_domain
86
- return unless jwt
87
- @jwt_shopify_domain ||= JWT.new(jwt).shopify_domain
86
+ request.env['jwt.shopify_domain']
88
87
  end
89
88
 
90
89
  def jwt_shopify_user_id
91
- return unless jwt
92
- @jwt_user_id ||= JWT.new(jwt).shopify_user_id
93
- end
94
-
95
- def jwt
96
- @jwt ||= authenticate_with_http_token { |token| token }
90
+ request.env['jwt.shopify_user_id']
97
91
  end
98
92
 
99
93
  def redirect_to_login
@@ -139,7 +133,7 @@ module ShopifyApp
139
133
  query_params = {}
140
134
  query_params[:shop] = sanitized_params[:shop] if params[:shop].present?
141
135
 
142
- return_to = session[:return_to] || params[:return_to]
136
+ return_to = RedirectSafely.make_safe(session[:return_to] || params[:return_to], nil)
143
137
 
144
138
  if return_to.present? && return_to_param_required?
145
139
  query_params[:return_to] = return_to
@@ -170,7 +164,10 @@ module ShopifyApp
170
164
  end
171
165
 
172
166
  def current_shopify_domain
173
- shopify_domain = sanitized_shop_name || session[:shopify_domain]
167
+ shopify_domain = sanitized_shop_name ||
168
+ jwt_shopify_domain ||
169
+ session[:shopify_domain]
170
+
174
171
  return shopify_domain if shopify_domain.present?
175
172
 
176
173
  raise ShopifyDomainNotFound
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyApp
3
+ module PayloadVerification
4
+ extend ActiveSupport::Concern
5
+
6
+ private
7
+
8
+ def shopify_hmac
9
+ request.headers['HTTP_X_SHOPIFY_HMAC_SHA256']
10
+ end
11
+
12
+ def hmac_valid?(data)
13
+ secrets = [ShopifyApp.configuration.secret, ShopifyApp.configuration.old_secret].reject(&:blank?)
14
+
15
+ secrets.any? do |secret|
16
+ digest = OpenSSL::Digest.new('sha256')
17
+ ActiveSupport::SecurityUtils.secure_compare(
18
+ shopify_hmac,
19
+ Base64.strict_encode64(OpenSSL::HMAC.digest(digest, secret, data))
20
+ )
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,6 +2,7 @@
2
2
  module ShopifyApp
3
3
  module WebhookVerification
4
4
  extend ActiveSupport::Concern
5
+ include ShopifyApp::PayloadVerification
5
6
 
6
7
  included do
7
8
  skip_before_action :verify_authenticity_token, raise: false
@@ -15,25 +16,8 @@ module ShopifyApp
15
16
  return head(:unauthorized) unless hmac_valid?(data)
16
17
  end
17
18
 
18
- def hmac_valid?(data)
19
- secrets = [ShopifyApp.configuration.secret, ShopifyApp.configuration.old_secret].reject(&:blank?)
20
-
21
- secrets.any? do |secret|
22
- digest = OpenSSL::Digest.new('sha256')
23
-
24
- ActiveSupport::SecurityUtils.secure_compare(
25
- shopify_hmac,
26
- Base64.strict_encode64(OpenSSL::HMAC.digest(digest, secret, data))
27
- )
28
- end
29
- end
30
-
31
19
  def shop_domain
32
20
  request.headers['HTTP_X_SHOPIFY_SHOP_DOMAIN']
33
21
  end
34
-
35
- def shopify_hmac
36
- request.headers['HTTP_X_SHOPIFY_HMAC_SHA256']
37
- end
38
22
  end
39
23
  end
@@ -16,6 +16,10 @@ module ShopifyApp
16
16
 
17
17
  initializer "shopify_app.middleware" do |app|
18
18
  app.config.middleware.insert_after(::Rack::Runtime, ShopifyApp::SameSiteCookieMiddleware)
19
+
20
+ if ShopifyApp.configuration.allow_jwt_authentication
21
+ app.config.middleware.insert_after(ShopifyApp::SameSiteCookieMiddleware, ShopifyApp::JWTMiddleware)
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyApp
3
+ class JWTMiddleware
4
+ TOKEN_REGEX = /^Bearer\s+(.*?)$/
5
+
6
+ def initialize(app)
7
+ @app = app
8
+ end
9
+
10
+ def call(env)
11
+ return call_next(env) unless authorization_header(env)
12
+
13
+ token = extract_token(env)
14
+ return call_next(env) unless token
15
+
16
+ set_env_variables(token, env)
17
+ call_next(env)
18
+ end
19
+
20
+ private
21
+
22
+ def call_next(env)
23
+ @app.call(env)
24
+ end
25
+
26
+ def authorization_header(env)
27
+ env['HTTP_AUTHORIZATION']
28
+ end
29
+
30
+ def extract_token(env)
31
+ match = authorization_header(env).match(TOKEN_REGEX)
32
+ match && match[1]
33
+ end
34
+
35
+ def set_env_variables(token, env)
36
+ jwt = ShopifyApp::JWT.new(token)
37
+
38
+ env['jwt.shopify_domain'] = jwt.shopify_domain
39
+ env['jwt.shopify_user_id'] = jwt.shopify_user_id
40
+ end
41
+ end
42
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyApp
3
- VERSION = '13.1.0'
3
+ VERSION = '13.4.1'
4
4
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "13.0.0",
3
+ "version": "13.4.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -53,12 +53,6 @@
53
53
  "minimist": "^1.2.0"
54
54
  }
55
55
  },
56
- "lodash": {
57
- "version": "4.17.15",
58
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
59
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
60
- "dev": true
61
- },
62
56
  "ms": {
63
57
  "version": "2.1.2",
64
58
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -78,14 +72,6 @@
78
72
  "lodash": "^4.17.13",
79
73
  "source-map": "^0.5.0",
80
74
  "trim-right": "^1.0.1"
81
- },
82
- "dependencies": {
83
- "lodash": {
84
- "version": "4.17.15",
85
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
86
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
87
- "dev": true
88
- }
89
75
  }
90
76
  },
91
77
  "@babel/helper-annotate-as-pure": {
@@ -151,14 +137,6 @@
151
137
  "@babel/helper-function-name": "^7.1.0",
152
138
  "@babel/types": "^7.5.5",
153
139
  "lodash": "^4.17.13"
154
- },
155
- "dependencies": {
156
- "lodash": {
157
- "version": "4.17.15",
158
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
159
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
160
- "dev": true
161
- }
162
140
  }
163
141
  },
164
142
  "@babel/helper-explode-assignable-expression": {
@@ -230,14 +208,6 @@
230
208
  "@babel/template": "^7.4.4",
231
209
  "@babel/types": "^7.5.5",
232
210
  "lodash": "^4.17.13"
233
- },
234
- "dependencies": {
235
- "lodash": {
236
- "version": "4.17.15",
237
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
238
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
239
- "dev": true
240
- }
241
211
  }
242
212
  },
243
213
  "@babel/helper-optimise-call-expression": {
@@ -262,14 +232,6 @@
262
232
  "dev": true,
263
233
  "requires": {
264
234
  "lodash": "^4.17.13"
265
- },
266
- "dependencies": {
267
- "lodash": {
268
- "version": "4.17.15",
269
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
270
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
271
- "dev": true
272
- }
273
235
  }
274
236
  },
275
237
  "@babel/helper-remap-async-to-generator": {
@@ -598,14 +560,6 @@
598
560
  "requires": {
599
561
  "@babel/helper-plugin-utils": "^7.0.0",
600
562
  "lodash": "^4.17.13"
601
- },
602
- "dependencies": {
603
- "lodash": {
604
- "version": "4.17.15",
605
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
606
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
607
- "dev": true
608
- }
609
563
  }
610
564
  },
611
565
  "@babel/plugin-transform-classes": {
@@ -1056,12 +1010,6 @@
1056
1010
  "ms": "^2.1.1"
1057
1011
  }
1058
1012
  },
1059
- "lodash": {
1060
- "version": "4.17.15",
1061
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
1062
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
1063
- "dev": true
1064
- },
1065
1013
  "ms": {
1066
1014
  "version": "2.1.2",
1067
1015
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -1079,14 +1027,6 @@
1079
1027
  "esutils": "^2.0.2",
1080
1028
  "lodash": "^4.17.13",
1081
1029
  "to-fast-properties": "^2.0.0"
1082
- },
1083
- "dependencies": {
1084
- "lodash": {
1085
- "version": "4.17.15",
1086
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
1087
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
1088
- "dev": true
1089
- }
1090
1030
  }
1091
1031
  },
1092
1032
  "@sinonjs/commons": {
@@ -1117,14 +1057,6 @@
1117
1057
  "@sinonjs/commons": "^1.3.0",
1118
1058
  "array-from": "^2.1.1",
1119
1059
  "lodash": "^4.17.15"
1120
- },
1121
- "dependencies": {
1122
- "lodash": {
1123
- "version": "4.17.15",
1124
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
1125
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
1126
- "dev": true
1127
- }
1128
1060
  }
1129
1061
  },
1130
1062
  "@sinonjs/text-encoding": {
@@ -4579,9 +4511,9 @@
4579
4511
  }
4580
4512
  },
4581
4513
  "lodash": {
4582
- "version": "4.17.15",
4583
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
4584
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
4514
+ "version": "4.17.19",
4515
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
4516
+ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
4585
4517
  "dev": true
4586
4518
  },
4587
4519
  "log-symbols": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "13.0.1",
3
+ "version": "13.4.1",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
@@ -13,11 +13,12 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.metadata['allowed_push_host'] = 'https://rubygems.org'
15
15
 
16
- s.add_runtime_dependency('browser_sniffer', '~> 1.2.0')
16
+ s.add_runtime_dependency('browser_sniffer', '~> 1.2.2')
17
17
  s.add_runtime_dependency('rails', '> 5.2.1')
18
- s.add_runtime_dependency('shopify_api', '~> 9.0.2')
18
+ s.add_runtime_dependency('shopify_api', '~> 9.1')
19
19
  s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 2.2.2')
20
20
  s.add_runtime_dependency('jwt', '~> 2.2.1')
21
+ s.add_runtime_dependency('redirect_safely', '~> 1.0')
21
22
 
22
23
  s.add_development_dependency('rake')
23
24
  s.add_development_dependency('byebug')
data/yarn.lock CHANGED
@@ -3202,9 +3202,9 @@ locate-path@^3.0.0:
3202
3202
  path-exists "^3.0.0"
3203
3203
 
3204
3204
  lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
3205
- version "4.17.15"
3206
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
3207
- integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
3205
+ version "4.17.19"
3206
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
3207
+ integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
3208
3208
 
3209
3209
  log-symbols@2.2.0:
3210
3210
  version "2.2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.1.0
4
+ version: 13.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0
19
+ version: 1.2.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.0
26
+ version: 1.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 9.0.2
47
+ version: '9.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 9.0.2
54
+ version: '9.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: omniauth-shopify-oauth2
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.2.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: redirect_safely
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rake
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -229,7 +243,9 @@ files:
229
243
  - ".babelrc"
230
244
  - ".github/CODEOWNERS"
231
245
  - ".github/ISSUE_TEMPLATE.md"
246
+ - ".github/PULL_REQUEST_TEMPLATE.md"
232
247
  - ".github/probots.yml"
248
+ - ".github/workflows/rubocop.yml"
233
249
  - ".gitignore"
234
250
  - ".nvmrc"
235
251
  - ".rubocop.yml"
@@ -240,6 +256,7 @@ files:
240
256
  - LICENSE
241
257
  - README.md
242
258
  - Rakefile
259
+ - SECURITY.md
243
260
  - app/assets/images/storage_access.svg
244
261
  - app/assets/javascripts/shopify_app/enable_cookies.js
245
262
  - app/assets/javascripts/shopify_app/itp_helper.js
@@ -251,6 +268,7 @@ files:
251
268
  - app/assets/javascripts/shopify_app/top_level.js
252
269
  - app/assets/javascripts/shopify_app/top_level_interaction.js
253
270
  - app/controllers/concerns/shopify_app/authenticated.rb
271
+ - app/controllers/concerns/shopify_app/require_known_shop.rb
254
272
  - app/controllers/shopify_app/authenticated_controller.rb
255
273
  - app/controllers/shopify_app/callback_controller.rb
256
274
  - app/controllers/shopify_app/extension_verification_controller.rb
@@ -341,16 +359,19 @@ files:
341
359
  - lib/shopify_app.rb
342
360
  - lib/shopify_app/configuration.rb
343
361
  - lib/shopify_app/controller_concerns/app_proxy_verification.rb
362
+ - lib/shopify_app/controller_concerns/csrf_protection.rb
344
363
  - lib/shopify_app/controller_concerns/embedded_app.rb
345
364
  - lib/shopify_app/controller_concerns/itp.rb
346
365
  - lib/shopify_app/controller_concerns/localization.rb
347
366
  - lib/shopify_app/controller_concerns/login_protection.rb
367
+ - lib/shopify_app/controller_concerns/payload_verification.rb
348
368
  - lib/shopify_app/controller_concerns/webhook_verification.rb
349
369
  - lib/shopify_app/engine.rb
350
370
  - lib/shopify_app/jobs/scripttags_manager_job.rb
351
371
  - lib/shopify_app/jobs/webhooks_manager_job.rb
352
372
  - lib/shopify_app/managers/scripttags_manager.rb
353
373
  - lib/shopify_app/managers/webhooks_manager.rb
374
+ - lib/shopify_app/middleware/jwt_middleware.rb
354
375
  - lib/shopify_app/middleware/same_site_cookie_middleware.rb
355
376
  - lib/shopify_app/session/in_memory_session_store.rb
356
377
  - lib/shopify_app/session/in_memory_shop_session_store.rb