shopify_app 21.6.0 → 22.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/ISSUE_TEMPLATE/bug-report.md +23 -18
  4. data/.github/workflows/build.yml +2 -2
  5. data/.github/workflows/release.yml +1 -1
  6. data/.github/workflows/rubocop.yml +1 -2
  7. data/.nvmrc +1 -1
  8. data/.rubocop.yml +0 -1
  9. data/CHANGELOG.md +115 -0
  10. data/CODE_OF_CONDUCT.md +46 -0
  11. data/CONTRIBUTING.md +1 -6
  12. data/Gemfile.lock +99 -96
  13. data/README.md +47 -2
  14. data/app/assets/javascripts/shopify_app/redirect.js +3 -10
  15. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +5 -1
  16. data/app/controllers/concerns/shopify_app/ensure_has_session.rb +11 -5
  17. data/app/controllers/concerns/shopify_app/ensure_installed.rb +10 -4
  18. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +5 -1
  19. data/app/controllers/shopify_app/callback_controller.rb +39 -18
  20. data/app/controllers/shopify_app/sessions_controller.rb +25 -4
  21. data/app/views/shopify_app/layouts/app_bridge.html.erb +17 -0
  22. data/app/views/shopify_app/sessions/patch_shopify_id_token.html.erb +0 -0
  23. data/app/views/shopify_app/shared/redirect.html.erb +10 -1
  24. data/config/locales/cs.yml +0 -18
  25. data/config/locales/da.yml +0 -15
  26. data/config/locales/de.yml +0 -17
  27. data/config/locales/en.yml +0 -11
  28. data/config/locales/es.yml +0 -17
  29. data/config/locales/fi.yml +0 -15
  30. data/config/locales/fr.yml +0 -18
  31. data/config/locales/it.yml +0 -16
  32. data/config/locales/ja.yml +0 -12
  33. data/config/locales/ko.yml +0 -14
  34. data/config/locales/nb.yml +0 -16
  35. data/config/locales/nl.yml +0 -16
  36. data/config/locales/pl.yml +0 -16
  37. data/config/locales/pt-BR.yml +0 -16
  38. data/config/locales/pt-PT.yml +0 -17
  39. data/config/locales/sv.yml +0 -16
  40. data/config/locales/th.yml +0 -15
  41. data/config/locales/tr.yml +0 -17
  42. data/config/locales/vi.yml +0 -17
  43. data/config/locales/zh-CN.yml +0 -11
  44. data/config/locales/zh-TW.yml +0 -11
  45. data/config/routes.rb +2 -1
  46. data/docs/Quickstart.md +9 -2
  47. data/docs/Troubleshooting.md +0 -23
  48. data/docs/Upgrading.md +64 -1
  49. data/docs/shopify_app/authentication.md +179 -58
  50. data/docs/shopify_app/controller-concerns.md +53 -12
  51. data/docs/shopify_app/generators.md +2 -2
  52. data/docs/shopify_app/sessions.md +358 -0
  53. data/docs/shopify_app/webhooks.md +88 -11
  54. data/karma.conf.js +6 -4
  55. data/lib/generators/shopify_app/add_declarative_webhook/add_declarative_webhook_generator.rb +53 -0
  56. data/lib/generators/shopify_app/add_declarative_webhook/templates/webhook_controller.rb.tt +13 -0
  57. data/lib/generators/shopify_app/add_declarative_webhook/templates/webhook_job.rb.tt +15 -0
  58. data/lib/generators/shopify_app/{add_gdpr_jobs/add_gdpr_jobs_generator.rb → add_privacy_jobs/add_privacy_jobs_generator.rb} +1 -1
  59. data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +6 -1
  60. data/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt +1 -0
  61. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +5 -2
  62. data/lib/generators/shopify_app/shopify_app_generator.rb +1 -1
  63. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_expires_at_column.erb +5 -0
  64. data/lib/generators/shopify_app/user_model/user_model_generator.rb +20 -0
  65. data/lib/shopify_app/admin_api/with_token_refetch.rb +27 -0
  66. data/lib/shopify_app/auth/post_authenticate_tasks.rb +48 -0
  67. data/lib/shopify_app/auth/token_exchange.rb +73 -0
  68. data/lib/shopify_app/configuration.rb +69 -1
  69. data/lib/shopify_app/controller_concerns/app_proxy_verification.rb +1 -1
  70. data/lib/shopify_app/controller_concerns/csrf_protection.rb +2 -1
  71. data/lib/shopify_app/controller_concerns/embedded_app.rb +42 -3
  72. data/lib/shopify_app/controller_concerns/ensure_billing.rb +14 -3
  73. data/lib/shopify_app/controller_concerns/frame_ancestors.rb +1 -1
  74. data/lib/shopify_app/controller_concerns/localization.rb +11 -8
  75. data/lib/shopify_app/controller_concerns/login_protection.rb +34 -38
  76. data/lib/shopify_app/controller_concerns/redirect_for_embedded.rb +5 -0
  77. data/lib/shopify_app/controller_concerns/sanitized_params.rb +4 -0
  78. data/lib/shopify_app/controller_concerns/token_exchange.rb +111 -0
  79. data/lib/shopify_app/controller_concerns/with_shopify_id_token.rb +48 -0
  80. data/lib/shopify_app/engine.rb +5 -11
  81. data/lib/shopify_app/managers/webhooks_manager.rb +6 -2
  82. data/lib/shopify_app/middleware/jwt_middleware.rb +13 -9
  83. data/lib/shopify_app/session/in_memory_user_session_store.rb +1 -1
  84. data/lib/shopify_app/session/jwt.rb +9 -0
  85. data/lib/shopify_app/session/session_repository.rb +49 -8
  86. data/lib/shopify_app/session/shop_session_storage.rb +4 -0
  87. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +4 -0
  88. data/lib/shopify_app/session/user_session_storage.rb +4 -0
  89. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +25 -0
  90. data/lib/shopify_app/test_helpers/shopify_session_helper.rb +1 -0
  91. data/lib/shopify_app/utils.rb +14 -1
  92. data/lib/shopify_app/version.rb +1 -1
  93. data/lib/shopify_app.rb +9 -3
  94. data/package.json +5 -6
  95. data/shopify_app.gemspec +4 -4
  96. data/yarn.lock +2134 -3905
  97. metadata +51 -60
  98. data/.github/workflows/stale.yml +0 -43
  99. data/app/assets/images/storage_access.svg +0 -1
  100. data/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js +0 -10
  101. data/app/assets/javascripts/shopify_app/app_bridge_redirect.js +0 -22
  102. data/app/assets/javascripts/shopify_app/app_bridge_utils_3.1.1.js +0 -1
  103. data/app/controllers/concerns/shopify_app/authenticated.rb +0 -17
  104. data/app/controllers/concerns/shopify_app/require_known_shop.rb +0 -16
  105. data/docs/shopify_app/script-tags.md +0 -28
  106. data/docs/shopify_app/session-repository.md +0 -79
  107. data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +0 -42
  108. data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +0 -63
  109. data/lib/shopify_app/controller_concerns/itp.rb +0 -50
  110. data/lib/shopify_app/jobs/scripttags_manager_job.rb +0 -16
  111. data/lib/shopify_app/managers/scripttags_manager.rb +0 -85
  112. /data/lib/generators/shopify_app/{add_gdpr_jobs → add_privacy_jobs}/templates/customers_data_request_job.rb.tt +0 -0
  113. /data/lib/generators/shopify_app/{add_gdpr_jobs → add_privacy_jobs}/templates/customers_redact_job.rb.tt +0 -0
  114. /data/lib/generators/shopify_app/{add_gdpr_jobs → add_privacy_jobs}/templates/shop_redact_job.rb.tt +0 -0
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: 21.6.0
4
+ version: 22.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -38,34 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.7'
41
- - !ruby/object:Gem::Dependency
42
- name: browser_sniffer
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
- - !ruby/object:Gem::Dependency
56
- name: jwt
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 2.2.3
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 2.2.3
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: rails
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +70,22 @@ dependencies:
98
70
  name: shopify_api
