shopify_app 17.0.1 → 17.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug-report.md +63 -0
  3. data/.github/ISSUE_TEMPLATE/config.yml +1 -0
  4. data/.github/ISSUE_TEMPLATE/feature-request.md +33 -0
  5. data/.github/PULL_REQUEST_TEMPLATE.md +17 -1
  6. data/.github/workflows/release.yml +6 -2
  7. data/CHANGELOG.md +21 -0
  8. data/CONTRIBUTING.md +76 -0
  9. data/Gemfile.lock +63 -63
  10. data/README.md +72 -593
  11. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +4 -0
  12. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
  13. data/app/controllers/shopify_app/callback_controller.rb +35 -4
  14. data/app/controllers/shopify_app/sessions_controller.rb +13 -4
  15. data/docs/Quickstart.md +15 -77
  16. data/docs/Upgrading.md +110 -0
  17. data/docs/shopify_app/authentication.md +124 -0
  18. data/docs/shopify_app/engine.md +82 -0
  19. data/docs/shopify_app/generators.md +127 -0
  20. data/docs/shopify_app/handling-access-scopes-changes.md +8 -0
  21. data/docs/shopify_app/script-tags.md +28 -0
  22. data/docs/shopify_app/session-repository.md +88 -0
  23. data/docs/shopify_app/testing.md +38 -0
  24. data/docs/shopify_app/webhooks.md +72 -0
  25. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +2 -0
  26. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +1 -0
  27. data/lib/generators/shopify_app/install/install_generator.rb +30 -1
  28. data/lib/generators/shopify_app/install/templates/omniauth.rb +1 -0
  29. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +20 -14
  30. data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
  31. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +27 -0
  32. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  33. data/lib/generators/shopify_app/shop_model/templates/shop.rb +1 -1
  34. data/lib/generators/shopify_app/shopify_app_generator.rb +1 -1
  35. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  36. data/lib/generators/shopify_app/user_model/templates/user.rb +1 -1
  37. data/lib/generators/shopify_app/user_model/user_model_generator.rb +27 -0
  38. data/lib/shopify_app.rb +10 -0
  39. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  40. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  41. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  42. data/lib/shopify_app/configuration.rb +22 -0
  43. data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
  44. data/lib/shopify_app/session/in_memory_shop_session_store.rb +9 -7
  45. data/lib/shopify_app/session/in_memory_user_session_store.rb +9 -7
  46. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
  47. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
  48. data/lib/shopify_app/utils.rb +12 -0
  49. data/lib/shopify_app/version.rb +1 -1
  50. data/package.json +1 -1
  51. data/shopify_app.gemspec +1 -1
  52. data/yarn.lock +70 -101
  53. metadata +27 -8
  54. data/.github/ISSUE_TEMPLATE.md +0 -19
  55. data/docs/install-on-dev-shop.png +0 -0
  56. data/docs/test-your-app.png +0 -0
  57. 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.1
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: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '9.1'
53
+ version: '9.4'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '9.1'
60
+ version: '9.4'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: omniauth-shopify-oauth2
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -248,7 +248,9 @@ extra_rdoc_files: []
248
248
  files:
249
249
  - ".babelrc"
250
250
  - ".github/CODEOWNERS"
251
- - ".github/ISSUE_TEMPLATE.md"
251
+ - ".github/ISSUE_TEMPLATE/bug-report.md"
252
+ - ".github/ISSUE_TEMPLATE/config.yml"
253
+ - ".github/ISSUE_TEMPLATE/feature-request.md"
252
254
  - ".github/PULL_REQUEST_TEMPLATE.md"
253
255
  - ".github/probots.yml"
254
256
  - ".github/workflows/build.yml"
@@ -259,6 +261,7 @@ files:
259
261
  - ".rubocop.yml"
260
262
  - ".ruby-version"
261
263
  - CHANGELOG.md
264
+ - CONTRIBUTING.md
262
265
  - Gemfile
263
266
  - Gemfile.lock
264
267
  - LICENSE
