omniauth-vkontakte 1.5.1 → 1.7.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 +22 -0
- data/.rubocop.yml +11 -3
- data/Gemfile +2 -4
- data/LICENSE +1 -1
- data/README.md +11 -13
- 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 +5 -3
- data/spec/omniauth/strategies/vkontakte_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -2
- metadata +8 -9
- data/.travis.yml +0 -11
- data/Rakefile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c31336de0c0d1630c1b24a9970d46503353a3d31a81be62dc9b0e5d3b910d9e8
|
4
|
+
data.tar.gz: 4d0e103aef7cd9593cf8e37e69c54c35a64a94a0b3f6c999d39d11d5a11cfcfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375f8caec707839dabce173adb21c63c7d9fee36852bf9e6412f1b463d1c0e520bc10810f9f0384799992abe8ffce007399001b22328a98cf8e1fb3ee211aa9f
|
7
|
+
data.tar.gz: 0daa0d710c5a061bdf7019aa6224e0cf718f9473e8f1f2397bfa068efd9208dd296ab726242b4722f2d1d11168c3a0a85096a50fea098807c284e745c983ced2
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: [2.5, 2.6, 2.7, 3.0, head, jruby, jruby-head]
|
11
|
+
os: [ubuntu-latest, macos-latest]
|
12
|
+
runs-on: ${{ matrix.os }}
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@master
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
- name: Install dependencies
|
20
|
+
run: bundle install
|
21
|
+
- name: Run test
|
22
|
+
run: rspec
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
-
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
TargetRubyVersion: 2.5
|
4
|
+
Layout/LineLength:
|
2
5
|
Max: 120
|
3
6
|
Metrics/MethodLength:
|
4
7
|
Enabled: false
|
5
8
|
Metrics/BlockLength:
|
6
9
|
Enabled: false
|
7
|
-
|
8
|
-
|
10
|
+
Metrics/ClassLength:
|
11
|
+
Max: 101
|
12
|
+
Lint/DuplicateBranch:
|
13
|
+
Enabled: false
|
14
|
+
Naming/FileName:
|
15
|
+
Exclude:
|
16
|
+
- 'lib/omniauth-vkontakte.rb'
|
data/Gemfile
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
5
|
-
gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '>= 2.0'
|
6
|
-
gem 'rake'
|
7
|
-
|
8
7
|
group :development do
|
9
8
|
gem 'rubocop', require: false
|
10
9
|
end
|
11
10
|
|
12
11
|
group :test do
|
13
|
-
gem 'rack-test'
|
14
12
|
gem 'rspec'
|
15
13
|
gem 'simplecov'
|
16
14
|
gem 'webmock'
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# OmniAuth VKontakte
|
2
2
|
|
3
|
+

