Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--color
--format=nested
--format progress
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bundler_args: --without development
before_install:
- gem update --system
- gem update bundler
cache: bundler
env:
global:
- JRUBY_OPTS="$JRUBY_OPTS --debug"
language: ruby
rvm:
- jruby-9000
- 2.2.9
- 2.3.6
- 2.4.3
- 2.5.0
- jruby-head
- ruby-head
matrix:
allow_failures:
- rvm: jruby-head
- rvm: ruby-head
fast_finish: true
sudo: false
13 changes: 8 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
source 'http://rubygems.org'

gem 'rake', '~> 12.0'

platforms :jruby do
gem 'jruby-openssl', '~> 0.7'
gem 'jruby-openssl', '~> 0.9'
end

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

gemspec

group :development, :test do
gem 'guard'
gem 'guard-rspec'
gem 'growl'
gem 'rb-fsevent'
gem 'rack-test'
gem 'rspec', '>= 3.0'
gem 'simplecov', '>= 0.9'
gem 'webmock', '~> 3.0'
gem 'yard', '>= 0.9.11'
end

group :example do
Expand Down
121 changes: 63 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,81 @@ GIT
PATH
remote: .
specs:
omniauth-openid (1.0.0.beta1)
omniauth (~> 1.0.0.beta1)
rack-openid (~> 1.3.1)
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.4.0)

GEM
remote: http://rubygems.org/
specs:
addressable (2.2.6)
crack (0.3.1)
diff-lcs (1.1.3)
growl (1.0.3)
guard (0.8.7)
thor (~> 0.14.6)
guard-rspec (0.5.0)
guard (>= 0.8.4)
hashie (1.2.0)
multi_json (1.0.3)
omniauth (1.0.0.pr2)
hashie
rack
rack (1.3.5)
rack-openid (1.3.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.3)
docile (1.1.5)
hashdiff (0.3.7)
hashie (3.5.7)
json (2.1.0)
mustermann (1.0.1)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
public_suffix (3.0.1)
rack (2.0.3)
rack-openid (1.4.2)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-protection (1.1.2)
rack-protection (2.0.0)
rack
rack-test (0.6.1)
rack (>= 1.0)
rake (0.9.2)
rb-fsevent (0.4.3.1)
rdiscount (1.6.8)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.0)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sinatra (1.3.0)
rack (~> 1.3)
rack-protection (~> 1.1)
tilt (~> 1.3)
thor (0.14.6)
tilt (1.3.3)
webmock (1.7.7)
addressable (> 2.2.5, ~> 2.2)
crack (>= 0.1.7)
yard (0.7.2)
rack-test (0.8.2)
rack (>= 1.0, < 3)
rake (12.3.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.0)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
safe_yaml (1.0.4)
simplecov (0.15.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sinatra (2.0.0)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
tilt (~> 2.0)
tilt (2.0.8)
webmock (3.1.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
yard (0.9.12)

PLATFORMS
ruby

DEPENDENCIES
growl
guard
guard-rspec
jruby-openssl (~> 0.7)
jruby-openssl (~> 0.9)
omniauth-openid!
rack-test (~> 0.5)
rake (~> 0.8)
rb-fsevent
rdiscount (~> 1.6)
rspec (~> 2.5)
rack-test
rake (~> 12.0)
rspec (>= 3.0)
ruby-openid (= 2.1.8)!
simplecov (~> 0.4)
simplecov (>= 0.9)
sinatra
webmock (~> 1.7)
yard (~> 0.7)
webmock (~> 3.0)
yard (>= 0.9.11)

BUNDLED WITH
1.15.4
14 changes: 3 additions & 11 deletions omniauth-openid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
require File.expand_path('../lib/omniauth-openid/version', __FILE__)

Gem::Specification.new do |gem|

gem.add_dependency 'omniauth', '~> 1.0'
gem.add_dependency 'rack-openid', '~> 1.3.1'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rdiscount', '~> 1.6'
gem.add_development_dependency 'rspec', '~> 2.7'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'webmock', '~> 1.7'
gem.add_development_dependency 'yard', '~> 0.7'
gem.add_dependency 'rack-openid', '~> 1.4.0'

gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober', 'Tom Milewski']
gem.description = %q{OpenID strategy for OmniAuth.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
gem.email = ['michael@intridea.com', 'sferik@gmail.com', 'tmilewski@gmail.com']
gem.files = `git ls-files`.split("\n")
gem.homepage = 'https://github.com/intridea/omniauth-openid'
gem.name = 'omniauth-openid'
Expand Down
71 changes: 35 additions & 36 deletions spec/omniauth/strategies/open_id_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def app
strat = OmniAuth::Strategies::OpenID
Rack::Builder.new {
use Rack::Session::Cookie
use Rack::Session::Cookie, secret: 'foobar'
use strat
run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [nil || env.key?('omniauth.auth').to_s]] }
}.to_app
Expand All @@ -22,55 +22,55 @@ def expired_query_string
end

it 'should respond with OK' do
last_response.should be_ok
expect(last_response).to be_ok
end

it 'should respond with HTML' do
last_response.content_type.should == 'text/html'
expect(last_response.content_type).to eq 'text/html'
end

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

#describe '/auth/open_id with an identifier URL' do
# context 'successful' do
# before do
# @identifier_url = 'http://me.example.org'
# # TODO: change this mock to actually return some sort of OpenID response
# stub_request(:get, @identifier_url)
# get '/auth/open_id?openid_url=' + @identifier_url
# end
#
# it 'should redirect to the OpenID identity URL' do
# last_response.should be_redirect
# last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
# end
#
# it 'should tell the OpenID server to return to the callback URL' do
# return_to = CGI.escape(last_request.url + '/callback')
# last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
# end
# end
#end
# describe '/auth/open_id with an identifier URL' do
# context 'successful' do
# before do
# @identifier_url = 'http://me.example.org'
# # TODO: change this mock to actually return some sort of OpenID response
# stub_request(:get, @identifier_url)
# get '/auth/open_id?openid_url=' + @identifier_url
# end
#
# it 'should redirect to the OpenID identity URL' do
# last_response.should be_redirect
# last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
# end
#
# it 'should tell the OpenID server to return to the callback URL' do
# return_to = CGI.escape(last_request.url + '/callback')
# last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
# end
# end
# end

describe 'followed by /auth/open_id/callback' do
context 'successful' do
#before do
# @identifier_url = 'http://me.example.org'
# # TODO: change this mock to actually return some sort of OpenID response
# stub_request(:get, @identifier_url)
# get '/auth/open_id/callback'
#end
# before do
# @identifier_url = 'http://me.example.org'
# # TODO: change this mock to actually return some sort of OpenID response
# stub_request(:get, @identifier_url)
# get '/auth/open_id/callback'
# end

it "should set provider to open_id"
it "should create auth_hash based on sreg"
it "should create auth_hash based on ax"

#it 'should call through to the master app' do
# last_response.body.should == 'true'
#end
# it 'should call through to the master app' do
# last_response.body.should == 'true'
# end
end

context 'unsuccessful' do
Expand All @@ -81,11 +81,10 @@ def expired_query_string

it 'it should redirect to invalid credentials' do
pending
last_response.should be_redirect
last_response.headers['Location'].should =~ %r{invalid_credentials}
expect(last_response).to be_redirect
expect(last_response).to match %r{invalid_credentials}
end
end
end
end

end