@@ -278,6 +281,7 @@ files:
278
281
  - app/controllers/concerns/shopify_app/authenticated.rb
279
282
  - app/controllers/concerns/shopify_app/ensure_authenticated_links.rb
280
283
  - app/controllers/concerns/shopify_app/require_known_shop.rb
284
+ - app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb
281
285
  - app/controllers/shopify_app/authenticated_controller.rb
282
286
  - app/controllers/shopify_app/callback_controller.rb
283
287
  - app/controllers/shopify_app/extension_verification_controller.rb
@@ -321,8 +325,15 @@ files:
321
325
  - docs/Quickstart.md
322
326
  - docs/Releasing.md
323
327
  - docs/Troubleshooting.md
324
- - docs/install-on-dev-shop.png
325
- - docs/test-your-app.png
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
326
337
  - images/app-proxy-screenshot.png
327
338
  - karma.conf.js
328
339
  - lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb
@@ -351,7 +362,7 @@ files:
351
362
  - lib/generators/shopify_app/install/templates/shopify_app.js
352
363
  - lib/generators/shopify_app/install/templates/shopify_app.rb.tt
353
364
  - lib/generators/shopify_app/install/templates/shopify_app_index.js
354
- - lib/generators/shopify_app/install/templates/shopify_provider.rb
365
+ - lib/generators/shopify_app/install/templates/shopify_provider.rb.tt
355
366
  - lib/generators/shopify_app/install/templates/user_agent.rb
356
367
  - lib/generators/shopify_app/products_controller/products_controller_generator.rb
357
368
  - lib/generators/shopify_app/products_controller/templates/products_controller.rb
@@ -361,16 +372,21 @@ files:
361
372
  - lib/generators/shopify_app/routes/routes_generator.rb
362
373
  - lib/generators/shopify_app/routes/templates/routes.rb
363
374
  - lib/generators/shopify_app/shop_model/shop_model_generator.rb
375
+ - lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb
364
376
  - lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.erb
365
377
  - lib/generators/shopify_app/shop_model/templates/shop.rb
366
378
  - lib/generators/shopify_app/shop_model/templates/shops.yml
367
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
368
381
  - lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb
369
382
  - lib/generators/shopify_app/user_model/templates/user.rb
370
383
  - lib/generators/shopify_app/user_model/templates/users.yml
371
384
  - lib/generators/shopify_app/user_model/user_model_generator.rb
372
385
  - lib/generators/shopify_app/views/views_generator.rb
373
386
  - lib/shopify_app.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
374
390
  - lib/shopify_app/configuration.rb
375
391
  - lib/shopify_app/controller_concerns/app_proxy_verification.rb
376
392
  - lib/shopify_app/controller_concerns/csrf_protection.rb
@@ -387,6 +403,7 @@ files:
387
403
  - lib/shopify_app/managers/webhooks_manager.rb
388
404
  - lib/shopify_app/middleware/jwt_middleware.rb
389
405
  - lib/shopify_app/middleware/same_site_cookie_middleware.rb
406
+ - lib/shopify_app/omniauth/omniauth_configuration.rb
390
407
  - lib/shopify_app/session/in_memory_session_store.rb
391
408
  - lib/shopify_app/session/in_memory_shop_session_store.rb
392
409
  - lib/shopify_app/session/in_memory_user_session_store.rb
@@ -395,7 +412,9 @@ files:
395
412
  - lib/shopify_app/session/session_repository.rb
396
413
  - lib/shopify_app/session/session_storage.rb
397
414
  - lib/shopify_app/session/shop_session_storage.rb
415
+ - lib/shopify_app/session/shop_session_storage_with_scopes.rb
398
416
  - lib/shopify_app/session/user_session_storage.rb
417
+ - lib/shopify_app/session/user_session_storage_with_scopes.rb
399
418
  - lib/shopify_app/test_helpers/all.rb
400
419
  - lib/shopify_app/test_helpers/webhook_verification_helper.rb
401
420
  - 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
- }