omniauth-vkontakte 1.5.1 → 1.6.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/.rubocop.yml +5 -2
- data/.travis.yml +4 -0
- data/Gemfile +2 -0
- data/README.md +7 -9
- data/Rakefile +2 -0
- data/examples/Gemfile +2 -0
- data/examples/config.ru +2 -0
- data/examples/main.rb +3 -1
- data/lib/omniauth-vkontakte.rb +2 -0
- data/lib/omniauth/strategies/vkontakte.rb +13 -9
- data/lib/omniauth/vkontakte/version.rb +3 -1
- data/omniauth-vkontakte.gemspec +2 -0
- data/spec/omniauth/strategies/vkontakte_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a66fd112fb2f1d79deedab3d2f7eb3eef303e0e22f827ccdb3174fe50a7f9b8c
|
4
|
+
data.tar.gz: 1651a2707b44331710292fa786093762a3b02797067cbb2402f615b44d5aafe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ecf8d314ae1095196f46b23e27b2408145fd25d790e66e04a4c236b0c6d26c0ead47edbe65b059cd9cf1089ce996d437dd9696a625c860d70a5812907557cd
|
7
|
+
data.tar.gz: abeaf3b11d33befae097b787e099094ca2c608391d63426de50159d52ccb72507e0038a622ceff527e3a60e8ce1542fc0b4cd2bd0b08e50b65a5efd237f24532
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,7 @@ Here's a quick example, adding the middleware to a Rails app in `config/initiali
|
|
27
27
|
|
28
28
|
```ruby
|
29
29
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
30
|
-
provider :vkontakte, ENV['
|
30
|
+
provider :vkontakte, ENV['VK_API_ID'], ENV['VK_API_SECRET']
|
31
31
|
end
|
32
32
|
```
|
33
33
|
|
@@ -50,14 +50,12 @@ Here's an example of a possible configuration:
|
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
use OmniAuth::Builder do
|
53
|
-
provider :vkontakte, ENV['
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
:image_size => 'original'
|
60
|
-
}
|
53
|
+
provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'],
|
54
|
+
scope: 'friends,audio,photos',
|
55
|
+
display: 'popup',
|
56
|
+
lang: 'en',
|
57
|
+
https: 1,
|
58
|
+
image_size: 'original'
|
61
59
|
end
|
62
60
|
```
|
63
61
|
|
data/Rakefile
CHANGED
data/examples/Gemfile
CHANGED
data/examples/config.ru
CHANGED
data/examples/main.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pp'
|
2
4
|
require 'sinatra'
|
3
5
|
require 'omniauth'
|
@@ -5,7 +7,7 @@ require 'omniauth-vkontakte'
|
|
5
7
|
|
6
8
|
configure { set :server, :puma }
|
7
9
|
|
8
|
-
SCOPE = 'friends,audio'
|
10
|
+
SCOPE = 'friends,audio'
|
9
11
|
|
10
12
|
use Rack::Session::Cookie
|
11
13
|
|
data/lib/omniauth-vkontakte.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'omniauth/strategies/oauth2'
|
2
4
|
|
3
5
|
module OmniAuth
|
@@ -13,9 +15,9 @@ module OmniAuth
|
|
13
15
|
class Vkontakte < OmniAuth::Strategies::OAuth2
|
14
16
|
class NoRawData < StandardError; end
|
15
17
|
|
16
|
-
API_VERSION = '5.
|
18
|
+
API_VERSION = '5.107'
|
17
19
|
|
18
|
-
DEFAULT_SCOPE = ''
|
20
|
+
DEFAULT_SCOPE = ''
|
19
21
|
|
20
22
|
option :name, 'vkontakte'
|
21
23
|
|
@@ -56,13 +58,6 @@ module OmniAuth
|
|
56
58
|
access_token.options[:mode] = :query
|
57
59
|
access_token.options[:param_name] = :access_token
|
58
60
|
@raw_info ||= begin
|
59
|
-
params = {
|
60
|
-
fields: info_options,
|
61
|
-
lang: lang_option,
|
62
|
-
https: https_option,
|
63
|
-
v: API_VERSION
|
64
|
-
}
|
65
|
-
|
66
61
|
result = access_token.get('/method/users.get', params: params).parsed['response']
|
67
62
|
|
68
63
|
raise NoRawData, result unless result.is_a?(Array) && result.first
|
@@ -95,6 +90,15 @@ module OmniAuth
|
|
95
90
|
|
96
91
|
private
|
97
92
|
|
93
|
+
def params
|
94
|
+
{
|
95
|
+
fields: info_options,
|
96
|
+
lang: lang_option,
|
97
|
+
https: https_option,
|
98
|
+
v: API_VERSION
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
98
102
|
def callback_url
|
99
103
|
options.redirect_url || (full_host + script_name + callback_path)
|
100
104
|
end
|
data/omniauth-vkontakte.gemspec
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-vkontakte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|