shopify_app 17.0.5 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/ISSUE_TEMPLATE/bug-report.md +63 -0
  4. data/.github/ISSUE_TEMPLATE/config.yml +1 -0
  5. data/.github/ISSUE_TEMPLATE/feature-request.md +33 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +17 -1
  7. data/.github/workflows/build.yml +4 -1
  8. data/CHANGELOG.md +26 -0
  9. data/CONTRIBUTING.md +76 -0
  10. data/Gemfile.lock +103 -91
  11. data/README.md +72 -593
  12. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
  13. data/app/controllers/shopify_app/callback_controller.rb +17 -2
  14. data/app/controllers/shopify_app/sessions_controller.rb +5 -1
  15. data/app/views/shopify_app/shared/post_redirect_to_auth_shopify.html.erb +21 -0
  16. data/config/locales/nl.yml +1 -1
  17. data/docs/Quickstart.md +15 -77
  18. data/docs/Troubleshooting.md +142 -4
  19. data/docs/Upgrading.md +126 -0
  20. data/docs/shopify_app/authentication.md +124 -0
  21. data/docs/shopify_app/engine.md +82 -0
  22. data/docs/shopify_app/generators.md +127 -0
  23. data/docs/shopify_app/handling-access-scopes-changes.md +14 -0
  24. data/docs/shopify_app/script-tags.md +28 -0
  25. data/docs/shopify_app/session-repository.md +88 -0
  26. data/docs/shopify_app/testing.md +38 -0
  27. data/docs/shopify_app/webhooks.md +72 -0
  28. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +10 -0
  29. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +1 -1
  30. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +2 -0
  31. data/lib/generators/shopify_app/install/install_generator.rb +30 -1
  32. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +2 -1
  33. data/lib/generators/shopify_app/install/templates/omniauth.rb +1 -0
  34. data/lib/generators/shopify_app/install/templates/shopify_app.js +1 -1
  35. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +5 -2
  36. data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
  37. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +27 -0
  38. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  39. data/lib/generators/shopify_app/shop_model/templates/shop.rb +1 -1
  40. data/lib/generators/shopify_app/shopify_app_generator.rb +1 -1
  41. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  42. data/lib/generators/shopify_app/user_model/templates/user.rb +1 -1
  43. data/lib/generators/shopify_app/user_model/user_model_generator.rb +27 -0
  44. data/lib/shopify_app.rb +11 -0
  45. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  46. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  47. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  48. data/lib/shopify_app/configuration.rb +22 -0
  49. data/lib/shopify_app/controller_concerns/login_protection.rb +10 -3
  50. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +1 -1
  51. data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
  52. data/lib/shopify_app/session/in_memory_shop_session_store.rb +9 -7
  53. data/lib/shopify_app/session/in_memory_user_session_store.rb +9 -7
  54. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
  55. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
  56. data/lib/shopify_app/utils.rb +12 -0
  57. data/lib/shopify_app/version.rb +1 -1
  58. data/package.json +1 -1
  59. data/service.yml +1 -4
  60. data/shopify_app.gemspec +5 -4
  61. data/yarn.lock +22 -22
  62. metadata +50 -16
  63. data/.github/ISSUE_TEMPLATE.md +0 -19
  64. data/docs/install-on-dev-shop.png +0 -0
  65. data/docs/test-your-app.png +0 -0
  66. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -20
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.0.5
4
+ version: 18.0.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-01-27 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.2.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-rails_csrf_protection
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rails
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +47,7 @@ dependencies:
33
47
  version: 5.2.1
34
48
  - - "<"
35
49
  - !ruby/object:Gem::Version
36
- version: '6.1'
50
+ version: '6.2'
37
51
  type: :runtime
38
52
  prerelease: false
39
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,49 +57,49 @@ dependencies:
43
57
  version: 5.2.1
44
58
  - - "<"
45
59
  - !ruby/object:Gem::Version
46
- version: '6.1'
60
+ version: '6.2'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: shopify_api
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '9.1'
67
+ version: '9.4'
54
68
  type: :runtime
55
69
  prerelease: false
