shopify_app 13.2.0 → 20.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) 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 +22 -0
  7. data/.github/workflows/build.yml +40 -0
  8. data/.github/workflows/cla.yml +22 -0
  9. data/.github/workflows/close-waiting-for-response-issues.yml +20 -0
  10. data/.github/workflows/release.yml +24 -0
  11. data/.github/workflows/remove-labels-on-activity.yml +16 -0
  12. data/.github/workflows/rubocop.yml +22 -0
  13. data/.github/workflows/stale.yml +31 -0
  14. data/.gitignore +1 -2
  15. data/.nvmrc +1 -1
  16. data/.rubocop.yml +2 -0
  17. data/.ruby-version +1 -1
  18. data/CHANGELOG.md +221 -0
  19. data/CONTRIBUTING.md +81 -0
  20. data/Gemfile +5 -2
  21. data/Gemfile.lock +248 -0
  22. data/README.md +74 -563
  23. data/Rakefile +4 -3
  24. data/SECURITY.md +59 -0
  25. data/app/assets/images/storage_access.svg +1 -2
  26. data/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js +10 -0
  27. data/app/assets/javascripts/shopify_app/app_bridge_redirect.js +22 -0
  28. data/app/assets/javascripts/shopify_app/app_bridge_utils_3.1.1.js +1 -0
  29. data/app/assets/javascripts/shopify_app/post_redirect.js +9 -0
  30. data/app/assets/javascripts/shopify_app/redirect.js +10 -14
  31. data/app/assets/javascripts/shopify_app/storage_access.js +5 -10
  32. data/app/assets/javascripts/shopify_app/top_level_interaction.js +1 -1
  33. data/app/controllers/concerns/shopify_app/authenticated.rb +4 -0
  34. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +39 -0
  35. data/app/controllers/concerns/shopify_app/require_known_shop.rb +48 -0
  36. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +40 -0
  37. data/app/controllers/shopify_app/authenticated_controller.rb +1 -0
  38. data/app/controllers/shopify_app/callback_controller.rb +56 -77
  39. data/app/controllers/shopify_app/extension_verification_controller.rb +2 -7
  40. data/app/controllers/shopify_app/sessions_controller.rb +33 -117
  41. data/app/controllers/shopify_app/webhooks_controller.rb +5 -26
  42. data/app/views/shopify_app/partials/_button_styles.html.erb +41 -36
  43. data/app/views/shopify_app/partials/_card_styles.html.erb +3 -3
  44. data/app/views/shopify_app/partials/_empty_state_styles.html.erb +28 -59
  45. data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
  46. data/app/views/shopify_app/partials/_layout_styles.html.erb +16 -1
  47. data/app/views/shopify_app/partials/_typography_styles.html.erb +6 -6
  48. data/app/views/shopify_app/sessions/enable_cookies.html.erb +2 -7
  49. data/app/views/shopify_app/sessions/new.html.erb +38 -110
  50. data/app/views/shopify_app/sessions/request_storage_access.html.erb +12 -12
  51. data/app/views/shopify_app/sessions/top_level_interaction.html.erb +21 -22
  52. data/app/views/shopify_app/shared/post_redirect_to_auth_shopify.html.erb +13 -0
  53. data/app/views/shopify_app/shared/redirect.html.erb +2 -2
  54. data/config/locales/de.yml +11 -11
  55. data/config/locales/ja.yml +4 -4
  56. data/config/locales/nl.yml +2 -2
  57. data/config/locales/th.yml +4 -4
  58. data/config/locales/vi.yml +22 -0
  59. data/config/locales/zh-CN.yml +2 -2
  60. data/config/routes.rb +20 -12
  61. data/docs/Quickstart.md +19 -83
  62. data/docs/Releasing.md +18 -15
  63. data/docs/Troubleshooting.md +140 -5
  64. data/docs/Upgrading.md +247 -0
  65. data/docs/shopify_app/authentication.md +128 -0
  66. data/docs/shopify_app/content-security-policy.md +10 -0
  67. data/docs/shopify_app/engine.md +82 -0
  68. data/docs/shopify_app/generators.md +127 -0
  69. data/docs/shopify_app/handling-access-scopes-changes.md +24 -0
  70. data/docs/shopify_app/script-tags.md +28 -0
  71. data/docs/shopify_app/session-repository.md +88 -0
  72. data/docs/shopify_app/testing.md +38 -0
  73. data/docs/shopify_app/webhooks.md +72 -0
  74. data/karma.conf.js +1 -1
  75. data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +10 -9
  76. data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +1 -0
  77. data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +4 -3
  78. data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +15 -14
  79. data/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt +9 -1
  80. data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +7 -6
  81. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +2 -1
  82. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +1 -1
  83. data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +4 -4
  84. data/lib/generators/shopify_app/controllers/controllers_generator.rb +5 -4
  85. data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +27 -4
  86. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +12 -2
  87. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +74 -16
  88. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +16 -0
  89. data/lib/generators/shopify_app/install/install_generator.rb +52 -40
  90. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +5 -2
  91. data/lib/generators/shopify_app/install/templates/flash_messages.js +0 -2
  92. data/lib/generators/shopify_app/install/templates/session_store.rb +2 -1
  93. data/lib/generators/shopify_app/install/templates/shopify_app.js +1 -1
  94. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +43 -5
  95. data/lib/generators/shopify_app/install/templates/shopify_app_importmap.js +13 -0
  96. data/lib/generators/shopify_app/products_controller/products_controller_generator.rb +19 -0
  97. data/lib/generators/shopify_app/products_controller/templates/products_controller.rb +8 -0
  98. data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +4 -4
  99. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +1 -0
  100. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +1 -1
  101. data/lib/generators/shopify_app/routes/routes_generator.rb +6 -5
  102. data/lib/generators/shopify_app/routes/templates/routes.rb +5 -5
  103. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +35 -7
  104. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  105. data/lib/generators/shopify_app/shop_model/templates/shop.rb +2 -1
  106. data/lib/generators/shopify_app/shopify_app_generator.rb +4 -3
  107. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  108. data/lib/generators/shopify_app/user_model/templates/user.rb +2 -1
  109. data/lib/generators/shopify_app/user_model/user_model_generator.rb +35 -7
  110. data/lib/generators/shopify_app/views/views_generator.rb +5 -4
  111. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  112. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  113. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  114. data/lib/shopify_app/configuration.rb +58 -11
  115. data/lib/shopify_app/controller_concerns/app_proxy_verification.rb +4 -4
  116. data/lib/shopify_app/controller_concerns/csrf_protection.rb +16 -0
  117. data/lib/shopify_app/controller_concerns/embedded_app.rb +6 -3
  118. data/lib/shopify_app/controller_concerns/ensure_billing.rb +243 -0
  119. data/lib/shopify_app/controller_concerns/frame_ancestors.rb +16 -0
  120. data/lib/shopify_app/controller_concerns/itp.rb +3 -3
  121. data/lib/shopify_app/controller_concerns/localization.rb +1 -0
  122. data/lib/shopify_app/controller_concerns/login_protection.rb +105 -90
  123. data/lib/shopify_app/controller_concerns/payload_verification.rb +25 -0
  124. data/lib/shopify_app/controller_concerns/redirect_for_embedded.rb +36 -0
  125. data/lib/shopify_app/controller_concerns/sanitized_params.rb +36 -0
  126. data/lib/shopify_app/controller_concerns/webhook_verification.rb +3 -18
  127. data/lib/shopify_app/engine.rb +26 -11
  128. data/lib/shopify_app/errors.rb +34 -0
  129. data/lib/shopify_app/jobs/scripttags_manager_job.rb +2 -2
  130. data/lib/shopify_app/jobs/webhooks_manager_job.rb +4 -5
  131. data/lib/shopify_app/managers/scripttags_manager.rb +12 -6
  132. data/lib/shopify_app/managers/webhooks_manager.rb +62 -42
  133. data/lib/shopify_app/middleware/jwt_middleware.rb +6 -3
  134. data/lib/shopify_app/session/in_memory_session_store.rb +2 -3
  135. data/lib/shopify_app/session/in_memory_shop_session_store.rb +10 -7
  136. data/lib/shopify_app/session/in_memory_user_session_store.rb +10 -7
  137. data/lib/shopify_app/session/jwt.rb +19 -16
  138. data/lib/shopify_app/session/null_user_session_store.rb +2 -1
  139. data/lib/shopify_app/session/session_repository.rb +40 -2
  140. data/lib/shopify_app/session/session_storage.rb +4 -6
  141. data/lib/shopify_app/session/shop_session_storage.rb +6 -6
  142. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +57 -0
  143. data/lib/shopify_app/session/user_session_storage.rb +20 -7
  144. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +71 -0
  145. data/lib/shopify_app/test_helpers/all.rb +2 -1
  146. data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +4 -3
  147. data/lib/shopify_app/utils.rb +14 -7
  148. data/lib/shopify_app/version.rb +2 -1
  149. data/lib/shopify_app.rb +52 -29
  150. data/package.json +7 -8
  151. data/service.yml +1 -5
  152. data/shopify_app.gemspec +22 -20
  153. data/translation.yml +1 -1
  154. data/yarn.lock +2173 -2206
  155. metadata +110 -56
  156. data/.github/ISSUE_TEMPLATE.md +0 -14
  157. data/.github/probots.yml +0 -2
  158. data/.travis.yml +0 -28
  159. data/config/locales/hi.yml +0 -23
  160. data/config/locales/ms.yml +0 -22
  161. data/docs/install-on-dev-shop.png +0 -0
  162. data/docs/test-your-app.png +0 -0
  163. data/lib/generators/shopify_app/install/templates/omniauth.rb +0 -3
  164. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -20
  165. data/lib/generators/shopify_app/install/templates/user_agent.rb +0 -6
  166. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +0 -34
  167. data/package-lock.json +0 -7245
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 342e069a4f4d0d9bd824403f44cbcf25e398c8e869b4c31058199c7a13daca19
4
- data.tar.gz: cebba3a407077d4dd86183b6aa4fe702593cfacb5de7f630305fefb7bf0ed545
3
+ metadata.gz: cb6f3007d376f75a09be6f17e5dd378e4adc0a7ccc5feeac7ee18ecaf5469ee5
4
+ data.tar.gz: 62c9f9d55bf842fb2c20c4123555d0c1e3f234e11855825e8afeec2e38db971d
5
5
  SHA512:
