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
metadata CHANGED
@@ -1,57 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.0
4
+ version: 17.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: browser_sniffer
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.2
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rails
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ">="
31
+ - - ">"
32
+ - !ruby/object:Gem::Version
33
+ version: 5.2.1
34
+ - - "<"
18
35
  - !ruby/object:Gem::Version
19
- version: 4.2.6
36
+ version: '6.1'
20
37
  type: :runtime
21
38
  prerelease: false
22
39
  version_requirements: !ruby/object:Gem::Requirement
23
40
  requirements:
24
- - - ">="
41
+ - - ">"
25
42
  - !ruby/object:Gem::Version
26
- version: 4.2.6
43
+ version: 5.2.1
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '6.1'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: shopify_api
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
- - - ">="
51
+ - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: 4.2.2
53
+ version: '9.4'
34
54
  type: :runtime
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
- - - ">="
58
+ - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: 4.2.2
60
+ version: '9.4'
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: omniauth-shopify-oauth2
43
63
  requirement: !ruby/object:Gem::Requirement
44
64
  requirements:
45
65
  - - "~>"
46
66
  - !ruby/object:Gem::Version
47
- version: 1.1.11
67
+ version: 2.2.2
48
68
  type: :runtime
49
69
  prerelease: false
50
70
  version_requirements: !ruby/object:Gem::Requirement
51
71
  requirements:
52
72
  - - "~>"
53
73
  - !ruby/object:Gem::Version
54
- version: 1.1.11
74
+ version: 2.2.2
75
+ - !ruby/object:Gem::Dependency
76
+ name: jwt
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 2.2.1
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 2.2.1
89
+ - !ruby/object:Gem::Dependency
90
+ name: redirect_safely
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.0'
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.0'
55
103
  - !ruby/object:Gem::Dependency
56
104
  name: rake
57
105
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +129,21 @@ dependencies:
81
129
  - !ruby/object:Gem::Version
82
130
  version: '0'
83
131
  - !ruby/object:Gem::Dependency
84
- name: sqlite3
132
+ name: pry
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: pry-nav
85
147
  requirement: !ruby/object:Gem::Requirement
86
148
  requirements:
87
149
  - - ">="
@@ -94,6 +156,48 @@ dependencies:
94
156
  - - ">="
95
157
  - !ruby/object:Gem::Version
96
158
  version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: pry-stack_explorer
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rb-readline
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: sqlite3
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: '1.4'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '1.4'
97
201
  - !ruby/object:Gem::Dependency
98
202
  name: minitest
99
203
  requirement: !ruby/object:Gem::Requirement
@@ -122,82 +226,210 @@ dependencies:
122
226
  - - ">="
123
227
  - !ruby/object:Gem::Version
124
228
  version: '0'
229
+ - !ruby/object:Gem::Dependency
230
+ name: webmock
231
+ requirement: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ type: :development
237
+ prerelease: false
238
+ version_requirements: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: '0'
125
243
  description:
126
244
  email:
127
245
  executables: []
128
246
  extensions: []
129
247
  extra_rdoc_files: []
130
248
  files:
249
+ - ".babelrc"
250
+ - ".github/CODEOWNERS"
251
+ - ".github/ISSUE_TEMPLATE/bug-report.md"
252
+ - ".github/ISSUE_TEMPLATE/config.yml"
253
+ - ".github/ISSUE_TEMPLATE/feature-request.md"
254
+ - ".github/PULL_REQUEST_TEMPLATE.md"
255
+ - ".github/probots.yml"
256
+ - ".github/workflows/build.yml"
257
+ - ".github/workflows/release.yml"
258
+ - ".github/workflows/rubocop.yml"
131
259
  - ".gitignore"
132
- - ".travis.yml"
260
+ - ".nvmrc"
261
+ - ".rubocop.yml"
262
+ - ".ruby-version"
133
263
  - CHANGELOG.md
