Merge branch 'master' of github.com:intridea/omniauth

This commit is contained in:
James A. Rosen 2010-08-11 08:24:56 -07:00
commit 75c3c8547f
29 changed files with 357 additions and 25 deletions

View File

@ -4,7 +4,7 @@ require 'term/ansicolor'
include Term::ANSIColor
OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-corporate omniauth)
OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise omniauth)
def each_gem(action, &block)
OMNIAUTH_GEMS.each_with_index do |dir, i|

View File

@ -8,7 +8,7 @@ if Object.const_defined?(:Bundler) && Bundler.const_defined?(:Dsl) && self.kind_
gem 'rake'
gem 'mg', '~> 0.0.8'
gem 'rspec', '~> 1.3.0'
gem 'webmock', '~> 1.2.2'
gem 'webmock', '~> 1.3.3'
gem 'rack-test', '~> 0.5.4'
gem 'json', '~> 1.4.3' # multi_json implementation
end
@ -16,7 +16,7 @@ else #gemspec
gem.add_development_dependency 'rake'
gem.add_development_dependency 'mg', '~> 0.0.8'
gem.add_development_dependency 'rspec', '~> 1.3.0'
gem.add_development_dependency 'webmock', '~> 1.2.2'
gem.add_development_dependency 'webmock', '~> 1.3.3'
gem.add_development_dependency 'rack-test', '~> 0.5.4'
gem.add_development_dependency 'json', '~> 1.4.3' # multi_json implementation
end

49
oa-basic/Gemfile.lock Normal file
View File

@ -0,0 +1,49 @@
PATH
remote: .
specs:
oa-basic (0.0.3)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
rest-client (~> 1.6.0)
PATH
remote: /Users/mbleigh/gems/omniauth/oa-core
specs:
oa-core (0.0.3)
rack (~> 1.1)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
json (1.4.3)
mg (0.0.8)
rake
mime-types (1.16)
multi_json (0.0.4)
nokogiri (1.4.3.1)
rack (1.2.1)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rest-client (1.6.0)
mime-types (>= 1.16)
rspec (1.3.0)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-basic!
oa-core!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
webmock (~> 1.3.3)

View File

@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', version
gem.add_dependency 'rest-client', '~> 1.5.1'
gem.add_dependency 'rest-client', '~> 1.6.0'
gem.add_dependency 'multi_json', '~> 0.0.2'
gem.add_dependency 'nokogiri', '~> 1.4.2'

34
oa-core/Gemfile.lock Normal file
View File

@ -0,0 +1,34 @@
PATH
remote: .
specs:
oa-core (0.0.3)
rack (~> 1.1)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
json (1.4.3)
mg (0.0.8)
rake
rack (1.2.1)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rspec (1.3.0)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-core!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
webmock (~> 1.3.3)

View File

@ -4,6 +4,6 @@ gem 'oa-core', :path => File.expand_path('../../oa-core/', __FILE__)
# Will automatically pull in this gem and all its
# dependencies specified in the gemspec
gem 'oa-corporate', :path => File.expand_path("..", __FILE__)
gem 'oa-enterprise', :path => File.expand_path("..", __FILE__)
eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))

View File

@ -0,0 +1,43 @@
PATH
remote: /Users/mbleigh/gems/omniauth/oa-core
specs:
oa-core (0.0.3)
rack (~> 1.1)
PATH
remote: .
specs:
oa-enterprise (0.0.3)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
json (1.4.3)
mg (0.0.8)
rake
nokogiri (1.4.3.1)
rack (1.1.0)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rspec (1.3.0)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-core!
oa-enterprise!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
webmock (~> 1.3.3)

View File

