Skip to content

Commit dba08e5

Browse files
authored
Merge pull request #33 from omniauth/outdated
Bring omniauth-openid up-to-date
2 parents e996549 + d098e70 commit dba08e5

File tree

6 files changed

+133
-111
lines changed

6 files changed

+133
-111
lines changed

.rspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
--color
2-
--format=nested
2+
--format progress

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
bundler_args: --without development
2+
before_install:
3+
- gem update --system
4+
- gem update bundler
5+
cache: bundler
6+
env:
7+
global:
8+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
9+
language: ruby
10+
rvm:
11+
- jruby-9000
12+
- 2.2.9
13+
- 2.3.6
14+
- 2.4.3
15+
- 2.5.0
16+
- jruby-head
17+
- ruby-head
18+
matrix:
19+
allow_failures:
20+
- rvm: jruby-head
21+
- rvm: ruby-head
22+
fast_finish: true
23+
sudo: false

Gemfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
source 'http://rubygems.org'
22

3+
gem 'rake', '~> 12.0'
4+
35
platforms :jruby do
4-
gem 'jruby-openssl', '~> 0.7'
6+
gem 'jruby-openssl', '~> 0.9'
57
end
68

79
gem 'ruby-openid', '2.1.8', :git => 'git://github.com/mbleigh/ruby-openid.git'
810

911
gemspec
1012

1113
group :development, :test do
12-
gem 'guard'
13-
gem 'guard-rspec'
14-
gem 'growl'
15-
gem 'rb-fsevent'
14+
gem 'rack-test'
15+
gem 'rspec', '>= 3.0'
16+
gem 'simplecov', '>= 0.9'
17+
gem 'webmock', '~> 3.0'
18+
gem 'yard', '>= 0.9.11'
1619
end
1720

1821
group :example do

Gemfile.lock

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,81 @@ GIT
77
PATH
88
remote: .
99
specs:
10-
omniauth-openid (1.0.0.beta1)
11-
omniauth (~> 1.0.0.beta1)
12-
rack-openid (~> 1.3.1)
10+
omniauth-openid (1.0.1)
11+
omniauth (~> 1.0)
12+
rack-openid (~> 1.4.0)
1313

