Skip to content

Commit ee63077

Browse files
authored
Merge pull request #109 from omniauth/fix-rest-api-vulnerability
Bring `omniauth-oauth2` up-to-date
2 parents 464fcef + 292a34b commit ee63077

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

.rubocop.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Layout/AccessModifierIndentation:
2+
EnforcedStyle: outdent
3+
4+
Layout/SpaceInsideHashLiteralBraces:
5+
EnforcedStyle: no_space
6+
17
Metrics/BlockNesting:
28
Max: 2
39

@@ -13,9 +19,6 @@ Metrics/ParameterLists:
1319
Max: 4
1420
CountKeywordArgs: true
1521

16-
Style/AccessModifierIndentation:
17-
EnforcedStyle: outdent
18-
1922
Style/CollectionMethods:
2023
PreferredMethods:
2124
map: 'collect'
@@ -32,11 +35,11 @@ Style/DoubleNegation:
3235
Style/HashSyntax:
3336
EnforcedStyle: hash_rockets
3437

35-
Style/SpaceInsideHashLiteralBraces:
36-
EnforcedStyle: no_space
38+
Style/StderrPuts:
39+
Enabled: false
3740

3841
Style/StringLiterals:
3942
EnforcedStyle: double_quotes
4043

41-
Style/TrailingComma:
44+
Style/TrailingCommaInLiteral:
4245
EnforcedStyleForMultiline: 'comma'

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ env:
44
- JRUBY_OPTS="$JRUBY_OPTS --debug"
55
language: ruby
66
rvm:
7-
- 1.8.7
8-
- 1.9.3
9-
- 2.0.0
10-
- 2.1
11-
- 2.2
12-
- jruby-18mode
13-
- jruby-19mode
7+
- jruby-9000
8+
- 2.1.10 # EOL Soon
9+
- 2.2.6
10+
- 2.3.3
11+
- 2.4.0
1412
- jruby-head
15-
- rbx-2
1613
- ruby-head
1714
matrix:
1815
allow_failures:

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ gem "rake"
44

55
group :test do
66
gem "coveralls"
7-
gem "json", :platforms => [:jruby, :ruby_18, :ruby_19]
8-
gem "mime-types", "~> 1.25", :platforms => [:jruby, :ruby_18]
7+
gem "json", :platforms => %i[jruby ruby_18 ruby_19]
8+
gem "mime-types", "~> 1.25", :platforms => %i[jruby ruby_18]
99
gem "rack-test"
10-
gem "rest-client", "~> 1.6.0", :platforms => [:jruby, :ruby_18]
10+
gem "rest-client", "~> 1.7.3", :platforms => %i[jruby ruby_18]
1111
gem "rspec", "~> 3.2"
12-
gem "rubocop", ">= 0.30", :platforms => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
12+
gem "rubocop", ">= 0.51", :platforms => %i[ruby_19 ruby_20 ruby_21 ruby_22]
1313
gem "simplecov", ">= 0.9"
1414
gem "webmock"
1515
end

Rakefile

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ rescue LoadError
1515
end
1616
end
1717

18-
task :default => [:spec, :rubocop]
18+
task :default => %i[spec rubocop]

lib/omniauth-oauth2/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module OmniAuth
22
module OAuth2
3-
VERSION = "1.4.0"
3+
VERSION = "1.4.0".freeze
44
end
55
end

lib/omniauth/strategies/oauth2.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.inherited(subclass)
1818
OmniAuth::Strategy.included(subclass)
1919
end
2020

21-
args [:client_id, :client_secret]
21+
args %i[client_id client_secret]
2222

2323
option :client_id, nil
2424
option :client_secret, nil
@@ -38,9 +38,9 @@ def client
3838

3939
credentials do
4040
hash = {"token" => access_token.token}
41-
hash.merge!("refresh_token" => access_token.refresh_token) if access_token.expires? && access_token.refresh_token
42-
hash.merge!("expires_at" => access_token.expires_at) if access_token.expires?
43-
hash.merge!("expires" => access_token.expires?)
41+
hash["refresh_token"] = access_token.refresh_token if access_token.expires? && access_token.refresh_token
42+
hash["expires_at"] = access_token.expires_at if access_token.expires?
43+
hash["expires"] = access_token.expires?
4444
hash
4545
end
4646

omniauth-oauth2.gemspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ Gem::Specification.new do |gem|
88

99
gem.add_development_dependency "bundler", "~> 1.0"
1010

11-
gem.authors = ["Michael Bleigh", "Erik Michaels-Ober"]
12-
11+
gem.authors = ["Michael Bleigh", "Erik Michaels-Ober", "Tom Milewski"]
12+
1313
gem.description = "An abstract OAuth2 strategy for OmniAuth."
1414
gem.summary = gem.description
15-
gem.homepage = "https://github.com/intridea/omniauth-oauth2"
16-
gem.licenses = %w(MIT)
15+
gem.homepage = "https://github.com/omniauth/omniauth-oauth2"
16+
gem.licenses = %w[MIT]
1717

1818
gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
1919
gem.files = `git ls-files`.split("\n")
2020
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
2121
gem.name = "omniauth-oauth2"
22-
gem.require_paths = %w(lib)
22+
gem.require_paths = %w[lib]
2323
gem.version = OmniAuth::OAuth2::VERSION
2424
end

spec/omniauth/strategies/oauth2_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "helper"
22

3-
describe OmniAuth::Strategies::OAuth2 do
3+
describe OmniAuth::Strategies::OAuth2 do # rubocop:disable Metrics/BlockLength
44
def app
55
lambda do |_env|
66
[200, {}, ["Hello."]]
@@ -49,7 +49,7 @@ def app
4949
end
5050

5151
it "includes top-level options that are marked as :authorize_options" do
52-
instance = subject.new("abc", "def", :authorize_options => [:scope, :foo, :state], :scope => "bar", :foo => "baz")
52+
instance = subject.new("abc", "def", :authorize_options => %i[scope foo state], :scope => "bar", :foo => "baz")
5353
expect(instance.authorize_params["scope"]).to eq("bar")
5454
expect(instance.authorize_params["foo"]).to eq("baz")
5555
end
@@ -70,7 +70,7 @@ def app
7070
end
7171

7272
it "includes top-level options that are marked as :authorize_options" do
73-
instance = subject.new("abc", "def", :token_options => [:scope, :foo], :scope => "bar", :foo => "baz")
73+
instance = subject.new("abc", "def", :token_options => %i[scope foo], :scope => "bar", :foo => "baz")
7474
expect(instance.token_params).to eq("scope" => "bar", "foo" => "baz")
7575
end
7676
end

0 commit comments

Comments
 (0)