99
71
  requirement: !ruby/object:Gem::Requirement
100
72
  requirements:
101
- - - "~>"
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 14.7.0
76
+ - - "<"
102
77
  - !ruby/object:Gem::Version
103
- version: '13.1'
78
+ version: '15.0'
104
79
  type: :runtime
105
80
  prerelease: false
106
81
  version_requirements: !ruby/object:Gem::Requirement
107
82
  requirements:
108
- - - "~>"
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 14.7.0
86
+ - - "<"
109
87
  - !ruby/object:Gem::Version
110
- version: '13.1'
88
+ version: '15.0'
111
89
  - !ruby/object:Gem::Dependency
112
90
  name: sprockets-rails
113
91
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +100,20 @@ dependencies:
122
100
  - - ">="
123
101
  - !ruby/object:Gem::Version
124
102
  version: 2.0.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: jwt
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 2.2.3
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 2.2.3
125
117
  - !ruby/object:Gem::Dependency
126
118
  name: byebug
127
119
  requirement: !ruby/object:Gem::Requirement
@@ -276,8 +268,8 @@ dependencies:
276
268
  - - ">="
277
269
  - !ruby/object:Gem::Version
278
270
  version: '0'
279
- description:
280
- email:
271
+ description:
272
+ email:
281
273
  executables: []