1414
GEM
1515
remote: http://rubygems.org/
1616
specs:
17-
addressable (2.2.6)
18-
crack (0.3.1)
19-
diff-lcs (1.1.3)
20-
growl (1.0.3)
21-
guard (0.8.7)
22-
thor (~> 0.14.6)
23-
guard-rspec (0.5.0)
24-
guard (>= 0.8.4)
25-
hashie (1.2.0)
26-
multi_json (1.0.3)
27-
omniauth (1.0.0.pr2)
28-
hashie
29-
rack
30-
rack (1.3.5)
31-
rack-openid (1.3.1)
17+
addressable (2.5.2)
18+
public_suffix (>= 2.0.2, < 4.0)
19+
crack (0.4.3)
20+
safe_yaml (~> 1.0.0)
21+
diff-lcs (1.3)
22+
docile (1.1.5)
23+
hashdiff (0.3.7)
24+
hashie (3.5.7)
25+
json (2.1.0)
26+
mustermann (1.0.1)
27+
omniauth (1.8.1)
28+
hashie (>= 3.4.6, < 3.6.0)
29+
rack (>= 1.6.2, < 3)
30+
public_suffix (3.0.1)
31+
rack (2.0.3)
32+
rack-openid (1.4.2)
3233
rack (>= 1.1.0)
3334
ruby-openid (>= 2.1.8)
34-
rack-protection (1.1.2)
35+
rack-protection (2.0.0)
3536
rack
36-
rack-test (0.6.1)
37-
rack (>= 1.0)
38-
rake (0.9.2)
39-
rb-fsevent (0.4.3.1)
40-
rdiscount (1.6.8)
41-
rspec (2.7.0)
42-
rspec-core (~> 2.7.0)
43-
rspec-expectations (~> 2.7.0)
44-
rspec-mocks (~> 2.7.0)
45-
rspec-core (2.7.0)
46-
rspec-expectations (2.7.0)
47-
diff-lcs (~> 1.1.2)
48-
rspec-mocks (2.7.0)
49-
simplecov (0.5.4)
50-
multi_json (~> 1.0.3)
51-
simplecov-html (~> 0.5.3)
52-
simplecov-html (0.5.3)
53-
sinatra (1.3.0)
54-
rack (~> 1.3)
55-
rack-protection (~> 1.1)
56-
tilt (~> 1.3)
57-
thor (0.14.6)
58-
tilt (1.3.3)
59-
webmock (1.7.7)
60-
addressable (> 2.2.5, ~> 2.2)
61-
crack (>= 0.1.7)
62-
yard (0.7.2)
37+
rack-test (0.8.2)
38+
rack (>= 1.0, < 3)
39+
rake (12.3.0)
40+
rspec (3.7.0)
41+
rspec-core (~> 3.7.0)
42+
rspec-expectations (~> 3.7.0)
43+
rspec-mocks (~> 3.7.0)
44+
rspec-core (3.7.0)
45+
rspec-support (~> 3.7.0)
46+
rspec-expectations (3.7.0)
47+
diff-lcs (>= 1.2.0, < 2.0)
48+
rspec-support (~> 3.7.0)
49+
rspec-mocks (3.7.0)
50+
diff-lcs (>= 1.2.0, < 2.0)
51+
rspec-support (~> 3.7.0)
52+
rspec-support (3.7.0)
53+
safe_yaml (1.0.4)
54+
simplecov (0.15.1)
55+
docile (~> 1.1.0)
56+
json (>= 1.8, < 3)
57+
simplecov-html (~> 0.10.0)
58+
simplecov-html (0.10.2)
59+
sinatra (2.0.0)
60+
mustermann (~> 1.0)
61+
rack (~> 2.0)
62+
rack-protection (= 2.0.0)
63+
tilt (~> 2.0)
64+
tilt (2.0.8)
65+
webmock (3.1.1)
66+
addressable (>= 2.3.6)
67+
crack (>= 0.3.2)
68+
hashdiff
69+
yard (0.9.12)
6370

6471
PLATFORMS
6572
ruby
6673

6774
DEPENDENCIES
68-
growl
69-
guard
70-
guard-rspec
71-
jruby-openssl (~> 0.7)
75+
jruby-openssl (~> 0.9)
7276
omniauth-openid!
73-
rack-test (~> 0.5)
74-
rake (~> 0.8)
75-
rb-fsevent
76-
rdiscount (~> 1.6)
77-
rspec (~> 2.5)
77+
rack-test
78+
rake (~> 12.0)
79+
rspec (>= 3.0)
7880
ruby-openid (= 2.1.8)!
79-
simplecov (~> 0.4)
81+
simplecov (>= 0.9)
8082
sinatra
81-
webmock (~> 1.7)
82-
yard (~> 0.7)
83+
webmock (~> 3.0)
84+
yard (>= 0.9.11)
85+
86+
BUNDLED WITH
87+
1.15.4

omniauth-openid.gemspec

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22
require File.expand_path('../lib/omniauth-openid/version', __FILE__)
33

44
Gem::Specification.new do |gem|
5-
65
gem.add_dependency 'omniauth', '~> 1.0'
7-
gem.add_dependency 'rack-openid', '~> 1.3.1'
8-
gem.add_development_dependency 'rack-test', '~> 0.5'
9-
gem.add_development_dependency 'rake', '~> 0.8'
10-
gem.add_development_dependency 'rdiscount', '~> 1.6'
11-
gem.add_development_dependency 'rspec', '~> 2.7'
12-
gem.add_development_dependency 'simplecov', '~> 0.4'
13-
gem.add_development_dependency 'webmock', '~> 1.7'
14-
gem.add_development_dependency 'yard', '~> 0.7'
6+
gem.add_dependency 'rack-openid', '~> 1.4.0'
157