56
70
  version_requirements: !ruby/object:Gem::Requirement
57
71
  requirements:
58
72
  - - "~>"
59
73
  - !ruby/object:Gem::Version
60
- version: '9.1'
74
+ version: '9.4'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: omniauth-shopify-oauth2
63
77
  requirement: !ruby/object:Gem::Requirement
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: 2.2.2
81
+ version: '2.3'
68
82
  type: :runtime
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: 2.2.2
88
+ version: '2.3'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: jwt
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
- - - "~>"
93
+ - - ">="
80
94
  - !ruby/object:Gem::Version
81
- version: 2.2.1
95
+ version: 2.2.3
82
96
  type: :runtime
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
- - - "~>"
100
+ - - ">="
87
101
  - !ruby/object:Gem::Version
88
- version: 2.2.1
102
+ version: 2.2.3
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: redirect_safely
91
105
  requirement: !ruby/object:Gem::Requirement
@@ -248,7 +262,9 @@ extra_rdoc_files: []
248
262
  files:
249
263
  - ".babelrc"
250
264
  - ".github/CODEOWNERS"
251
- - ".github/ISSUE_TEMPLATE.md"
265
+ - ".github/ISSUE_TEMPLATE/bug-report.md"
266
+ - ".github/ISSUE_TEMPLATE/config.yml"
267
+ - ".github/ISSUE_TEMPLATE/feature-request.md"
252
268
  - ".github/PULL_REQUEST_TEMPLATE.md"
253
269
  - ".github/probots.yml"
254
270
  - ".github/workflows/build.yml"
@@ -259,6 +275,7 @@ files:
259
275
  - ".rubocop.yml"
260
276
  - ".ruby-version"
261
277
  - CHANGELOG.md
278
+ - CONTRIBUTING.md
262
279
  - Gemfile
263
280
  - Gemfile.lock
264
281
  - LICENSE
@@ -278,6 +295,7 @@ files:
278
295
  - app/controllers/concerns/shopify_app/authenticated.rb
279
296
  - app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
280
297
  - app/controllers/concerns/shopify_app/require_known_shop.rb
298
+ - app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb
281
299
  - app/controllers/shopify_app/authenticated_controller.rb
282
300
  - app/controllers/shopify_app/callback_controller.rb
283
301
  - app/controllers/shopify_app/extension_verification_controller.rb
@@ -293,6 +311,7 @@ files:
293
311
  - app/views/shopify_app/sessions/new.html.erb
294
312
  - app/views/shopify_app/sessions/request_storage_access.html.erb
295
313
  - app/views/shopify_app/sessions/top_level_interaction.html.erb
314
+ - app/views/shopify_app/shared/post_redirect_to_auth_shopify.html.erb
296
315
  - app/views/shopify_app/shared/redirect.html.erb
297
316
  - config/locales/cs.yml
298
317
  - config/locales/da.yml
@@ -321,8 +340,15 @@ files:
321
340
  - docs/Quickstart.md
322
341
  - docs/Releasing.md
323
342
  - docs/Troubleshooting.md
324
- - docs/install-on-dev-shop.png
325
- - docs/test-your-app.png
343
+ - docs/Upgrading.md
344
+ - docs/shopify_app/authentication.md
345
+ - docs/shopify_app/engine.md
346
+ - docs/shopify_app/generators.md
347
+ - docs/shopify_app/handling-access-scopes-changes.md
348
+ - docs/shopify_app/script-tags.md
349
+ - docs/shopify_app/session-repository.md
350
+ - docs/shopify_app/testing.md
351
+ - docs/shopify_app/webhooks.md
326
352
  - images/app-proxy-screenshot.png
327
353
  - karma.conf.js
328
354
  - lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb
@@ -351,7 +377,7 @@ files:
351
377
  - lib/generators/shopify_app/install/templates/shopify_app.js
352
378
  - lib/generators/shopify_app/install/templates/shopify_app.rb.tt
353
379
  - lib/generators/shopify_app/install/templates/shopify_app_index.js