282
274
  extensions: []
283
275
  extra_rdoc_files: []
@@ -295,13 +287,13 @@ files:
295
287
  - ".github/workflows/release.yml"
296
288
  - ".github/workflows/remove-labels-on-activity.yml"
297
289
  - ".github/workflows/rubocop.yml"
298
- - ".github/workflows/stale.yml"
299
290
  - ".gitignore"
300
291
  - ".nvmrc"
301
292
  - ".rubocop.yml"
302
293
  - ".ruby-version"
303
294
  - ".spin/rails/prepare-application"
304
295
  - CHANGELOG.md
296
+ - CODE_OF_CONDUCT.md
305
297
  - CONTRIBUTING.md
306
298
  - Gemfile
307
299
  - Gemfile.lock
@@ -309,22 +301,17 @@ files:
309
301
  - README.md
310
302
  - Rakefile
311
303
  - SECURITY.md
312
- - app/assets/images/storage_access.svg
313
- - app/assets/javascripts/shopify_app/app_bridge_3.1.1.js
314
- - app/assets/javascripts/shopify_app/app_bridge_redirect.js
315
- - app/assets/javascripts/shopify_app/app_bridge_utils_3.1.1.js
316
304
  - app/assets/javascripts/shopify_app/redirect.js
317
- - app/controllers/concerns/shopify_app/authenticated.rb
318
305
  - app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
319
306
  - app/controllers/concerns/shopify_app/ensure_has_session.rb
320
307
  - app/controllers/concerns/shopify_app/ensure_installed.rb
321
- - app/controllers/concerns/shopify_app/require_known_shop.rb
322
308
  - app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb
323
309
  - app/controllers/shopify_app/authenticated_controller.rb
324
310
  - app/controllers/shopify_app/callback_controller.rb
325
311
  - app/controllers/shopify_app/extension_verification_controller.rb
326
312
  - app/controllers/shopify_app/sessions_controller.rb
327
313
  - app/controllers/shopify_app/webhooks_controller.rb
314
+ - app/views/shopify_app/layouts/app_bridge.html.erb
328
315
  - app/views/shopify_app/partials/_button_styles.html.erb
329
316
  - app/views/shopify_app/partials/_card_styles.html.erb
330
317
  - app/views/shopify_app/partials/_empty_state_styles.html.erb
@@ -332,6 +319,7 @@ files:
332
319
  - app/views/shopify_app/partials/_layout_styles.html.erb
333
320
  - app/views/shopify_app/partials/_typography_styles.html.erb
334
321
  - app/views/shopify_app/sessions/new.html.erb
322
+ - app/views/shopify_app/sessions/patch_shopify_id_token.html.erb
335
323
  - app/views/shopify_app/shared/redirect.html.erb
336
324
  - config/locales/cs.yml
337
325
  - config/locales/da.yml
@@ -366,8 +354,7 @@ files:
366
354
  - docs/shopify_app/generators.md