16-
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
8+
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober', 'Tom Milewski']
179
gem.description = %q{OpenID strategy for OmniAuth.}
18-
10+
1911
gem.files = `git ls-files`.split("\n")
2012
gem.homepage = 'https://github.com/intridea/omniauth-openid'
2113
gem.name = 'omniauth-openid'

spec/omniauth/strategies/open_id_spec.rb

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def app
77
strat = OmniAuth::Strategies::OpenID
88
Rack::Builder.new {
9-
use Rack::Session::Cookie
9+
use Rack::Session::Cookie, secret: 'foobar'
1010
use strat
1111
run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [nil || env.key?('omniauth.auth').to_s]] }
1212
}.to_app
@@ -22,55 +22,55 @@ def expired_query_string
2222
end
2323

2424
it 'should respond with OK' do
25-
last_response.should be_ok
25+
expect(last_response).to be_ok
2626
end
2727

2828
it 'should respond with HTML' do
29-
last_response.content_type.should == 'text/html'
29+
expect(last_response.content_type).to eq 'text/html'
3030
end
3131

3232
it 'should render an identifier URL input' do
33-
last_response.body.should =~ %r{<input[^>]*openid_url}
33+
expect(last_response.body).to match %r{<input[^>]*openid_url}
3434
end
3535
end
3636

37-
#describe '/auth/open_id with an identifier URL' do
38-
# context 'successful' do
39-
# before do
40-
# @identifier_url = 'http://me.example.org'
41-
# # TODO: change this mock to actually return some sort of OpenID response
42-
# stub_request(:get, @identifier_url)
43-
# get '/auth/open_id?openid_url=' + @identifier_url
44-
# end
45-
#
46-
# it 'should redirect to the OpenID identity URL' do
47-
# last_response.should be_redirect
48-
# last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
49-
# end
50-
#
51-
# it 'should tell the OpenID server to return to the callback URL' do
52-
# return_to = CGI.escape(last_request.url + '/callback')
53-
# last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
54-
# end
55-
# end
56-
#end
37+
# describe '/auth/open_id with an identifier URL' do
38+
# context 'successful' do
39+
# before do
40+
# @identifier_url = 'http://me.example.org'
41+
# # TODO: change this mock to actually return some sort of OpenID response
42+
# stub_request(:get, @identifier_url)
43+
# get '/auth/open_id?openid_url=' + @identifier_url
44+
# end
45+
#
46+
# it 'should redirect to the OpenID identity URL' do
47+
# last_response.should be_redirect
48+
# last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
49+
# end
50+
#
51+
# it 'should tell the OpenID server to return to the callback URL' do
52+
# return_to = CGI.escape(last_request.url + '/callback')
53+
# last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
54+
# end
55+
# end
56+
# end
5757

5858
describe 'followed by /auth/open_id/callback' do
5959
context 'successful' do
60-
#before do
61-
# @identifier_url = 'http://me.example.org'
62-
# # TODO: change this mock to actually return some sort of OpenID response
63-
# stub_request(:get, @identifier_url)
64-
# get '/auth/open_id/callback'
65-
#end
60+
# before do
61+
# @identifier_url = 'http://me.example.org'
62+
# # TODO: change this mock to actually return some sort of OpenID response
63+
# stub_request(:get, @identifier_url)
64+
# get '/auth/open_id/callback'
65+
# end
6666

6767
it "should set provider to open_id"
6868
it "should create auth_hash based on sreg"
6969
it "should create auth_hash based on ax"
7070

71-
#it 'should call through to the master app' do
72-
# last_response.body.should == 'true'
73-
#end
71+
# it 'should call through to the master app' do
72+
# last_response.body.should == 'true'
73+
# end
7474
end
7575

7676
context 'unsuccessful' do
@@ -81,11 +81,10 @@ def expired_query_string
8181

8282
it 'it should redirect to invalid credentials' do
8383
pending
84-
last_response.should be_redirect
85-
last_response.headers['Location'].should =~ %r{invalid_credentials}
84+
expect(last_response).to be_redirect
85+
expect(last_response).to match %r{invalid_credentials}
8686
end
8787
end
8888
end
8989
end
90-
9190
end

0 commit comments

Comments
 (0)