264
+ - CONTRIBUTING.md
134
265
  - Gemfile
135
- - Gemfile.rails50
136
- - Gemfile.ruby22
137
- - Gemfile.ruby22.rails50
138
- - ISSUE_TEMPLATE.md
266
+ - Gemfile.lock
139
267
  - LICENSE
140
- - QUICKSTART.md
141
268
  - README.md
142
- - RELEASING
143
269
  - Rakefile
270
+ - SECURITY.md
271
+ - app/assets/images/storage_access.svg
272
+ - app/assets/javascripts/shopify_app/enable_cookies.js
273
+ - app/assets/javascripts/shopify_app/itp_helper.js
274
+ - app/assets/javascripts/shopify_app/partition_cookies.js
275
+ - app/assets/javascripts/shopify_app/redirect.js
276
+ - app/assets/javascripts/shopify_app/request_storage_access.js
277
+ - app/assets/javascripts/shopify_app/storage_access.js
278
+ - app/assets/javascripts/shopify_app/storage_access_redirect.js
279
+ - app/assets/javascripts/shopify_app/top_level.js
280
+ - app/assets/javascripts/shopify_app/top_level_interaction.js
281
+ - app/controllers/concerns/shopify_app/authenticated.rb
282
+ - app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
283
+ - app/controllers/concerns/shopify_app/require_known_shop.rb
284
+ - app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb
144
285
  - app/controllers/shopify_app/authenticated_controller.rb
286
+ - app/controllers/shopify_app/callback_controller.rb
287
+ - app/controllers/shopify_app/extension_verification_controller.rb
145
288
  - app/controllers/shopify_app/sessions_controller.rb
146
289
  - app/controllers/shopify_app/webhooks_controller.rb
290
+ - app/views/shopify_app/partials/_button_styles.html.erb
291
+ - app/views/shopify_app/partials/_card_styles.html.erb
292
+ - app/views/shopify_app/partials/_empty_state_styles.html.erb
293
+ - app/views/shopify_app/partials/_form_styles.html.erb
294
+ - app/views/shopify_app/partials/_layout_styles.html.erb
295
+ - app/views/shopify_app/partials/_typography_styles.html.erb
296
+ - app/views/shopify_app/sessions/enable_cookies.html.erb
147
297
  - app/views/shopify_app/sessions/new.html.erb
298
+ - app/views/shopify_app/sessions/request_storage_access.html.erb
299
+ - app/views/shopify_app/sessions/top_level_interaction.html.erb
300
+ - app/views/shopify_app/shared/redirect.html.erb
301
+ - config/locales/cs.yml
302
+ - config/locales/da.yml
303
+ - config/locales/de.yml
148
304
  - config/locales/en.yml
149
305
  - config/locales/es.yml
306
+ - config/locales/fi.yml
307
+ - config/locales/fr.yml
308
+ - config/locales/hi.yml
309
+ - config/locales/it.yml
310
+ - config/locales/ja.yml
311
+ - config/locales/ko.yml
312
+ - config/locales/ms.yml
313
+ - config/locales/nb.yml
314
+ - config/locales/nl.yml
315
+ - config/locales/pl.yml
316
+ - config/locales/pt-BR.yml
317
+ - config/locales/pt-PT.yml
318
+ - config/locales/sv.yml
319
+ - config/locales/th.yml
320
+ - config/locales/tr.yml
321
+ - config/locales/vi.yml
322
+ - config/locales/zh-CN.yml
323
+ - config/locales/zh-TW.yml
150
324
  - config/routes.rb
325
+ - docs/Quickstart.md
326
+ - docs/Releasing.md
327
+ - docs/Troubleshooting.md
328
+ - docs/Upgrading.md
329
+ - docs/shopify_app/authentication.md
330
+ - docs/shopify_app/engine.md
331
+ - docs/shopify_app/generators.md
332
+ - docs/shopify_app/handling-access-scopes-changes.md
333
+ - docs/shopify_app/script-tags.md
334
+ - docs/shopify_app/session-repository.md
335
+ - docs/shopify_app/testing.md
336
+ - docs/shopify_app/webhooks.md
151
337
  - images/app-proxy-screenshot.png