367
355
  - docs/shopify_app/handling-access-scopes-changes.md
368
356
  - docs/shopify_app/logging.md
369
- - docs/shopify_app/script-tags.md
370
- - docs/shopify_app/session-repository.md
357
+ - docs/shopify_app/sessions.md
371
358
  - docs/shopify_app/testing.md
372
359
  - docs/shopify_app/webhooks.md
373
360
  - images/app-proxy-screenshot.png
@@ -376,12 +363,13 @@ files:
376
363
  - lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb
377
364
  - lib/generators/shopify_app/add_app_uninstalled_job/add_app_uninstalled_job_generator.rb
378
365
  - lib/generators/shopify_app/add_app_uninstalled_job/templates/app_uninstalled_job.rb.tt
379
- - lib/generators/shopify_app/add_gdpr_jobs/add_gdpr_jobs_generator.rb
380
- - lib/generators/shopify_app/add_gdpr_jobs/templates/customers_data_request_job.rb.tt
381
- - lib/generators/shopify_app/add_gdpr_jobs/templates/customers_redact_job.rb.tt
382
- - lib/generators/shopify_app/add_gdpr_jobs/templates/shop_redact_job.rb.tt
383
- - lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb
384
- - lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb
366
+ - lib/generators/shopify_app/add_declarative_webhook/add_declarative_webhook_generator.rb
367
+ - lib/generators/shopify_app/add_declarative_webhook/templates/webhook_controller.rb.tt
368
+ - lib/generators/shopify_app/add_declarative_webhook/templates/webhook_job.rb.tt
369
+ - lib/generators/shopify_app/add_privacy_jobs/add_privacy_jobs_generator.rb
370
+ - lib/generators/shopify_app/add_privacy_jobs/templates/customers_data_request_job.rb.tt
371
+ - lib/generators/shopify_app/add_privacy_jobs/templates/customers_redact_job.rb.tt
372
+ - lib/generators/shopify_app/add_privacy_jobs/templates/shop_redact_job.rb.tt
385
373
  - lib/generators/shopify_app/add_webhook/add_webhook_generator.rb
386
374
  - lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
387
375
  - lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb
@@ -418,6 +406,7 @@ files:
418
406
  - lib/generators/shopify_app/shop_model/templates/shops.yml
419
407
  - lib/generators/shopify_app/shopify_app_generator.rb
420
408
  - lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb
409
+ - lib/generators/shopify_app/user_model/templates/db/migrate/add_user_expires_at_column.erb
421
410
  - lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb
422
411
  - lib/generators/shopify_app/user_model/templates/user.rb
423
412
  - lib/generators/shopify_app/user_model/templates/users.yml
@@ -427,25 +416,27 @@ files:
427
416
  - lib/shopify_app/access_scopes/noop_strategy.rb
428
417
  - lib/shopify_app/access_scopes/shop_strategy.rb
429
418
  - lib/shopify_app/access_scopes/user_strategy.rb
419
+ - lib/shopify_app/admin_api/with_token_refetch.rb
420
+ - lib/shopify_app/auth/post_authenticate_tasks.rb
421
+ - lib/shopify_app/auth/token_exchange.rb
430
422
  - lib/shopify_app/configuration.rb
431
423
  - lib/shopify_app/controller_concerns/app_proxy_verification.rb
432
424
  - lib/shopify_app/controller_concerns/csrf_protection.rb
433
425
  - lib/shopify_app/controller_concerns/embedded_app.rb
434
426
  - lib/shopify_app/controller_concerns/ensure_billing.rb
435
427
  - lib/shopify_app/controller_concerns/frame_ancestors.rb
436
- - lib/shopify_app/controller_concerns/itp.rb
437
428
  - lib/shopify_app/controller_concerns/localization.rb
438
429
  - lib/shopify_app/controller_concerns/login_protection.rb
439
430
  - lib/shopify_app/controller_concerns/payload_verification.rb
440
431
  - lib/shopify_app/controller_concerns/redirect_for_embedded.rb
441
432
  - lib/shopify_app/controller_concerns/sanitized_params.rb
