omniauth-shopify-oauth2 2.1.0 → 2.2.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: a323c0e91f3f9574a06a0510f3a68e3ac0d0fefd52a9202d1d7899005ed3fa33
4
- data.tar.gz: 3fb6661fe5e570d77070bdac24f88577c53a36b5fd847955dbf9368491620d28
3
+ metadata.gz: 9ac8b79643ac902aa6d573980e4e9256a6ce87dfa464549960592cc30ac0a680
4
+ data.tar.gz: da71a89cc375e080513dc05b8fc7d8bebf0e6066fc38222e330f5385b4461e94
5
5
  SHA512:
6
- metadata.gz: 8f4909d9271c0b50bade9ea456594275aee7ee4877c6d89c55c9cae824e6b63c9659fecf945cfa6cc44ac3bdc67c1ae8961289b6a84f4683f2874419846fbcfc
7
- data.tar.gz: d4df88d5a00976d50b2137f213ac6f64ff9ea011538a835d7e63204a3b5cdafc9b2f000947652de0ad0407a8ef37a9710b94495a8a3fe7aa175aaff77a89679d
6
+ metadata.gz: 2f35605d913503c727412e4897de24a9a8f5cb38e6f34715b74491e2a55cf6c1fbc32c7723506dff64a48d5f141b735e96371a973dfba9ba9173ba04e33a1f85
7
+ data.tar.gz: c1f81b9573ad924ceee5ccf03b5c74a4d447c46f8809497fac98c5e33b0533364c1ce0e2176e55e802c4e28d75cd75fd8548b61992a721dfa5b5aa5904e839f8
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Shopify
3
- VERSION = "2.1.0"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
@@ -44,6 +44,7 @@ module OmniAuth
44
44
  'associated_user' => access_token['associated_user'],
45
45
  'associated_user_scope' => access_token['associated_user_scope'],
46
46
  'scope' => access_token['scope'],
47
+ 'session' => access_token['session']
47
48
  }
48
49
  end
49
50
  end
@@ -305,6 +305,19 @@ class IntegrationTest < Minitest::Test
305
305
  assert_equal 200, response.status
306
306
  end
307
307
 
308
+ def test_callback_when_a_session_is_present
309
+ build_app(scope: 'scope', per_user_permissions: true)
310
+
311
+ access_token = SecureRandom.hex(16)
312
+ code = SecureRandom.hex(16)
313
+ session = SecureRandom.hex
314
+ expect_access_token_request(access_token, 'scope', { id: 1, email: 'bob@bobsen.com'}, session)
315
+
316
+ response = callback(sign_with_new_secret(shop: 'snowdevil.myshopify.com', code: code, state: opts["rack.session"]["omniauth.state"]))
317
+
318
+ assert_equal 200, response.status
319
+ end
320
+
308
321
  def test_callback_works_with_old_secret
309
322
  build_app scope: OmniAuth::Strategies::Shopify::DEFAULT_SCOPE
310
323
  access_token = SecureRandom.hex(16)
@@ -344,9 +357,14 @@ class IntegrationTest < Minitest::Test
344
357
  params
345
358
  end
346
359
 
347
- def expect_access_token_request(access_token, scope, associated_user=nil)
360
+ def expect_access_token_request(access_token, scope, associated_user=nil, session=nil)
348
361
  FakeWeb.register_uri(:post, "https://snowdevil.myshopify.com/admin/oauth/access_token",
349
- body: JSON.dump(access_token: access_token, scope: scope, associated_user: associated_user),
362
+ body: JSON.dump(
363
+ access_token: access_token,
364
+ scope: scope,
365
+ associated_user: associated_user,
366
+ session: session,
367
+ ),
350
368
  content_type: 'application/json')
351
369
  end
352
370
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-shopify-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Odorcic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-26 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.6
126
+ rubygems_version: 3.0.3
128
127
  signing_key:
129
128
  specification_version: 4
130
129
  summary: Shopify strategy for OmniAuth