338
+ - karma.conf.js
339
+ - lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb
340
+ - lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb
341
+ - lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb
342
+ - lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb
152
343
  - lib/generators/shopify_app/add_webhook/add_webhook_generator.rb
153
- - lib/generators/shopify_app/add_webhook/templates/webhook_job.rb
344
+ - lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
154
345
  - lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
155
346
  - lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb
156
347
  - lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb
157
348
  - lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb
349
+ - lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb
350
+ - lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb
158
351
  - lib/generators/shopify_app/controllers/controllers_generator.rb
159
352
  - lib/generators/shopify_app/home_controller/home_controller_generator.rb
160
353
  - lib/generators/shopify_app/home_controller/templates/home_controller.rb
161
354
  - lib/generators/shopify_app/home_controller/templates/index.html.erb
162
- - lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb
355
+ - lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb
163
356
  - lib/generators/shopify_app/install/install_generator.rb
164
357
  - lib/generators/shopify_app/install/templates/_flash_messages.html.erb
165
358
  - lib/generators/shopify_app/install/templates/embedded_app.html.erb
359
+ - lib/generators/shopify_app/install/templates/flash_messages.js
166
360
  - lib/generators/shopify_app/install/templates/omniauth.rb
167
- - lib/generators/shopify_app/install/templates/shopify_app.rb
168
- - lib/generators/shopify_app/install/templates/shopify_provider.rb
169
- - lib/generators/shopify_app/install/templates/shopify_session_repository.rb
361
+ - lib/generators/shopify_app/install/templates/session_store.rb
362
+ - lib/generators/shopify_app/install/templates/shopify_app.js
363
+ - lib/generators/shopify_app/install/templates/shopify_app.rb.tt
364
+ - lib/generators/shopify_app/install/templates/shopify_app_index.js
365
+ - lib/generators/shopify_app/install/templates/shopify_provider.rb.tt
366
+ - lib/generators/shopify_app/install/templates/user_agent.rb
367
+ - lib/generators/shopify_app/products_controller/products_controller_generator.rb
368
+ - lib/generators/shopify_app/products_controller/templates/products_controller.rb
369
+ - lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb
370
+ - lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake
371
+ - lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb
170
372
  - lib/generators/shopify_app/routes/routes_generator.rb
171
373
  - lib/generators/shopify_app/routes/templates/routes.rb
172
374
  - lib/generators/shopify_app/shop_model/shop_model_generator.rb
173
- - lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.rb
375
+ - lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb
376
+ - lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.erb
174
377
  - lib/generators/shopify_app/shop_model/templates/shop.rb
175
- - lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb
176
378
  - lib/generators/shopify_app/shop_model/templates/shops.yml
177
379
  - lib/generators/shopify_app/shopify_app_generator.rb
380
+ - lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb
381
+ - lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb
382
+ - lib/generators/shopify_app/user_model/templates/user.rb
383
+ - lib/generators/shopify_app/user_model/templates/users.yml
384
+ - lib/generators/shopify_app/user_model/user_model_generator.rb
178
385
  - lib/generators/shopify_app/views/views_generator.rb
179
386
  - lib/shopify_app.rb
180
- - lib/shopify_app/app_proxy_verification.rb
387
+ - lib/shopify_app/access_scopes/noop_strategy.rb
388
+ - lib/shopify_app/access_scopes/shop_strategy.rb
389
+ - lib/shopify_app/access_scopes/user_strategy.rb
181
390
  - lib/shopify_app/configuration.rb
