omniauth-shopify-oauth2 1.1.12 → 1.1.13
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 +2 -1
- data/test/integration_test.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 302968d8c7499cf54d89ef0b5b53549911545743
|
4
|
+
data.tar.gz: 20b3c6e2381e5229e0a00166568426416cff46f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a99dc64abd740de41d62508b0939fa62f7b1b69f3e4fee52e40c8996440155d9f69a607cf844a915543257c751440bff2ed9d5207ea9bd00df830a7e7173f041
|
7
|
+
data.tar.gz: 31a0d25400a590a03f8ce4d09c5f05a7caf46480b344c856929dce9a7cf8ecaba2c2a78ec2c81d7fba8c28a022b158ecf58e14c06329834decd78b5536741bcd
|
@@ -49,7 +49,8 @@ module OmniAuth
|
|
49
49
|
def valid_scope?(token)
|
50
50
|
params = options.authorize_params.merge(options_for("authorize"))
|
51
51
|
return false unless token && params[:scope] && token['scope']
|
52
|
-
|
52
|
+
expected_scope = params[:scope].split(',').map(&:strip).reject(&:empty?).uniq.sort
|
53
|
+
(expected_scope == token['scope'].split(',').sort)
|
53
54
|
end
|
54
55
|
|
55
56
|
def self.encoded_params_for_signature(params)
|
data/test/integration_test.rb
CHANGED
@@ -85,6 +85,17 @@ class IntegrationTest < Minitest::Test
|
|
85
85
|
assert_callback_success(response, access_token, code)
|
86
86
|
end
|
87
87
|
|
88
|
+
def test_callback_with_spaces_in_scope
|
89
|
+
build_app scope: 'write_products, read_orders'
|
90
|
+
access_token = SecureRandom.hex(16)
|
91
|
+
code = SecureRandom.hex(16)
|
92
|
+
expect_access_token_request(access_token, 'read_orders,write_products')
|
93
|
+
|
94
|
+
response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: code, state: opts["rack.session"]["omniauth.state"]))
|
95
|
+
|
96
|
+
assert_callback_success(response, access_token, code)
|
97
|
+
end
|
98
|
+
|
88
99
|
def test_callback_rejects_invalid_hmac
|
89
100
|
@secret = 'wrong_secret'
|
90
101
|
response = callback(sign_params(shop: 'snowdevil.myshopify.com', code: SecureRandom.hex(16)))
|
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: 1.1.
|
4
|
+
version: 1.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Odorcic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|