omniauth-facebook 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -7
- data/CHANGELOG.md +6 -0
- data/lib/omniauth/facebook/version.rb +1 -1
- data/lib/omniauth/strategies/facebook.rb +6 -4
- data/omniauth-facebook.gemspec +1 -1
- data/test/strategy_test.rb +25 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de07dc27eb8810abd1b2a688449e1ad0360f063a5c233c0c36f1902a721be927
|
4
|
+
data.tar.gz: f938ca12195ac5e3581e39802d5f54e82bae3fc22e71db51d1ce4a62b25750cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90f607d371c1e1b73cfb854d9fb1e0f7abb5e65d8e08d2043de57f20079ac4bcff5461f3bd3c536c47506ec174029a49cb500d536485649e4ac044cf5009ae8a
|
7
|
+
data.tar.gz: c30e200b472c2ddfbf9566ff14c2ca34e408a0380d41ed8328a2580fa21a3349f214767211d7574a744e9a8d35f61e44423a643a6a42419fa2f96d6f73ba38fd
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -161,13 +161,15 @@ module OmniAuth
|
|
161
161
|
uri_class = options[:secure_image_url] ? URI::HTTPS : URI::HTTP
|
162
162
|
site_uri = URI.parse(client.site)
|
163
163
|
url = uri_class.build({host: site_uri.host, path: "#{site_uri.path}/#{uid}/picture"})
|
164
|
+
query = { access_token: access_token.token }
|
164
165
|
|
165
|
-
|
166
|
-
|
166
|
+
if options[:image_size].is_a?(String) || options[:image_size].is_a?(Symbol)
|
167
|
+
query[:type] = options[:image_size]
|
167
168
|
elsif options[:image_size].is_a?(Hash)
|
168
|
-
options[:image_size]
|
169
|
+
query.merge!(options[:image_size])
|
169
170
|
end
|
170
|
-
|
171
|
+
|
172
|
+
url.query = Rack::Utils.build_query(query)
|
171
173
|
|
172
174
|
url.to_s
|
173
175
|
end
|
data/omniauth-facebook.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ['Mark Dodwell', 'Josef Šimánek']
|
9
9
|
s.email = ['mark@madeofcode.com', 'retro@ballgag.cz']
|
10
10
|
s.summary = 'Facebook OAuth2 Strategy for OmniAuth'
|
11
|
-
s.homepage = 'https://github.com/
|
11
|
+
s.homepage = 'https://github.com/simi/omniauth-facebook'
|
12
12
|
s.license = 'MIT'
|
13
13
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
data/test/strategy_test.rb
CHANGED
@@ -95,41 +95,52 @@ class UidTest < StrategyTestCase
|
|
95
95
|
end
|
96
96
|
|
97
97
|
class InfoTest < StrategyTestCase
|
98
|
+
def setup
|
99
|
+
super
|
100
|
+
@access_token = stub('OAuth2::AccessToken')
|
101
|
+
@access_token.stubs(:token).returns('test_access_token')
|
102
|
+
end
|
103
|
+
|
98
104
|
test 'returns the secure facebook avatar url when `secure_image_url` option is specified' do
|
99
105
|
@options = { secure_image_url: true }
|
100
106
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
101
107
|
strategy.stubs(:raw_info).returns(raw_info)
|
102
|
-
|
108
|
+
strategy.stubs(:access_token).returns(@access_token)
|
109
|
+
assert_equal 'https://graph.facebook.com/v4.0/321/picture?access_token=test_access_token', strategy.info['image']
|
103
110
|
end
|
104
111
|
|
105
112
|
test 'returns the image_url based of the client site' do
|
106
113
|
@options = { secure_image_url: true, client_options: {site: "https://blah.facebook.com/v2.2"}}
|
107
114
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
108
115
|
strategy.stubs(:raw_info).returns(raw_info)
|
109
|
-
|
116
|
+
strategy.stubs(:access_token).returns(@access_token)
|
117
|
+
assert_equal "https://blah.facebook.com/v2.2/321/picture?access_token=test_access_token", strategy.info['image']
|
110
118
|
end
|
111
119
|
|
112
120
|
test 'returns the image with size specified in the `image_size` option' do
|
113
121
|
@options = { image_size: 'normal' }
|
114
122
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
115
123
|
strategy.stubs(:raw_info).returns(raw_info)
|
116
|
-
|
124
|
+
strategy.stubs(:access_token).returns(@access_token)
|
125
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture?access_token=test_access_token&type=normal', strategy.info['image']
|
117
126
|
end
|
118
127
|
|
119
128
|
test 'returns the image with size specified as a symbol in the `image_size` option' do
|
120
129
|
@options = { image_size: :normal }
|
121
130
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
122
131
|
strategy.stubs(:raw_info).returns(raw_info)
|
123
|
-
|
132
|
+
strategy.stubs(:access_token).returns(@access_token)
|
133
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture?access_token=test_access_token&type=normal', strategy.info['image']
|
124
134
|
end
|
125
135
|
|
126
136
|
test 'returns the image with width and height specified in the `image_size` option' do
|
127
137
|
@options = { image_size: { width: 123, height: 987 } }
|
128
138
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
129
139
|
strategy.stubs(:raw_info).returns(raw_info)
|
140
|
+
strategy.stubs(:access_token).returns(@access_token)
|
130
141
|
assert_match 'width=123', strategy.info['image']
|
131
142
|
assert_match 'height=987', strategy.info['image']
|
132
|
-
assert_match 'http://graph.facebook.com/v4.0/321/picture?', strategy.info['image']
|
143
|
+
assert_match 'http://graph.facebook.com/v4.0/321/picture?access_token=test_access_token', strategy.info['image']
|
133
144
|
end
|
134
145
|
end
|
135
146
|
|
@@ -138,6 +149,10 @@ class InfoTestOptionalDataPresent < StrategyTestCase
|
|
138
149
|
super
|
139
150
|
@raw_info ||= { 'name' => 'Fred Smith' }
|
140
151
|
strategy.stubs(:raw_info).returns(@raw_info)
|
152
|
+
|
153
|
+
access_token = stub('OAuth2::AccessToken')
|
154
|
+
access_token.stubs(:token).returns('test_access_token')
|
155
|
+
strategy.stubs(:access_token).returns(access_token)
|
141
156
|
end
|
142
157
|
|
143
158
|
test 'returns the name' do
|
@@ -176,7 +191,7 @@ class InfoTestOptionalDataPresent < StrategyTestCase
|
|
176
191
|
|
177
192
|
test 'returns the facebook avatar url' do
|
178
193
|
@raw_info['id'] = '321'
|
179
|
-
assert_equal 'http://graph.facebook.com/v4.0/321/picture', strategy.info['image']
|
194
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture?access_token=test_access_token', strategy.info['image']
|
180
195
|
end
|
181
196
|
|
182
197
|
test 'returns the Facebook link as the Facebook url' do
|
@@ -215,6 +230,10 @@ class InfoTestOptionalDataNotPresent < StrategyTestCase
|
|
215
230
|
super
|
216
231
|
@raw_info ||= { 'name' => 'Fred Smith' }
|
217
232
|
strategy.stubs(:raw_info).returns(@raw_info)
|
233
|
+
|
234
|
+
access_token = stub('OAuth2::AccessToken')
|
235
|
+
access_token.stubs(:token).returns('test_access_token')
|
236
|
+
strategy.stubs(:access_token).returns(access_token)
|
218
237
|
end
|
219
238
|
|
220
239
|
test 'has no email key' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-facebook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth-oauth2
|
@@ -98,7 +98,7 @@ files:
|
|
98
98
|
- test/signed_request_test.rb
|
99
99
|
- test/strategy_test.rb
|
100
100
|
- test/support/shared_examples.rb
|
101
|
-
homepage: https://github.com/
|
101
|
+
homepage: https://github.com/simi/omniauth-facebook
|
102
102
|
licenses:
|
103
103
|
- MIT
|
104
104
|
metadata: {}
|