391
+ - lib/shopify_app/controller_concerns/app_proxy_verification.rb
392
+ - lib/shopify_app/controller_concerns/csrf_protection.rb
393
+ - lib/shopify_app/controller_concerns/embedded_app.rb
394
+ - lib/shopify_app/controller_concerns/itp.rb
395
+ - lib/shopify_app/controller_concerns/localization.rb
396
+ - lib/shopify_app/controller_concerns/login_protection.rb
397
+ - lib/shopify_app/controller_concerns/payload_verification.rb
398
+ - lib/shopify_app/controller_concerns/webhook_verification.rb
182
399
  - lib/shopify_app/engine.rb
183
- - lib/shopify_app/in_memory_session_store.rb
184
- - lib/shopify_app/login_protection.rb
185
- - lib/shopify_app/scripttags_manager.rb
186
- - lib/shopify_app/scripttags_manager_job.rb
187
- - lib/shopify_app/session_storage.rb
188
- - lib/shopify_app/sessions_concern.rb
189
- - lib/shopify_app/shop.rb
190
- - lib/shopify_app/shopify_session_repository.rb
400
+ - lib/shopify_app/jobs/scripttags_manager_job.rb
401
+ - lib/shopify_app/jobs/webhooks_manager_job.rb
402
+ - lib/shopify_app/managers/scripttags_manager.rb
403
+ - lib/shopify_app/managers/webhooks_manager.rb
404
+ - lib/shopify_app/middleware/jwt_middleware.rb
405
+ - lib/shopify_app/middleware/same_site_cookie_middleware.rb
406
+ - lib/shopify_app/omniauth/omniauth_configuration.rb
407
+ - lib/shopify_app/session/in_memory_session_store.rb
408
+ - lib/shopify_app/session/in_memory_shop_session_store.rb
409
+ - lib/shopify_app/session/in_memory_user_session_store.rb
410
+ - lib/shopify_app/session/jwt.rb
411
+ - lib/shopify_app/session/null_user_session_store.rb
412
+ - lib/shopify_app/session/session_repository.rb
413
+ - lib/shopify_app/session/session_storage.rb
414
+ - lib/shopify_app/session/shop_session_storage.rb
415
+ - lib/shopify_app/session/shop_session_storage_with_scopes.rb
416
+ - lib/shopify_app/session/user_session_storage.rb
417
+ - lib/shopify_app/session/user_session_storage_with_scopes.rb
418
+ - lib/shopify_app/test_helpers/all.rb
419
+ - lib/shopify_app/test_helpers/webhook_verification_helper.rb
191
420
  - lib/shopify_app/utils.rb
192
421
  - lib/shopify_app/version.rb
193
- - lib/shopify_app/webhook_verification.rb
194
- - lib/shopify_app/webhooks_manager.rb
195
- - lib/shopify_app/webhooks_manager_job.rb
422
+ - package.json
423
+ - service.yml
196
424
  - shipit.rubygems.yml
197
425
  - shopify_app.gemspec
426
+ - translation.yml
427
+ - webpack.config.js
428
+ - yarn.lock
198
429
  homepage:
199
430
  licenses: []
200
- metadata: {}
431
+ metadata:
432
+ allowed_push_host: https://rubygems.org
201
433
  post_install_message:
202
434
  rdoc_options: []
203
435
  require_paths:
@@ -206,15 +438,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
438
  requirements:
207
439
  - - ">="
208
440
  - !ruby/object:Gem::Version
209
- version: 2.2.2
441
+ version: '2.5'
210
442
  required_rubygems_version: !ruby/object:Gem::Requirement
211
443
  requirements:
212
444
  - - ">="
213
445
  - !ruby/object:Gem::Version
214
446
  version: '0'
215
447
  requirements: []
216
- rubyforge_project:
217
- rubygems_version: 2.5.1
448
+ rubygems_version: 3.0.3
218
449
  signing_key:
219
450
  specification_version: 4