433
+ - lib/shopify_app/controller_concerns/token_exchange.rb
442
434
  - lib/shopify_app/controller_concerns/webhook_verification.rb
435
+ - lib/shopify_app/controller_concerns/with_shopify_id_token.rb
443
436
  - lib/shopify_app/engine.rb
444
437
  - lib/shopify_app/errors.rb
445
- - lib/shopify_app/jobs/scripttags_manager_job.rb
446
438
  - lib/shopify_app/jobs/webhooks_manager_job.rb
447
439
  - lib/shopify_app/logger.rb
448
- - lib/shopify_app/managers/scripttags_manager.rb
449
440
  - lib/shopify_app/managers/webhooks_manager.rb
450
441
  - lib/shopify_app/middleware/jwt_middleware.rb
451
442
  - lib/shopify_app/session/in_memory_session_store.rb
@@ -471,11 +462,11 @@ files:
471
462
  - translation.yml
472
463
  - webpack.config.js
473
464
  - yarn.lock
474
- homepage:
465
+ homepage:
475
466
  licenses: []
476
467
  metadata:
477
468
  allowed_push_host: https://rubygems.org
478
- post_install_message:
469
+ post_install_message:
479
470
  rdoc_options: []
480
471
  require_paths:
481
472
  - lib
@@ -483,15 +474,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
483
474
  requirements:
484
475
  - - ">="
485
476
  - !ruby/object:Gem::Version
486
- version: '2.7'
477
+ version: '3.0'
487
478
  required_rubygems_version: !ruby/object:Gem::Requirement
488
479
  requirements:
489
480
  - - ">="
490
481
  - !ruby/object:Gem::Version
491
482
  version: '0'
492
483
  requirements: []
493
- rubygems_version: 3.4.14
494
- signing_key:
484
+ rubygems_version: 3.5.23
485
+ signing_key:
495
486
  specification_version: 4
496
487
  summary: This gem is used to get quickly started with the Shopify API
497
488
  test_files: []
@@ -1,43 +0,0 @@
1
- name: Close inactive issues / prs
2
- on:
3
- schedule:
4
- - cron: "30 1 * * *"
5
-
6
- jobs:
7
- stale:
8
- runs-on: ubuntu-latest
9
- permissions:
10
- issues: write
11
- pull-requests: write
12
- steps:
13
- - uses: actions/stale@v7
14
- with:
15
- days-before-issue-stale: 60
16
- days-before-issue-close: 14
17
- days-before-pr-stale: 60
18
- days-before-pr-close: 14
19
- operations-per-run: 1000
20
- stale-issue-label: "Stale"
21
- stale-pr-label: "Stale"
22
- stale-issue-message: >
23
- This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
24
- close-issue-message: |
25
- We are closing this issue because it has been inactive for a few months.
26
- This probably means that it is not reproducible or it has been fixed in a newer version.
27
- If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
28
-
29
- If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the [CONTRIBUTING.md](https://github.com/Shopify/shopify_app/blob/main/CONTRIBUTING.md) file for guidelines
30
-
31
- Thank you!
32
- stale-pr-message: >
33
- This pull request is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
34
- close-pr-message: |
35
- We are closing this pull request because it has been inactive for a few months.
36
- This probably means that it is not reproducible or it has been fixed in a newer version.
37
- If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
38
-
39
- If you still encounter this pull request with the latest stable version, please reopen using the pull request template. You can also contribute directly by submitting a pull request– see the [CONTRIBUTING.md](https://github.com/Shopify/shopify_app/blob/main/CONTRIBUTING.md) file for guidelines
40
-
41
- Thank you!
42
- repo-token: ${{ github.token }}
43
- close-issue-reason: "not_planned"
@@ -1 +0,0 @@
1
- <svg width="140" height="140" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M79 55a9 9 0 00-18 0v8h18v-8zm6 8v-8a15 15 0 00-30 0v8h-5a2 2 0 00-2 2v20a15 15 0 0015 15h14a15 15 0 0015-15V65a2 2 0 00-2-2h-5zM70 90a3 3 0 01-3-3V75a3 3 0 116 0v12a3 3 0 01-3 3z" fill="#8C9196"/></svg>