omniauth-shopify-oauth2 1.1.8 → 1.1.10

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
  SHA1:
3
- metadata.gz: 306d7810c126a0e99bf80f437726d22576178cab
4
- data.tar.gz: 5ba33d8271dfcf92f542e04e7a8ddafcfc0e49e1
3
+ metadata.gz: 022af1f9a3fda484fc995538a135bc0ea0041b51
4
+ data.tar.gz: c91fe606094ca421be88500f272c97564eca95d0
5
5
  SHA512:
6
- metadata.gz: 89a3cb9ea64f06a33e623fbd9368dd77ebaf2d5284cceef17cfeb68c54e8bf464ae72170e053c562d52a353a17b95574806d8361478896129d431e7a617befe9
7
- data.tar.gz: 54919d9f8729c51df48175dff1d2881b58c775fc97402fef5ad7d69c94e29851f2a3c99f91b0701a563e3741517f79c8f36f81d35d51f6122505bcfe214d0d23
6
+ metadata.gz: 0e109b8742b1fde0cfb031426d755b65d3030f4d664de50d3bce0ddb8d995f667b57111ef72681f0c6c2d1b10fe29973d60b76aba6926f37a35a597310c94409
7
+ data.tar.gz: d9945d8ccbad48b9fae262871c66a2d25d3541c55d02983465dbf8163552f8bcd38445e3609f27cc34b69f31cdbe77a8c2c77223cad566a2890af1d3278bb4ca
data/README.md CHANGED
@@ -32,16 +32,11 @@ You can configure the scope, which you pass in to the `provider` method via a `H
32
32
 
33
33
  * `scope`: A comma-separated list of permissions you want to request from the user. See [the Shopify API docs](http://docs.shopify.com/api/tutorials/oauth) for a full list of available permissions.
34
34
 
35
- * `setup`: A lambda which dynamically sets the `site`. You must initiate the OmniAuth process by passing in a `shop` query parameter of the shop you're requesting permissions for. Ex. http://myapp.com/auth/shopify?shop=example.myshopify.com
36
-
37
35
  For example, to request `read_products`, `read_orders` and `write_content` permissions and display the authentication page:
38
36
 
39
37
  ```ruby
40
38
  Rails.application.config.middleware.use OmniAuth::Builder do
41
- provider :shopify, ENV['SHOPIFY_API_KEY'], ENV['SHOPIFY_SHARED_SECRET'],
42
- :scope => 'read_products,read_orders,write_content',
43
- :setup => lambda { |env| params = Rack::Utils.parse_query(env['QUERY_STRING'])
44
- env['omniauth.strategy'].options[:client_options][:site] = "https://#{params['shop']}" }
39
+ provider :shopify, ENV['SHOPIFY_API_KEY'], ENV['SHOPIFY_SHARED_SECRET'], :scope => 'read_products,read_orders,write_content'
45
40
  end
