shopify_app 21.7.0 → 21.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '008956269ae292bfcb408c5701406a310047edbf97fb9296842187dd007d3b9c'
4
- data.tar.gz: dc745806e7b7704ee849fe492860aebc9e4d3ff6a45dde83cad944c96cd7721a
3
+ metadata.gz: 49db79a7ee1809140f869b5a2b0ab52fe6b9e64d53c8d4cd21084763b59392cc
4
+ data.tar.gz: 5cef8ded01f6a2cebbd887fdc2811ac5612df5ae7b6fb684fa8aadfd3b56ad37
5
5
  SHA512:
6
- metadata.gz: b5c923af9c94e9c95278febd2b528bd1f51b6e4ff59693f9f32937c37bec078eee4ff06c801f52a2f7424df46b13c0616989e413a4c849b85e74b9394b02cae9
7
- data.tar.gz: 93511dc7c71caeec004438d7131d9289eae5dd285365e9fd10fbb771e5567818e561c747607cefe12ff76e32c4f913f59704008db90e13bbab4c216486b7d734
6
+ metadata.gz: 705b96b32ef22ee3c0f24391e2dc18c194e0c914fb1b03df449d79129da5dddfbdf095949c0ae5d1b219f5533a53384d24ded2464a8e00190099cf6c77c4f182
7
+ data.tar.gz: ffb76479139e64d4685c87f2af945e90bb7ad45e56b3d42bb6738052da2bedc80c637df977a7671e2ed1c2e28ba2041489444c9046fe5a13631b4708ae0ab9fa
data/.github/CODEOWNERS CHANGED
@@ -1,2 +1,3 @@
1
1
  * @shopify/platform-dev-tools-education
2
2
  * @shopify/app-foundations
3
+ * @Shopify/client-libraries-app-templates
@@ -30,7 +30,7 @@ jobs:
30
30
  - name: Set up Node
31
31
  uses: actions/setup-node@v3
32
32
  with:
33
- node-version: '12'
33
+ node-version: '18'
34
34
  - name: Install Yarn Dependencies
35
35
  run: yarn
36
36
  - name: Run Yarn Tests
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Unreleased
2
2
  ----------
3
3
 