220
451
  summary: This gem is used to get quickly started with the Shopify API
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- sudo: false
4
-
5
- rvm:
6
- - 2.3.1
7
-
8
- gemfile:
9
- - Gemfile
10
- - Gemfile.rails50
11
-
12
- matrix:
13
- include:
14
- - rvm: 2.2.2
15
- gemfile: Gemfile.ruby22
16
- - rvm: 2.2.2
17
- gemfile: Gemfile.ruby22.rails50
data/Gemfile.rails50 DELETED
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- gem 'rails', '~> 5.0'
5
- gem 'activeresource', github: 'rails/activeresource'
data/Gemfile.ruby22 DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in shopify_app.gemspec
4
- gemspec
5
-
6
- gem 'shopify_api', '< 4.3'
@@ -1,9 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in shopify_app.gemspec
4
- gemspec
5
-
6
- gem 'rails', '~> 5.0'
7
- gem 'activeresource', github: 'rails/activeresource'
8
-
9
- gem 'shopify_api', '< 4.3'
data/ISSUE_TEMPLATE.md DELETED
@@ -1,14 +0,0 @@
1
- Submitting Issues
2
- -----------------
3
-
4
- Please open an issue here if you encounter a specific bug with this gem or the generators
5
-
6
- General questions about the Shopify API should be posted on the [Shopify forums](https://ecommerce.shopify.com/c/shopify-apis-and-technology).
7
-
8
-
9
- Authentication Issues
10
- ---------------------
11
-
12
- A great deal of the issues surrounding this repo are around authenticating (installing) the generated app with Shopify.
13
-
14
- If you are experiencing issues with your app authenticating/installing the best way to get help fast is to create a repo with the minimal amount of code to demonstrate the issue and a clearly documented set of steps you took to arrive there. This will help us solve your problem quicker since we won't need to spend any time figuring out how to reproduce the bug. Please also include your operating system and browser.
data/QUICKSTART.md DELETED
@@ -1,72 +0,0 @@
1
- Quickstart
2
- ==========
3
-
4
- Build and deploy a new Shopify App to Heroku in minutes
5
-
6
- 1. New Rails App (with postgres)
7
- --------------------------------
8
-
9
- ```
10
- rails new test-app --database=postgresql
11
- cd test-app
12
- git init
13
- git add .
14
- git commit -m 'new rails app'
15
- ```
16
-
17
- 2. Create a new Heroku app
18
- --------------------------
19
-
20
- The next step is to create a new heroku app. Pull up your heroku dashboard and make a new app!
21
-
22
- cli:
23
- ```
24
- heroku create name
25
- heroku git:remote -a name
26
- ```
27
-
28
- now we need to let git know where the remote server is so we'll be able to deploy later
29
-
30
- web:
31
- ```
32
- https://dashboard.heroku.com/new
33
- git remote add heroku git@heroku.com:appinfive.git
34
- ```
35
-
36
- 3. Create a new App in the partners area
37
- -----------------------------------------
38
- [https://app.shopify.com/services/partners/api_clients](https://app.shopify.com/services/partners/api_clients)
39
- * set the callback url to `https://<name>.herokuapp.com/`
40
- * choose an embedded app
41
- * set the redirect_uri to `https://<name>.herokuapp.com/auth/shopify/callback`
42
-
43
-
44
- 4. Add ShopifyApp to gemfile
45
- ----------------------------
46
- ```
47
- $ echo "gem 'shopify_app'" >> Gemfile
48
-
49
- bundle install
50
- ```
51
-
52
- Note - its recommended to use the latest released version. Check the git tags to see the latest release and then add it to your Gemfile e.g `gem 'shopify_app', '~> 7.0.0'`
53
-
54
- 5. Run the ShopifyApp generator
55
- -------------------------------
56
- ```
57
- use the keys from your app in the partners area
58
- rails generate shopify_app --api_key a366cbafaccebd2f615aebdfc932fa1c --secret 8750306a895b3dbc7f4136c2ae2ea293
59
- git add .
60
- git commit -m 'generated shopify app'
61
- ```
62
-
63
- 6. Deploy
64
- ---------
65
- ```
66
- git push heroku
67
- heroku run rake db:migrate
68
- ```
69
-
70
- 7. Install the App!
71
- -------------------
72
- `https://<name>.herokuapp.com/`
data/RELEASING DELETED
@@ -1,13 +0,0 @@
1
- Releasing ShopifyApp
2
-
3
- 1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
- 2. Update the version of ShopifyApp in lib/shopify_app/version.rb
5
- 3. Add a CHANGELOG entry for the new release with the date
6
- 4. Commit the changes with a commit message like "Packaging for release X.Y.Z"
7
- 5. Tag the release with the version (Leave REV blank for HEAD or provide a SHA)
8
- $ git tag vX.Y.Z REV
9
- 6. Push out the changes
10
- $ git push
11
- 7. Push out the tags
12
- $ git push --tags
13
- 8. Use Shipit to build and push the gem
@@ -1,11 +0,0 @@
1
- <% content_for :javascript do %>
2
- <script type="text/javascript">
3
- ShopifyApp.ready(function(){
4
- ShopifyApp.Bar.initialize({
5
- title: "Home",
6
- icon: "<%= asset_path('favicon.ico') %>"
7
- });
8
- });
9
- </script>
10
- <% end %>
11
-
@@ -1,9 +0,0 @@
1
- ShopifyApp.configure do |config|
2
- <% if @application_name.present? %>
3
- config.application_name = "<%= @application_name %>"
4
- <% end %>
5
- config.api_key = "<%= @api_key %>"
6
- config.secret = "<%= @secret %>"
7
- config.scope = "<%= @scope %>"
8
- config.embedded_app = <%= embedded_app? %>
9
- end
@@ -1,4 +0,0 @@
1
- provider :shopify,
2
- ShopifyApp.configuration.api_key,
3
- ShopifyApp.configuration.secret,
4
- scope: ShopifyApp.configuration.scope
@@ -1,23 +0,0 @@
1
- # You should replace InMemorySessionStore with what you will be using
2
- # in Production. For example a model called "Shop":
3
- #
4
- # ShopifySessionRepository.storage = 'Shop'
5
- #
6
- # Interface to implement are self.retrieve(id) and self.store(ShopifyAPI::Session)
7
- # Here is how you would add these functions to an ActiveRecord:
8
- #
9
- # class Shop < ActiveRecord::Base
10
- # def self.store(session)
11
- # shop = self.new(domain: session.url, token: session.token)
12
- # shop.save!
13
- # shop.id
14
- # end
15
- #
16
- # def self.retrieve(id)
17
- # if shop = self.where(id: id).first
18
- # ShopifyAPI::Session.new(shop.domain, shop.token)
19
- # end
20
- # end
21
- # end
22
-
23
- ShopifyApp::SessionRepository.storage = InMemorySessionStore
@@ -1,7 +0,0 @@
1
- if Rails.configuration.cache_classes
2
- ShopifyApp::SessionRepository.storage = Shop
3
- else
4
- ActionDispatch::Reloader.to_prepare do
5
- ShopifyApp::SessionRepository.storage = Shop
6
- end
7
- end
@@ -1,25 +0,0 @@
1
- # WARNING - This really only works for development, see README for more details
2
- class InMemorySessionStore
3
- class EnvironmentError < StandardError; end
4
-
5
- def self.retrieve(id)
6
- repo[id]
7
- end
8
-
9
- def self.store(session)
10
- id = SecureRandom.uuid
11
- repo[id] = session
12
- id
13
- end
14
-
15
- def self.clear
16
- @@repo = nil
17
- end
18
-
19
- def self.repo
20
- if Rails.env.production?
21
- raise EnvironmentError.new("Cannot use InMemorySessionStore in a Production environment")
22
- end
23
- @@repo ||= {}
24
- end
25
- end