shopify_app 7.2.0 → 17.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +5 -5
  2. data/.babelrc +5 -0
  3. data/.github/CODEOWNERS +1 -0
  4. data/.github/ISSUE_TEMPLATE/bug-report.md +63 -0
  5. data/.github/ISSUE_TEMPLATE/config.yml +1 -0
  6. data/.github/ISSUE_TEMPLATE/feature-request.md +33 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  8. data/.github/probots.yml +2 -0
  9. data/.github/workflows/build.yml +38 -0
  10. data/.github/workflows/release.yml +24 -0
  11. data/.github/workflows/rubocop.yml +22 -0
  12. data/.gitignore +4 -1
  13. data/.nvmrc +1 -0
  14. data/.rubocop.yml +18 -0
  15. data/.ruby-version +1 -0
  16. data/CHANGELOG.md +465 -0
  17. data/CONTRIBUTING.md +76 -0
  18. data/Gemfile +7 -0
  19. data/Gemfile.lock +256 -0
  20. data/README.md +73 -288
  21. data/Rakefile +1 -0
  22. data/SECURITY.md +59 -0
  23. data/app/assets/images/storage_access.svg +1 -0
  24. data/app/assets/javascripts/shopify_app/enable_cookies.js +3 -0
  25. data/app/assets/javascripts/shopify_app/itp_helper.js +40 -0
  26. data/app/assets/javascripts/shopify_app/partition_cookies.js +8 -0
  27. data/app/assets/javascripts/shopify_app/redirect.js +33 -0
  28. data/app/assets/javascripts/shopify_app/request_storage_access.js +3 -0
  29. data/app/assets/javascripts/shopify_app/storage_access.js +154 -0
  30. data/app/assets/javascripts/shopify_app/storage_access_redirect.js +17 -0
  31. data/app/assets/javascripts/shopify_app/top_level.js +2 -0
  32. data/app/assets/javascripts/shopify_app/top_level_interaction.js +11 -0
  33. data/app/controllers/concerns/shopify_app/authenticated.rb +16 -0
  34. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +26 -0
  35. data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
  36. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
  37. data/app/controllers/shopify_app/authenticated_controller.rb +5 -5
  38. data/app/controllers/shopify_app/callback_controller.rb +196 -0
  39. data/app/controllers/shopify_app/extension_verification_controller.rb +15 -0
  40. data/app/controllers/shopify_app/sessions_controller.rb +190 -2
  41. data/app/controllers/shopify_app/webhooks_controller.rb +16 -7
  42. data/app/views/shopify_app/partials/_button_styles.html.erb +109 -0
  43. data/app/views/shopify_app/partials/_card_styles.html.erb +33 -0
  44. data/app/views/shopify_app/partials/_empty_state_styles.html.erb +98 -0
  45. data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
  46. data/app/views/shopify_app/partials/_layout_styles.html.erb +182 -0
  47. data/app/views/shopify_app/partials/_typography_styles.html.erb +35 -0
  48. data/app/views/shopify_app/sessions/enable_cookies.html.erb +70 -0
  49. data/app/views/shopify_app/sessions/new.html.erb +39 -83
  50. data/app/views/shopify_app/sessions/request_storage_access.html.erb +68 -0
  51. data/app/views/shopify_app/sessions/top_level_interaction.html.erb +63 -0
  52. data/app/views/shopify_app/shared/redirect.html.erb +23 -0
  53. data/config/locales/cs.yml +23 -0
  54. data/config/locales/da.yml +20 -0
  55. data/config/locales/de.yml +22 -0
  56. data/config/locales/en.yml +12 -1
  57. data/config/locales/es.yml +21 -3
  58. data/config/locales/fi.yml +20 -0
  59. data/config/locales/fr.yml +23 -0
  60. data/config/locales/hi.yml +23 -0
  61. data/config/locales/it.yml +21 -0
  62. data/config/locales/ja.yml +17 -0
  63. data/config/locales/ko.yml +19 -0
  64. data/config/locales/ms.yml +22 -0
  65. data/config/locales/nb.yml +21 -0
  66. data/config/locales/nl.yml +21 -0
  67. data/config/locales/pl.yml +21 -0
  68. data/config/locales/pt-BR.yml +21 -0
  69. data/config/locales/pt-PT.yml +22 -0
  70. data/config/locales/sv.yml +21 -0
  71. data/config/locales/th.yml +20 -0
  72. data/config/locales/tr.yml +22 -0
  73. data/config/locales/vi.yml +22 -0
  74. data/config/locales/zh-CN.yml +16 -0
  75. data/config/locales/zh-TW.yml +16 -0
  76. data/config/routes.rb +12 -1
  77. data/docs/Quickstart.md +31 -0
  78. data/docs/Releasing.md +21 -0
  79. data/docs/Troubleshooting.md +16 -0
  80. data/docs/Upgrading.md +110 -0
  81. data/docs/shopify_app/authentication.md +124 -0
  82. data/docs/shopify_app/engine.md +82 -0
  83. data/docs/shopify_app/generators.md +127 -0
  84. data/docs/shopify_app/handling-access-scopes-changes.md +8 -0
  85. data/docs/shopify_app/script-tags.md +28 -0
  86. data/docs/shopify_app/session-repository.md +88 -0
  87. data/docs/shopify_app/testing.md +38 -0
  88. data/docs/shopify_app/webhooks.md +72 -0
  89. data/karma.conf.js +44 -0
  90. data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +47 -0
  91. data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +11 -0
  92. data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +40 -0
  93. data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +62 -0
  94. data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +5 -4
  95. data/lib/generators/shopify_app/add_webhook/templates/{webhook_job.rb → webhook_job.rb.tt} +5 -0
  96. data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +4 -3
  97. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +3 -3
  98. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +10 -9
  99. data/lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb +2 -2
  100. data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +15 -0
  101. data/lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb +5 -0
  102. data/lib/generators/shopify_app/controllers/controllers_generator.rb +2 -1
  103. data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +31 -9
  104. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +6 -1
  105. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +70 -6
  106. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +11 -0
  107. data/lib/generators/shopify_app/install/install_generator.rb +78 -27
  108. data/lib/generators/shopify_app/install/templates/_flash_messages.html.erb +1 -13
  109. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +12 -11
  110. data/lib/generators/shopify_app/install/templates/flash_messages.js +24 -0
  111. data/lib/generators/shopify_app/install/templates/omniauth.rb +3 -1
  112. data/lib/generators/shopify_app/install/templates/session_store.rb +4 -0
  113. data/lib/generators/shopify_app/install/templates/shopify_app.js +15 -0
  114. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +25 -0
  115. data/lib/generators/shopify_app/install/templates/shopify_app_index.js +2 -0
  116. data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
  117. data/lib/generators/shopify_app/install/templates/user_agent.rb +6 -0
  118. data/lib/generators/shopify_app/products_controller/products_controller_generator.rb +19 -0
  119. data/lib/generators/shopify_app/products_controller/templates/products_controller.rb +8 -0
  120. data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +16 -0
  121. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +17 -0
  122. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +42 -0
  123. data/lib/generators/shopify_app/routes/routes_generator.rb +1 -0
  124. data/lib/generators/shopify_app/routes/templates/routes.rb +10 -9
  125. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +42 -14
  126. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  127. data/lib/generators/shopify_app/shop_model/templates/db/migrate/{create_shops.rb → create_shops.erb} +1 -1
  128. data/lib/generators/shopify_app/shop_model/templates/shop.rb +6 -2
  129. data/lib/generators/shopify_app/shopify_app_generator.rb +5 -3
  130. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  131. data/lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb +16 -0
  132. data/lib/generators/shopify_app/user_model/templates/user.rb +8 -0
  133. data/lib/generators/shopify_app/user_model/templates/users.yml +4 -0
  134. data/lib/generators/shopify_app/user_model/user_model_generator.rb +70 -0
  135. data/lib/generators/shopify_app/views/views_generator.rb +2 -1
  136. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  137. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  138. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  139. data/lib/shopify_app/configuration.rb +69 -5
  140. data/lib/shopify_app/{app_proxy_verification.rb → controller_concerns/app_proxy_verification.rb} +4 -9
  141. data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
  142. data/lib/shopify_app/controller_concerns/embedded_app.rb +20 -0
  143. data/lib/shopify_app/controller_concerns/itp.rb +45 -0
  144. data/lib/shopify_app/controller_concerns/localization.rb +23 -0
  145. data/lib/shopify_app/controller_concerns/login_protection.rb +244 -0
  146. data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
  147. data/lib/shopify_app/controller_concerns/webhook_verification.rb +23 -0
  148. data/lib/shopify_app/engine.rb +40 -0
  149. data/lib/shopify_app/jobs/scripttags_manager_job.rb +16 -0
  150. data/lib/shopify_app/{webhooks_manager_job.rb → jobs/webhooks_manager_job.rb} +3 -2
  151. data/lib/shopify_app/{scripttags_manager.rb → managers/scripttags_manager.rb} +25 -8
  152. data/lib/shopify_app/{webhooks_manager.rb → managers/webhooks_manager.rb} +6 -5
  153. data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
  154. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +34 -0
  155. data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
  156. data/lib/shopify_app/session/in_memory_session_store.rb +31 -0
  157. data/lib/shopify_app/session/in_memory_shop_session_store.rb +16 -0
  158. data/lib/shopify_app/session/in_memory_user_session_store.rb +16 -0
  159. data/lib/shopify_app/session/jwt.rb +63 -0
  160. data/lib/shopify_app/session/null_user_session_store.rb +22 -0
  161. data/lib/shopify_app/session/session_repository.rb +56 -0
  162. data/lib/shopify_app/session/session_storage.rb +20 -0
  163. data/lib/shopify_app/session/shop_session_storage.rb +42 -0
  164. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
  165. data/lib/shopify_app/session/user_session_storage.rb +42 -0
  166. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
  167. data/lib/shopify_app/test_helpers/all.rb +2 -0
  168. data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +17 -0
  169. data/lib/shopify_app/utils.rb +24 -4
  170. data/lib/shopify_app/version.rb +2 -1
  171. data/lib/shopify_app.rb +65 -24
  172. data/package.json +27 -0
  173. data/service.yml +7 -0
  174. data/shipit.rubygems.yml +3 -0
  175. data/shopify_app.gemspec +20 -9
  176. data/translation.yml +7 -0
  177. data/webpack.config.js +24 -0
  178. data/yarn.lock +5215 -0
  179. metadata +274 -43
  180. data/.travis.yml +0 -17
  181. data/Gemfile.rails50 +0 -5
  182. data/Gemfile.ruby22 +0 -6
  183. data/Gemfile.ruby22.rails50 +0 -9
  184. data/ISSUE_TEMPLATE.md +0 -14
  185. data/QUICKSTART.md +0 -72
  186. data/RELEASING +0 -13
  187. data/lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb +0 -11
  188. data/lib/generators/shopify_app/install/templates/shopify_app.rb +0 -9
  189. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -4
  190. data/lib/generators/shopify_app/install/templates/shopify_session_repository.rb +0 -23
  191. data/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb +0 -7
  192. data/lib/shopify_app/in_memory_session_store.rb +0 -25
  193. data/lib/shopify_app/login_protection.rb +0 -103
  194. data/lib/shopify_app/scripttags_manager_job.rb +0 -15
  195. data/lib/shopify_app/session_storage.rb +0 -23
  196. data/lib/shopify_app/sessions_concern.rb +0 -101
  197. data/lib/shopify_app/shop.rb +0 -15
  198. data/lib/shopify_app/shopify_session_repository.rb +0 -34
  199. data/lib/shopify_app/webhook_verification.rb +0 -39
