shopify_app 8.4.0 → 8.4.1

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
- SHA1:
3
- metadata.gz: 45878b4b2df0d02183a741d202e4d3012ea371f0
4
- data.tar.gz: 5526b90556c92908c0815d2373c54710a878396b
2
+ SHA256:
3
+ metadata.gz: 8c695f515629401adce7691c5c22417b77a2b56a1e3a267d179ebffe200690c5
4
+ data.tar.gz: c24e3011bea73560b4c5e72add9d68ee379a0bf59929015080e382dc08276bd1
5
5
  SHA512:
6
- metadata.gz: d70b9286c3e9b2cb0e4e06562b2ee0f77fb9e1ad3ebad9d6c70929da8befcc610637ca5e68a1ef240130b2add6da4d5810f0428f122335addc8f6c2b70abc8c6
7
- data.tar.gz: ef0d81bc695c1f90c16972c08fda12904ce9305c209d540729c2b5d795d5607bb99313fe0e1ddc491dc2ac8b35a3ccca3a433d069388b51e2b7582d46c3ab4cf
6
+ metadata.gz: eb5d3161cf7711ad28a1031be1c28fe35a80f8ca39bd5fac7fbcae8d10e3ed8752ca2df9d8b20848a21e585ba696876da604cf0392150aaa9e1261792e7169b5
7
+ data.tar.gz: eab9ff64fd7929b6bc9e1ae96dd92f4c055d756722607226b11707bd8f3045bc61c07868c11070a09bd93da70b996e6828ce66ce9854ea31dee6b628fe252107
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.0
data/.travis.yml CHANGED
@@ -6,9 +6,9 @@ before_script:
6
6
  - "sudo chown root /opt/google/chrome/chrome-sandbox"
7
7
  - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
8
8
  language: ruby
9
- before_install:
9
+ before_install:
10
10
  - gem update --system
11
- cache:
11
+ cache:
12
12
  bundler: true
13
13
  directories:
14
14
  - node_modules
@@ -27,4 +27,3 @@ install:
27
27
  script:
28
28
  - yarn test
29
29
  - bundle exec rake test
30
-
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ 8.4.1
2
+ -----
3
+ * Update README and Releasing.md
4
+ * Allow user agent to not be set
5
+ * Remove legacy EASDK examples
6
+ * Add .ruby-version file
7
+ * Clean up omniauth setup and fix examples
8
+ * Fix infinite redirect loops if users have disabled 3rd party cookies in their browser
9
+
1
10
  8.4.0
2
11
  ----
3
12
  * Fix embedded app session management in Safari 12.1
@@ -18,7 +27,7 @@
18
27
 
19
28
  8.2.6
20
29
  ----
21
- * Sanitize the shop query param to include `.myshopify.com` if no domain was provided
30
+ * Sanitize the shop query param to include `.myshopify.com` if no domain was provided
22
31
 
23
32
  8.2.5
24
33
  ----
