Skip to content

Commit

Permalink
Merge branch 'master' of github.com:intridea/omniauth
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bleigh committed May 17, 2011
2 parents 212acb5 + de7af0b commit c34f9dc
Show file tree
Hide file tree
Showing 31 changed files with 321 additions and 82 deletions.
78 changes: 49 additions & 29 deletions .gitignore
@@ -1,36 +1,56 @@
## MAC OS
.DS_Store

/live
.rvmrc

dist/*

## TEXTMATE
!.autotest
!.document
!.gemtest
!.gitignore
!.rspec
!.yardopts
*.gem
*.rbc
*.sw[a-z]
*.tmproj
tmtags

## EMACS
*.tmproject
*.un~
*~
\#*
.*
.DS_Store
.Spotlight-V100
.Trashes
.\#*

## VIM
*.swp

## PROJECT::GENERAL
coverage
rdoc
pkg
tmp
oa-live

## PROJECT::SPECIFIC
*.gem
._*
.bundle
.project
.config
.directory
.elc
.loadpath
.project
.redcar
.rvmrc
.yardoc
doc

/.emacs.desktop
/.emacs.desktop.lock
/live
Desktop.ini
Gemfile.lock
Icon?
InstalledFiles
Session.vim
Thumbs.db
\#*
\#*\#
_yardoc
auto-save-list
coverage
dist/*
doc
doc/
lib/bundler/man
oa-live
pkg
pkg/*
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
tmtags
tramp
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -3,5 +3,7 @@ rvm:
- 1.8.7
- 1.9.1
- 1.9.2
- jruby
- rbx
- ree
- ruby-head
8 changes: 8 additions & 0 deletions Gemfile
@@ -1,5 +1,13 @@
source 'http://rubygems.org'

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

group :development do
gem 'yard', :git => 'https://github.com/lsegal/yard.git'
end

gemspec :path => 'oa-basic'
gemspec :path => 'oa-core'
gemspec :path => 'oa-enterprise'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
@@ -1,4 +1,4 @@
Copyright (c) 2010-2011 Michael Bleigh and Intridea, Inc.
Copyright (c) 2010-2011 Michael Bleigh, Erik Michaels-Ober, and Intridea, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 5 additions & 6 deletions README.markdown → README.md
Expand Up @@ -11,7 +11,6 @@ To install OmniAuth, simply install the gem:

gem install omniauth


## Continuous Integration
[![Build Status](http://travis-ci.org/intridea/omniauth.png)](http://travis-ci.org/intridea/omniauth)

Expand Down Expand Up @@ -43,7 +42,7 @@ OmniAuth currently supports the following external providers:
* Mixi (credit: [kiyoshi](https://github.com/kiyoshi))
* Netflix (credit: [caged](https://github.com/caged))
* Qzone (credit: [quake](https://github.com/quake))
* Rdio (via [brandonweiss](http://github.com/brandonweiss))
* Rdio (via [brandonweiss](https://github.com/brandonweiss))
* Renren (credit: [quake](https://github.com/quake))
* Salesforce (via [CloudSpokes](http://www.cloudspokes.com))
* SmugMug (credit: [pchilton](https://github.com/pchilton))
Expand Down Expand Up @@ -108,12 +107,12 @@ The `user_info` hash will automatically be populated with as much information ab

## Resources

The best place to find more information is the [OmniAuth Wiki](http://github.com/intridea/omniauth/wiki). Some specific information you might be interested in:
The best place to find more information is the [OmniAuth Wiki](https://github.com/intridea/omniauth/wiki). Some specific information you might be interested in:

* [CI Build Status](http://travis-ci.org/#!/intridea/omniauth)
* [Roadmap](http://github.com/intridea/omniauth/wiki/Roadmap)
* [Changelog](http://github.com/intridea/omniauth/wiki/Changelog)
* [Report Issues](http://github.com/intridea/omniauth/issues)
* [Roadmap](https://github.com/intridea/omniauth/wiki/Roadmap)
* [Changelog](https://github.com/intridea/omniauth/wiki/Changelog)
* [Report Issues](https://github.com/intridea/omniauth/issues)
* [Mailing List](http://groups.google.com/group/omniauth)

## OmniAuth Core
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
@@ -1,3 +1,5 @@
#!/usr/bin/env rake

$:.unshift File.expand_path('..', __FILE__)
require 'tasks/all'

Expand Down Expand Up @@ -47,4 +49,3 @@ namespace :doc do
task.files = PROJECTS.map{|project| "#{root}/#{project}/lib/**/*.rb"} + ['README.markdown', 'LICENSE']
end
end

10 changes: 9 additions & 1 deletion oa-basic/Gemfile
@@ -1,3 +1,11 @@
source "http://rubygems.org"
source 'http://rubygems.org'

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

group :development do
gem 'yard', :git => 'https://github.com/lsegal/yard.git'
end

gemspec
3 changes: 1 addition & 2 deletions oa-basic/oa-basic.gemspec
Expand Up @@ -3,15 +3,14 @@ require File.expand_path('../lib/omniauth/version', __FILE__)

Gem::Specification.new do |gem|
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
# gem.add_development_dependency 'yard', '~> 0.7'
gem.add_development_dependency 'ZenTest', '~> 4.5'
gem.name = 'oa-basic'
gem.version = OmniAuth::Version::STRING
Expand Down
6 changes: 5 additions & 1 deletion oa-core/Gemfile
@@ -1,3 +1,7 @@
source "http://rubygems.org"
source 'http://rubygems.org'