@ -1,12 +1,12 @@
= OmniAuth::Corporate
= OmniAuth::Enterprise
OmniAuth strategies for use in your intranet.
== Installation
To get just corporate functionality:
To get just enterprise functionality:
gem install oa-corporate
gem install oa-enterprise
For the full auth suite:
@ -16,7 +16,7 @@ For the full auth suite:
Use the strategy as a middleware in your application:
require 'omniauth/corporate'
require 'omniauth/enterprise'
use OmniAuth::Strategies::CAS, :server => 'http://cas.mycompany.com/cas'
@ -28,7 +28,7 @@ See OmniAuth::Strategies::CAS::Configuration for more configuration options.
If CAS is one of several authentication strategies, use the OmniAuth Builder:
require 'omniauth/corporate'
require 'omniauth/enterprise'
require 'omniauth/oauth' # for Campfire
require 'openid/store/filesystem'

View File

@ -4,7 +4,7 @@ Bundler.setup
require 'rake'
require 'mg'
MG.new('oa-corporate.gemspec')
MG.new('oa-enterprise.gemspec')
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|

View File

@ -1,4 +1,4 @@
require 'omniauth/corporate'
require 'omniauth/enterprise'
module OmniAuth
module Strategies

View File

@ -3,10 +3,10 @@ require 'rubygems'
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "oa-corporate"
gem.name = "oa-enterprise"
gem.version = version
gem.summary = %Q{Corporate strategies for OmniAuth.}
gem.description = %Q{Corporate strategies for OmniAuth.}
gem.summary = %Q{Enterprise strategies for OmniAuth.}
gem.description = %Q{Enterprise strategies for OmniAuth.}
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/intridea/omniauth"
gem.authors = ["James A. Rosen"]

View File

@ -7,7 +7,7 @@ require 'webmock/rspec'
require 'rack/test'
require 'omniauth/core'
require 'omniauth/test'
require 'omniauth/corporate'
require 'omniauth/enterprise'
Spec::Runner.configure do |config|
config.include WebMock

54
oa-oauth/Gemfile.lock Normal file
View File

@ -0,0 +1,54 @@
PATH
remote: /Users/mbleigh/gems/omniauth/oa-core
specs:
oa-core (0.0.3)
rack (~> 1.1)
PATH
remote: .
specs:
oa-oauth (0.0.3)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
oauth (~> 0.4.0)
oauth2 (~> 0.0.10)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
faraday (0.4.6)
addressable (>= 2.1.1)
rack (>= 1.0.1)
json (1.4.3)
mg (0.0.8)
rake
multi_json (0.0.4)
nokogiri (1.4.3.1)
oauth (0.4.1)
oauth2 (0.0.10)
faraday (~> 0.4.1)
multi_json (>= 0.0.4)
rack (1.2.1)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rspec (1.3.0)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-core!
oa-oauth!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
webmock (~> 1.3.3)

50
oa-openid/Gemfile.lock Normal file
View File

@ -0,0 +1,50 @@
PATH
remote: /Users/mbleigh/gems/omniauth/oa-core
specs:
oa-core (0.0.3)
rack (~> 1.1)
PATH
remote: .
specs:
oa-openid (0.0.3)
oa-core (= 0.0.3)
rack-openid (~> 1.1.1)
ruby-openid-apps-discovery
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
json (1.4.3)
mg (0.0.8)
rake
rack (1.2.1)
rack-openid (1.1.1)
rack (>= 0.4)
ruby-openid (>= 2.0.3)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rspec (1.3.0)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-core!
oa-openid!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
ruby-openid-apps-discovery
webmock (~> 1.3.3)

View File

@ -3,14 +3,13 @@ require 'omniauth/openid'
module OmniAuth
module Strategies
class GoogleApps < OmniAuth::Strategies::OpenID
def initialize(app, domain, store = nil, options = {})
@domain = domain
options[:name] ||= 'apps'
def initialize(app, store = nil, options = {})
options[:name] ||= 'google_apps'
super(app, store, options)
end
def identifier
@domain
options[:domain] || request['domain']
end
end
end

View File