6
- metadata.gz: 3d7e6c9dc9a521fe022f91e3c2761ff451a34fb67a61ebe3ac5888e5a19924d8eea912a9d644c4255ab0570c959ee8f56f6b30b98809b9d6bb9e09323f7bfec3
7
- data.tar.gz: 67ed9dbc2897dce008f35c760251d64c708319a2171617692caedf01026b8366dd5f3ac9609d23c2ee8d196d2b90a34adce2bcf2974e7541bfa24a74a06c303b
6
+ metadata.gz: d845e94acae7308bb796e46c1134faa06fdfa564fdfb8ecb65ec942a85d7e4b464de4e4d875b52add54d60ba6d3d4f4678f009957b8ac277067e683d3ebb70b2
7
+ data.tar.gz: 16fbc75dc6a020f758e2020b2735ed6357878065e110c63072ac1c9114ba4bdc0dad8378d74064e34f69d4287046069e68004f9a64a14ac9c6c587102933c01a
data/.github/CODEOWNERS CHANGED
@@ -1 +1,2 @@
1
1
  * @shopify/platform-dev-tools-education
2
+ * @shopify/app-foundations
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a technical issue with the Shopify App gem.
4
+ labels: bug
5
+ ---
6
+
7
+ <!--
8
+
9
+ Do you want to ask a question? Are you looking for support? The Shopify Community forum is the best place for getting support: https://community.shopify.com
10
+
11
+ You can also join the Partners Slack Community group: https://www.shopify.com/partners/community#conversation
12
+
13
+ Authentication Issues: A great deal of the issues surrounding this repo are around authenticating (installing) the generated app with Shopify.
14
+
15
+ 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.
16
+
17
+ -->
18
+
19
+ ### Description
20
+
21
+ <!-- Description of the issue -->
22
+
23
+ ### Steps to Reproduce
24
+
25
+ 1. <!-- First Step -->
26
+ 2. <!-- Second Step -->
27
+ 3. <!-- and so on… -->
28
+
29
+ **Expected behavior:**
30
+
31
+ <!-- What you expect to happen -->
32
+
33
+ **Actual behavior:**
34
+
35
+ <!-- What actually happens -->
36
+
37
+ **Reproduces how often:**
38
+
39
+ <!-- What percentage of the time does it reproduce? -->
40
+
41
+ ### Browsers
42
+
43
+ <!-- Please specify the browser(s) you have tested that exhibit this behaviour. -->
44
+
45
+ ### Gem versions
46
+
47
+ <!-- Please specify which version(s) of the gem exhibit this behaviour. -->
48
+
49
+ ### Additional Information
50
+
51
+ <!-- Any additional information, configuration or data that might be necessary to reproduce the issue. See common examples of important information below. -->
52
+
53
+ <!-- - [x] My app relies on third-party cookies -->
54
+ <!-- - [x] My app is intended to be a non-embedded app -->
55
+ <!-- - [x] My app uses session tokens -->
56
+
57
+
58
+ ### Security
59
+
60
+ <!-- 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. -->
61
+
62
+ - [ ] I have redacted any private information from my logs or code snippets.
63
+
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Feature request
3
+ about: Request new functionality for the Shopify App gem.
4
+ labels: feature request
5
+ ---
6
+
7
+ <!--
8
+
9
+ Do you want to ask a question? Are you looking for support? The Shopify Community forum is the best place for getting support: https://community.shopify.com
10
+
11
+ You can also join the Partners Slack Community group: https://www.shopify.com/partners/community#conversation
12
+
13
+ ---
14
+
15
+ Please note that the team that maintains this gem has finite resources so it's unlikely that we'll work on feature requests. If we're interested in a particular feature however, we'll follow up and ask for more detail.
16
+
17
+ -->
18
+
19
+ ### Summary
20
+
21
+ <!-- One paragraph explanation of the feature or suggestions. -->
22
+
23
+ ### Motivation
24
+
25
+ <!-- Why is this feature or suggestion needed? What is the expected outcome? -->
26
+
27
+ ### Describe alternatives you've considered
28
+
29
+ <!-- A clear and concise description of the alternative solutions you've considered. -->
30
+
31
+ ### Additional context
32
+
33
+ <!-- Add any other context or screenshots about the feature request here. -->
@@ -0,0 +1,22 @@
1
+ ### What this PR does
2
+
3
+ <!-- Please describe what changes this PR introduces and why they're needed. -->
4
+
5
+ ### Reviewer's guide to testing
6
+
7
+ <!-- If this PR changes functionality, please list out steps to test your changes. This helps reviewers verify your changes are correct. -->
8
+
9
+ ### Things to focus on
10
+
11
+ 1. <!-- Focus on a particular file -->
12
+ 2. <!-- Is the test case correct? -->
13
+ 3. <!-- Etc. -->
14
+
15
+ ### Checklist
16
+
17
+ Before submitting the PR, please consider if any of the following are needed:
18
+
19
+ - [ ] Update `CHANGELOG.md` if the changes would impact users
20
+ - [ ] Update `README.md`, if appropriate.
21
+ - [ ] Update any relevant pages in `/docs`, if necessary
22
+ - [ ] For security fixes, the [Disclosure Policy](https://github.com/Shopify/shopify_app/blob/master/SECURITY.md#disclosure-policy) must be followed.
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: macos-latest # prevents intermittent Chrome Headless error unlike ubuntu
12
+ name: Ruby ${{ matrix.version }}
13
+ strategy:
14
+ matrix:
15
+ version: ['2.7', '3.0']
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Cache node modules
20
+ uses: actions/cache@v2
21
+ with:
22
+ # npm cache files are stored in `~/.npm` on Linux/macOS
23
+ path: ~/.npm
24
+ key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
25
+ - name: Set up Ruby ${{ matrix.version }}
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.version }}
29
+ bundler-cache: true
30
+ - name: Set up Node
31
+ uses: actions/setup-node@v2-beta
32
+ with:
33
+ node-version: '12'
34
+ - name: Install Dependencies
35
+ run: |
36
+ yarn
37
+ - name: Run Tests
38
+ run: |
39
+ yarn test
40
+ bundle exec rake test
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
@@ -0,0 +1,20 @@
1
+ name: Close Waiting for Response Issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+ workflow_dispatch:
6
+ jobs:
7
+ check-need-info:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: close-issues
11
+ uses: actions-cool/issues-helper@v3
12
+ with:
13
+ actions: 'close-issues'
14
+ token: ${{ secrets.GITHUB_TOKEN }}
15
+ labels: 'Waiting for Response'
16
+ inactive-day: 7
17
+ body: |
18
+ We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.
19
+
20
+ We appreciate your understanding as we try to manage our number of open issues.
@@ -0,0 +1,24 @@
1
+ name: Create Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ create-release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Extract tag name
13
+ id: tag
14
+ run: echo "::set-output name=value::${GITHUB_REF##*/}"
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Create Release
18
+ id: create_release
19
+ uses: actions/create-release@v1
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22
+ with:
23
+ tag_name: ${{ steps.tag.outputs.value }}
24
+ release_name: ${{ steps.tag.outputs.value }}
@@ -0,0 +1,16 @@
1
+ name: Remove Stale or Waiting Labels
2
+ on:
3
+ issue_comment:
4
+ types: [created]
5
+ workflow_dispatch:
6
+ jobs:
7
+ remove-labels-on-activity:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: actions-ecosystem/action-remove-labels@v1
12
+ if: contains(github.event.issue.labels.*.name, 'Waiting for Response')
13
+ with:
14
+ labels: |
15
+ Waiting for Response
16
+
@@ -0,0 +1,22 @@
1
+ name: RuboCop
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - name: Set up Ruby 2.7
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.7
15
+ bundler-cache: true
16
+ - name: Install gems
17
+ run: |
18
+ bundle config path vendor/bundle
19
+ bundle config set without 'default development test'
20
+ bundle install --jobs 4 --retry 3
21
+ - name: Run RuboCop
22
+ run: bundle exec rubocop --parallel
@@ -0,0 +1,31 @@
1
+ name: Close inactive issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+
6
+ jobs:
7
+ close-issues:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+ steps:
13
+ - uses: actions/stale@v5
14
+ with:
15
+ days-before-issue-stale: 90
16
+ days-before-issue-close: 14
17
+ stale-issue-label: "Stale"
18
+ stale-issue-message: >
19
+ This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.
20
+ close-issue-message: |
21
+ We are closing this issue because it has been inactive for a few months.
22
+ This probably means that it is not reproducible or it has been fixed in a newer version.
23
+ If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
24
+
25
+ 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
26
+
27
+ Thank you!
28
+ days-before-pr-stale: -1
29
+ days-before-pr-close: -1
30
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
31
+ exempt-issue-labels: "feature request"
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
4
3
  pkg/*
5
4
  .DS_Store
6
5
  .yardoc
@@ -8,9 +7,9 @@ doc/
8
7
  *.log
9
8
  *.sqlite3
10
9
  test/tmp/*
10
+ test/.generated/*
11
11
  .idea
12
12
  # ignore sprockets cache
13
13
  /test/dummy/tmp/*
14
14
  /node_modules/
15
15
  .byebug_history
16
-
data/.nvmrc CHANGED
@@ -1 +1 @@
1
- 8.10.0
1
+ 12.22.8
data/.rubocop.yml CHANGED
@@ -5,10 +5,12 @@ AllCops:
5
5
  TargetRubyVersion: 2.7
6
6
  Exclude:
7
7
  - 'test/tmp/**/*'