group :development do
gem 'yard', :git => 'https://github.com/lsegal/yard.git'
end

gemspec
8 changes: 5 additions & 3 deletions oa-core/lib/omniauth/form.rb
Expand Up @@ -90,13 +90,14 @@ class Form

def initialize(options = {})
options[:title] ||= "Authentication Info Required"
options[:header_info] ||= ""
self.options = options

@html = ""
header(options[:title])
header(options[:title],options[:header_info])
end

def self.build(title=nil, &block)
def self.build(title=nil,&block)
form = OmniAuth::Form.new(title)
form.instance_eval(&block)
end
Expand Down Expand Up @@ -138,13 +139,14 @@ def fieldset(legend, options = {}, &block)
self
end

def header(title)
def header(title,header_info)
@html << <<-HTML
<!DOCTYPE html>
<html>
<head>
<title>#{title}</title>
#{css}
#{header_info}
</head>
<body>
<h1>#{title}</h1>
Expand Down
2 changes: 1 addition & 1 deletion oa-core/lib/omniauth/strategy.rb
Expand Up @@ -95,7 +95,7 @@ def mock_request_call
elsif env['HTTP_REFERER'] && !env['HTTP_REFERER'].match(/#{request_path}$/)
@env['rack.session']['omniauth.origin'] = env['HTTP_REFERER']
end
redirect(callback_path)
redirect(script_name + callback_path)
end

def mock_callback_call
Expand Down
2 changes: 1 addition & 1 deletion oa-core/oa-core.gemspec
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'yard', '~> 0.6'
# gem.add_development_dependency 'yard', '~> 0.7'
gem.add_development_dependency 'ZenTest', '~> 4.5'
gem.name = 'oa-core'
gem.version = OmniAuth::Version::STRING
Expand Down
5 changes: 5 additions & 0 deletions oa-core/spec/omniauth/strategy_spec.rb
Expand Up @@ -258,6 +258,11 @@ def make_env(path = '/auth/test', props = {})
strategy.call(make_env('/AUTH/Test'))[0].should == 302
end

it 'should respect SCRIPT_NAME (a.k.a. BaseURI)' do
response = strategy.call(make_env('/auth/test', 'SCRIPT_NAME' => '/sub_uri'))
response[1]['Location'].should == '/sub_uri/auth/test/callback'
end

it 'should be case insensitive on callback path' do
strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).should == strategy.call(make_env('/auth/test/callback'))
end
Expand Down
10 changes: 9 additions & 1 deletion oa-enterprise/Gemfile
@@ -1,3 +1,11 @@
source "http://rubygems.org"
source 'http://rubygems.org'

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

group :development do
gem 'yard', :git => 'https://github.com/lsegal/yard.git'
end

gemspec
Expand Up @@ -38,14 +38,21 @@ def user_info
# returns nil if given nil
def parse_user_info(node)
return nil if node.nil?
node.children.inject({}) do |hash, child|
unless child.kind_of?(Nokogiri::XML::Text) ||
child.name == 'cas:proxies' ||
child.name == 'proxies'
hash[child.name.sub(/^cas:/, '')] = child.content
hash = {}
node.children.each do |e|
unless e.kind_of?(Nokogiri::XML::Text) ||
e.name == 'cas:proxies' ||
e.name == 'proxies'
# There are no child elements
if e.element_children.count == 0
hash[e.name.sub(/^cas:/, '')] = e.content
elsif e.element_children.count
hash[e.name.sub(/^cas:/, '')] = [] if hash[e.name.sub(/^cas:/, '')].nil?
hash[e.name.sub(/^cas:/, '')].push parse_user_info e
end
end
hash
end
hash
end

# finds an `<cas:authenticationSuccess>` node in
Expand Down
5 changes: 2 additions & 3 deletions oa-enterprise/oa-enterprise.gemspec
Expand Up @@ -2,8 +2,7 @@
require File.expand_path('../lib/omniauth/version', __FILE__)

Gem::Specification.new do |gem|
gem.add_runtime_dependency 'addressable', '2.2.4'
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
gem.add_runtime_dependency 'addressable', '~> 2.2.6'
gem.add_runtime_dependency 'nokogiri', '~> 1.4.2'
gem.add_runtime_dependency 'net-ldap', '~> 0.2.2'
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
Expand All @@ -15,7 +14,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
# gem.add_development_dependency 'yard', '~> 0.7'
gem.add_development_dependency 'ZenTest', '~> 4.5'
gem.name = 'oa-enterprise'
gem.version = OmniAuth::Version::STRING
Expand Down
10 changes: 9 additions & 1 deletion oa-more/Gemfile
@@ -1,3 +1,11 @@
source "http://rubygems.org"
source 'http://rubygems.org'

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

group :development do
gem 'yard', :git => 'https://github.com/lsegal/yard.git'
end

gemspec
1 change: 1 addition & 0 deletions oa-more/lib/omniauth/more.rb
Expand Up @@ -5,5 +5,6 @@ module Strategies
autoload :WindowsLive, 'omniauth/strategies/windows_live'
autoload :Flickr, 'omniauth/strategies/flickr'
autoload :Yupoo, 'omniauth/strategies/yupoo'
autoload :Ign, 'omniauth/strategies/ign'
end
end

0 comments on commit c34f9dc

Please sign in to comment.