@ -7,6 +7,8 @@ module OmniAuth
class OpenID
include OmniAuth::Strategy
attr_accessor :options
# Should be 'openid_url'
# @see http://github.com/intridea/omniauth/issues/issue/13
IDENTIFIER_URL_PARAMETER = 'identifier'
@ -26,8 +28,8 @@ module OmniAuth
def initialize(app, store = nil, options = {})
super(app, options[:name] || :open_id)
@options = options
@options[:required] ||= [AX[:email], AX[:name], 'email', 'fullname']
@options[:optional] ||= [AX[:first_name], AX[:last_name], AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']
@options[:required] ||= [AX[:email], AX[:first_name], AZ[:last_name], 'email', 'fullname']
@options[:optional] ||= [AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']
@store = store
end

View File

@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', version
gem.add_dependency 'rack-openid', '~> 1.0.3'
gem.add_dependency 'rack-openid', '~> 1.1.1'
gem.add_dependency 'ruby-openid-apps-discovery'
eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))

View File

@ -2,7 +2,7 @@ source "http://rubygems.org"
gem 'oa-core', :path => File.expand_path('../../oa-core/', __FILE__)
gem 'oa-basic', :path => File.expand_path('../../oa-basic/', __FILE__)
gem 'oa-corporate', :path => File.expand_path('../../oa-corporate/', __FILE__)
gem 'oa-enterprise', :path => File.expand_path('../../oa-enterprise/', __FILE__)
gem 'oa-oauth', :path => File.expand_path('../../oa-oauth/', __FILE__)
gem 'oa-openid', :path => File.expand_path('../../oa-openid/', __FILE__)

101
omniauth/Gemfile.lock Normal file
View File

@ -0,0 +1,101 @@
PATH
remote: /Users/mbleigh/gems/omniauth/oa-basic
specs:
oa-basic (0.0.3)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
rest-client (~> 1.6.0)
PATH
remote: /Users/mbleigh/gems/omniauth/oa-core
specs:
oa-core (0.0.3)
rack (~> 1.1)
PATH
remote: /Users/mbleigh/gems/omniauth/oa-enterprise
specs:
oa-enterprise (0.0.3)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
PATH
remote: /Users/mbleigh/gems/omniauth/oa-oauth
specs:
oa-oauth (0.0.3)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.0.3)
oauth (~> 0.4.0)
oauth2 (~> 0.0.10)
PATH
remote: /Users/mbleigh/gems/omniauth/oa-openid
specs:
oa-openid (0.0.3)
oa-core (= 0.0.3)
rack-openid (~> 1.1.1)
ruby-openid-apps-discovery
PATH
remote: .
specs:
omniauth (0.0.3)
oa-basic (= 0.0.3)
oa-core (= 0.0.3)
oa-enterprise (= 0.0.3)
oa-oauth (= 0.0.3)
oa-openid (= 0.0.3)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.0)
crack (0.1.8)
faraday (0.4.6)
addressable (>= 2.1.1)
rack (>= 1.0.1)
json (1.4.3)
mg (0.0.8)
rake
mime-types (1.16)
multi_json (0.0.4)
nokogiri (1.4.3.1)
oauth (0.4.1)
oauth2 (0.0.10)
faraday (~> 0.4.1)
multi_json (>= 0.0.4)
rack (1.2.1)
rack-openid (1.1.1)
rack (>= 0.4)
ruby-openid (>= 2.0.3)
rack-test (0.5.4)
rack (>= 1.0)
rake (0.8.7)
rest-client (1.6.0)
mime-types (>= 1.16)
rspec (1.3.0)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
webmock (1.3.3)
addressable (>= 2.1.1)
crack (>= 0.1.7)
PLATFORMS
ruby
DEPENDENCIES
json (~> 1.4.3)
mg (~> 0.0.8)
oa-basic!
oa-core!
oa-enterprise!
oa-oauth!
oa-openid!
omniauth!
rack-test (~> 0.5.4)
rake
rspec (~> 1.3.0)
webmock (~> 1.3.3)

View File

@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
%w(oa-core oa-oauth oa-basic oa-openid oa-corporate).each do |subgem|
%w(oa-core oa-oauth oa-basic oa-openid oa-enterprise).each do |subgem|
gem.add_dependency subgem, version
end