shopify_app 17.1.1 → 17.2.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: b7c85212f0a947dfc426afa1c06eec9330bfd47ff42794f05d070e7e01cdbe42
4
- data.tar.gz: f919606ea20ae9b7626983783dc99aa1fc7776fc0cc2fe1f87b35653847f86ee
3
+ metadata.gz: 88d5209cb72a9fd96ac20c09e3a253625e1b4bb0d3984ec3d492e14a9752cb06
4
+ data.tar.gz: 6b322c48546fcf069a949f44acf1e39649948233ed1f06076037883d2037a0e5
5
5
  SHA512:
6
- metadata.gz: 0ed7553a6e6c0397668e7897bb42871bc96375f2773d017f18c3ef60572fb3979cd7ce101c3ffcf601057134676b4881aa96097123438ba83275c20086a9d4aa
7
- data.tar.gz: 2a37f8439ad82010abddbc9108e08de3d8ef3c574a7ee24b67eb3ec36cfd36856563658f2f5014815a9cbea7210f495f8672337b6cd2c0ce5445e61a46753ce8
6
+ metadata.gz: 03c81a3c3bb325970ffeea7dcf1d238b3558260dfd48f8a1fb30bd75328444a19d6493847c83c8314f596e66881129a5965d10c74612eb9fa0703ab0b86c0c42
7
+ data.tar.gz: 55e7b76c79faa4599c9b6b35392ebe9be03c9300401655aa92443c43f4c7ba9cd8fca2f896a153852e4ef0a9de28e764f9d001a729d93408b17f3898de0ea17a
data/.github/CODEOWNERS CHANGED
@@ -1 +1,2 @@
1
1
  * @shopify/platform-dev-tools-education
2
+ * @shopify/app-foundations
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased
2
2
  ----------
3
3
 
4
+ 17.2.0 (April 1, 2021)
5
+ ----------
6
+ * Support Rails `v6.1` [#1221](https://github.com/Shopify/shopify_app/pull/1221)
7
+ * Check out [Upgrading to `v17.2.0`](/docs/Upgrading.md#upgrading-to-v1720) in the Upgrading.md guide for the changes needed to support Rails `v6.1`
8
+
4
9
  17.1.1 (March 12, 2021)
5
10
  ----------
6
11
  * Fix issues with mocking OmniAuth callback controller tests [#1210](https://github.com/Shopify/shopify_app/pull/1210)
data/Gemfile.lock CHANGED
@@ -1,80 +1,84 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_app (17.1.1)
4
+ shopify_app (17.2.0)
5
5
  browser_sniffer (~> 1.2.2)
6
6
  jwt (~> 2.2.1)
7
7
  omniauth-shopify-oauth2 (~> 2.2.2)
8
- rails (> 5.2.1, < 6.1)
8
+ rails (> 5.2.1, < 6.2)
9
9
  redirect_safely (~> 1.0)
10
10
  shopify_api (~> 9.4)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- actioncable (6.0.3.5)
16
- actionpack (= 6.0.3.5)
15
+ actioncable (6.1.3.1)
16
+ actionpack (= 6.1.3.1)
17
+ activesupport (= 6.1.3.1)
17
18
  nio4r (~> 2.0)
18
19
  websocket-driver (>= 0.6.1)
19
- actionmailbox (6.0.3.5)
20
- actionpack (= 6.0.3.5)
21
- activejob (= 6.0.3.5)
22
- activerecord (= 6.0.3.5)
23
- activestorage (= 6.0.3.5)
24
- activesupport (= 6.0.3.5)
20
+ actionmailbox (6.1.3.1)
21
+ actionpack (= 6.1.3.1)
22
+ activejob (= 6.1.3.1)
23
+ activerecord (= 6.1.3.1)
24
+ activestorage (= 6.1.3.1)
25
+ activesupport (= 6.1.3.1)
25
26
  mail (>= 2.7.1)
26
- actionmailer (6.0.3.5)
27
- actionpack (= 6.0.3.5)
28
- actionview (= 6.0.3.5)
29
- activejob (= 6.0.3.5)
27
+ actionmailer (6.1.3.1)
28
+ actionpack (= 6.1.3.1)
29
+ actionview (= 6.1.3.1)
30
+ activejob (= 6.1.3.1)
31
+ activesupport (= 6.1.3.1)
30
32
  mail (~> 2.5, >= 2.5.4)
31
33
  rails-dom-testing (~> 2.0)
32
- actionpack (6.0.3.5)
33
- actionview (= 6.0.3.5)
34
- activesupport (= 6.0.3.5)
35
- rack (~> 2.0, >= 2.0.8)
34
+ actionpack (6.1.3.1)
35
+ actionview (= 6.1.3.1)
36
+ activesupport (= 6.1.3.1)
37
+ rack (~> 2.0, >= 2.0.9)
36
38
  rack-test (>= 0.6.3)
37
39
  rails-dom-testing (~> 2.0)
38
40
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
39
- actiontext (6.0.3.5)
40
- actionpack (= 6.0.3.5)
41
- activerecord (= 6.0.3.5)
42
- activestorage (= 6.0.3.5)
43
- activesupport (= 6.0.3.5)
41
+ actiontext (6.1.3.1)
42
+ actionpack (= 6.1.3.1)
43
+ activerecord (= 6.1.3.1)
44
+ activestorage (= 6.1.3.1)
45
+ activesupport (= 6.1.3.1)
44
46
  nokogiri (>= 1.8.5)
45
- actionview (6.0.3.5)
46
- activesupport (= 6.0.3.5)
47
+ actionview (6.1.3.1)
48
+ activesupport (= 6.1.3.1)
47
49
  builder (~> 3.1)
48
50
  erubi (~> 1.4)
49
51
  rails-dom-testing (~> 2.0)
50
52
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
51
- activejob (6.0.3.5)
52
- activesupport (= 6.0.3.5)
53
+ activejob (6.1.3.1)
54
+ activesupport (= 6.1.3.1)
53
55
  globalid (>= 0.3.6)
54
- activemodel (6.0.3.5)
55
- activesupport (= 6.0.3.5)
56
+ activemodel (6.1.3.1)
57
+ activesupport (= 6.1.3.1)
56
58
  activemodel-serializers-xml (1.0.2)
57
59
  activemodel (> 5.x)
58
60
  activesupport (> 5.x)
59
61
  builder (~> 3.1)
60
- activerecord (6.0.3.5)
61
- activemodel (= 6.0.3.5)
62
- activesupport (= 6.0.3.5)
62
+ activerecord (6.1.3.1)
63
+ activemodel (= 6.1.3.1)
64
+ activesupport (= 6.1.3.1)
63
65
  activeresource (5.1.1)
64
66
  activemodel (>= 5.0, < 7)
65
67
  activemodel-serializers-xml (~> 1.0)
66
68
  activesupport (>= 5.0, < 7)
67
- activestorage (6.0.3.5)
68
- actionpack (= 6.0.3.5)
69
- activejob (= 6.0.3.5)
70
- activerecord (= 6.0.3.5)
71
- marcel (~> 0.3.1)
72
- activesupport (6.0.3.5)
69
+ activestorage (6.1.3.1)
70
+ actionpack (= 6.1.3.1)
71
+ activejob (= 6.1.3.1)
72
+ activerecord (= 6.1.3.1)
73
+ activesupport (= 6.1.3.1)
74
+ marcel (~> 1.0.0)
75
+ mini_mime (~> 1.0.2)
76
+ activesupport (6.1.3.1)
73
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
74
- i18n (>= 0.7, < 2)
75
- minitest (~> 5.1)
76
- tzinfo (~> 1.1)
77
- zeitwerk (~> 2.2, >= 2.2.2)
78
+ i18n (>= 1.6, < 2)
79
+ minitest (>= 5.1)
80
+ tzinfo (~> 2.0)
81
+ zeitwerk (~> 2.3)
78
82
  addressable (2.7.0)
79
83
  public_suffix (>= 2.0.2, < 5.0)
80
84
  ast (2.4.1)
@@ -88,7 +92,7 @@ GEM
88
92
  crack (0.4.4)
89
93
  crass (1.0.6)
90
94
  debug_inspector (0.0.3)
91
- erubi (1.9.0)
95
+ erubi (1.10.0)
92
96
  faraday (1.3.0)
93
97
  faraday-net_http (~> 1.0)
94
98
  multipart-post (>= 1.2, < 3)
@@ -96,7 +100,7 @@ GEM
96
100
  faraday-net_http (1.0.1)
97
101
  globalid (0.4.2)
98
102
  activesupport (>= 4.2.0)
99
- graphql (1.12.5)
103
+ graphql (1.12.6)
100
104
  graphql-client (0.16.0)
101
105
  activesupport (>= 3.0)
102
106
  graphql (~> 1.8)
@@ -105,16 +109,14 @@ GEM
105
109
  i18n (1.8.9)
106
110
  concurrent-ruby (~> 1.0)
107
111
  jwt (2.2.2)
108
- loofah (2.7.0)
112
+ loofah (2.9.0)
109
113
  crass (~> 1.0.2)
110
114
  nokogiri (>= 1.5.9)
111
115
  mail (2.7.1)
112
116
  mini_mime (>= 0.1.1)
113
- marcel (0.3.3)
114
- mimemagic (~> 0.3.2)
117
+ marcel (1.0.0)
115
118
  method_source (0.9.2)
116
- mimemagic (0.3.5)
117
- mini_mime (1.0.2)
119
+ mini_mime (1.0.3)
118
120
  mini_portile2 (2.5.0)
119
121
  minitest (5.14.4)
120
122
  mocha (1.11.2)
@@ -122,10 +124,10 @@ GEM
122
124
  multi_xml (0.6.0)
123
125
  multipart-post (2.1.1)
124
126
  nio4r (2.5.7)
125
- nokogiri (1.11.1)
127
+ nokogiri (1.11.2)
126
128
  mini_portile2 (~> 2.5.0)
127
129
  racc (~> 1.4)
128
- oauth2 (1.4.4)
130
+ oauth2 (1.4.7)
129
131
  faraday (>= 0.8, < 2.0)
130
132
  jwt (>= 1.0, < 3.0)
131
133
  multi_json (~> 1.3)
@@ -156,20 +158,20 @@ GEM
156
158
  rack (2.2.3)
157
159
  rack-test (1.1.0)
158
160
  rack (>= 1.0, < 3)
159
- rails (6.0.3.5)
160
- actioncable (= 6.0.3.5)
161
- actionmailbox (= 6.0.3.5)
162
- actionmailer (= 6.0.3.5)
163
- actionpack (= 6.0.3.5)
164
- actiontext (= 6.0.3.5)
165
- actionview (= 6.0.3.5)
166
- activejob (= 6.0.3.5)
167
- activemodel (= 6.0.3.5)
168
- activerecord (= 6.0.3.5)
169
- activestorage (= 6.0.3.5)
170
- activesupport (= 6.0.3.5)
171
- bundler (>= 1.3.0)
172
- railties (= 6.0.3.5)
161
+ rails (6.1.3.1)
162
+ actioncable (= 6.1.3.1)
163
+ actionmailbox (= 6.1.3.1)
164
+ actionmailer (= 6.1.3.1)
165
+ actionpack (= 6.1.3.1)
166
+ actiontext (= 6.1.3.1)
167
+ actionview (= 6.1.3.1)
168
+ activejob (= 6.1.3.1)
169
+ activemodel (= 6.1.3.1)
170
+ activerecord (= 6.1.3.1)
171
+ activestorage (= 6.1.3.1)
172
+ activesupport (= 6.1.3.1)
173
+ bundler (>= 1.15.0)
174
+ railties (= 6.1.3.1)
173
175
  sprockets-rails (>= 2.0.0)
174
176
  rails-controller-testing (1.0.5)
175
177
  actionpack (>= 5.0.1.rc1)
@@ -180,12 +182,12 @@ GEM
180
182
  nokogiri (>= 1.6)
181
183
  rails-html-sanitizer (1.3.0)
182
184
  loofah (~> 2.3)
183
- railties (6.0.3.5)
184
- actionpack (= 6.0.3.5)
185
- activesupport (= 6.0.3.5)
185
+ railties (6.1.3.1)
186
+ actionpack (= 6.1.3.1)
187
+ activesupport (= 6.1.3.1)
186
188
  method_source
187
189
  rake (>= 0.8.7)
188
- thor (>= 0.20.3, < 2.0)
190
+ thor (~> 1.0)
189
191
  rainbow (3.0.0)
190
192
  rake (13.0.3)
191
193
  rb-readline (0.5.5)
@@ -208,7 +210,7 @@ GEM
208
210
  rubocop (~> 1.4)
209
211
  ruby-progressbar (1.10.1)
210
212
  ruby2_keywords (0.0.4)
211
- shopify_api (9.4.0)
213
+ shopify_api (9.4.1)
212
214
  activeresource (>= 4.1.0, < 6.0.0)
213
215
  graphql-client
214
216
  rack
@@ -221,9 +223,8 @@ GEM
221
223
  sprockets (>= 3.0.0)
222
224
  sqlite3 (1.4.2)
223
225
  thor (1.1.0)
224
- thread_safe (0.3.6)
225
- tzinfo (1.2.9)
226
- thread_safe (~> 0.1)
226
+ tzinfo (2.0.4)
227
+ concurrent-ruby (~> 1.0)
227
228
  unicode-display_width (1.7.0)
228
229
  webmock (3.9.1)
229
230
  addressable (>= 2.3.6)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [gem]: https://img.shields.io/gem/v/shopify_app.svg
6
6
  [gem_url]: https://rubygems.org/gems/shopify_app
7
- [supported_rails_version]: https://img.shields.io/badge/rails-%3C6.1.0-orange
7
+ [supported_rails_version]: https://img.shields.io/badge/rails-%3C6.2.0-orange
8
8
 
9
9
  This gem builds Rails applications that can be embedded in the Shopify Admin.
10
10
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  nl:
3
3
  logged_out: Je bent afgemeld
4
- could_not_log_in: Kon niet aanmelden bij Shopify-winkel
4
+ could_not_log_in: Kon niet inloggen bij Shopify-winkel
5
5
  invalid_shop_url: Ongeldig winkeldomein
6
6
  enable_cookies_heading: Schakel cookies in van %{app}
7
7
  enable_cookies_body: Je moet cookies in deze browser handmatig inschakelen om %{app}
@@ -5,8 +5,12 @@
5
5
  [Generators](#generators)
6
6
  * [The `shopify_app:install` generator hangs](#the-shopifyappinstall-generator-hangs)
7
7
 
8
+ [Rails](#rails)
9
+ * [Known issues with Rails `v6.1`](#known-issues-with-rails-v61)
10
+
8
11
  [App installation](#app-installation)
9
12
  * [My app won't install](#my-app-wont-install)
13
+ * [My app keeps redirecting to login](#my-app-keeps-redirecting-to-login)
10
14
 
11
15
  [JWT session tokens](#jwt-session-tokens)
12
16
  * [My app is still using cookies to authenticate](#my-app-is-still-using-cookies-to-authenticate)
@@ -24,6 +28,35 @@ $ bundle exec spring stop
24
28
 
25
29
  Run shopify_app generator again.
26
30
 
31
+ ## Rails
32
+
33
+ ### Known issues with Rails `v6.1`
34
+
35
+ If you recently upgraded your application's `Rails::Application` configuration to load the default configuration for Rails `v6.1`, then you will need to update the following `cookies_same_site_protection` ActionDispatch configuration.
36
+
37
+ ```diff
38
+ # config/application.rb
39
+
40
+ require_relative 'boot'
41
+
42
+ require 'rails/all'
43
+
44
+ Bundler.require(*Rails.groups)
45
+
46
+ module AppName
47
+ class Application < Rails::Application
48
+ + config.load_defaults 6.1
49
+
50
+ + config.action_dispatch.cookies_same_site_protection = :none
51
+ ...
52
+ end
53
+ end
54
+ ```
55
+
56
+ As of Rails `v6.1`, the same-site cookie protection setting defaults to `Lax`. This does not allow an embedded app to make cross-domain requests in the Shopify Admin.
57
+
58
+ Alternatively, you can upgrade to [`v17.2.0` of the shopify_app gem](/docs/Upgrading.md#upgrading-to-v1720).
59
+
27
60
  ## App installation
28
61
 
29
62
  ### My app won't install
data/docs/Upgrading.md CHANGED
@@ -4,12 +4,28 @@ This file documents important changes needed to upgrade your app's Shopify App v
4
4
 
5
5
  #### Table of contents
6
6
 
7
+ [Upgrading to `v17.2.0`](#upgrading-to-v1720)
8
+
7
9
  [Upgrading to `v13.0.0`](#upgrading-to-v1300)
8
10
 
9
11
  [Upgrading to `v11.7.0`](#upgrading-to-v1170)
10
12
 
11
13
  [Upgrading from `v8.6` to `v9.0.0`](#upgrading-from-v86-to-v900)
12
14
 
15
+ ## Upgrading to `v17.2.0`
16
+
17
+ ### Different SameSite cookie attribute behaviour
18
+
19
+ To support Rails `v6.1`, the [`SameSiteCookieMiddleware`](/lib/shopify_app/middleware/same_site_cookie_middleware.rb) was updated to configure cookies to `SameSite=None` if the app is embedded. Before this release, cookies were configured to `SameSite=None` only if this attribute had not previously been set before.
20
+
21
+ ```diff
22
+ # same_site_cookie_middleware.rb
23
+ - cookie << '; SameSite=None' unless cookie =~ /;\s*samesite=/i
24
+ + cookie << '; SameSite=None' if ShopifyApp.configuration.embedded_app?
25
+ ```
26
+
27
+ By default, Rails `v6.1` configures `SameSite=Lax` on all cookies that don't specify this attribute.
28
+
13
29
  ## Upgrading to `v13.0.0`
14
30
 
15
31
  Version 13.0.0 adds the ability to use both user and shop sessions, concurrently. This however involved a large
@@ -1,8 +1,14 @@
1
1
  # Handling changes in access scopes
2
- The Shopify App gem provides handling changes to scopes for both shop/offline and user/online tokens. To enable your app to login via OAuth on scope changes, you can set the following configuration flag:
2
+ The Shopify App gem provides handling changes to scopes for both shop/offline and user/online tokens. To enable your app to login via OAuth on scope changes, you can set the following configuration flag in your `config/initializers/shopify_app.rb`:
3
3
  ```ruby
4
- ShopifyApp.configuration.reauth_on_access_scope_changes = true
4
+ config.reauth_on_access_scope_changes = true
5
5
  ```
6
6
 
7
7
  ## ShopAccessScopesVerification
8
8
  The `ShopifyApp::ShopAccessScopesVerification` concern helps merchants grant new access scopes requested by the app. The concern compares the current access scopes granted by the shop and compares them with the scopes requested by the app. If there is a mismatch in configuration, the merchant is redirected to login via OAuth and grant the net new scopes.
9
+
10
+ To activate the `ShopAccessScopesVerification` for a controller add `include ShopifyApp::ShopAccessScopesVerification`:
11
+ ```ruby
12
+ class HomeController < AuthenticatedController
13
+ include ShopifyApp::ShopAccessScopesVerification
14
+ ```
@@ -78,7 +78,7 @@ end
78
78
  provider :shopify,
79
79
  ...
80
80
  setup: lambda { |env|
81
- configuration = ShopifyApp::OmniauthConfiguration.new(env['omniauth.strategy'], Rack::Request.new(env))
81
+ configuration = ShopifyApp::OmniAuthConfiguration.new(env['omniauth.strategy'], Rack::Request.new(env))
82
82
  configuration.build_options
83
83
  }
84
84
 
@@ -21,7 +21,7 @@ module ShopifyApp
21
21
  .compact
22
22
  .map do |cookie|
23
23
  cookie << '; Secure' unless cookie =~ /;\s*secure/i
24
- cookie << '; SameSite=None' unless cookie =~ /;\s*samesite=/i
24
+ cookie << '; SameSite=None' if ShopifyApp.configuration.embedded_app?
25
25
  cookie
26
26
  end
27
27
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyApp
3
- VERSION = '17.1.1'
3
+ VERSION = '17.2.0'
4
4
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "17.1.1",
3
+ "version": "17.2.0",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
data/shopify_app.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.metadata['allowed_push_host'] = 'https://rubygems.org'
15
15
 
16
16
  s.add_runtime_dependency('browser_sniffer', '~> 1.2.2')
17
- s.add_runtime_dependency('rails', '> 5.2.1', '< 6.1')
17
+ s.add_runtime_dependency('rails', '> 5.2.1', '< 6.2')
18
18
  s.add_runtime_dependency('shopify_api', '~> 9.4')
19
19
  s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 2.2.2')
20
20
  s.add_runtime_dependency('jwt', '~> 2.2.1')
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: 17.1.1
4
+ version: 17.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-12 00:00:00.000000000 Z
11
+ date: 2021-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 5.2.1
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '6.1'
36
+ version: '6.2'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 5.2.1
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '6.1'
46
+ version: '6.2'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: shopify_api
49
49
  requirement: !ruby/object:Gem::Requirement