shopify_app 14.4.4 → 18.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) 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 +41 -0
  8. data/.github/workflows/release.yml +24 -0
  9. data/.github/workflows/rubocop.yml +1 -7
  10. data/.gitignore +0 -2
  11. data/CHANGELOG.md +75 -0
  12. data/CONTRIBUTING.md +76 -0
  13. data/Gemfile.lock +268 -0
  14. data/README.md +73 -572
  15. data/app/assets/images/storage_access.svg +1 -2
  16. data/app/assets/javascripts/shopify_app/post_redirect.js +9 -0
  17. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +26 -0
  18. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
  19. data/app/controllers/shopify_app/callback_controller.rb +34 -10
  20. data/app/controllers/shopify_app/sessions_controller.rb +19 -20
  21. data/app/views/shopify_app/partials/_button_styles.html.erb +41 -36
  22. data/app/views/shopify_app/partials/_card_styles.html.erb +3 -3
  23. data/app/views/shopify_app/partials/_empty_state_styles.html.erb +28 -59
  24. data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
  25. data/app/views/shopify_app/partials/_layout_styles.html.erb +16 -1
  26. data/app/views/shopify_app/partials/_typography_styles.html.erb +6 -6
  27. data/app/views/shopify_app/sessions/enable_cookies.html.erb +1 -1
  28. data/app/views/shopify_app/sessions/new.html.erb +38 -110
  29. data/app/views/shopify_app/sessions/request_storage_access.html.erb +1 -1
  30. data/app/views/shopify_app/sessions/top_level_interaction.html.erb +20 -15
  31. data/app/views/shopify_app/shared/post_redirect_to_auth_shopify.html.erb +13 -0
  32. data/config/locales/de.yml +11 -11
  33. data/config/locales/nl.yml +1 -1
  34. data/config/locales/vi.yml +22 -0
  35. data/config/locales/zh-CN.yml +1 -1
  36. data/docs/Quickstart.md +15 -77
  37. data/docs/Releasing.md +9 -6
  38. data/docs/Troubleshooting.md +147 -4
  39. data/docs/Upgrading.md +126 -0
  40. data/docs/shopify_app/authentication.md +124 -0
  41. data/docs/shopify_app/engine.md +82 -0
  42. data/docs/shopify_app/generators.md +127 -0
  43. data/docs/shopify_app/handling-access-scopes-changes.md +14 -0
  44. data/docs/shopify_app/script-tags.md +28 -0
  45. data/docs/shopify_app/session-repository.md +88 -0
  46. data/docs/shopify_app/testing.md +38 -0
  47. data/docs/shopify_app/webhooks.md +72 -0
  48. data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +16 -7
  49. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +10 -0
  50. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +11 -11
  51. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +2 -0
  52. data/lib/generators/shopify_app/install/install_generator.rb +36 -2
  53. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +2 -1
  54. data/lib/generators/shopify_app/install/templates/omniauth.rb +1 -0
  55. data/lib/generators/shopify_app/install/templates/shopify_app.js +1 -1
  56. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +13 -4
  57. data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
  58. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +27 -0
  59. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  60. data/lib/generators/shopify_app/shop_model/templates/shop.rb +1 -1
  61. data/lib/generators/shopify_app/shopify_app_generator.rb +1 -1
  62. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  63. data/lib/generators/shopify_app/user_model/templates/user.rb +1 -1
  64. data/lib/generators/shopify_app/user_model/user_model_generator.rb +27 -0
  65. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  66. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  67. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  68. data/lib/shopify_app/configuration.rb +25 -0
  69. data/lib/shopify_app/controller_concerns/itp.rb +0 -2
  70. data/lib/shopify_app/controller_concerns/login_protection.rb +14 -17
  71. data/lib/shopify_app/engine.rb +1 -0
  72. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +1 -1
  73. data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
  74. data/lib/shopify_app/session/in_memory_shop_session_store.rb +9 -7
  75. data/lib/shopify_app/session/in_memory_user_session_store.rb +9 -7
  76. data/lib/shopify_app/session/jwt.rb +3 -1
  77. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
  78. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
  79. data/lib/shopify_app/utils.rb +12 -0
  80. data/lib/shopify_app/version.rb +1 -1
  81. data/lib/shopify_app.rb +11 -0
  82. data/package.json +1 -1
  83. data/service.yml +1 -4
  84. data/shopify_app.gemspec +5 -4
  85. data/translation.yml +1 -1
  86. data/yarn.lock +92 -123
  87. metadata +62 -16
  88. data/.github/ISSUE_TEMPLATE.md +0 -19
  89. data/.travis.yml +0 -27
  90. data/docs/install-on-dev-shop.png +0 -0
  91. data/docs/test-your-app.png +0 -0
  92. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -20
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- sudo: required
2
- dist: trusty
3
- addons:
4
- chrome: stable
5
- before_script:
6
- - "sudo chown root /opt/google/chrome/chrome-sandbox"
7
- - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
8
- language: ruby
9
- cache:
10
- bundler: true
11
- directories:
12
- - node_modules
13
- yarn: true
14
-
15
- rvm:
16
- - 2.5
17
- - 2.6
18
- - 2.7
19
-
20
- install:
21
- - bundle install
22
- - nvm install node
23
- - yarn
24
-
25
- script:
26
- - yarn test
27
- - bundle exec rake test
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
- }