4
+ 21.8.0 (Dec 1, 2023)
5
+ ----------
6
+ * Bump `shopify_api` to include bugfix with mandatory webhooks + fixes for CI failures that prevented earlier release
7
+ * Fixes bug with `WebhooksManager#recreate_webhooks!` where we failed to register topics in the registry[#1743](https://github.com/Shopify/shopify_app/pull/1704)
8
+ * Allow embedded apps to provide a full URL to get redirected to, rather than defaulting to Shopify Admin [#1746](https://github.com/Shopify/shopify_app/pull/1746)
9
+
4
10
  21.7.0 (Oct 12, 2023)
5
11
  ----------
6
12
  * Fixes typo in webhook generator [#1704](https://github.com/Shopify/shopify_app/pull/1704)
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_app (21.7.0)
4
+ shopify_app (21.8.0)
5
5
  activeresource
6
6
  addressable (~> 2.7)
7
7
  browser_sniffer (~> 2.0)
8
8
  jwt (>= 2.2.3)
9
9
  rails (> 5.2.1)
10
10
  redirect_safely (~> 1.0)
11
- shopify_api (~> 13.2)
11
+ shopify_api (~> 13.3)
12
12
  sprockets-rails (>= 2.0.0)
13
13
 
14
14
  GEM
@@ -217,7 +217,7 @@ GEM
217
217
  ruby-progressbar (1.13.0)
218
218
  ruby2_keywords (0.0.5)
219
219
  securerandom (0.2.2)
220
- shopify_api (13.2.0)
220
+ shopify_api (13.3.0)
221
221
  activesupport
222
222
  concurrent-ruby
223
223
  hash_diff
@@ -70,14 +70,25 @@ module ShopifyApp
70
70
 
71
71
  def redirect_to_app
72
72
  if ShopifyAPI::Context.embedded?
73
- return_to = "#{decoded_host}#{session.delete(:return_to)}"
74
- return_to = ShopifyApp.configuration.root_url if deduced_phishing_attack?
75
- redirect_to(return_to, allow_other_host: true)
73
+ return_to = session.delete(:return_to)
74
+ redirect_to = if fully_formed_url?(return_to)
75
+ return_to
76
+ else
77
+ "#{decoded_host}#{return_to}"
78
+ end
79
+
80
+ redirect_to = ShopifyApp.configuration.root_url if deduced_phishing_attack?
81
+ redirect_to(redirect_to, allow_other_host: true)
76
82
  else
77
83
  redirect_to(return_address)
78
84
  end
79
85
  end
80
86
 
87
+ def fully_formed_url?(return_to)
88
+ uri = Addressable::URI.parse(return_to)
89
+ uri.present? && uri.scheme.present? && uri.host.present?
90
+ end
91
+
81
92
  def decoded_host
82
93
  @decoded_host ||= ShopifyAPI::Auth.embedded_app_url(params[:host])
83
94
  end
@@ -3,7 +3,7 @@
3
3
  #### Table of contents
4
4
 
5
5
  [Manage webhooks using `ShopifyApp::WebhooksManager`](#manage-webhooks-using-shopifyappwebhooksmanager)
6
- [Mandatory GDPR Webhooks](#mandatory-gdpr-webhooks)
6
+ [Mandatory Privacy Webhooks](#mandatory-privacy-webhooks)
7
7
 
8
8
  ## Manage webhooks using `ShopifyApp::WebhooksManager`
9
9
 
@@ -72,9 +72,9 @@ rails g shopify_app:add_webhook --topic carts/update --path webhooks/carts_updat
72
72
 
73
73
  Where `--topic` is the topic and `--path` is the path the webhook should be sent to.
74
74
 
75
- ## Mandatory GDPR Webhooks
75
+ ## Mandatory Privacy Webhooks
76
76
 
77
- We have three mandatory GDPR webhooks
77
+ We have three mandatory privacy webhooks
78
78
 
79
79
  1. `customers/data_request`
80
80
  2. `customer/redact`
data/karma.conf.js CHANGED
@@ -26,7 +26,12 @@ module.exports = function(config) {
26
26
  preprocessors: {
27
27
  'test/javascripts/**/*test.js': ['webpack'],
28
28
  },
29
- webpack: {},
29
+ webpack: {
30
+ mode: 'none',
31
+ output: {
32
+ hashFunction: 'rsa-sha512',
33
+ },
34
+ },
30
35
  reporters: karmaReporters,
31
36
  port: 9876,
32
37
  colors: true,
@@ -4,7 +4,7 @@ require "rails/generators/base"
4
4
 
5
5
  module ShopifyApp
6
6
  module Generators
7
- class AddGdprJobsGenerator < Rails::Generators::Base
7
+ class AddPrivacyJobsGenerator < Rails::Generators::Base
8
8
  source_root File.expand_path("../templates", __FILE__)
9
9
 
10
10
  def add_customer_data_request_job
@@ -10,7 +10,7 @@ module ShopifyApp
10
10
 
11
11
  def run_all_generators
12
12
  generate("shopify_app:add_app_uninstalled_job")
13
- generate("shopify_app:add_gdpr_jobs")
13
+ generate("shopify_app:add_privacy_jobs")
14
14
  generate("shopify_app:install #{@opts.join(" ")}")
15
15
  generate("shopify_app:shop_model #{@opts.join(" ")}")
16
16
  generate("shopify_app:authenticated_controller")
@@ -26,6 +26,7 @@ module ShopifyApp
26
26
 
27
27
  ShopifyApp::Logger.debug("Recreating webhooks")
28
28
  add_registrations
29
+ create_webhooks(session: session)
29
30
  end
30
31
 
31
32
  def destroy_webhooks(session:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShopifyApp
4
- VERSION = "21.7.0"
4
+ VERSION = "21.8.0"
5
5
  end
data/package.json CHANGED
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "21.7.0",
3
+ "version": "21.8.0",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
7
- "dependencies": {},
8
7
  "devDependencies": {
9
8
  "babel-loader": "^8.0.6",
10
9
  "babel-preset-shopify": "^21.0.0",
11
10
  "chai": "^4.1.2",
12
- "karma": "^5.2.1",
11
+ "karma": "^6.4.2",
13
12
  "karma-chai-sinon": "^0.1.5",
14
13
  "karma-chrome-launcher": "^3.1.0",
15
14
  "karma-cli": "^2.0.0",
16
15
  "karma-mocha": "^2.0.1",
17
16
  "karma-mocha-clean-reporter": "^0.0.1",
18
- "karma-webpack": "^4.0.2",
19
- "mocha": "^8.1.3",
17
+ "karma-webpack": "^5.0.0",
18
+ "mocha": "^10.2.0",
20
19
  "sinon": "^9.0.3",
21
20
  "sinon-chai": "^3.2.0",
22
- "webpack": "^4.44.1"
21
+ "webpack": "^5.89.0"
23
22
  },
24
23
  "scripts": {
25
24
  "test": "./node_modules/.bin/karma start --browsers ChromeHeadless --single-run"
data/shopify_app.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_runtime_dependency("jwt", ">= 2.2.3")
21
21
  s.add_runtime_dependency("rails", "> 5.2.1")
22
22
  s.add_runtime_dependency("redirect_safely", "~> 1.0")
23
- s.add_runtime_dependency("shopify_api", "~> 13.2")
23
+ s.add_runtime_dependency("shopify_api", "~> 13.3")
24
24
  s.add_runtime_dependency("sprockets-rails", ">= 2.0.0")
25
25
 
26
26
  s.add_development_dependency("byebug")