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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97a799d1a663fd5b32fbb1b5ed00385314955ff3d8af788d37b8949c99402b95
4
- data.tar.gz: dc69884b28a8fce16bb73ec4d06bdf9c63314fba54386ce22d503ce13b097003
3
+ metadata.gz: c31336de0c0d1630c1b24a9970d46503353a3d31a81be62dc9b0e5d3b910d9e8
4
+ data.tar.gz: 4d0e103aef7cd9593cf8e37e69c54c35a64a94a0b3f6c999d39d11d5a11cfcfa
5
5
  SHA512:
6
- metadata.gz: 619795bc0590021e0fde0044ed06bd8500740f133f68180c53525859863f505cf035e130e958723eb07ed838cc4b1132fdd875e6b97296d28d847a3bea2b9628
7
- data.tar.gz: e7eab5866e9bf03eb1b071a65b603d6adfcb1e421401712ef02b5537618721446d9380ffa45c527ee332bc9241c8e2faa360880a5e3cfe70a983987e04e3b130
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
@@ -1,8 +1,16 @@
1
- Metrics/LineLength:
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
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2011-2019 Anton Maminov
3
+ Copyright (c) 2011-2021 Anton Maminov
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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['API_KEY'], ENV['API_SECRET']
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['API_KEY'], ENV['API_SECRET'],
54
- {
55
- :scope => 'friends,audio,photos',
56
- :display => 'popup',
57
- :lang => 'en',
58
- :https => 1,
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.3.0+)
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-2019 Anton Maminov (anton.maminov@gmail.com)
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
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gem 'omniauth-vkontakte', path: '../'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/setup'
2
4
  require_relative 'main'
3
5
 
@@ -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'.freeze
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/vkontakte/version'
2
4
  require 'omniauth'
3
5
 
@@ -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.8'.freeze
18
+ API_VERSION = '5.107'
17
19
 
18
- DEFAULT_SCOPE = ''.freeze
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
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OmniAuth
2
4
  module Vkontakte
3
- VERSION = '1.5.1'.freeze
5
+ VERSION = '1.7.0'
4
6
  end
5
7
  end
@@ -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.linux@gmail.com']
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.6']
18
+ gem.required_ruby_version = '>= 2.5.0'
19
+ gem.add_runtime_dependency 'omniauth-oauth2', ['>= 1.5', '<= 1.7.1']
18
20
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe OmniAuth::Strategies::Vkontakte do
@@ -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.5.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: 2019-11-13 00:00:00.000000000 Z
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: '1.6'
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: '1.6'
32
+ version: 1.7.1
33
33
  description:
34
34
  email:
35
- - anton.linux@gmail.com
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: '0'
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.0.3
77
+ rubygems_version: 3.2.3
79
78
  signing_key:
80
79
  specification_version: 4
81
80
  summary: Vkontakte OAuth2 Strategy for OmniAuth
@@ -1,11 +0,0 @@
1
- before_install:
2
- - gem update bundler
3
- - bundle --version
4
- - gem update --system
5
- - gem --version
6
- rvm:
7
- - 2.6.0
8
- - 2.5.3
9
- - 2.4.5
10
- - 2.3.8
11
- - jruby-head
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env rake
2
- require 'bundler/gem_tasks'
3
- require 'rspec/core/rake_task'
4
-
5
- desc 'Run specs'
6
- RSpec::Core::RakeTask.new
7
-
8
- desc 'Default: run specs.'
9
- task default: :spec