46
41
  ```
47
42
 
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
2
+ require 'rake/testtask'
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ task :default => :test
5
5
 
6
- task :default => :spec
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.pattern = 'test/**/*_test.rb'
8
+ t.verbose = true
9
+ end
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org/'
2
2
 
3
- gem 'rack'
3
+ gem 'rack', '~> 1.6'
4
4
 
5
- gem 'sinatra'
5
+ gem 'sinatra', '~> 1.4'
6
6
  gem 'omniauth-shopify-oauth2', :path => '../'
@@ -3,8 +3,31 @@ require 'sinatra/base'
3
3
  require 'omniauth-shopify-oauth2'
4
4
 
5
5
  SCOPE = 'read_products,read_orders,read_customers,write_shipping'
6
+ SHOPIFY_API_KEY = ENV['SHOPIFY_API_KEY']
7
+ SHOPIFY_SHARED_SECRET = ENV['SHOPIFY_SHARED_SECRET']
8
+
9
+ unless SHOPIFY_API_KEY && SHOPIFY_SHARED_SECRET
10
+ abort("SHOPIFY_API_KEY and SHOPIFY_SHARED_SECRET environment variables must be set")
11
+ end
6
12
 
7
13
  class App < Sinatra::Base
14
+ get '/' do
15
+ <<-HTML
16
+ <html>
17
+ <head>
18
+ <title>Shopify Oauth2</title>
19
+ </head>
20
+ <body>
21
+ <form action="/auth/shopify" method="get">
22
+ <label for="shop">Enter your store's URL:</label>
23
+ <input type="text" name="shop" placeholder="your-shop-url.myshopify.com">
24
+ <button type="submit">Log In</button>
25
+ </form>
26
+ </body>
27
+ </html>
28
+ HTML
29
+ end
30
+
8
31
  get '/auth/:provider/callback' do
9
32
  <<-HTML
10
33
  <html>
@@ -38,10 +61,7 @@ end
38
61
  use Rack::Session::Cookie, secret: SecureRandom.hex(64)
39
62
 
40
63
  use OmniAuth::Builder do
41
- provider :shopify, ENV['SHOPIFY_API_KEY'], ENV['SHOPIFY_SHARED_SECRET'],
42
- :scope => SCOPE,
43
- :setup => lambda { |env| params = Rack::Utils.parse_query(env['QUERY_STRING'])
44
- env['omniauth.strategy'].options[:client_options][:site] = "https://#{params['shop']}" }
64
+ provider :shopify, SHOPIFY_API_KEY, SHOPIFY_SHARED_SECRET, :scope => SCOPE
45
65
  end
46
66
 
47
67
  run App.new
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Shopify
3
- VERSION = "1.1.8"
3
+ VERSION = "1.1.10"
4
4
  end
5
5
  end
@@ -6,6 +6,8 @@ module OmniAuth
6
6
  # Available scopes: content themes products customers orders script_tags shipping
7
7
  # read_* or write_*
8
8
  DEFAULT_SCOPE = 'read_products'
9
+ MINUTE = 60
10
+ CODE_EXPIRES_AFTER = 10 * MINUTE
9
11
 
10
12
  option :client_options, {
11
13
  :authorize_url => '/admin/oauth/authorize',
@@ -13,16 +15,44 @@ module OmniAuth
13
15
  }
14
16
 
15
17
  option :callback_url
16
-
17
- option :provider_ignores_state, true
18
18
  option :myshopify_domain, 'myshopify.com'
19
19
 
20
+ option :setup, proc { |env|
21
+ request = Rack::Request.new(env)
22
+ env['omniauth.strategy'].options[:client_options][:site] = "https://#{request.GET['shop']}"
23
+ }
24
+
20
25
  uid { URI.parse(options[:client_options][:site]).host }
21
26
 
22
27
  def valid_site?
23
28
  !!(/\A(https|http)\:\/\/[a-zA-Z0-9][a-zA-Z0-9\-]*\.#{Regexp.quote(options[:myshopify_domain])}[\/]?\z/ =~ options[:client_options][:site])
24
29
  end
25
30
 
31
+ def valid_signature?
32
+ return false unless request.POST.empty?
33
+
34
+ params = request.GET
35
+ signature = params['hmac']
36
+ timestamp = params['timestamp']
37
+ return false unless signature && timestamp
38
+
39
+ return false unless timestamp.to_i > Time.now.to_i - CODE_EXPIRES_AFTER
40
+
41
+ calculated_signature = self.class.hmac_sign(self.class.encoded_params_for_signature(params), options.client_secret)
42
+ Rack::Utils.secure_compare(calculated_signature, signature)
43
+ end
44
+
45
+ def self.encoded_params_for_signature(params)
46
+ params = params.dup
47
+ params.delete('hmac')
48
+ params.delete('signature') # deprecated signature
49
+ params.map{|k,v| "#{URI.escape(k.to_s, '&=%')}=#{URI.escape(v.to_s, '&%')}"}.sort.join('&')
50
+ end
51
+
52
+ def self.hmac_sign(encoded_params, secret)
53
+ OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, secret, encoded_params)
54
+ end
55
+
26
56
  def fix_https
27
57
  options[:client_options][:site].gsub!(/\Ahttp\:/, 'https:')
28
58
  end
@@ -41,11 +71,9 @@ module OmniAuth
41
71
  end
42
72
 
43
73
  def callback_phase
44
- if valid_site?
45
- super
46
- else
47
- fail!(:invalid_site)
48
- end
74
+ return fail!(:invalid_site) unless valid_site?
75
+ return fail!(:invalid_signature) unless valid_signature?
76
+ super
49
77
  end
50
78
 
51
79
  def authorize_params
@@ -16,8 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
17
17
  s.require_paths = ['lib']
18
18
 
19
- s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.1'
19
+ s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
20
20
 
21
- s.add_development_dependency 'rspec', '~> 2.7.0'
21
+ s.add_development_dependency 'minitest', '~> 5.6'
22
+ s.add_development_dependency 'fakeweb', '~> 1.3'
22
23
  s.add_development_dependency 'rake'
23
24
  end
@@ -0,0 +1,218 @@
1
+ require_relative 'test_helper'
2
+
3
+ class IntegrationTest < Minitest::Test
4
+ def setup
5
+ build_app
6
+ end
7
+
8
+ def teardown
9
+ FakeWeb.clean_registry
10
+ FakeWeb.last_request = nil
11
+ end
12
+
13
+ def test_authorize
14
+ response = authorize('snowdevil.myshopify.com')
15
+ assert_equal 302, response.status
16
+ assert_match /\A#{Regexp.quote("https://snowdevil.myshopify.com/admin/oauth/authorize?")}/, response.location
17
+ redirect_params = Rack::Utils.parse_query(URI(response.location).query)
18
+ assert_equal "123", redirect_params['client_id']
19
+ assert_equal "https://app.example.com/auth/shopify/callback", redirect_params['redirect_uri']
20
+ assert_equal "read_products", redirect_params['scope']
21
+ end
22
+
23
+ def test_authorize_overrides_site_with_https_scheme
24
+ build_app setup: lambda { |env|
25
+ params = Rack::Utils.parse_query(env['QUERY_STRING'])
26
+ env['omniauth.strategy'].options[:client_options][:site] = "http://#{params['shop']}"
27
+ }
28
+
29
+ response = authorize('snowdevil.myshopify.com')
30
+ assert_match /\A#{Regexp.quote("https://snowdevil.myshopify.com/admin/oauth/authorize?")}/, response.location
31
+ end
32
+
33
+ def test_site_validation
34
+ code = SecureRandom.hex(16)
35
+
36
+ [
37
+ 'foo.example.com', # shop doesn't end with .myshopify.com
38
+ 'http://snowdevil.myshopify.com', # shop contains protocol
39
+ 'snowdevil.myshopify.com/path', # shop contains path
40
+ 'user@snowdevil.myshopify.com', # shop contains user
41
+ 'snowdevil.myshopify.com:22', # shop contains port
42
+ ].each do |shop, valid|
43
+ response = authorize(shop)
44
+ assert_auth_failure(response, 'invalid_site')
45
+
46
+ response = callback(sign_params(shop: shop, code: code))
47
+ assert_auth_failure(response, 'invalid_site')
48
+ end
49
+ end
50
+
51
+ def test_callback
52
+ access_token = SecureRandom.hex(16)
53
+ code = SecureRandom.hex(16)
54
+ expect_access_token_request(access_token)
55
+
56
+ response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: code, state: opts["rack.session"]["omniauth.state"]))
57
+
58
+ assert_callback_success(response, access_token, code)
59
+ end
60
+
61
+ def test_callback_with_legacy_signature
62
+ access_token = SecureRandom.hex(16)
63
+ code = SecureRandom.hex(16)
64
+ expect_access_token_request(access_token)
65
+
66
+ response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: code, state: opts["rack.session"]["omniauth.state"]).merge(signature: 'ignored'))
67
+
68
+ assert_callback_success(response, access_token, code)
69
+ end
70
+
71
+ def test_callback_custom_params
72
+ access_token = SecureRandom.hex(16)
73
+ code = SecureRandom.hex(16)
74
+ FakeWeb.register_uri(:post, "https://snowdevil.myshopify.com/admin/oauth/access_token",
75
+ body: JSON.dump(access_token: access_token),
76
+ content_type: 'application/json')
77
+
78
+ now = Time.now.to_i
79
+ params = { shop: 'snowdevil.myshopify.com', code: code, timestamp: now, next: '/products?page=2&q=red%20shirt', state: opts["rack.session"]["omniauth.state"] }
80
+ encoded_params = "code=#{code}&next=/products?page=2%26q=red%2520shirt&shop=snowdevil.myshopify.com&state=#{opts["rack.session"]["omniauth.state"]}&timestamp=#{now}"
81
+ params[:hmac] = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, @secret, encoded_params)
82
+
83
+ response = callback(params)
84
+
85
+ assert_callback_success(response, access_token, code)
86
+ end
87
+
88
+ def test_callback_rejects_invalid_hmac
89
+ @secret = 'wrong_secret'
90
+ response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: SecureRandom.hex(16)))
91
+
92
+ assert_auth_failure(response, 'invalid_signature')
93
+ end
94
+
95
+ def test_callback_rejects_old_timestamps
96
+ expired_timestamp = Time.now.to_i - OmniAuth::Strategies::Shopify::CODE_EXPIRES_AFTER - 1
97
+ response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: SecureRandom.hex(16), timestamp: expired_timestamp))
98
+
99
+ assert_auth_failure(response, 'invalid_signature')
100
+ end
101
+
102
+ def test_callback_rejects_missing_hmac
103
+ code = SecureRandom.hex(16)
104
+
105
+ response = callback(shop: 'snowdevil.myshopify.com', code: code, timestamp: Time.now.to_i)
106
+
107
+ assert_auth_failure(response, 'invalid_signature')
108
+ end
109
+
110
+ def test_callback_rejects_body_params
111
+ code = SecureRandom.hex(16)
112
+ params = sign_params(shop: 'snowdevil.myshopify.com', code: code)
113
+ body = Rack::Utils.build_nested_query(unsigned: 'value')
114
+
115
+ response = request.get("https://app.example.com/auth/shopify/callback?#{Rack::Utils.build_query(params)}",
116
+ input: body,
117
+ "CONTENT_TYPE" => 'application/x-www-form-urlencoded')
118
+
119
+ assert_auth_failure(response, 'invalid_signature')
120
+ end
121
+
122
+ def test_provider_options
123
+ build_app scope: 'read_products,read_orders,write_content',
124
+ callback_path: '/admin/auth/legacy/callback',
125
+ myshopify_domain: 'myshopify.dev:3000',
126
+ setup: lambda { |env|
127
+ shop = Rack::Request.new(env).GET['shop']
128
+ shop += ".myshopify.dev:3000" unless shop.include?(".")
129
+ env['omniauth.strategy'].options[:client_options][:site] = "https://#{shop}"
130
+ }
131
+
132
+ response = authorize('snowdevil')
133
+ assert_equal 302, response.status
134
+ assert_match /\A#{Regexp.quote("https://snowdevil.myshopify.dev:3000/admin/oauth/authorize?")}/, response.location
135
+ redirect_params = Rack::Utils.parse_query(URI(response.location).query)
136
+ assert_equal 'read_products,read_orders,write_content', redirect_params['scope']
137
+ assert_equal 'https://app.example.com/admin/auth/legacy/callback', redirect_params['redirect_uri']
138
+ end
139
+ def test_callback_with_invalid_state_fails
140
+ access_token = SecureRandom.hex(16)
141
+ code = SecureRandom.hex(16)
142
+ FakeWeb.register_uri(:post, "https://snowdevil.myshopify.com/admin/oauth/access_token",
143
+ body: JSON.dump(access_token: access_token),
144
+ content_type: 'application/json')
145
+
146
+ response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: code, state: 'invalid'))
147
+
148
+ assert_equal 302, response.status
149
+ assert_equal '/auth/failure?message=csrf_detected&strategy=shopify', response.location
150
+ end
151
+ private
152
+
153
+ def sign_params(params)
154
+ params = params.dup
155
+
156
+ params[:timestamp] ||= Time.now.to_i
157
+
158
+ encoded_params = OmniAuth::Strategies::Shopify.encoded_params_for_signature(params)
159
+ params['hmac'] = OmniAuth::Strategies::Shopify.hmac_sign(encoded_params, @secret)
160
+ params
161
+ end
162
+
163
+ def expect_access_token_request(access_token)
164
+ FakeWeb.register_uri(:post, "https://snowdevil.myshopify.com/admin/oauth/access_token",
165
+ body: JSON.dump(access_token: access_token),
166
+ content_type: 'application/json')
167
+ end
168
+
169
+ def assert_callback_success(response, access_token, code)
170
+ token_request_params = Rack::Utils.parse_query(FakeWeb.last_request.body)
171
+ assert_equal token_request_params['client_id'], '123'
172
+ assert_equal token_request_params['client_secret'], @secret
173
+ assert_equal token_request_params['code'], code
174
+
175
+ assert_equal 'snowdevil.myshopify.com', @omniauth_result.uid
176
+ assert_equal access_token, @omniauth_result.credentials.token
177
+ assert_equal false, @omniauth_result.credentials.expires
178
+
179
+ assert_equal 200, response.status
180
+ assert_equal "OK", response.body
181
+ end
182
+
183
+ def assert_auth_failure(response, reason)
184
+ assert_nil FakeWeb.last_request
185
+ assert_equal 302, response.status
186
+ assert_match /\A#{Regexp.quote("/auth/failure?message=#{reason}")}/, response.location
187
+ end
188
+
189
+ def build_app(options={})
190
+ app = proc { |env|
191
+ @omniauth_result = env['omniauth.auth']
192
+ [200, {Rack::CONTENT_TYPE => "text/plain"}, "OK"]
193
+ }
194
+
195
+ opts["rack.session"]["omniauth.state"] = SecureRandom.hex(32)
196
+ app = OmniAuth::Builder.new(app) do
197
+ provider :shopify, '123', '53cr3tz', options
198
+ end
199
+ @secret = '53cr3tz'
200
+ @app = Rack::Session::Cookie.new(app, secret: SecureRandom.hex(64))
201
+ end
202
+
203
+ def authorize(shop)
204
+ request.get("https://app.example.com/auth/shopify?shop=#{CGI.escape(shop)}", opts)
205
+ end
206
+
207
+ def callback(params)
208
+ request.get("https://app.example.com/auth/shopify/callback?#{Rack::Utils.build_query(params)}", opts)
209
+ end
210
+
211
+ def opts
212
+ @opts ||= { "rack.session" => {} }
213
+ end
214
+
215
+ def request
216
+ Rack::MockRequest.new(@app)
217
+ end
218
+ end
@@ -0,0 +1,10 @@
1
+ $: << File.expand_path("../../lib", __FILE__)
2
+ require 'bundler/setup'
3
+ require 'omniauth-shopify-oauth2'
4
+
5
+ require 'minitest/autorun'
6
+ require 'fakeweb'
7
+ require 'json'
8
+
9
+ OmniAuth.config.logger = Logger.new(nil)
10
+ FakeWeb.allow_net_connect = false
metadata CHANGED
@@ -1,36 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-shopify-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Odorcic
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZhZG1p
14
- bnMxFzAVBgoJkiaJk/IsZAEZFgdzaG9waWZ5MRMwEQYKCZImiZPyLGQBGRYDY29t
15
- MB4XDTE0MDUxNTIwMzM0OFoXDTE1MDUxNTIwMzM0OFowPzEPMA0GA1UEAwwGYWRt
16
- aW5zMRcwFQYKCZImiZPyLGQBGRYHc2hvcGlmeTETMBEGCgmSJomT8ixkARkWA2Nv
17
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0/81O3e1vh5smcwp2G
18
- MpLQ6q0kejQLa65bPYPxdzWA1SYOKyGfw+yR9LdFzsuKpwWzKq6zX35lj1IckWS4
19
- bNBEQzxmufUxU0XPM02haFB8fOfDJzdXsWte9Ge4IFwahwn68gpMqN+BvxL+KMYz
20
- Iut9YmN44d4LZdsENEIO5vmybuG2vYDz7R56qB0PA+Q2P2CdhymsBad2DQs69FBo
21
- uico9V6VMYYctL9lCYdzu9IXrOYNTt88suKIVzzAlHOKeN0Ng5qdztFoTR8sfxDr
22
- Ydg3KHl5n47wlpgd8R0f/4b5gGxW+v9pyJCgQnLlRu7DedVSvv7+GMtj3g9r3nhJ
23
- KqECAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/o
24
- maf34HXbUOQsdoLHacEKQgunMB0GA1UdEQQWMBSBEmFkbWluc0BzaG9waWZ5LmNv
25
- bTAdBgNVHRIEFjAUgRJhZG1pbnNAc2hvcGlmeS5jb20wDQYJKoZIhvcNAQEFBQAD
26
- ggEBADkK9aj5T0HPExsov4EoMWFnO+G7RQ28C30VAfKxnL2UxG6i4XMHVs6Xi94h
27
- qXFw1ec9Y2eDUqaolT3bviOk9BB197+A8Vz/k7MC6ci2NE+yDDB7HAC8zU6LAx8Y
28
- Iqvw7B/PSZ/pz4bUVFlTATif4mi1vO3lidRkdHRtM7UePSn2rUpOi0gtXBP3bLu5
29
- YjHJN7wx5cugMEyroKITG5gL0Nxtu21qtOlHX4Hc4KdE2JqzCPOsS4zsZGhgwhPs
30
- fl3hbtVFTqbOlwL9vy1fudXcolIE/ZTcxQ+er07ZFZdKCXayR9PPs64heamfn0fp
31
- TConQSX2BnZdhIEYW+cKzEC/bLc=
32
- -----END CERTIFICATE-----
33
- date: 2015-05-12 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2015-05-27 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  name: omniauth-oauth2
@@ -38,28 +16,42 @@ dependencies:
38
16
  requirements:
39
17
  - - "~>"
40
18
  - !ruby/object:Gem::Version
41
- version: 1.1.1
19
+ version: '1.2'
42
20
  type: :runtime
43
21
  prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
24
  - - "~>"
47
25
  - !ruby/object:Gem::Version
48
- version: 1.1.1
26
+ version: '1.2'
49
27
  - !ruby/object:Gem::Dependency
50
- name: rspec
28
+ name: minitest
51
29
  requirement: !ruby/object:Gem::Requirement
52
30
  requirements:
53
31
  - - "~>"
54
32
  - !ruby/object:Gem::Version
55
- version: 2.7.0
33
+ version: '5.6'
56
34
  type: :development
57
35
  prerelease: false
58
36
  version_requirements: !ruby/object:Gem::Requirement
59
37
  requirements:
60
38
  - - "~>"
61
39
  - !ruby/object:Gem::Version
62
- version: 2.7.0
40
+ version: '5.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: fakeweb
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
63
55
  - !ruby/object:Gem::Dependency
64
56
  name: rake
65
57
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +79,6 @@ files:
87
79
  - README.md
88
80
  - Rakefile
89
81
  - example/Gemfile
90
- - example/Gemfile.lock
91
82
  - example/config.ru
92
83
  - lib/omniauth-shopify-oauth2.rb
93
84
  - lib/omniauth/shopify.rb
@@ -96,8 +87,8 @@ files:
96
87
  - omniauth-shopify-oauth2.gemspec
97
88
  - shipit.rubygems.yml
98
89
  - spec/omniauth/strategies/shopify_spec.rb
99
- - spec/spec_helper.rb
100
- - spec/support/shared_examples.rb
90
+ - test/integration_test.rb
91
+ - test/test_helper.rb
101
92
  homepage: https://github.com/Shopify/omniauth-shopify-oauth2
102
93
  licenses:
103
94
  - MIT
@@ -118,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
109
  version: '0'
119
110
  requirements: []
120
111
  rubyforge_project:
121
- rubygems_version: 2.2.2
112
+ rubygems_version: 2.2.3
122
113
  signing_key:
123
114
  specification_version: 4
124
115
  summary: Shopify strategy for OmniAuth
@@ -1 +0,0 @@
1
- ]��j��G|�܆/��kҾ!�Z��P~���Uj�cm�,��C><L����~VO)���k�m�hz���*��Ԭ<?��a�;˝��չ�w�3��r�^X>8;�p(i��A/*{^×����X��M��W4����u��%HA$� q;4�,�8<�>kև(�{�O4���6X�>�B+t>c�������w !��i����7 �M? R�����'cϻ_��{Q\&-Ԭ��O��n�+!A}���*
data.tar.gz.sig DELETED
Binary file
@@ -1,6 +0,0 @@
1
- require 'bundler/setup'
2
- require 'rspec'
3
- Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
4
-
5
- RSpec.configure do |config|
6
- end
@@ -1,36 +0,0 @@
1
- shared_examples 'an oauth2 strategy' do
2
- describe '#client' do
3
- it 'should be initialized with symbolized client_options' do
4
- @options = { :client_options => { 'authorize_url' => 'https://example.com' } }
5
- subject.client.options[:authorize_url].should == 'https://example.com'
6
- end
7
- end
8
-
9
- describe '#authorize_params' do
10
- it 'should include any authorize params passed in the :authorize_params option' do
11
- @options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
12
- subject.authorize_params['foo'].should eq('bar')
13
- subject.authorize_params['baz'].should eq('zip')
14
- end
15
-
16
- it 'should include top-level options that are marked as :authorize_options' do
17
- @options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
18
- subject.authorize_params['scope'].should eq('bar')
19
- subject.authorize_params['foo'].should eq('baz')
20
- end
21
- end
22
-
23
- describe '#token_params' do
24
- it 'should include any token params passed in the :token_params option' do
25
- @options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
26
- subject.token_params['foo'].should eq('bar')
27
- subject.token_params['baz'].should eq('zip')
28
- end
29
-
30
- it 'should include top-level options that are marked as :token_options' do
31
- @options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
32
- subject.token_params['scope'].should eq('bar')
33
- subject.token_params['foo'].should eq('baz')
34
- end
35
- end
36
- end
metadata.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- ���w�`&k�b)5���x���I`?3�7������cR?4n��N��1�����I��)PYt3D* V���g ����wb,���yLSh?�2�W�� %%aD�9���Y�� �PKk�e
2
- ��������m-4LDVI����
3
- ��V.�ЫD�iX�]���5y�k� �ldY((�=qA�x�����ȐB�'��s���~:����j�q�N Y��� &�n aD?�|��m+��6�F�<-�@Wz�f����˒��;��Qc