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 +4 -4
- data/lib/omniauth/shopify/version.rb +1 -1
- data/lib/omniauth/strategies/shopify.rb +1 -0
- data/test/integration_test.rb +20 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ac8b79643ac902aa6d573980e4e9256a6ce87dfa464549960592cc30ac0a680
|
4
|
+
data.tar.gz: da71a89cc375e080513dc05b8fc7d8bebf0e6066fc38222e330f5385b4461e94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f35605d913503c727412e4897de24a9a8f5cb38e6f34715b74491e2a55cf6c1fbc32c7723506dff64a48d5f141b735e96371a973dfba9ba9173ba04e33a1f85
|
7
|
+
data.tar.gz: c1f81b9573ad924ceee5ccf03b5c74a4d447c46f8809497fac98c5e33b0533364c1ce0e2176e55e802c4e28d75cd75fd8548b61992a721dfa5b5aa5904e839f8
|
data/test/integration_test.rb
CHANGED
@@ -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(
|
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.
|
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-
|
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
|
-
|
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
|