354
- - lib/generators/shopify_app/install/templates/shopify_provider.rb
380
+ - lib/generators/shopify_app/install/templates/shopify_provider.rb.tt
355
381
  - lib/generators/shopify_app/install/templates/user_agent.rb
356
382
  - lib/generators/shopify_app/products_controller/products_controller_generator.rb
357
383
  - lib/generators/shopify_app/products_controller/templates/products_controller.rb
@@ -361,16 +387,21 @@ files:
361
387
  - lib/generators/shopify_app/routes/routes_generator.rb
362
388
  - lib/generators/shopify_app/routes/templates/routes.rb
363
389
  - lib/generators/shopify_app/shop_model/shop_model_generator.rb
390
+ - lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb
364
391
  - lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.erb
365
392
  - lib/generators/shopify_app/shop_model/templates/shop.rb
366
393
  - lib/generators/shopify_app/shop_model/templates/shops.yml
367
394
  - lib/generators/shopify_app/shopify_app_generator.rb
395
+ - lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb
368
396
  - lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb
369
397
  - lib/generators/shopify_app/user_model/templates/user.rb
370
398
  - lib/generators/shopify_app/user_model/templates/users.yml
371
399
  - lib/generators/shopify_app/user_model/user_model_generator.rb
372
400
  - lib/generators/shopify_app/views/views_generator.rb
373
401
  - lib/shopify_app.rb
402
+ - lib/shopify_app/access_scopes/noop_strategy.rb
403
+ - lib/shopify_app/access_scopes/shop_strategy.rb
404
+ - lib/shopify_app/access_scopes/user_strategy.rb
374
405
  - lib/shopify_app/configuration.rb
375
406
  - lib/shopify_app/controller_concerns/app_proxy_verification.rb
376
407
  - lib/shopify_app/controller_concerns/csrf_protection.rb
@@ -387,6 +418,7 @@ files:
387
418
  - lib/shopify_app/managers/webhooks_manager.rb
388
419
  - lib/shopify_app/middleware/jwt_middleware.rb
389
420
  - lib/shopify_app/middleware/same_site_cookie_middleware.rb
421
+ - lib/shopify_app/omniauth/omniauth_configuration.rb
390
422
  - lib/shopify_app/session/in_memory_session_store.rb
391
423
  - lib/shopify_app/session/in_memory_shop_session_store.rb
392
424
  - lib/shopify_app/session/in_memory_user_session_store.rb
@@ -395,7 +427,9 @@ files:
395
427
  - lib/shopify_app/session/session_repository.rb
396
428
  - lib/shopify_app/session/session_storage.rb
397
429
  - lib/shopify_app/session/shop_session_storage.rb
430
+ - lib/shopify_app/session/shop_session_storage_with_scopes.rb
398
431
  - lib/shopify_app/session/user_session_storage.rb
432
+ - lib/shopify_app/session/user_session_storage_with_scopes.rb
399
433
  - lib/shopify_app/test_helpers/all.rb
400
434
  - lib/shopify_app/test_helpers/webhook_verification_helper.rb
401
435
  - lib/shopify_app/utils.rb
@@ -1,19 +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.
15
-
16
- Security
17
- --------
18
-
19
- Please be certain to redact any private information from your logs or code snippets such as Api Keys, Api Secrets, and any authentication tokens such as shop_tokens.
Binary file
Binary file
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- provider :shopify,
4
- ShopifyApp.configuration.api_key,
5
- ShopifyApp.configuration.secret,
6
- scope: ShopifyApp.configuration.scope,
7
- setup: lambda { |env|
8
- strategy = env['omniauth.strategy']
9
-
10
- shopify_auth_params = strategy.session['shopify.omniauth_params']&.with_indifferent_access
11
- shop = if shopify_auth_params.present?
12
- "https://#{shopify_auth_params[:shop]}"
13
- else
14
- ''
15
- end
16
-
17
- strategy.options[:client_options][:site] = shop
18
- strategy.options[:old_client_secret] = ShopifyApp.configuration.old_secret
19
- strategy.options[:per_user_permissions] = strategy.session[:user_tokens]
20
- }