shopify_app 11.0.0 → 11.0.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
2
  SHA256:
3
- metadata.gz: 99e91b542c6d5f2fb530c9d259e6d32d463bb6e8d0720dd11faa009e845d2ced
4
- data.tar.gz: '0214085b33d8ccbb7dfe929430f81b75296ac5cf201c6b9969ba0b5d78ea7351'
3
+ metadata.gz: b874717cc161bca6ab8798663bffe95921d8996c0bb47bbee3088b39e475ced9
4
+ data.tar.gz: 951abd9f6de28d85017ea86ecf476c3a593a39a2c97d78b1de0c2730a66d2947
5
5
  SHA512:
6
- metadata.gz: f8fb32cc915ecfeba1ee7db40f1cd3ec4e0c9b8c8bae697370248a8f6225f70504da6a3a160cdfb960426899c2d0abcbbe8f623a0771cef81c7ddb1e58ac779d
7
- data.tar.gz: 73c4b7f0f49130ea808fd7b4c24cef408025a5fcaf89a8b29ee2c0baa0e00d0837b11ec6ecd7f35d4c57269a39e357a9d3cb7d5b55b66a76ff25b0444f503405
6
+ metadata.gz: 6294f63182cc288b07bf9fd4ec70ccc69503debd780693288982eea396f7b748ddb2da868971b616c470ae7fc1308598dbf64d4ece89e57953d80007e124b963
7
+ data.tar.gz: e45293b324384dad4db23338dbb9846a5f81db31d7dcd03fa4b14d985e64b281e3571d67ab7f7a70ff6ef62710b9cc39a808c016c9e56acd98810ea8dcccbb24
@@ -1,3 +1,8 @@
1
+ 11.0.1
2
+ -----
3
+
4
+ * Add dotenv-rails gem to install generator, so apps fetch credentials from `.env` by default: [#776](https://github.com/Shopify/shopify_app/pull/776)
5
+
1
6
  11.0.0
2
7
  -----
3
8
 
data/README.md CHANGED
@@ -26,7 +26,6 @@ Table of Contents
26
26
  * [App Proxy Controller Generator](#app-proxy-controller-generator)
27
27
  * [Controllers, Routes and Views](#controllers-routes-and-views)
28
28
  * [**Mounting the Engine**](#mounting-the-engine)
29
- * [**Managing Api Keys**](#managing-api-keys)
30
29
  * [**WebhooksManager**](#webhooksmanager)
31
30
  * [**ScripttagsManager**](#scripttagsmanager)
32
31
  * [**AfterAuthenticate Job**](#afterauthenticate-job)
@@ -104,11 +103,22 @@ Generators
104
103
  The default generator will run the `install`, `shop`, and `home_controller` generators. This is the recommended way to start your app.
105
104
 
106
105
  ```sh
107
- $ rails generate shopify_app --api_key <your_api_key> --secret <your_app_secret>
106
+ $ rails generate shopify_app
108
107
  ```
109
108
 
110
109
  After running the generator, you will need to run `rake db:migrate` to add tables to your database. You can start your app with `bundle exec rails server` and install your app by visiting localhost.
111
110
 
111
+ ### API Keys
112
+
113
+ The default and install generators have been updated to source Shopify API key and secret from a `.env` file, which you will need to create with the following format:
114
+
115
+ ```
116
+ SHOPIFY_API_KEY=your api key
117
+ SHOPIFY_API_SECRET=your api secret
118
+ ```
119
+
120
+ These values can be found on the "App Setup" page in the [Shopify Partners Dashboard][dashboard].
121
+
112
122
  ### Install Generator
113
123
 
114
124
  ```sh
@@ -116,7 +126,7 @@ $ rails generate shopify_app:install
116
126
 
117
127
  # or optionally with arguments:
118
128
 
119
- $ rails generate shopify_app:install --api_key <your_api_key> --secret <your_app_secret>
129
+ $ rails generate shopify_app:install
120
130
  ```
121
131
 
122
132
  Other options include:
@@ -244,21 +254,6 @@ The current Shopify user will be stored in the rails session at `session[:shopif
244
254
 
245
255
  This will change the type of token that Shopify returns and it will only be valid for a short time. Read more about `Online access` [here](https://help.shopify.com/api/getting-started/authentication/oauth). Note that this means you won't be able to use this token to respond to Webhooks.
246
256
 
247
- Managing Api Keys
248
- -----------------
249
-
250
- The `install` generator places your Api credentials directly into the shopify_app initializer which is convenient and fine for development but once your app goes into production **your api credentials should not be in source control**. When we develop apps we keep our keys in environment variables so a production shopify_app initializer would look like this:
251
-
252
- ```ruby
253
- ShopifyApp.configure do |config|
254
- config.application_name = 'Your app name' # Optional
255
- config.api_key = ENV['SHOPIFY_CLIENT_API_KEY']
256
- config.secret = ENV['SHOPIFY_CLIENT_API_SECRET']
257
- config.scope = 'read_customers, write_products'
258
- config.embedded_app = true
259
- end
260
- ```
261
-
262
257
 
263
258
  WebhooksManager
264
259
  ---------------
@@ -439,7 +434,7 @@ class ReviewsController < ApplicationController
439
434
  end
440
435
  ```
441
436
 
442
- Create your app proxy url in the [Shopify Partners' Dashboard](https://app.shopify.com/services/partners/api_clients), making sure to point it to `https://your_app_website.com/app_proxy`.
437
+ Create your app proxy url in the [Shopify Partners' Dashboard][dashboard], making sure to point it to `https://your_app_website.com/app_proxy`.
443
438
  ![Creating an App Proxy](/images/app-proxy-screenshot.png)
444
439
 
445
440
  Troubleshooting
@@ -515,3 +510,5 @@ is changed to
515
510
  ### ShopifyAPI changes
516
511
 
517
512
  You will need to also follow the ShopifyAPI [upgrade guide](https://github.com/Shopify/shopify_api/blob/master/README.md#-breaking-change-notice-for-version-700-) to ensure your app is ready to work with api versioning.
513
+
514
+ [dashboard]:https://partners.shopify.com
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  nl:
3
- logged_out: u bent afgemeld
3
+ logged_out: je bent afgemeld
4
4
  could_not_log_in: Kon niet aanmelden bij Shopify-winkel
5
5
  invalid_shop_url: Ongeldig winkeldomein
6
6
  enable_cookies_heading: Schakel cookies in van %{app}
@@ -7,18 +7,16 @@ module ShopifyApp
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
9
9
  class_option :application_name, type: :array, default: ['My', 'Shopify', 'App']
10
- class_option :api_key, type: :string, default: '<api_key>'
11
- class_option :secret, type: :string, default: '<secret>'
12
- class_option :old_secret, type: :string, default: '<old_secret>'
13
10
  class_option :scope, type: :array, default: ['read_products']
14
11
  class_option :embedded, type: :string, default: 'true'
15
12
  class_option :api_version, type: :string, default: ShopifyAPI::ApiVersion.latest_stable_version.to_s
16
13
 
14
+ def add_dotenv_gem
15
+ gem('dotenv-rails', group: [:test, :development])
16
+ end
17
+
17
18
  def create_shopify_app_initializer
18
19
  @application_name = format_array_argument(options['application_name'])
19
- @api_key = options['api_key']
20
- @secret = options['secret']
21
- @old_secret = options['old_secret']
22
20
  @scope = format_array_argument(options['scope'])
23
21
  @api_version = options['api_version']
24
22
 
@@ -1,7 +1,7 @@
1
1
  ShopifyApp.configure do |config|
2
2
  config.application_name = "<%= @application_name %>"
3
- config.api_key = "<%= @api_key %>"
4
- config.secret = "<%= @secret %>"
3
+ config.api_key = ENV['SHOPIFY_API_KEY']
4
+ config.secret = ENV['SHOPIFY_API_SECRET']
5
5
  config.old_secret = "<%= @old_secret %>"
6
6
  config.scope = "<%= @scope %>" # Consult this page for more scope options:
7
7
  # https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = '11.0.0'.freeze
2
+ VERSION = '11.0.1'.freeze
3
3
  end
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: 11.0.0
4
+ version: 11.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-03 00:00:00.000000000 Z
11
+ date: 2019-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer