omniauth-vkontakte 1.8.0 → 1.9.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/.github/workflows/ruby.yml +2 -2
- data/.rubocop.yml +2 -2
- data/Gemfile +1 -0
- data/LICENSE +1 -1
- data/README.md +13 -10
- data/examples/main.rb +0 -1
- data/lib/omniauth/strategies/vkontakte.rb +10 -8
- data/lib/omniauth/vkontakte/version.rb +1 -1
- data/omniauth-vkontakte.gemspec +1 -1
- data/spec/omniauth/strategies/vkontakte_spec.rb +9 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f2958affb17d7f866c7d8375223e1412b343173b8219bc96328fa9d4427d373
|
4
|
+
data.tar.gz: 4b15a1699fdb845a8a2842f58d97a06243a69282b5fe8d42a5c73184a734b717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a5bb2c7246941a135c7680d5f23b4399e1f0c8f364868ee182c74fdb910dbf1a710ff82493b42c7363ef866c8b6d75380ae6dee0bf3edc52ac18d69e929d5e1
|
7
|
+
data.tar.gz: 3104e2baa0bf051706b13b3b424eb21e0092875fb7f81122814673136d482db11a8715538c4e50d354f4d24fd9b144170d1671154095c1f26f36a33dad66a39b
|
data/.github/workflows/ruby.yml
CHANGED
@@ -7,8 +7,8 @@ jobs:
|
|
7
7
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [
|
11
|
-
os: [ubuntu-latest, macos-
|
10
|
+
ruby: [3.2, 3.3, 3.4, head]
|
11
|
+
os: [ubuntu-latest, macos-14]
|
12
12
|
runs-on: ${{ matrix.os }}
|
13
13
|
steps:
|
14
14
|
- uses: actions/checkout@master
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
AllCops:
|
2
2
|
NewCops: enable
|
3
|
-
TargetRubyVersion: 2.
|
3
|
+
TargetRubyVersion: 2.7
|
4
4
|
Layout/LineLength:
|
5
5
|
Max: 120
|
6
6
|
Metrics/MethodLength:
|
@@ -8,7 +8,7 @@ Metrics/MethodLength:
|
|
8
8
|
Metrics/BlockLength:
|
9
9
|
Enabled: false
|
10
10
|
Metrics/ClassLength:
|
11
|
-
|
11
|
+
Enabled: false
|
12
12
|
Lint/DuplicateBranch:
|
13
13
|
Enabled: false
|
14
14
|
Naming/FileName:
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
This is the unofficial [OmniAuth](https://github.com/intridea/omniauth) strategy for authenticating to VKontakte via OAuth.
|
9
9
|
To use it, you'll need to sign up for an OAuth2 Application ID and Secret
|
10
|
-
on the [Vkontakte Developers Page](http://vk.
|
10
|
+
on the [Vkontakte Developers Page](http://vk.ru/dev).
|
11
11
|
|
12
12
|

|
13
13
|
|
@@ -39,13 +39,13 @@ end
|
|
39
39
|
|
40
40
|
You can configure several options, which you pass in to the `provider` method via a `Hash`:
|
41
41
|
|
42
|
-
* `scope`: a comma-separated list of access permissions you want to request from the user. [Read the Vkontakte docs for more details](http://vk.
|
42
|
+
* `scope`: a comma-separated list of access permissions you want to request from the user. [Read the Vkontakte docs for more details](http://vk.ru/dev/permissions)
|
43
43
|
* `display`: the display context to show the authentication page. Valid options include `page`, `popup` and `mobile`.
|
44
44
|
* `lang`: specifies the language. Optional options include `ru`, `ua`, `be`, `en`, `es`, `fi`, `de`, `it`.
|
45
45
|
* `image_size`: defines the size of the user's image. Valid options include `mini`(50x50), `bigger`(100x100), `bigger_x2`(200x200), `original`(200x*) and `original_x2`(400x*). Default is `mini`.
|
46
46
|
* `info_fields`: specify which fields should be added to AuthHash when
|
47
|
-
getting the user's info. Value should be a comma-separated string as per http://vk.
|
48
|
-
* `redirect_url`: URL where code will be passed. This URL shall be a part of the domain specified in application settings http://vk.
|
47
|
+
getting the user's info. Value should be a comma-separated string as per http://vk.ru/dev/fields.
|
48
|
+
* `redirect_url`: URL where code will be passed. This URL shall be a part of the domain specified in application settings http://vk.ru/dev/auth_sites.
|
49
49
|
* `https`: 1 - allows you to receive https links to photos and other media. 0 - return an http links (the default).
|
50
50
|
|
51
51
|
Here's an example of a possible configuration:
|
@@ -75,7 +75,7 @@ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
|
|
75
75
|
"last_name"=>"Дуров",
|
76
76
|
"image"=>"http://cs7001.vk.me/c7003/v7003079/374b/53lwetwOxD8.jpg",
|
77
77
|
"location"=>"Росiя, Санкт-Петербург",
|
78
|
-
"urls"=>{"Vkontakte"=>"http://vk.
|
78
|
+
"urls"=>{"Vkontakte"=>"http://vk.ru/durov"}},
|
79
79
|
"credentials"=>
|
80
80
|
{"token"=>
|
81
81
|
"187041a618229fdaf16613e96e1caabc1e86e46bbfad228de41520e63fe45873684c365a14417289599f3",
|
@@ -105,16 +105,19 @@ The precise information available may depend on the permissions which you reques
|
|
105
105
|
|
106
106
|
Tested with the following Ruby versions:
|
107
107
|
|
108
|
-
- Ruby MRI (2.
|
109
|
-
- JRuby (9.2.0+)
|
108
|
+
- Ruby MRI (3.2.0+)
|
110
109
|
|
111
|
-
## Contributing
|
110
|
+
## Contributing
|
112
111
|
|
113
|
-
|
112
|
+
1. Fork it (<https://github.com/mamantoha/omniauth-vkontakte/fork>)
|
113
|
+
2. Create your feature branch (git checkout -b my-new-feature)
|
114
|
+
3. Commit your changes (git commit -am 'Add some feature')
|
115
|
+
4. Push to the branch (git push origin my-new-feature)
|
116
|
+
5. Create a new Pull Request
|
114
117
|
|
115
118
|
## License
|
116
119
|
|
117
|
-
Copyright: 2011-
|
120
|
+
Copyright: 2011-2025 Anton Maminov (anton.maminov@gmail.com)
|
118
121
|
|
119
122
|
This library is distributed under the MIT license. Please see the LICENSE file.
|
120
123
|
|
data/examples/main.rb
CHANGED
@@ -7,7 +7,7 @@ module OmniAuth
|
|
7
7
|
# Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve
|
8
8
|
# basic user information.
|
9
9
|
# documentation available here:
|
10
|
-
# http://vk.
|
10
|
+
# http://vk.ru/dev/authentication
|
11
11
|
#
|
12
12
|
# @example Basic Usage
|
13
13
|
# use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'
|
@@ -21,10 +21,12 @@ module OmniAuth
|
|
21
21
|
|
22
22
|
option :name, 'vkontakte'
|
23
23
|
|
24
|
-
option :client_options,
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
option :client_options, {
|
25
|
+
site: 'https://api.vk.ru/',
|
26
|
+
token_url: 'https://oauth.vk.ru/access_token',
|
27
|
+
authorize_url: 'https://oauth.vk.ru/authorize',
|
28
|
+
auth_scheme: :request_body
|
29
|
+
}
|
28
30
|
|
29
31
|
option :authorize_options, %i[scope display]
|
30
32
|
|
@@ -43,7 +45,7 @@ module OmniAuth
|
|
43
45
|
image: image_url,
|
44
46
|
location: location,
|
45
47
|
urls: {
|
46
|
-
'Vkontakte' => "http://vk.
|
48
|
+
'Vkontakte' => "http://vk.ru/#{raw_info['screen_name']}"
|
47
49
|
}
|
48
50
|
}
|
49
51
|
end
|
@@ -69,7 +71,7 @@ module OmniAuth
|
|
69
71
|
# You can pass +display+, +revoke+ or +scope+ params to the auth request,
|
70
72
|
# if you need to set them dynamically.
|
71
73
|
#
|
72
|
-
# http://vk.
|
74
|
+
# http://vk.ru/dev/oauth_dialog
|
73
75
|
#
|
74
76
|
# +revoke+ revokes access and re-authorizes user.
|
75
77
|
def authorize_params
|
@@ -104,7 +106,7 @@ module OmniAuth
|
|
104
106
|
end
|
105
107
|
|
106
108
|
def info_options
|
107
|
-
# http://vk.
|
109
|
+
# http://vk.ru/dev/fields
|
108
110
|
fields = %w[
|
109
111
|
nickname screen_name sex city country online bdate
|
110
112
|
photo_50 photo_100 photo_200 photo_200_orig photo_400_orig
|
data/omniauth-vkontakte.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = 'omniauth-vkontakte'
|
15
15
|
gem.require_paths = ['lib']
|
16
16
|
gem.version = OmniAuth::Vkontakte::VERSION
|
17
|
-
gem.required_ruby_version = '>= 2.
|
17
|
+
gem.required_ruby_version = '>= 3.2.0'
|
18
18
|
gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.8.0'
|
19
19
|
gem.metadata['rubygems_mfa_required'] = 'true'
|
20
20
|
end
|
@@ -33,15 +33,19 @@ describe OmniAuth::Strategies::Vkontakte do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should have correct site' do
|
36
|
-
expect(subject.options.client_options.site).to eq('https://api.vk.
|
36
|
+
expect(subject.options.client_options.site).to eq('https://api.vk.ru/')
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should have correct authorize url' do
|
40
|
-
expect(subject.options.client_options.authorize_url).to eq('https://oauth.vk.
|
40
|
+
expect(subject.options.client_options.authorize_url).to eq('https://oauth.vk.ru/authorize')
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'should have correct token url' do
|
44
|
-
expect(subject.options.client_options.token_url).to eq('https://oauth.vk.
|
44
|
+
expect(subject.options.client_options.token_url).to eq('https://oauth.vk.ru/access_token')
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should have correct auth_scheme' do
|
48
|
+
expect(subject.options.client_options.auth_scheme).to eq(:request_body)
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
@@ -75,7 +79,7 @@ describe OmniAuth::Strategies::Vkontakte do
|
|
75
79
|
end
|
76
80
|
|
77
81
|
it 'should returns the urls' do
|
78
|
-
expect(subject.info[:urls]['Vkontakte']).to eq("http://vk.
|
82
|
+
expect(subject.info[:urls]['Vkontakte']).to eq("http://vk.ru/#{raw_info_hash['screen_name']}")
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
@@ -139,7 +143,7 @@ describe OmniAuth::Strategies::Vkontakte do
|
|
139
143
|
allow(subject).to receive(:env).and_return({})
|
140
144
|
allow(subject).to receive(:request).and_return(
|
141
145
|
double('Request', params: {}, scheme: 'https',
|
142
|
-
url: 'https://oauth.vk.
|
146
|
+
url: 'https://oauth.vk.ru/authorize',
|
143
147
|
cookies: {}, env: {})
|
144
148
|
)
|
145
149
|
allow(subject).to receive(:request_phase).and_return(:whatever)
|
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.9.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: 2025-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -69,14 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
69
|
requirements:
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 2.
|
72
|
+
version: 3.2.0
|
73
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
79
|
+
rubygems_version: 3.5.9
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Vkontakte OAuth2 Strategy for OmniAuth
|