Skip to content

Commit f7ec7ee

Browse files
authoredJan 14, 2021
chore: Allow OmniAuth 2.0.0
1 parent d978d8e commit f7ec7ee

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed
 

‎lib/omniauth-saml/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 SAML
3-
VERSION = '1.10.3'
3+
VERSION = '2.0.0'
44
end
55
end

‎omniauth-saml.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
1313

1414
gem.required_ruby_version = '>= 2.4'
1515

16-
gem.add_runtime_dependency 'omniauth', '~> 1.3', '>= 1.3.2'
16+
gem.add_runtime_dependency 'omniauth', '~> 2.0'
1717
gem.add_runtime_dependency 'ruby-saml', '~> 1.9'
1818

1919
gem.add_development_dependency 'rake', '>= 12.3.3'

‎spec/omniauth/strategies/saml_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
end
77
end
88

9-
def post_xml(xml=:example_response, opts = {})
9+
def post_xml(xml = :example_response, opts = {})
1010
post "/auth/saml/callback", opts.merge({'SAMLResponse' => load_xml(xml)})
1111
end
1212

@@ -34,10 +34,10 @@ def post_xml(xml=:example_response, opts = {})
3434
end
3535
let(:strategy) { [OmniAuth::Strategies::SAML, saml_options] }
3636

37-
describe 'GET /auth/saml' do
37+
describe 'POST /auth/saml' do
3838
context 'without idp runtime params present' do
3939
before do
40-
get '/auth/saml'
40+
post '/auth/saml'
4141
end
4242

4343
it 'should get authentication page' do
@@ -51,7 +51,7 @@ def post_xml(xml=:example_response, opts = {})
5151

5252
context 'with idp runtime params' do
5353
before do
54-
get '/auth/saml', 'original_param_key' => 'original_param_value', 'mapped_param_key' => 'mapped_param_value'
54+
post '/auth/saml', 'original_param_key' => 'original_param_value', 'mapped_param_key' => 'mapped_param_value'
5555
end
5656

5757
it 'should get authentication page' do
@@ -71,7 +71,7 @@ def post_xml(xml=:example_response, opts = {})
7171

7272
it 'should send the current callback_url as the assertion_consumer_service_url' do
7373
%w(foo.example.com bar.example.com).each do |host|
74-
get "https://#{host}/auth/saml"
74+
post "https://#{host}/auth/saml"
7575

7676
expect(last_response).to be_redirect
7777

@@ -89,7 +89,7 @@ def post_xml(xml=:example_response, opts = {})
8989
end
9090

9191
context 'when authn request signing is requested' do
92-
subject { get '/auth/saml' }
92+
subject { post '/auth/saml' }
9393

9494
let(:private_key) { OpenSSL::PKey::RSA.new 2048 }
9595

@@ -402,10 +402,10 @@ def test_default_relay_state(static_default_relay_state = nil, &block_default_re
402402
end
403403
end
404404

405-
describe 'GET /auth/saml/metadata' do
405+
describe 'POST /auth/saml/metadata' do
406406
before do
407407
saml_options[:issuer] = 'http://example.com/SAML'
408-
get '/auth/saml/metadata'
408+
post '/auth/saml/metadata'
409409
end
410410

411411
it 'should get SP metadata page' do
@@ -424,19 +424,19 @@ def test_default_relay_state(static_default_relay_state = nil, &block_default_re
424424
end
425425

426426
context 'when hitting an unknown route in our sub path' do
427-
before { get '/auth/saml/unknown' }
427+
before { post '/auth/saml/unknown' }
428428

429429
specify { expect(last_response.status).to eql 404 }
430430
end
431431

432432
context 'when hitting a completely unknown route' do
433-
before { get '/unknown' }
433+
before { post '/unknown' }
434434

435435
specify { expect(last_response.status).to eql 404 }
436436
end
437437

438438
context 'when hitting a route that contains a substring match for the strategy name' do
439-
before { get '/auth/saml2/metadata' }
439+
before { post '/auth/saml2/metadata' }
440440

441441
it 'should not set the strategy' do
442442
expect(last_request.env['omniauth.strategy']).to be_nil

‎spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
TEST_LOGGER = Logger.new(StringIO.new)
1717
OneLogin::RubySaml::Logging.logger = TEST_LOGGER
1818
OmniAuth.config.logger = TEST_LOGGER
19+
OmniAuth.config.request_validation_phase = proc {}
1920

2021
RSpec.configure do |config|
2122
config.include Rack::Test::Methods

0 commit comments

Comments
 (0)