8
+ - 'vendor/bundle/**/*'
8
9
 
9
10
  Style/MethodCallWithArgsParentheses:
10
11
  Exclude:
11
12
  - '**/Gemfile'
13
+ - 'test/**/*'
12
14
 
13
15
  Style/ClassAndModuleChildren:
14
16
  Exclude:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 3.0.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,224 @@
1
+ Unreleased
2
+ ----------
3
+
4
+ 20.2.0 (September 30, 2022)
5
+ ----------
6
+ * Fixes a method signature error bug when raising `BillingError`. [#1513](https://github.com/Shopify/shopify_app/pull/1513)
7
+ * Fixes bug with Rails 7 and import maps with Safari/Firefox on the HomeController#index view. [#1506](https://github.com/Shopify/shopify_app/pull/1506)
8
+ * Refactors how default `domain_host` is populated in the CSP header added to responses in the `FrameAncestors` controller concern. [#1504](https://github.com/Shopify/shopify_app/pull/1504)
9
+ * Removes duplicate `;` added in CSP header. [#1500](https://github.com/Shopify/shopify_app/pull/1500)
10
+
11
+ * Fixed an issue where `ShopifyApp::UserSessionStorage` was causing an infinite OAuth loop when not checking scopes. [#1516](https://github.com/Shopify/shopify_app/pull/1516)
12
+ * Move all error classes created for this gem into `lib/shopify_app/errors.rb`. Constant names of errors nested by modules and classes have been removed to give a shorter namespace.
13
+
14
+ 20.1.1 (September 2, 2022)
15
+ ----------
16
+
17
+ * Fixed an issue where the `embedded_redirect_url` could lead to a redirect loop in server-side rendered (or production) apps. [#1497](https://github.com/Shopify/shopify_app/pull/1497)
18
+ * Fixes bug where webhooks were generated with addresses instead of the [path the Ruby API](https://github.com/Shopify/shopify-api-ruby/blob/7a08ae9d96a7a85abd0113dae4eb76398cba8c64/lib/shopify_api/webhooks/registrations/http.rb#L12) is expecting [#1474](https://github.com/Shopify/shopify_app/pull/1474). The breaking change that was accidentially already shipped was that `address` attribute for webhooks should be paths not addresses with `https://` and the host name. While the `address` attribute name will still work assuming the value is a path, this name is deprecated. Please configure webhooks with the `path` attribute name instead.
19
+ * Deduce webhook path from deprecated webhook address if initializer uses address attribute. This makes this attribute change a non-breaking change for those upgrading.
20
+
21
+ 20.1.0 (August 22, 2022)
22
+ ----------
23
+
24
+ * Set the appropriate CSP `frame-ancestor` directive in controllers using the `EmbeddedApp` concern. [#1474](https://github.com/Shopify/shopify_app/pull/1474)
25
+ * Allow [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare/) hosts in `config/environments/development.rb`.
26
+ * Use [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare/) as example tunnel in readme/docs.
27
+ * Change to optimize OAuth redirects to happen on the server side when possible. Also, add an optional `.embedded_redirect_url` configuration parameter to enable customized App Bridge-supported redirect. [1483](https://github.com/Shopify/shopify_app/pull/1483)
28
+
29
+ 20.0.2 (July 7, 2022)
30
+ ----------
31
+
32
+ * Bump [Shopify API](https://github.com/Shopify/shopify-api-ruby) to version 11.0.1. It includes [these updates](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#version-1101). Fix an issue where HMAC signature verification would fail in OAuth flows during API key rotation.
33
+
34
+ 20.0.1 (July 6, 2022)
35
+ ----------
36
+
37
+ * Accept extra keyword arguments to WebhooksManagerJob to ease upgrade path from v18 or older (https://github.com/Shopify/shopify_app/pull/1466)
38
+
39
+ 20.0.0 (July 4, 2022)
40
+ ----------
41
+
42
+ * Bump [Shopify API](https://github.com/Shopify/shopify-api-ruby) to version 11.0.0. It includes [these updates](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#version-1100). The breaking change relates to the removal of API version `2021-07` support.
43
+ * Internal update, adding App Bridge 3 for redirect (only). [#1458](https://github.com/Shopify/shopify_app/pull/1458)
44
+
45
+ 19.1.0 (June 20, 2022)
46
+ ----------
47
+
48
+ * Add the `login_callback_url` config to allow overwriting that route as well, and mount the engine routes based on the configurations. [#1445](https://github.com/Shopify/shopify_app/pull/1445)
49
+ * Add special headers when returning 401s from LoginProtection. [#1450](https://github.com/Shopify/shopify_app/pull/1450)
50
+ * Add a new `billing` configuration which takes in a `ShopifyApp::BillingConfiguration` object and checks for payment on controllers with `Authenticated`. [#1455](https://github.com/Shopify/shopify_app/pull/1455)
51
+
52
+ 19.0.2 (April 27, 2022)
53
+ ----------
54
+
55
+ * Fix regression in apps using online tokens. [#1413](https://github.com/Shopify/shopify_app/pull/1413)
56
+ * Bump [Shopify API](https://github.com/Shopify/shopify-api-ruby) to version 10.0.3. It includes [these fixes](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#version-1003).
57
+
58
+ 19.0.1 (April 11, 2022)
59
+ ----------
60
+ * Bump Shopify API (https://github.com/Shopify/shopify-api-ruby) to version 10.0.2. This update includes patch fixes since the initial v10 release.
61
+
62
+ 19.0.0 (April 6, 2022)
63
+ ----------
64
+ * Use v10 of the Shopify API (https://github.com/Shopify/shopify-api-ruby). This update requires changes to an app - please refer to the [migration guide](https://github.com/Shopify/shopify_app/blob/main/docs/Upgrading.md) for details.
65
+ BREAKING, please see migration notes.
66
+
67
+ 18.1.2 (Mar 3, 2022)
68
+ ----------
69
+ * Use the App Bridge 2.0 redirect when attempting to break out of an iframe. This happens when an app is installed, requires new access scopes, or re-authentication because the login session is expired. [#1376](https://github.com/Shopify/shopify_app/pull/1376)
70
+
71
+ 18.1.1 (Feb 2, 2022)
72
+ ----------
73
+ * Fix bug causing `unsafe-inline` CSP violation. [#1362](https://github.com/Shopify/shopify_app/pull/1362)
74
+
75
+ 18.1.0 (Jan 28, 2022)
76
+ ----------
77
+ * Support Rails 7 [#1354](https://github.com/Shopify/shopify_app/pull/1354)
78
+ * Fix webhooks handling in Ruby 3 [#1342](https://github.com/Shopify/shopify_app/pull/1342)
79
+ * Update to Ruby 3 and drop support to Ruby 2.5 [#1359](https://github.com/Shopify/shopify_app/pull/1359)
80
+
81
+ 18.0.4 (Jan 27, 2022)
82
+ ----------
83
+ * Use App Bridge client for redirect [#1247](https://github.com/Shopify/shopify_app/pull/1247)
84
+ * Replaces deprecated EASDK with App Bridge when redirecting out of an embedded iframe.
85
+
86
+ 18.0.3 (Jan 7, 2022)
87
+ ----------
88
+ * Change regexp to match standard ngrok URLs. [#1311](https://github.com/Shopify/shopify_app/pull/1311)
89
+ * Make `EnsureAuthenticatedLinks` compatible with AppBridge 2.0. [#1277](https://github.com/Shopify/shopify_app/pull/1277)
90
+ * Includes the `host` parameter when redirecting to the splash page in an unauthenticated state.
91
+
92
+ 18.0.2 (Jun 15, 2021)
93
+ ----------
94
+ * Added careers link to readme. [#1274](https://github.com/Shopify/shopify_app/pull/1274)
95
+
96
+ 18.0.1 (May 7, 2021)
97
+ ----------
98
+ * Fix bug causing OAuth flow to fail due to CSP violation. [#1265](https://github.com/Shopify/shopify_app/pull/1265)
99
+
100
+ 18.0.0 (May 3, 2021)
101
+ ----------
102
+ * Support OmniAuth 2.x
103
+ * If your app has custom OmniAuth configuration, please refer to the [OmniAuth 2.0 upgrade guide](https://github.com/omniauth/omniauth/wiki/Upgrading-to-2.0).
104
+ * Support App Bridge version 2.x in the Embedded App layout. [#1241](https://github.com/Shopify/shopify_app/pull/1241)
105
+
106
+ 17.2.1 (April 1, 2021)
107
+ ----------
108
+ * Bug fix: Lock the CDN App Bridge version to `v1.X.Y` in the Embedded App layout [#1238](https://github.com/Shopify/shopify_app/pull/1238)
109
+ * App Bridge `v2.0` is a non-backwards compatible release
110
+ * A future major shopify_app gem release will support only App Bridge `v2.0`
111
+
112
+ 17.2.0 (April 1, 2021)
113
+ ----------
114
+ * Support Rails `v6.1` [#1221](https://github.com/Shopify/shopify_app/pull/1221)
115
+ * Check out [Upgrading to `v17.2.0`](/docs/Upgrading.md#upgrading-to-v1720) in the Upgrading.md guide for the changes needed to support Rails `v6.1`
116
+
117
+ 17.1.1 (March 12, 2021)
118
+ ----------
119
+ * Fix issues with mocking OmniAuth callback controller tests [#1210](https://github.com/Shopify/shopify_app/pull/1210)
120
+
121
+ 17.1.0 (March 5, 2021)
122
+ ----------
123
+ * Create OmniAuthConfiguration object to build future OmniAuth strategies [#1190](https://github.com/Shopify/shopify_app/pull/1190)
124
+ * 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)
125
+
126
+ 17.0.5 (January 27, 2021)
127
+ ----------
128
+ * Fix omniauth strategy not being set correctly for apps using session tokens [#1164](https://github.com/Shopify/shopify_app/pull/1164)
129
+
130
+ 17.0.4 (January 25, 2021)
131
+ ----------
132
+ * Redirect user to login page if shopify domain is not found in the `EnsureAuthenticatedLinks` concern [#1158](https://github.com/Shopify/shopify_app/pull/1158)
133
+
134
+ 17.0.3 (January 22, 2021)
135
+ ----------
136
+ * Amend fix for #1144 to raise on missing API keys only when running the server [#1155](https://github.com/Shopify/shopify_app/pull/1155)
137
+
138
+ 17.0.2 (January 20, 2021)
139
+ ------
140
+ * Fix failing script tags and webhooks installs after completing OAuth [#1151](https://github.com/Shopify/shopify_app/pull/1151)
141
+
142
+ 17.0.1 (January 18, 2021)
143
+ ------
144
+ * 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)
145
+
146
+ 17.0.0 (January 13, 2021)
147
+ ------
148
+ * Rails 6.1 is not yet supported [#1134](https://github.com/Shopify/shopify_app/pull/1134)
149
+
150
+ 16.1.0
151
+ ------
152
+ * Use Session Token auth strategy by default for new embedded apps [#1111](https://github.com/Shopify/shopify_app/pull/1111)
153
+ * Create optional `EnsureAuthenticatedLinks` concern to authenticate deep links using Turbolinks [#1118](https://github.com/Shopify/shopify_app/pull/1118)
154
+
155
+ 16.0.0
156
+ ------
157
+ * Update all `html.erb` and `css` files to correspond with updated store admin design language [#1102](https://github.com/Shopify/shopify_app/pull/1102)
158
+
159
+ 15.0.1
160
+ ------
161
+ * Allow JWT session token `sub` field to be parsed as a string [#1103](https://github.com/Shopify/shopify_app/pull/1103)
162
+
163
+ 15.0.0
164
+ ------
165
+ * Change `X-Shopify-API-Request-Failure-Unauthorized` HTTP header value from boolean to string
166
+
167
+ 14.4.4
168
+ ------
169
+ * Patch to not log params in ShopifyApp jobs [#1086](https://github.com/Shopify/shopify_app/pull/1086)
170
+
171
+ 14.4.3
172
+ ------
173
+ * Fix to ensure post authenticate jobs are run after callback requests [#1079](https://github.com/Shopify/shopify_app/pull/1079)
174
+
175
+ 14.4.2
176
+ ------
177
+ * Add debug logs in sessions controller
178
+
179
+ 14.4.1
180
+ ------
181
+ * Add debug logs for investigating authentication issues
182
+
183
+ 14.4.0
184
+ ------
185
+ * Replace script tags for ITP screens with data attributes
186
+
187
+ 14.3.0
188
+ ------
189
+ * Create user session if one does not exist but was expected
190
+
191
+ 14.2.0
192
+ ------
193
+ * Revert "Replace redirect calls to use App Bridge redirect functionality"
194
+
195
+ 14.1.0
196
+ ------
197
+ * Replace redirect calls to use App Bridge redirect functionality
198
+
199
+ 14.0.0
200
+ ------
201
+ * Ruby 2.4 is no longer supported by this gem
202
+ * Bump gemspec ruby dependency to 2.5
203
+ * (Beta) Add `--with-session-token` flag to the Shopify App generator to create an app that is compatible with App Bridge Authentication
204
+
205
+ 13.5.0
206
+ ------
207
+ * Add `signal_access_token_required` helper method for apps to indicate access token has expired and that a new one is required
208
+
209
+ 13.4.1
210
+ ------
211
+ * Fix the version checks for the dependency on `shopify_api` to allow all of v9.X
212
+
213
+ 13.4.0
214
+ ------
215
+ * 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)
216
+
217
+ 13.3.0
218
+ ------
219
+ * Added Payload Verification module [#992](https://github.com/Shopify/shopify_app/pull/992)
220
+ * Add concern to check for valid shop domains in the unauthenticated controller
221
+
1
222
  13.2.0
2
223
  ------
3
224
  * Get current shop domain from JWT header