shopify-sinatra-app 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46049e2afcd7dce3a1d3f115ba665a731d4fcb1b5344dcc9ff84649cfd30beda
4
- data.tar.gz: 2ba425471b1cbb5e40f91178d646d8c0dd4da456321518a0772afb7ec4359058
3
+ metadata.gz: 3d4212df144a7d460c275e8f7cbfea4c5a0332d5293bb4ea3c1138764748bc37
4
+ data.tar.gz: 2f637570f3210796ec09f812e1c4c58b9110db590eeb7366eb2fc58286f20c84
5
5
  SHA512:
6
- metadata.gz: c7223a2223ba1a71865bdbf05ef3d20585723da858cc99b2ac3872c13c29a3cb6db4e03502a8412f329393e6458e4d2c8038355abcd81247992bd44cf4ff8826
7
- data.tar.gz: 81f547ba807a56f66802482746ff9a7d6d4ccacf7c9c5d3650491e3cabde7280fed22ce576b42a901f0ce5a57f36cef355108ac12f82223aeca33b9dc8ca1ac3
6
+ metadata.gz: 4cfbca73509abcf9b7b77b9e73e2ee0694f2dc280797b8f9188a2adef9acc5c266dcce5503fa3df69e1269ad8db48e1daee27e63305dd65ce0e4f73a7fd41bc6
7
+ data.tar.gz: 5d85a7eafcfced73d5d08d9a8212d764c8ae3ca06b0e05849b6074bef007c5ec3dd3b42974e0c25d0a76c3062a2bb7dbc833fce41360c5114086297420371191
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ 1.1.0
2
+ -----
3
+ * update to Shopify App Bridge 3
4
+
5
+ 1.0.1
6
+ -----
7
+ * drop sinatra version requirement from gemspec
8
+
1
9
  1.0.0
2
10
  -----
3
11
  * Update to omniauth 2.0.4 and add rack protection authenticity token
@@ -1,14 +1,16 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <script src="https://unpkg.com/@shopify/app-bridge"></script>
4
+ <script src="https://unpkg.com/@shopify/app-bridge@3"></script>
5
5
  <script type="text/javascript">
6
6
  var AppBridge = window['app-bridge'];
7
- var createApp = AppBridge.default;
8
7
 
9
- var app = createApp({
10
- apiKey: "<%= SinatraApp.settings.api_key %>",
11
- shopOrigin: "<%= shop_origin %>",
8
+ var host = '<%= shop_host %>';
9
+ var apiKey = '<%= SinatraApp.settings.api_key %>';
10
+
11
+ var app = AppBridge.createApp({
12
+ apiKey: apiKey,
13
+ host: host
12
14
  });
13
15
  </script>
14
16
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
@@ -16,8 +16,8 @@ module Sinatra
16
16
  end
17
17
 
18
18
  # for the app bridge initializer
19
- def shop_origin
20
- "#{session[:shopify][:shop]}"
19
+ def shop_host
20
+ "#{session[:shopify][:host]}"
21
21
  end
22
22
 
23
23
  def shopify_session(&blk)
@@ -135,7 +135,7 @@ module Sinatra
135
135
  app.set :public_folder, File.expand_path('public')
136
136
  app.enable :inline_templates
137
137
 
138
- app.set :protection, except: :frame_options
138
+ app.set :protection, except: :frame_options, frame_ancestors: "https://admin.shopify.com;"
139
139
 
140
140
  app.set :api_version, '2019-07'
141
141
  app.set :scope, 'read_products, read_orders'
@@ -197,6 +197,7 @@ module Sinatra
197
197
  app.get '/auth/shopify/callback' do
198
198
  shop_name = params['shop']
199
199
  token = request.env['omniauth.auth']['credentials']['token']
200
+ host = params['host']
200
201
 
201
202
  shop = Shop.find_or_initialize_by(name: shop_name)
202
203
  shop.token = token
@@ -204,6 +205,7 @@ module Sinatra
204
205
 
205
206
  session[:shopify] = {
206
207
  shop: shop_name,
208
+ host: host,
207
209
  token: token
208
210
  }
209
211
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopify-sinatra-app'
3
- s.version = '1.0.0'
3
+ s.version = '1.1.0'
4
4
 
5
5
  s.summary = 'A classy shopify app'
6
6
  s.description = 'A Sinatra extension for building Shopify Apps. Akin to the shopify_app gem but for Sinatra'
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.executables << 'shopify-sinatra-app-generator'
15
15
 
16
- s.add_runtime_dependency 'sinatra', '>= 2.0.2', '< 2.2.0'
16
+ s.add_runtime_dependency 'sinatra', '~> 2.2.0'
17
17
  s.add_runtime_dependency 'sinatra-activerecord', '~> 2.0.9'
18
18
  s.add_runtime_dependency 'activesupport'
19
19
  s.add_runtime_dependency 'attr_encrypted', '~> 3.1.0'
20
20
 
21
- s.add_runtime_dependency 'shopify_api', '>= 7.0.1', '< 9.4.0'
21
+ s.add_runtime_dependency 'shopify_api', '>= 7.0.1', '< 9.6'
22
22
  s.add_runtime_dependency 'omniauth-shopify-oauth2', '>= 2.3.2'
23
23
  s.add_runtime_dependency 'omniauth', '>= 2.0.4'
24
24
 
metadata CHANGED
@@ -1,33 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-sinatra-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Hughes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-20 00:00:00.000000000 Z
11
+ date: 2022-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 2.0.2
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
19
  version: 2.2.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 2.0.2
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
26
  version: 2.2.0
33
27
  - !ruby/object:Gem::Dependency
@@ -81,7 +75,7 @@ dependencies:
81
75
  version: 7.0.1
82
76
  - - "<"
83
77
  - !ruby/object:Gem::Version
84
- version: 9.4.0
78
+ version: '9.6'
85
79
  type: :runtime
86
80
  prerelease: false
87
81
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +85,7 @@ dependencies:
91
85
  version: 7.0.1
92
86
  - - "<"
93
87
  - !ruby/object:Gem::Version
94
- version: 9.4.0
88
+ version: '9.6'
95
89
  - !ruby/object:Gem::Dependency
96
90
  name: omniauth-shopify-oauth2
97
91
  requirement: !ruby/object:Gem::Requirement