data/CHANGELOG.md CHANGED
@@ -1,3 +1,468 @@
1
+ Unreleased
2
+ ----------
3
+
4
+ 17.1.0 (March 5, 2021)
5
+ ----------
6
+ * Create OmniAuthConfiguration object to build future OmniAuth strategies [#1190](https://github.com/Shopify/shopify_app/pull/1190)
7
+ * Added access scopes to Shop and User models, added checks to handle scope changes [#1192](https://github.com/Shopify/shopify_app/pull/1192) [#1197](https://github.com/Shopify/shopify_app/pull/1197)
8
+
9
+ 17.0.5 (January 27, 2021)
10
+ ----------
11
+ * Fix omniauth strategy not being set correctly for apps using session tokens [#1164](https://github.com/Shopify/shopify_app/pull/1164)
12
+
13
+ 17.0.4 (January 25, 2021)
14
+ ----------
15
+ * Redirect user to login page if shopify domain is not found in the `EnsureAuthenticatedLinks` concern [#1158](https://github.com/Shopify/shopify_app/pull/1158)
16
+
17
+ 17.0.3 (January 22, 2021)
18
+ ----------
19
+ * Amend fix for #1144 to raise on missing API keys only when running the server [#1155](https://github.com/Shopify/shopify_app/pull/1155)
20
+
21
+ 17.0.2 (January 20, 2021)
22
+ ------
23
+ * Fix failing script tags and webhooks installs after completing OAuth [#1151](https://github.com/Shopify/shopify_app/pull/1151)
24
+
25
+ 17.0.1 (January 18, 2021)
26
+ ------
27
+ * Don't attempt to read Shopify environment variables when the generators are running, since they may not be present yet [#1144](https://github.com/Shopify/shopify_app/pull/1144)
28
+
29
+ 17.0.0 (January 13, 2021)
30
+ ------
31
+ * Rails 6.1 is not yet supported [#1134](https://github.com/Shopify/shopify_app/pull/1134)
32
+
33
+ 16.1.0
34
+ ------
35
+ * Use Session Token auth strategy by default for new embedded apps [#1111](https://github.com/Shopify/shopify_app/pull/1111)
36
+ * Create optional `EnsureAuthenticatedLinks` concern to authenticate deep links using Turbolinks [#1118](https://github.com/Shopify/shopify_app/pull/1118)
37
+
38
+ 16.0.0
39
+ ------
40
+ * Update all `html.erb` and `css` files to correspond with updated store admin design language [#1102](https://github.com/Shopify/shopify_app/pull/1102)
41
+
42
+ 15.0.1
43
+ ------
44
+ * Allow JWT session token `sub` field to be parsed as a string [#1103](https://github.com/Shopify/shopify_app/pull/1103)
45
+
46
+ 15.0.0
47
+ ------
48
+ * Change `X-Shopify-API-Request-Failure-Unauthorized` HTTP header value from boolean to string
49
+
50
+ 14.4.4
51
+ ------
52
+ * Patch to not log params in ShopifyApp jobs [#1086](https://github.com/Shopify/shopify_app/pull/1086)
53
+
54
+ 14.4.3
55
+ ------
56
+ * Fix to ensure post authenticate jobs are run after callback requests [#1079](https://github.com/Shopify/shopify_app/pull/1079)
57
+
58
+ 14.4.2
59
+ ------
60
+ * Add debug logs in sessions controller
61
+
62
+ 14.4.1
63
+ ------
64
+ * Add debug logs for investigating authentication issues
65
+
66
+ 14.4.0
67
+ ------
68
+ * Replace script tags for ITP screens with data attributes
69
+
70
+ 14.3.0
71
+ ------
72
+ * Create user session if one does not exist but was expected
73
+
74
+ 14.2.0
75
+ ------
76
+ * Revert "Replace redirect calls to use App Bridge redirect functionality"
77
+
78
+ 14.1.0
79
+ ------
80
+ * Replace redirect calls to use App Bridge redirect functionality
81
+
82
+ 14.0.0
83
+ ------
84
+ * Ruby 2.4 is no longer supported by this gem
85
+ * Bump gemspec ruby dependency to 2.5
86
+ * (Beta) Add `--with-session-token` flag to the Shopify App generator to create an app that is compatible with App Bridge Authentication
87
+
88
+ 13.5.0
89
+ ------
90
+ * Add `signal_access_token_required` helper method for apps to indicate access token has expired and that a new one is required
91
+
92
+ 13.4.1
93
+ ------
94
+ * Fix the version checks for the dependency on `shopify_api` to allow all of v9.X
95
+
96
+ 13.4.0
97
+ ------
98
+ * 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)
99
+
100
+ 13.3.0
101
+ ------
102
+ * Added Payload Verification module [#992](https://github.com/Shopify/shopify_app/pull/992)
103
+ * Add concern to check for valid shop domains in the unauthenticated controller
104
+
105
+ 13.2.0
106
+ ------
107
+ * Get current shop domain from JWT header
108
+ * Validate that the omniauth data matches the JWT data
109
+ * Persist the token information to the session store
110
+
111
+ 13.1.1
112
+ ------
113
+ * Update browser_sniffer to 1.2.2
114
+
115
+ 13.1.0
116
+ ------
117
+ * Adds the shop URL as a parameter when redirecting after the callback
118
+ * Bump minimum Ruby version to 2.4
119
+ * Bug fixes
120
+
121
+ 13.0.1
122
+ ------
123
+ * Small addition to WebhookJob to return if the shop is nil #952
124
+ * Added Rubocop to the Repo #948
125
+ * Added a WebhookVerification test helper #950
126
+ * Fix for deprecation warning while loading session storage at startup
127
+ * Changes that will allow future JWT authentication
128
+
129
+ 13.0.1
130
+ ------
131
+ * fix for deprecation warning while loading session storage at startup
132
+
133
+ 13.0.0
134
+ ------
135
+ + #887 Added concurrent user and shop session support (online/offline)
136
+ BREAKING, please see README for migration notes.
137
+
138
+ 12.0.7
139
+ ------
140
+ * Remove check for API_KEY in config that was throwing errors during install #919
141
+
142
+ 12.0.6
143
+ ------
144
+ * Adds changelog information and README updates for 8.4.0 #916
145
+
146
+ 12.0.5
147
+ ------
148
+ * Updating shopify_api gem to 9.0.1
149
+
150
+ 12.0.4
151
+ ------
152
+ * Reverts reverted PR (#895) #897
153
+
154
+ 12.0.3
155
+ ------
156
+ * Moves samesite middleware higher in the stack #898
157
+ * Fix issue where not redirecting user to granted storage page casues infinite loop #900
158
+
159
+ 12.0.2
160
+ ------
161
+ * Reverts "Fix for return_to in safari after enable_cookies/granted_storage_access" introduced in 12.0.1
162
+
163
+ 12.0.1
164
+ ------
165
+ * disable samesite cookie middleware in tests
166
+ * middleware compatibility for ruby 2.3
167
+ * samesite cookie fixes for javascript libraries
168
+ * change generators to add AppBridge instead of EASDK
169
+ * Fix for return_to in safari after enable_cookies/granted_storage_access
170
+
171
+ 12.0.0
172
+ -----
173
+ * Updating shopify_api gem to 9.0.0
174
+
175
+ 11.7.1
176
+ -----
177
+ * Fix to allow SessionStorage to be flexible on what model names that the are used for storing shop and user data
178
+
179
+ 11.7.0
180
+ -----
181
+ * Move ExtensionVerificationController from engine to app controllers, as being in the engine makes ActionController::Base get loaded before app initiates [#855](https://github.com/Shopify/shopify_app/pull/855)
182
+ * Add back per-user token support (added in 11.5.0, reverted in 11.5.1)
183
+ * If you have an override on the `self.store(auth_session)` method on your `SessionRepository` model, the method signature must be changed as according to this [change](https://github.com/Shopify/shopify_app/pull/856/files#diff-deaed2b262ec885f4e36de05621e41eaR18)
184
+
185
+ 11.6.0
186
+ -----
187
+ * Enable SameSite=None; Secure by default on all cookies for embedded apps [#851](https://github.com/Shopify/shopify_app/pull/851)
188
+ * Ensures compatibility of embedded apps with upcoming Chrome version 80 changes to cookie behaviour
189
+ * Configurable via `ShopifyApp.configuration.enable_same_site_none` (default true for embedded apps)
190
+
191
+ 11.5.1
192
+ -----
193
+ * Revert per-user token support temporarily
194
+
195
+ 11.5.0
196
+ -----
197
+ * Modularizes durable session storage
198
+ * Introduces per-user token support and user session management
199
+
200
+ 11.4.0
201
+ -----
202
+ * Remove `dotenv-rails` dependency. [#835](https://github.com/Shopify/shopify_app/pull/835)
203
+
204
+ 11.3.2
205
+ -----
206
+ * Fix hosts generator in Rails 5 [#823](https://github.com/Shopify/shopify_app/pull/823)
207
+
208
+ 11.3.1
209
+ -----
210
+ * Bump browser_sniffer version to 1.1.3 [#824](https://github.com/Shopify/shopify_app/pull/824)
211
+
212
+ 11.3.0
213
+ -----
214
+ * Update assets to be compatible with Rails 6 [#808](https://github.com/Shopify/shopify_app/pull/808)
215
+
216
+ 11.2.1
217
+ -----
218
+ * Adds ngrok whitelist in development [#802](https://github.com/Shopify/shopify_app/pull/802)
219
+
220
+ 11.2.0
221
+ -----
222
+
223
+ * Bump omniauth-shopify-oauth2 gem to v2.2.0
224
+
225
+ 11.1.0
226
+ -----
227
+
228
+ * Add Webmock and Pry as development dependencies
229
+ * Update install generator to leverage updates to ShopifyAPI::ApiVersion add in v8.0.0 of the shopify_api gem [#790](https://github.com/Shopify/shopify_app/pull/790)
230
+
231
+
232
+ 11.0.2
233
+ -----
234
+
235
+ * Lock shopify_api gem dependency to `~> 7.0` from `>= 7.0.0`.
236
+ * Remove flakey JS Tests
237
+ * bump sqlite3 development dependency to `~>1.4` from `~> 1.3.6`. [#789](https://github.com/Shopify/shopify_app/pull/789)
238
+
239
+ 11.0.1
240
+ -----
241
+
242
+ * Add dotenv-rails gem to install generator, so apps fetch credentials from `.env` by default: [#776](https://github.com/Shopify/shopify_app/pull/776)
243
+
244
+ 11.0.0
245
+ -----
246
+
247
+ * Rename `login_url` method to `login_url_with_optional_shop` to avoid ambiguity with Rails' route helper method of the
248
+ same name (see [#585](https://github.com/Shopify/shopify_app/pull/585)).
249
+
250
+ 10.0.0
251
+ -----
252
+
253
+ * Make sure OAuth-related redirects return user to originally requested URL once authenticated
254
+ * Add/update translations
255
+ * Update README to clarify nested routes
256
+ * Remove example app. Users should instead use the generators to scaffold an example app.
257
+ * Bump required Rails version to `> 5.2.1` to ensure `5.2.1.1` or greater is used. This ensures two things:
258
+ * Apps are not vulnerable to [CVE-2018-16476](https://nvd.nist.gov/vuln/detail/CVE-2018-16476)
259
+ * Webhook payloads, from Shopify for API version 2019-07, which are processed in ActiveJob background jobs (the
260
+ default behaviour of shopify_app's WebhooksController) are compatible, due to how ActiveJob versions prior to
261
+ 5.2.1.1 process GlobalIDs encoded as string in job parameters. This prevents the
262
+ [exceptions reported previously](https://github.com/Shopify/shopify_app/issues/600).
263
+
264
+ 9.0.4
265
+ -----
266
+
267
+ * Fix returning to a deep link after authentication [#746](https://github.com/Shopify/shopify_app/pull/746)
268
+
269
+ 9.0.3
270
+ -----
271
+
272
+ * Add `meta viewport` tags to fix mobile responsive problems
273
+ * Remove outdated, extraneous `yarn.lock` file (and rely on existing `package-lock.json` instead)
274
+ * Move inline js to a js asset file
275
+ * Minor documentation corrections
276
+
277
+ 9.0.2
278
+ -----
279
+
280
+ * Update browser_sniffer to fix unnecessary ITP flows in Shopify Mobile
281
+ * Add additional languages to translation.yml
282
+ * Minor documentation corrections
283
+
284
+ 9.0.1
285
+ -----
286
+
287
+ * Minor documentation corrections
288
+ * Handle `Webhook.all` returning `nil` and raising on `index_by`
289
+
290
+
291
+ 9.0.0
292
+ -----
293
+
294
+ * Breaking change: Api version support added see [migration guide](README.md#upgrading-from-86-to-900)
295
+
296
+ 8.6.1
297
+ -----
298
+
299
+ * Locked `shopify_api` gem to version < 7.0. 7.0 will have breaking changes that are incompatable with `shopify_app`
300
+
301
+ * Session storage validation for shopify_domain is now set to `case_sensitive: false`.
302
+
303
+ 8.6.0
304
+ -----
305
+
306
+ * Added an `Authenticated` concern to allow gem users to inherit from a custom `AuthenticatedController` instead of
307
+ `ShopifyApp::AuthenticatedController`
308
+
309
+ 8.5.1
310
+ -----
311
+
312
+ * Fixed a typo in RotateShopifyTokenJob
313
+
314
+ 8.5.0
315
+ -----
316
+ Added support for rotating Shopify access tokens:
317
+
318
+ * Added a generator shopify_app:rotate_shopify_token_job for generating the job to perform token rotation
319
+ * Extend Shopify app configuration to support a new and old secret token
320
+ * Extended webhook validation code to support validating against new and old secret tokens
321
+ * See the README for more details: https://github.com/Shopify/shopify_app#rotateshopifytokenjob
322
+
323
+ 8.4.2
324
+ -----
325
+ * Clear stale user session during auth callback
326
+
327
+ 8.4.1
328
+ -----
329
+ * Update README and Releasing.md
330
+ * Allow user agent to not be set
331
+ * Remove legacy EASDK examples
332
+ * Add .ruby-version file
333
+ * Clean up omniauth setup and fix examples
334
+ * Fix infinite redirect loops if users have disabled 3rd party cookies in their browser
335
+
336
+ 8.4.0
337
+ ----
338
+ * Fix embedded app session management in Safari 12.1
339
+ * Note that with this change we have extracted the callback action in its own controller. If you are relying on it, see the README for more details: https://github.com/Shopify/shopify_app#callback
340
+ * Shop names passed to OAuth are no longer case sensitive
341
+
342
+ 8.3.2
343
+ ----
344
+ * Removes `read_orders` from the default scopes provided upon app generation
345
+
346
+ 8.3.1
347
+ ----
348
+ * Adds the ability to customize the login URL through the initializer
349
+
350
+ 8.3.0
351
+ ----
352
+ * Fix embedded app session management in Safari 12
353
+ * Add support for translation platform
354
+
355
+ 8.2.6
356
+ ----
357
+ * Sanitize the shop query param to include `.myshopify.com` if no domain was provided
358
+
359
+ 8.2.5
360
+ ----
361
+ * fix iframe headers on session controller
362
+
363
+ 8.2.4
364
+ -----
365
+ * Add CSRF protection through `protect_from_forgery with: :exception` on `ShopifyApp::AuthenticatedController`
366
+
367
+ 8.2.3
368
+ -----
369
+ * Send head :forbidden instead of :unauthorized when AppProxyVerification fails
370
+
371
+ 8.2.2
372
+ -----
373
+ * Changes how the ESDK concern allows iframes. Fixes an issue with the first request for some people
374
+
375
+ 8.2.1
376
+ -----
377
+ * Bugfix: Don't logout shops from `login_again_if_different_shop` when Rails
378
+ params for a 'Shop' model are passed in [[#477]](https://github.com/Shopify/shopify_app/pull/477)
379
+
380
+ 8.2.0
381
+ -----
382
+ Known bug: Shop logged out when submitting a form for 'Shop' objects, fixed in 8.2.1 [[See #480 for details]](https://github.com/Shopify/shopify_app/issues/480)
383
+
384
+ * Add `webhook_jobs_namespace` config option. [[#463]](https://github.com/Shopify/shopify_app/pull/463)
385
+ * Updates login page styles to match the [Polaris](https://polaris.shopify.com/) design system. [[#474]](https://github.com/Shopify/shopify_app/pull/474)
386
+
387
+ 8.1.0
388
+ -----
389
+ Known bug: Shop logged out when submitting a form for 'Shop' objects, fixed in 8.2.1 [[See #480 for details]](https://github.com/Shopify/shopify_app/issues/480)
390
+
391
+ * Add support for per_user_authentication
392
+ * Pass the shop param in the session for authentication instead of a url param (prevents csrf). If you are upgrading from an older version of the gem you will need to update your omniauth.rb initializer file. Check the example app for what it what it should look like.
393
+
394
+ 8.0.0
395
+ -----
396
+ Known bug: Shop logged out when submitting a form for 'Shop' objects, fixed in 8.2.1 [[See #480 for details]](https://github.com/Shopify/shopify_app/issues/480)
397
+
398
+ * Removed the `shopify_session_repository` initializer. The SessionRepository is now configured through the main ShopifyApp configuration object and the generated initializer
399
+ * Moved InMemorySessionStore into the ShopifyApp namespace
400
+ * Remove ShopifySession concern. This module made the code internal to this engine harder to follow and we want to discourage over-writing the auth code now that we have generic hooks for all extra tasks during install.
401
+ * Changed engine controllers to subclass ActionController::Base to avoid any possible conflict with the parent application
402
+ * Removed the `ShopifyApp::Shop` concern and added its methods to `ShopifyApp::SessionStorage`. To update for this change just remove this concern anywhere it is being used in your application.
403
+ * Add `ShopifyApp::EmbeddedApp` controller concern which handles setting the required headers for the ESDK. Previously this was done by injecting configuration into applicaton.rb which affects the entire app.
404
+ * Add webhooks to generated home controller. This should help new users debug issues.
405
+
406
+ 7.4.0
407
+ -----
408
+ Known bug: Shop logged out when submitting a form for 'Shop' objects, fixed in 8.2.1 [[See #480 for details]](https://github.com/Shopify/shopify_app/issues/480)
409
+
410
+ * Add an after_authenticate job which will be run once the shop is authenticated. [[#431]](https://github.com/Shopify/shopify_app/pull/432)
411
+
412
+ 7.3.0
413
+ -----
414
+ Known bug: Shop logged out when submitting a form for 'Shop' objects, fixed in 8.2.1 [[See #480 for details]](https://github.com/Shopify/shopify_app/issues/480)
415
+
416
+ * Bump required omniauth-shopify-oauth2 version to 1.2.0.
417
+ * Always expect params[:shop] to be a string.
418
+
419
+ 7.2.11
420
+ -----
421
+ * Remove 'Logged in' flash message [[#425]](https://github.com/Shopify/shopify_app/pull/425)
422
+
423
+ 7.2.10
424
+ -----
425
+ * Fix an issue with the create_shops generator template
426
+ [[#423]](https://github.com/Shopify/shopify_app/pull/423)
427
+
428
+ 7.2.9
429
+ -----
430
+ * Remove support for Rails 4
431
+ [[#417]](https://github.com/Shopify/shopify_app/pull/417)
432
+
433
+ 7.2.8
434
+ -----
435
+ * Add i18n locale param support
436
+ [[#409]](https://github.com/Shopify/shopify_app/pull/409)
437
+
438
+
439
+ 7.2.7
440
+ -----
441
+ * Require `shopify_app` `>= 4.3.2`. This version relaxes the ruby version requirement from `>= 2.3.0` to `>= 2.0`
442
+ * Rails 5: ActionDispatch::Reloader#to_prepare is deprecated
443
+ [[#404]](https://github.com/Shopify/shopify_app/pull/404)
444
+
445
+ 7.2.6
446
+ -----
447
+ * Update LoginProtection#fullpage_redirect_to to get shopify domain from session
448
+ [[#401]](https://github.com/Shopify/shopify_app/pull/401)
449
+
450
+ 7.2.5
451
+ -----
452
+ * Update LoginProtection.redirection_javascript to work with absolute URLS
453
+ [[#389]](https://github.com/Shopify/shopify_app/pull/389)
454
+
455
+ 7.2.4
456
+ -----
457
+ * Fix redirect issue by sanitizing shop name on sessions#new
458
+
459
+ 7.2.3
460
+ -----
461
+ * Use postMessage to redirect parent iframe during authentication [[#366]](https://github.com/Shopify/shopify_app/pull/366)
462
+ * Add support for dynamically generating scripttag URLs
463
+ * Bug-fix: Update scripttags_manager_job
464
+ * Bug-fix: `--application_name` and `--scope` generates proper Configuration even when options supplied to them contain whitespaces.
465
+
1
466
  7.2.0
2
467
  -----
3
468
  * Disable application layout rendering for the `/login` page
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,76 @@
1
+ # Contributing to the Shopify App gem
2
+
3
+ The following is a set of guidelines for contributing to the Shopify App gem. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
4
+
5
+ #### Table of contents
6
+
7
+ [I just have a question!](#i-just-have-a-question)
8
+
9
+ [How can I contribute?](#how-can-i-contribute)
10
+ * [Reporting bugs](#reporting-bugs)
11
+ * [Suggesting or requesting improvements](#suggesting-or-requesting-improvements)
12
+ * [Pull requests](#pull-requests)
13
+
14
+ ## I just have a question!
15
+
16
+ > **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
17
+
18
+ Shopify has an official message board with dedicated forums to discuss all things apps, APIs, SDKs and more.
19
+
20
+ #### Shopify Community forum links
21
+
22
+ * [Shopify Community](https://community.shopify.com)
23
+ * [Shopify Apps](https://community.shopify.com/c/Shopify-Apps/bd-p/shopify-apps)
24
+ * [Shopify APIs & SDKs](https://community.shopify.com/c/Shopify-APIs-SDKs/bd-p/shopify-apis-and-technology)
25
+
26
+ If you prefer to chat instead, join the [Shopify Partners Slack Community group](https://www.shopify.com/partners/community#conversation). This Slack group hosts an active community of thousands of app developers.
27
+
28
+ By participating in the Community forum or Slack group, you agree to adhere to the forum [Code of Conduct](https://community.shopify.com/c/Announcements/Code-of-Conduct/m-p/491969#M23) outlined.
29
+
30
+ ## How can I contribute?
31
+
32
+ ### Reporting bugs
33
+
34
+ This section guides you through submitting a bug report for the Shopify App gem. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
35
+
36
+ #### Before submitting a bug report
37
+
38
+ * **Check the [troubleshooting guide](/docs/Troubleshooting.md).** You may be able to troubleshoot the issue you're facing.
39
+ * **Check the [Shopify Community links](#shopify-community-forum-links) to search for your issue.** This problem may have been reported before and solved on the Shopify forum.
40
+ * **Perform a cursory search for similar issues.** You may find that the same problem (or a similar one) has been filed already as an issue.
41
+
42
+ #### How do I submit a good bug report?
43
+
44
+ Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the [bug-report template](/.github/ISSUE_TEMPLATE/bug-report.md).
45
+
46
+ Explain the problem and include additional details to help maintainers reproduce the problem:
47
+
48
+ * **Use a clear and descriptive title** for the issue to identify the problem.
49
+ * **Describe the exact steps which reproduce the problem** in as many details as possible.
50
+ * **Provide specific examples to demonstrate the steps.** Include links to files, or copy/pasteable snippets. If you're providing snippets in the issue, use Markdown code blocks.
51
+ * **Describe the behavior you observed** after following the steps and point out what exactly is the problem with that behavior.
52
+ * **Explain which behavior you expected to see** instead and why.
53
+ * **Include screenshots and animated GIFs** where possible.
54
+ * **Redact any private information** from your logs and issue description. This includes things like API keys, API secrets, and any access tokens.
55
+
56
+ ### Suggesting or requesting improvements
57
+
58
+ If you have a suggestion for the Shopify App gem or a feature request, provide the appropriate information by filling out the [feature-request template](/.github/ISSUE_TEMPLATE/feature-request.md).
59
+
60
+ ### Pull requests
61
+
62
+ The process described here has several goals:
63
+
64
+ * Maintain the Shopify App gem's quality
65
+ * Fix problems that are important to app developers
66
+ * Enable a sustainable system for the Shopify App gem's maintainers to review contributions
67
+
68
+ Please follow these steps to have your contribution considered by the maintainers:
69
+
70
+ * Follow all instructions in the [pull request template](/.github/PULL_REQUEST_TEMPLATE.md)
71
+ * After you submit your pull request, verify that all status checks are passing
72
+ * <details>
73
+ <summary>What if the status checks are failing?</summary>
74
+
75
+ While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
76
+ </details>
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
+ # frozen_string_literal: true
1
2
  source "https://rubygems.org"
2
3
 
3
4
  # Specify your gem's dependencies in shopify_app.gemspec
4
5
  gemspec
6
+
7
+ gem 'rails-controller-testing', group: :test
8
+
9
+ group :rubocop do
10
+ gem 'rubocop-shopify', require: false
11
+ end