From 07ab985e4c69726f0c03921a26df476f40d9786f Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:32:53 +0200 Subject: [PATCH 1/7] Explicitly set request_body OAuth2 auth scheme --- lib/omniauth/strategies/vkontakte.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/omniauth/strategies/vkontakte.rb b/lib/omniauth/strategies/vkontakte.rb index c5717f1..5583748 100644 --- a/lib/omniauth/strategies/vkontakte.rb +++ b/lib/omniauth/strategies/vkontakte.rb @@ -21,10 +21,12 @@ class NoRawData < StandardError; end option :name, 'vkontakte' - option :client_options, - site: 'https://api.vk.com/', - token_url: 'https://oauth.vk.com/access_token', - authorize_url: 'https://oauth.vk.com/authorize' + option :client_options, { + site: 'https://api.vk.com/', + token_url: 'https://oauth.vk.com/access_token', + authorize_url: 'https://oauth.vk.com/authorize', + auth_scheme: :request_body + } option :authorize_options, %i[scope display] From 1a25c92c5817226df140e888e24cc9cbf847312f Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:34:55 +0200 Subject: [PATCH 2/7] add Ruby 3.2 and remove 2.6 --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d6ac5db..2105afc 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -7,7 +7,7 @@ jobs: name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [2.6, 2.7, 3.0, 3.1, head, jruby, jruby-head] + ruby: [2.7, 3.0, 3.1, 3.2, head, jruby, jruby-head] os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: From 3c373d51ead47469348de5c98e921b1e9a1c25cd Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:36:06 +0200 Subject: [PATCH 3/7] Remove unnecessary require statement --- examples/main.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/main.rb b/examples/main.rb index 771d8cb..714baf1 100644 --- a/examples/main.rb +++ b/examples/main.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'pp' require 'sinatra' require 'omniauth' require 'omniauth-vkontakte' From 3bc867119c1d7eedca6ff3d922112e4a4e36d3fc Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:37:33 +0200 Subject: [PATCH 4/7] require Ruby >= 2.7.0 --- .rubocop.yml | 4 ++-- omniauth-vkontakte.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 70d993f..3307589 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ AllCops: NewCops: enable - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 Layout/LineLength: Max: 120 Metrics/MethodLength: @@ -8,7 +8,7 @@ Metrics/MethodLength: Metrics/BlockLength: Enabled: false Metrics/ClassLength: - Max: 101 + Enabled: false Lint/DuplicateBranch: Enabled: false Naming/FileName: diff --git a/omniauth-vkontakte.gemspec b/omniauth-vkontakte.gemspec index e2545cf..d8dbc86 100644 --- a/omniauth-vkontakte.gemspec +++ b/omniauth-vkontakte.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |gem| gem.name = 'omniauth-vkontakte' gem.require_paths = ['lib'] gem.version = OmniAuth::Vkontakte::VERSION - gem.required_ruby_version = '>= 2.6.0' + gem.required_ruby_version = '>= 2.7.0' gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.8.0' gem.metadata['rubygems_mfa_required'] = 'true' end From 38e7fb69b9419e02228d8ea74025bb4dc7033c06 Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:40:18 +0200 Subject: [PATCH 5/7] add specs --- spec/omniauth/strategies/vkontakte_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/omniauth/strategies/vkontakte_spec.rb b/spec/omniauth/strategies/vkontakte_spec.rb index e014bd2..807a4d8 100644 --- a/spec/omniauth/strategies/vkontakte_spec.rb +++ b/spec/omniauth/strategies/vkontakte_spec.rb @@ -43,6 +43,10 @@ it 'should have correct token url' do expect(subject.options.client_options.token_url).to eq('https://oauth.vk.com/access_token') end + + it 'should have correct auth_scheme' do + expect(subject.options.client_options.auth_scheme).to eq(:request_body) + end end describe 'info' do From de00c30e40d9f45607d60371bcf02aed24818919 Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:41:03 +0200 Subject: [PATCH 6/7] 2023 --- LICENSE | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 8706f86..65d92a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2011-2022 Anton Maminov +Copyright (c) 2011-2023 Anton Maminov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0bc067b..5142f8b 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Tested with the following Ruby versions: ## License -Copyright: 2011-2022 Anton Maminov (anton.maminov@gmail.com) +Copyright: 2011-2023 Anton Maminov (anton.maminov@gmail.com) This library is distributed under the MIT license. Please see the LICENSE file. From 8bf7425242cfe26efaf155587a58ab7ac958b99f Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Wed, 25 Jan 2023 15:42:14 +0200 Subject: [PATCH 7/7] v1.8.1 --- lib/omniauth/vkontakte/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omniauth/vkontakte/version.rb b/lib/omniauth/vkontakte/version.rb index 42e7fd4..c17c603 100644 --- a/lib/omniauth/vkontakte/version.rb +++ b/lib/omniauth/vkontakte/version.rb @@ -2,6 +2,6 @@ module OmniAuth module Vkontakte - VERSION = '1.8.0' + VERSION = '1.8.1' end end