|
3
4
|
[](https://app.codacy.com/app/mamantoha/omniauth-vkontakte?utm_source=github.com&utm_medium=referral&utm_content=mamantoha/omniauth-vkontakte&utm_campaign=Badge_Grade_Dashboard)
|
4
|
-
[](https://travis-ci.org/mamantoha/omniauth-vkontakte)
|
5
5
|
[![Gem Version][rubygems_badge]][rubygems]
|
6
6
|
[](https://codeclimate.com/github/mamantoha/omniauth-vkontakte/maintainability)
|
7
7
|
|
@@ -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
|
|
@@ -105,8 +103,8 @@ The precise information available may depend on the permissions which you reques
|
|
105
103
|
|
106
104
|
Tested with the following Ruby versions:
|
107
105
|
|
108
|
-
- Ruby MRI (2.
|
109
|
-
- JRuby
|
106
|
+
- Ruby MRI (2.5.0+)
|
107
|
+
- JRuby (9.2.0+)
|
110
108
|
|
111
109
|
## Contributing to omniauth-vkontakte
|
112
110
|
|
@@ -114,7 +112,7 @@ Tested with the following Ruby versions:
|
|
114
112
|
|
115
113
|
## License
|
116
114
|
|
117
|
-
Copyright: 2011-
|
115
|
+
Copyright: 2011-2021 Anton Maminov (anton.maminov@gmail.com)
|
118
116
|
|
119
117
|
This library is distributed under the MIT license. Please see the LICENSE file.
|
120
118
|
|
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
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require File.expand_path('lib/omniauth/vkontakte/version', __dir__)
|
2
4
|
|
3
5
|
Gem::Specification.new do |gem|
|
4
6
|
gem.authors = ['Anton Maminov']
|
5
|
-
gem.email = ['anton.
|
7
|
+
gem.email = ['anton.maminov@gmail.com']
|
6
8
|
gem.summary = 'Vkontakte OAuth2 Strategy for OmniAuth'
|
7
9
|
gem.homepage = 'https://github.com/mamantoha/omniauth-vkontakte'
|
8
10
|
gem.licenses = ['MIT']
|
@@ -13,6 +15,6 @@ Gem::Specification.new do |gem|
|
|
13
15
|
gem.name = 'omniauth-vkontakte'
|
14
16
|
gem.require_paths = ['lib']
|
15
17
|
gem.version = OmniAuth::Vkontakte::VERSION
|
16
|
-
|
17
|
-
gem.add_runtime_dependency 'omniauth-oauth2', ['>= 1.5', '<= 1.
|
18
|
+
gem.required_ruby_version = '>= 2.5.0'
|
19
|
+
gem.add_runtime_dependency 'omniauth-oauth2', ['>= 1.5', '<= 1.7.1']
|
18
20
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
$LOAD_PATH.unshift File.expand_path(__dir__)
|
2
4
|
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
3
5
|
require 'simplecov'
|
4
6
|
SimpleCov.start
|
5
7
|
require 'rspec'
|
6
|
-
require 'rack/test'
|
7
8
|
require 'webmock/rspec'
|
8
9
|
require 'omniauth'
|
9
10
|
require 'omniauth-vkontakte'
|
10
11
|
|
11
12
|
RSpec.configure do |config|
|
12
13
|
config.include WebMock::API
|
13
|
-
config.include Rack::Test::Methods
|
14
14
|
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
|
15
15
|
config.expect_with :rspec do |c|
|
16
16
|
c.syntax = :expect
|
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.7.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: 2021-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.5'
|
20
20
|
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 1.7.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,22 +29,21 @@ dependencies:
|
|
29
29
|
version: '1.5'
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 1.7.1
|
33
33
|
description:
|
34
34
|
email:
|
35
|
-
- anton.
|
35
|
+
- anton.maminov@gmail.com
|
36
36
|
executables: []
|
37
37
|
extensions: []
|
38
38
|
extra_rdoc_files: []
|
39
39
|
files:
|
40
|
+
- ".github/workflows/ruby.yml"
|
40
41
|
- ".gitignore"
|
41
42
|
- ".rspec"
|
42
43
|
- ".rubocop.yml"
|
43
|
-
- ".travis.yml"
|
44
44
|
- Gemfile
|
45
45
|
- LICENSE
|
46
46
|
- README.md
|
47
|
-
- Rakefile
|
48
47
|
- examples/.env.example
|
49
48
|
- examples/Gemfile
|
50
49
|
- examples/README.md
|
@@ -68,14 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
67
|
requirements:
|
69
68
|
- - ">="
|
70
69
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
70
|
+
version: 2.5.0
|
72
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
72
|
requirements:
|
74
73
|
- - ">="
|
75
74
|
- !ruby/object:Gem::Version
|
76
75
|
version: '0'
|
77
76
|
requirements: []
|
78
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.2.3
|
79
78
|
signing_key:
|
80
79
|
specification_version: 4
|
81
80
|
summary: Vkontakte OAuth2 Strategy for OmniAuth
|
data/.travis.yml
DELETED