shopify_app 13.3.0 → 13.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6666c7899ac8e3332bf950ce28d445e2fc40886c811631a4bfb3f1e446c286e0
4
- data.tar.gz: f85b1b7ed7a77e2430ed955ed0f65bd30b5021d85614da8943332077a999d38e
3
+ metadata.gz: 3f4300bbcbbf4e0e2c6b64d3943a83f8eda2774615016551b109880b21cb32d6
4
+ data.tar.gz: 68eca06abf0153e592b7a167bcaf0b60720213e351355737c59eafba01f65e82
5
5
  SHA512:
6
- metadata.gz: 6582a20d5b5340e7259aef06660e0a2673f31cc0b9413d6d8fda0a7c7fa34982f7dc08cd69f78cad2a0d4e322aedddcc6e472ba368ac4066f1215dc5daaacc4d
7
- data.tar.gz: c9bf293b825e474f3ef73353428309baa0c3536c7781597b58ca083fc03b587e210e05dbbdc398edf235b225a537dd3dd02bb612176625d42743a2ae1978aeec
6
+ metadata.gz: 9052491aa073afeacbb8cc6dc5bd6e12fe73c4935ed36e823ed5b3966df8c240d1e1a48e9adf02444c79e4aacada04b85e0de8184ea8148b9227589ef600fc6c
7
+ data.tar.gz: a78d6b3a5fb2a02c3122afabd2a4b2e564f5e5d0c7cb530622004e39143f695e0fbb804a9be20379a245e600330e08e3e8837dfb9dafe0ad8ceeade613c07c3d
@@ -1,3 +1,7 @@
1
+ 13.4.0
2
+ ------
3
+ * 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)
4
+
1
5
  13.3.0
2
6
  ------
3
7
  * Added Payload Verification module [#992](https://github.com/Shopify/shopify_app/pull/992)
data/README.md CHANGED
@@ -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.
@@ -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
@@ -40,11 +40,10 @@ $ heroku create name
40
40
  4. Add ShopifyApp to Gemfile
41
41
  ----------------------------
42
42
 
43
- 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:
44
44
 
45
45
  ```sh
46
- $ echo "gem 'shopify_app'" >> Gemfile
47
- $ bundle install
46
+ $ bundle add shopify_app
48
47
  ```
49
48
 
50
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'`
@@ -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
  }
@@ -27,6 +27,7 @@ module ShopifyApp
27
27
  require 'shopify_app/utils'
28
28
 
29
29
  # controller concerns
30
+ require 'shopify_app/controller_concerns/csrf_protection'
30
31
  require 'shopify_app/controller_concerns/localization'
31
32
  require 'shopify_app/controller_concerns/itp'
32
33
  require 'shopify_app/controller_concerns/login_protection'
@@ -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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyApp
3
- VERSION = '13.3.0'
3
+ VERSION = '13.4.0'
4
4
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "13.3.0",
3
+ "version": "13.4.0",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
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.3.0
4
+ version: 13.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-01 00:00:00.000000000 Z
11
+ date: 2020-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -358,6 +358,7 @@ files:
358
358
  - lib/shopify_app.rb
359
359
  - lib/shopify_app/configuration.rb
360
360
  - lib/shopify_app/controller_concerns/app_proxy_verification.rb
361
+ - lib/shopify_app/controller_concerns/csrf_protection.rb
361
362
  - lib/shopify_app/controller_concerns/embedded_app.rb
362
363
  - lib/shopify_app/controller_concerns/itp.rb
363
364
  - lib/shopify_app/controller_concerns/localization.rb