omniauth-vkontakte 1.5.1 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- 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/strategies/vkontakte.rb +13 -9
- data/lib/omniauth/vkontakte/version.rb +3 -1
- data/lib/omniauth-vkontakte.rb +2 -0
- data/omniauth-vkontakte.gemspec +5 -3
- data/spec/omniauth/strategies/vkontakte_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -2
- metadata +16 -14
- 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: f5e77d3608f8ffe151363232409686cd04951f3ad82892d5452e82e649976e96
|
4
|
+
data.tar.gz: ac475f089c5aeaa54a010f80342cb540182a9aa08303a4aa99b12e6665c1d07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fddd2cc46e35fb4b26e711ed95b629bdb68aef390f9c6c4eb83d541321496afd8fe8951613ab666a4ac827a58855f64354293edee6936c465b4e0e68f3f4ba
|
7
|
+
data.tar.gz: 9f1a3be96a75531a5c2d854bd5b88d99142783a23d6e06eab06fa0ab9ddf3ff3d4288ce7d1af64da9bee05159339593d05c6ee7c2710e4e2a06e12fe151f820c
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "daily"
|
@@ -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
|
+
![Ruby](https://github.com/mamantoha/omniauth-vkontakte/workflows/Ruby/badge.svg)
|
3
4
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/149c0614deef469faa49e1e8ae384bd3)](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
|
-
[![Build Status](https://travis-ci.org/mamantoha/omniauth-vkontakte.svg?branch=master)](https://travis-ci.org/mamantoha/omniauth-vkontakte)
|
5
5
|
[![Gem Version][rubygems_badge]][rubygems]
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/1ea61cb860f9f6aafb4f/maintainability)](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
|
|
@@ -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/lib/omniauth-vkontakte.rb
CHANGED
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',
|
18
|
+
gem.required_ruby_version = '>= 2.5.0'
|
19
|
+
gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.7.3'
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-13 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.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,22 +29,22 @@ dependencies:
|
|
29
29
|
version: '1.5'
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
description:
|
32
|
+
version: 1.7.3
|
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/dependabot.yml"
|
41
|
+
- ".github/workflows/ruby.yml"
|
40
42
|
- ".gitignore"
|
41
43
|
- ".rspec"
|
42
44
|
- ".rubocop.yml"
|
43
|
-
- ".travis.yml"
|
44
45
|
- Gemfile
|
45
46
|
- LICENSE
|
46
47
|
- README.md
|
47
|
-
- Rakefile
|
48
48
|
- examples/.env.example
|
49
49
|
- examples/Gemfile
|
50
50
|
- examples/README.md
|
@@ -60,7 +60,7 @@ homepage: https://github.com/mamantoha/omniauth-vkontakte
|
|
60
60
|
licenses:
|
61
61
|
- MIT
|
62
62
|
metadata: {}
|
63
|
-
post_install_message:
|
63
|
+
post_install_message:
|
64
64
|
rdoc_options: []
|
65
65
|
require_paths:
|
66
66
|
- lib
|
@@ -68,15 +68,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements:
|
69
69
|
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
71
|
+
version: 2.5.0
|
72
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.
|
79
|
-
signing_key:
|
78
|
+
rubygems_version: 3.2.32
|
79
|
+
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Vkontakte OAuth2 Strategy for OmniAuth
|
82
|
-
test_files:
|
82
|
+
test_files:
|
83
|
+
- spec/omniauth/strategies/vkontakte_spec.rb
|
84
|
+
- spec/spec_helper.rb
|
data/.travis.yml
DELETED