data/README.md CHANGED
@@ -15,6 +15,7 @@ Table of Contents
15
15
  * [**Description**](#description)
16
16
  * [**Quickstart**](#quickstart)
17
17
  * [**Becoming a Shopify App Developer**](#becoming-a-shopify-app-developer)
18
+ * [**App Tunneling**](#app-tunneling)
18
19
  * [**Installation**](#installation)
19
20
  * [Rails Compatibility](#rails-compatibility)
20
21
  * [**Generators**](#generators)
@@ -36,7 +37,6 @@ Table of Contents
36
37
  * [**Troubleshooting**](#troubleshooting)
37
38
  * [Generator shopify_app:install hangs](#generator-shopify_appinstall-hangs)
38
39
  * [**Testing an embedded app outside the Shopify admin**](#testing-an-embedded-app-outside-the-shopify-admin)
39
- * [**App Tunneling**](#app-tunneling)
40
40
  * [**Questions or problems?**](#questions-or-problems)
41
41
 
42
42
 
@@ -58,26 +58,22 @@ Check out this screencast on how to create and deploy a new Shopify App to Herok
58
58
 
59
59
  Or if you prefer text instructions the steps in the video are written out [here](https://github.com/Shopify/shopify_app/blob/master/docs/Quickstart.md)
60
60
 
61
- Becoming a Shopify App Developer
62
- --------------------------------
63
- If you don't have a Shopify Partner account yet head over to http://shopify.com/partners to create one, you'll need it before you can start developing apps.
64
-
65
- Once you have a Partner account create a new application to get an Api key and other Api credentials. To create a development application set the Application Callback URL to
61
+ App Tunneling
62
+ -------------
66
63
 
67
- ```
68
- http://localhost:3000/
69
- ```
64
+ Your local app needs to be accessible from the public Internet in order to install it on a shop, use the [App Proxy Controller](#app-proxy-controller-generator) or receive Webhooks. Use a tunneling service like [ngrok](https://ngrok.com/), [Forward](https://forwardhq.com/), [Beeceptor](https://beeceptor.com/), [Mockbin](http://mockbin.org/), [Hookbin](https://hookbin.com/), etc.
70
65
 
71
- and the `redirect_uri` to
66
+ For example with [ngrok](https://ngrok.com/), run this command to set up proxying to Rails' default port:
72
67
 
68
+ ```sh
69
+ ngrok http 3000
73
70
  ```
74
- http://localhost:3000/auth/shopify/callback
75
- ```
76
-
77
- This way you'll be able to run the app on your local machine.
78
71
 
79
- Also note, ShopifyApp creates embedded apps by default, so remember to check `enabled` for the embedded settings.
72
+ Becoming a Shopify App Developer
73
+ --------------------------------
74
+ If you don't have a Shopify Partner account yet head over to http://shopify.com/partners to create one, you'll need it before you can start developing apps.
80
75
 
76
+ Once you have a Partner account create a new application to get an API key and other API credentials. To create a development application set the `App URL` to the URL provided by [your tunnel](#app-tunneling) or `http://localhost:3000/` if you are not embeddeding your app inside the admin or receiving webhooks and the `Whitelisted redirection URL(s)` to contain `<App URL>/auth/shopify/callback`. Ensure you are using `https://` URLs if you are using tunneling.
81
77
 
82
78
  Installation
83
79
  ------------
@@ -125,9 +121,9 @@ $ rails generate shopify_app:install --api_key <your_api_key> --secret <your_app
125
121
  ```
126
122
 
127
123
  Other options include:
128
- * `application_name` - the name of your app, it can be supplied with or without double-quotes if a whitespace is present. (e.g. `--application_name Example App` or `--application_name "Example App"`)
129
- * `scope` - the Oauth access scope required for your app, eg **read_products, write_orders**. *Multiple options* need to be delimited by a comma-space, and can be supplied with or without double-quotes
130
- (e.g. `--scope read_products, write_orders, write_products` or `--scope "read_products, write_orders, write_products"`)
124
+ * `application_name` - the name of your app, it can be supplied with or without double-quotes if a whitespace is present. (e.g. `--application_name Example App` or `--application_name "Example App"`)
125
+ * `scope` - the Oauth access scope required for your app, eg **read_products, write_orders**. *Multiple options* need to be delimited by a comma-space, and can be supplied with or without double-quotes
126
+ (e.g. `--scope read_products, write_orders, write_products` or `--scope "read_products, write_orders, write_products"`)
131
127
  For more information, refer the [docs](http://docs.shopify.com/api/tutorials/oauth).
132
128
  * `embedded` - the default is to generate an [embedded app](http://docs.shopify.com/embedded-app-sdk), if you want a legacy non-embedded app then set this to false, `--embedded false`
133
129
 
@@ -409,19 +405,12 @@ see [TROUBLESHOOTING.md](https://github.com/Shopify/shopify_app/blob/master/docs
409
405
  Testing an embedded app outside the Shopify admin
410
406
  -------------------------------------------------
411
407
 
412
- By default, loading your embedded app will redirect to the Shopify admin, with the app view loaded in an `iframe`. If you need to load your app outside of the Shopify admin (e.g., for performance testing), you can change `forceRedirect: false` to `true` in `ShopifyApp.init` block in the `embedded_app` view. To keep the redirect on in production but off in your `development` and `test` environments, you can use:
408
+ By default, loading your embedded app will redirect to the Shopify admin, with the app view loaded in an `iframe`. If you need to load your app outside of the Shopify admin (e.g., for performance testing), you can change `forceRedirect: true` to `false` in `ShopifyApp.init` block in the `embedded_app` view. To keep the redirect on in production but off in your `development` and `test` environments, you can use:
413
409
 
414
410
  ```javascript
415
411
  forceRedirect: <%= Rails.env.development? || Rails.env.test? ? 'false' : 'true' %>
416
412
  ```
417
413
 
418
- App Tunneling
419
- -------------
420
-
421
- For certain features like Application Proxy or Webhooks to receive requests from Shopify, your app needs to be on a publicly visible URL. This can be a hurdle during development or testing on a local machine. Fortunately, this can be overcome by employing a tunneling service like [Forward](https://forwardhq.com/), [RequestBin](https://requestb.in/), [ngrok](https://ngrok.com/) etc. These tools allow you to create a secure tunnel from the public Internet to your local machine.
422
-
423
- Tunneling is also useful for working the the embedded app sdk to solve mixed content issues since most tunnles provide ssl.
424
-
425
414
  Questions or problems?
426
415
  ----------------------
427
416
 
@@ -33,9 +33,14 @@
33
33
  }
34
34
 
35
35
  StorageAccessHelper.prototype.grantedStorageAccess = function() {
36
- sessionStorage.setItem('shopify.granted_storage_access', true);
37
- document.cookie = 'shopify.granted_storage_access=true';
38
- this.redirectToAppHome();
36
+ try {
37
+ sessionStorage.setItem('shopify.granted_storage_access', true);
38
+ document.cookie = 'shopify.granted_storage_access=true';
39
+ this.redirectToAppHome();
40
+ } catch (error) {
41
+ console.warn('Third party cookies may be blocked.', error);
42
+ this.redirectToAppTLD(ACCESS_DENIED_STATUS);
43
+ }
39
44
  }
40
45
 
41
46
  StorageAccessHelper.prototype.handleRequestStorageAccess = function() {
data/docs/Releasing.md CHANGED
@@ -3,6 +3,7 @@ Releasing ShopifyApp
3
3
  1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
4
  2. Create a pull request with the following changes:
5
5
  * Update the version of ShopifyApp in lib/shopify_app/version.rb
6
+ * Update the version in package.json
6
7
  * Add a CHANGELOG entry for the new release with the date
7
8
  * Change the title of the PR to something like: "Packaging for release X.Y.Z"
8
9
  3. Merge your pull request
@@ -23,23 +23,23 @@ module ShopifyApp
23
23
  def user_agent_is_mobile
24
24
  user_agent = BrowserSniffer.new(request.user_agent).browser_info
25
25
 
26
- user_agent[:name].match(/Shopify\sMobile/)
26
+ user_agent[:name].to_s.match(/Shopify\sMobile/)
27
27
  end
28
28
 
29
29
  def user_agent_is_pos
30
30
  user_agent = BrowserSniffer.new(request.user_agent).browser_info
31
31
 
32
- user_agent[:name].match(/Shopify\sPOS/)
32
+ user_agent[:name].to_s.match(/Shopify\sPOS/)
33
33
  end
34
34
 
35
35
  def user_agent_can_partition_cookies
36
36
  user_agent = BrowserSniffer.new(request.user_agent).browser_info
37
37
 
38
- is_safari = user_agent[:name].match(/Safari/)
38
+ is_safari = user_agent[:name].to_s.match(/Safari/)
39
39
 
40
40
  return false unless is_safari
41
41
 
42
- user_agent[:version].match(/12.0/)
42
+ user_agent[:version].to_s.match(/12\.0/)
43
43
  end
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = '8.4.0'.freeze
2
+ VERSION = '8.4.1'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "1.0.0",
3
+ "version": "8.4.1",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
data/shipit.rubygems.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  # using the default shipit config
2
2
  hide:
3
- - policial
3
+ - code-review/policial
data/shopify_app.gemspec CHANGED
@@ -13,11 +13,11 @@ Gem::Specification.new do |s|
13
13
  s.add_runtime_dependency('browser_sniffer', '~> 1.1.0')
14
14
  s.add_runtime_dependency('rails', '>= 5.0.0')
15
15
  s.add_runtime_dependency('shopify_api', '>= 4.3.5')
16
- s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 1.2.0')
16
+ s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 2.0.0')
17
17
 
18
18
  s.add_development_dependency('rake')
19
19
  s.add_development_dependency('byebug')
20
- s.add_development_dependency('sqlite3')
20
+ s.add_development_dependency('sqlite3', '~> 1.3.6')
21
21
  s.add_development_dependency('minitest')
22
22
  s.add_development_dependency('mocha')
23
23
 
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: 8.4.0
4
+ version: 8.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-16 00:00:00.000000000 Z
11
+ date: 2019-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.0
61
+ version: 2.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2.0
68
+ version: 2.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: sqlite3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.6
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 1.3.6
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -149,6 +149,7 @@ files:
149
149
  - ".gitignore"
150
150
  - ".nvmrc"
151
151
  - ".rubocop.yml"
152
+ - ".ruby-version"
152
153
  - ".travis.yml"
153
154
  - CHANGELOG.md
154
155
  - Gemfile
@@ -264,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
265
  version: '0'
265
266
  requirements: []
266
267
  rubyforge_project:
267
- rubygems_version: 2.6.14
268
+ rubygems_version: 2.7.6
268
269
  signing_key:
269
270
  specification_version: 4
270
271
  summary: This gem is used to get quickly started with the Shopify API