omniauth 0.2.6 → 0.3.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of omniauth might be problematic. Click here for more details.
- data/README.md +62 -34
- data/lib/omniauth/version.rb +3 -3
- metadata +74 -228
- data/Gemfile +0 -12
- data/Rakefile +0 -51
- data/oa-basic/Gemfile +0 -7
- data/oa-basic/LICENSE +0 -19
- data/oa-basic/README.rdoc +0 -34
- data/oa-basic/Rakefile +0 -6
- data/oa-basic/lib/oa-basic.rb +0 -1
- data/oa-basic/lib/omniauth/basic.rb +0 -8
- data/oa-basic/lib/omniauth/strategies/http_basic.rb +0 -56
- data/oa-basic/lib/omniauth/version.rb +0 -19
- data/oa-basic/oa-basic.gemspec +0 -27
- data/oa-basic/spec/omniauth/strategies/basic_spec.rb +0 -7
- data/oa-basic/spec/spec_helper.rb +0 -11
- data/oa-core/Gemfile +0 -3
- data/oa-core/LICENSE +0 -19
- data/oa-core/Rakefile +0 -6
- data/oa-core/autotest/discover.rb +0 -1
- data/oa-core/lib/oa-core.rb +0 -1
- data/oa-core/lib/omniauth/builder.rb +0 -33
- data/oa-core/lib/omniauth/core.rb +0 -135
- data/oa-core/lib/omniauth/form.rb +0 -186
- data/oa-core/lib/omniauth/strategy.rb +0 -227
- data/oa-core/lib/omniauth/test.rb +0 -12
- data/oa-core/lib/omniauth/test/phony_session.rb +0 -8
- data/oa-core/lib/omniauth/test/strategy_macros.rb +0 -34
- data/oa-core/lib/omniauth/test/strategy_test_case.rb +0 -49
- data/oa-core/lib/omniauth/version.rb +0 -19
- data/oa-core/oa-core.gemspec +0 -24
- data/oa-core/spec/omniauth/builder_spec.rb +0 -20
- data/oa-core/spec/omniauth/core_spec.rb +0 -79
- data/oa-core/spec/omniauth/strategy_spec.rb +0 -363
- data/oa-core/spec/spec_helper.rb +0 -12
- data/oa-enterprise/Gemfile +0 -7
- data/oa-enterprise/LICENSE +0 -19
- data/oa-enterprise/README.rdoc +0 -82
- data/oa-enterprise/Rakefile +0 -6
- data/oa-enterprise/lib/oa-enterprise.rb +0 -1
- data/oa-enterprise/lib/omniauth/enterprise.rb +0 -8
- data/oa-enterprise/lib/omniauth/strategies/cas.rb +0 -47
- data/oa-enterprise/lib/omniauth/strategies/cas/configuration.rb +0 -98
- data/oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb +0 -91
- data/oa-enterprise/lib/omniauth/strategies/ldap.rb +0 -111
- data/oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb +0 -279
- data/oa-enterprise/lib/omniauth/version.rb +0 -19
- data/oa-enterprise/oa-enterprise.gemspec +0 -31
- data/oa-enterprise/spec/fixtures/cas_failure.xml +0 -4
- data/oa-enterprise/spec/fixtures/cas_success.xml +0 -8
- data/oa-enterprise/spec/omniauth/strategies/cas_spec.rb +0 -94
- data/oa-enterprise/spec/omniauth/strategies/ldap_spec.rb +0 -41
- data/oa-enterprise/spec/spec_helper.rb +0 -14
- data/oa-more/Gemfile +0 -7
- data/oa-more/LICENSE +0 -19
- data/oa-more/README.rdoc +0 -22
- data/oa-more/Rakefile +0 -6
- data/oa-more/lib/oa-more.rb +0 -1
- data/oa-more/lib/omniauth/more.rb +0 -11
- data/oa-more/lib/omniauth/strategies/draugiem.rb +0 -104
- data/oa-more/lib/omniauth/strategies/flickr.rb +0 -86
- data/oa-more/lib/omniauth/strategies/ign.rb +0 -93
- data/oa-more/lib/omniauth/strategies/windows_live.rb +0 -39
- data/oa-more/lib/omniauth/strategies/windows_live/windowslivelogin.rb +0 -1143
- data/oa-more/lib/omniauth/strategies/yupoo.rb +0 -67
- data/oa-more/lib/omniauth/version.rb +0 -19
- data/oa-more/oa-more.gemspec +0 -29
- data/oa-more/spec/omniauth/strategies/draugiem_spec.rb +0 -51
- data/oa-more/spec/omniauth/strategies/flickr_spec.rb +0 -7
- data/oa-more/spec/spec_helper.rb +0 -11
- data/oa-oauth/Gemfile +0 -7
- data/oa-oauth/LICENSE +0 -19
- data/oa-oauth/README.rdoc +0 -35
- data/oa-oauth/Rakefile +0 -6
- data/oa-oauth/autotest/discover.rb +0 -1
- data/oa-oauth/lib/oa-oauth.rb +0 -1
- data/oa-oauth/lib/omniauth/oauth.rb +0 -56
- data/oa-oauth/lib/omniauth/strategies/bitly.rb +0 -46
- data/oa-oauth/lib/omniauth/strategies/dailymile.rb +0 -64
- data/oa-oauth/lib/omniauth/strategies/doit.rb +0 -60
- data/oa-oauth/lib/omniauth/strategies/dopplr.rb +0 -53
- data/oa-oauth/lib/omniauth/strategies/douban.rb +0 -60
- data/oa-oauth/lib/omniauth/strategies/evernote.rb +0 -54
- data/oa-oauth/lib/omniauth/strategies/facebook.rb +0 -70
- data/oa-oauth/lib/omniauth/strategies/foursquare.rb +0 -62
- data/oa-oauth/lib/omniauth/strategies/github.rb +0 -50
- data/oa-oauth/lib/omniauth/strategies/goodreads.rb +0 -44
- data/oa-oauth/lib/omniauth/strategies/google.rb +0 -80
- data/oa-oauth/lib/omniauth/strategies/gowalla.rb +0 -72
- data/oa-oauth/lib/omniauth/strategies/hyves.rb +0 -67
- data/oa-oauth/lib/omniauth/strategies/identica.rb +0 -49
- data/oa-oauth/lib/omniauth/strategies/instagram.rb +0 -56
- data/oa-oauth/lib/omniauth/strategies/instapaper.rb +0 -40
- data/oa-oauth/lib/omniauth/strategies/linked_in.rb +0 -56
- data/oa-oauth/lib/omniauth/strategies/mailru.rb +0 -107
- data/oa-oauth/lib/omniauth/strategies/meetup.rb +0 -56
- data/oa-oauth/lib/omniauth/strategies/miso.rb +0 -41
- data/oa-oauth/lib/omniauth/strategies/mixi.rb +0 -59
- data/oa-oauth/lib/omniauth/strategies/netflix.rb +0 -65
- data/oa-oauth/lib/omniauth/strategies/oauth.rb +0 -83
- data/oa-oauth/lib/omniauth/strategies/oauth2.rb +0 -91
- data/oa-oauth/lib/omniauth/strategies/plurk.rb +0 -58
- data/oa-oauth/lib/omniauth/strategies/qzone.rb +0 -69
- data/oa-oauth/lib/omniauth/strategies/rdio.rb +0 -45
- data/oa-oauth/lib/omniauth/strategies/renren.rb +0 -87
- data/oa-oauth/lib/omniauth/strategies/salesforce.rb +0 -44
- data/oa-oauth/lib/omniauth/strategies/smug_mug.rb +0 -42
- data/oa-oauth/lib/omniauth/strategies/sound_cloud.rb +0 -46
- data/oa-oauth/lib/omniauth/strategies/t163.rb +0 -57
- data/oa-oauth/lib/omniauth/strategies/taobao.rb +0 -79
- data/oa-oauth/lib/omniauth/strategies/teambox.rb +0 -49
- data/oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb +0 -41
- data/oa-oauth/lib/omniauth/strategies/tqq.rb +0 -64
- data/oa-oauth/lib/omniauth/strategies/trade_me.rb +0 -45
- data/oa-oauth/lib/omniauth/strategies/trip_it.rb +0 -22
- data/oa-oauth/lib/omniauth/strategies/tsina.rb +0 -79
- data/oa-oauth/lib/omniauth/strategies/tsohu.rb +0 -57
- data/oa-oauth/lib/omniauth/strategies/tumblr.rb +0 -60
- data/oa-oauth/lib/omniauth/strategies/twitter.rb +0 -57
- data/oa-oauth/lib/omniauth/strategies/type_pad.rb +0 -76
- data/oa-oauth/lib/omniauth/strategies/vimeo.rb +0 -54
- data/oa-oauth/lib/omniauth/strategies/vkontakte.rb +0 -87
- data/oa-oauth/lib/omniauth/strategies/xauth.rb +0 -67
- data/oa-oauth/lib/omniauth/strategies/yahoo.rb +0 -55
- data/oa-oauth/lib/omniauth/strategies/yammer.rb +0 -43
- data/oa-oauth/lib/omniauth/strategies/you_tube.rb +0 -73
- data/oa-oauth/lib/omniauth/version.rb +0 -19
- data/oa-oauth/oa-oauth.gemspec +0 -32
- data/oa-oauth/spec/fixtures/basecamp_200.xml +0 -24
- data/oa-oauth/spec/fixtures/campfire_200.json +0 -10
- data/oa-oauth/spec/omniauth/strategies/bitly_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/dailymile_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/doit_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/dopplr_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/douban_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/evernote_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/facebook_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/foursquare_spec.rb +0 -18
- data/oa-oauth/spec/omniauth/strategies/github_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/goodreads_spec.rb +0 -6
- data/oa-oauth/spec/omniauth/strategies/google_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/gowalla_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/hyves_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/identica_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/linked_in_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/mailru_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/meetup_spec.rb +0 -14
- data/oa-oauth/spec/omniauth/strategies/miso_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/netflix_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/oauth2_spec.rb +0 -0
- data/oa-oauth/spec/omniauth/strategies/oauth_spec.rb +0 -77
- data/oa-oauth/spec/omniauth/strategies/plurk_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/rdio_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/salesforce_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/smug_mug_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/sound_cloud_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/t163_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/taobao_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/teambox_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/thirty_seven_signals_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/trade_me_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/trip_it_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/tsina_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/tumblr_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/twitter_spec.rb +0 -20
- data/oa-oauth/spec/omniauth/strategies/type_pad_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/vimeo_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/vkontakte_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/yahoo_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/yammer_spec.rb +0 -5
- data/oa-oauth/spec/omniauth/strategies/you_tube_spec.rb +0 -5
- data/oa-oauth/spec/spec_helper.rb +0 -27
- data/oa-oauth/spec/support/shared_examples.rb +0 -29
- data/oa-openid/Gemfile +0 -7
- data/oa-openid/LICENSE +0 -19
- data/oa-openid/README.rdoc +0 -51
- data/oa-openid/Rakefile +0 -6
- data/oa-openid/lib/oa-openid.rb +0 -1
- data/oa-openid/lib/omniauth/openid.rb +0 -60
- data/oa-openid/lib/omniauth/openid/gapps.rb +0 -32
- data/oa-openid/lib/omniauth/strategies/google_apps.rb +0 -23
- data/oa-openid/lib/omniauth/strategies/open_id.rb +0 -132
- data/oa-openid/lib/omniauth/strategies/steam.rb +0 -55
- data/oa-openid/lib/omniauth/version.rb +0 -19
- data/oa-openid/oa-openid.gemspec +0 -28
- data/oa-openid/spec/omniauth/strategies/open_id_spec.rb +0 -71
- data/oa-openid/spec/spec_helper.rb +0 -14
- data/omniauth.gemspec +0 -20
- data/tasks/all.rb +0 -134
data/Gemfile
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
platforms :jruby do
|
4
|
-
gem 'jruby-openssl', '~> 0.7'
|
5
|
-
end
|
6
|
-
|
7
|
-
gemspec :path => 'oa-basic'
|
8
|
-
gemspec :path => 'oa-core'
|
9
|
-
gemspec :path => 'oa-enterprise'
|
10
|
-
gemspec :path => 'oa-more'
|
11
|
-
gemspec :path => 'oa-oauth'
|
12
|
-
gemspec :path => 'oa-openid'
|
data/Rakefile
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
|
3
|
-
$:.unshift File.expand_path('..', __FILE__)
|
4
|
-
require 'tasks/all'
|
5
|
-
|
6
|
-
desc 'Clean up temporary files'
|
7
|
-
task :clean => 'all:clean'
|
8
|
-
|
9
|
-
desc 'Build gem files for all projects into the package directory'
|
10
|
-
task :build => 'all:build'
|
11
|
-
|
12
|
-
desc 'Build and install gems for all projects'
|
13
|
-
task :install => 'all:install'
|
14
|
-
|
15
|
-
desc 'Write version with MAJOR, MINOR, PATCH, and PRE environment variables'
|
16
|
-
task 'version:write' => 'all:version:write'
|
17
|
-
|
18
|
-
desc 'Display the current version for all projects'
|
19
|
-
task :version => 'all:version'
|
20
|
-
desc 'Increment the major version for all projects'
|
21
|
-
task 'version:bump:major' => 'all:version:bump:major'
|
22
|
-
desc 'Increment the minor version for all projects'
|
23
|
-
task 'version:bump:minor' => 'all:version:bump:minor'
|
24
|
-
desc 'Increment the patch version for all projects'
|
25
|
-
task 'version:bump:patch' => 'all:version:bump:patch'
|
26
|
-
|
27
|
-
desc 'Run specs for all projects'
|
28
|
-
task :spec => 'all:spec'
|
29
|
-
task :test => :spec
|
30
|
-
task :default => :test
|
31
|
-
|
32
|
-
desc 'Generate docs for all projects'
|
33
|
-
task 'doc:yard' => 'all:doc:yard'
|
34
|
-
|
35
|
-
task :tag do
|
36
|
-
sh "git tag -a -m \"Version #{version}\" v#{version}"
|
37
|
-
sh "git push"
|
38
|
-
sh "git push --tags"
|
39
|
-
end
|
40
|
-
|
41
|
-
task :push => 'all:push'
|
42
|
-
|
43
|
-
desc 'Build, tag, and push gems for all projects to Rubygems'
|
44
|
-
task :release => [:build, :tag, :push]
|
45
|
-
|
46
|
-
namespace :doc do
|
47
|
-
require 'yard'
|
48
|
-
YARD::Rake::YardocTask.new do |task|
|
49
|
-
task.files = PROJECTS.map{|project| "#{root}/#{project}/lib/**/*.rb"} + ['README.markdown', 'LICENSE']
|
50
|
-
end
|
51
|
-
end
|
data/oa-basic/Gemfile
DELETED
data/oa-basic/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (c) 2010-2011 Michael Bleigh and Intridea, Inc.
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|
data/oa-basic/README.rdoc
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
= OmniAuth::Basic
|
2
|
-
|
3
|
-
OmniAuth stratgies for APIs that have HTTP Basic authentication (such as Campfire and Basecamp).
|
4
|
-
|
5
|
-
== Installation
|
6
|
-
|
7
|
-
To get just HTTP Basic functionality:
|
8
|
-
|
9
|
-
gem install oa-basic
|
10
|
-
|
11
|
-
For the full auth suite:
|
12
|
-
|
13
|
-
gem install omniauth
|
14
|
-
|
15
|
-
== Stand-Alone Example
|
16
|
-
|
17
|
-
Use the strategy as a middleware in your application:
|
18
|
-
|
19
|
-
require 'omniauth/basic'
|
20
|
-
|
21
|
-
use OmniAuth::Strategies::Campfire
|
22
|
-
|
23
|
-
Then simply direct users to '/auth/campfire' to prompt them for their Campfire credentials. You may also pre-set the credentials by POSTing to the URL with appropriate parameters (in the case of Campfire and Basecamp, the parameters are <tt>subdomain</tt>, <tt>user</tt>, and <tt>password</tt>).
|
24
|
-
|
25
|
-
== OmniAuth Builder
|
26
|
-
|
27
|
-
If you want to allow multiple providers, use the OmniAuth Builder:
|
28
|
-
|
29
|
-
require 'omniauth/basic'
|
30
|
-
|
31
|
-
use OmniAuth::Builder do
|
32
|
-
provider :campfire
|
33
|
-
provider :basecamp
|
34
|
-
end
|
data/oa-basic/Rakefile
DELETED
data/oa-basic/lib/oa-basic.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'omniauth/basic'
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'rest-client'
|
2
|
-
require 'omniauth/basic'
|
3
|
-
|
4
|
-
module OmniAuth
|
5
|
-
module Strategies
|
6
|
-
class HttpBasic
|
7
|
-
include OmniAuth::Strategy
|
8
|
-
|
9
|
-
def initialize(app, name, endpoint = nil, headers = {}, &block)
|
10
|
-
super
|
11
|
-
@endpoint = endpoint
|
12
|
-
@request_headers = headers
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :endpoint, :request_headers
|
16
|
-
|
17
|
-
def request_phase
|
18
|
-
if env['REQUEST_METHOD'] == 'GET'
|
19
|
-
get_credentials
|
20
|
-
else
|
21
|
-
perform
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def title
|
26
|
-
name.split('_').map{|s| s.capitalize}.join(' ')
|
27
|
-
end
|
28
|
-
|
29
|
-
def get_credentials
|
30
|
-
OmniAuth::Form.build(:title => title) do
|
31
|
-
text_field 'Username', 'username'
|
32
|
-
password_field 'Password', 'password'
|
33
|
-
end.to_response
|
34
|
-
end
|
35
|
-
|
36
|
-
def perform
|
37
|
-
@response = perform_authentication(endpoint)
|
38
|
-
@env['omniauth.auth'] = auth_hash
|
39
|
-
@env['REQUEST_METHOD'] = 'GET'
|
40
|
-
@env['PATH_INFO'] = "#{OmniAuth.config.path_prefix}/#{name}/callback"
|
41
|
-
|
42
|
-
call_app!
|
43
|
-
rescue RestClient::Request::Unauthorized => e
|
44
|
-
fail!(:invalid_credentials, e)
|
45
|
-
end
|
46
|
-
|
47
|
-
def perform_authentication(uri, headers = request_headers)
|
48
|
-
RestClient.get(uri, headers)
|
49
|
-
end
|
50
|
-
|
51
|
-
def callback_phase
|
52
|
-
fail!(:invalid_credentials)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module OmniAuth
|
2
|
-
module Version
|
3
|
-
unless defined?(::OmniAuth::Version::MAJOR)
|
4
|
-
MAJOR = 0
|
5
|
-
end
|
6
|
-
unless defined?(::OmniAuth::Version::MINOR)
|
7
|
-
MINOR = 2
|
8
|
-
end
|
9
|
-
unless defined?(::OmniAuth::Version::PATCH)
|
10
|
-
PATCH = 6
|
11
|
-
end
|
12
|
-
unless defined?(::OmniAuth::Version::PRE)
|
13
|
-
PRE = nil
|
14
|
-
end
|
15
|
-
unless defined?(::OmniAuth::Version::STRING)
|
16
|
-
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/oa-basic/oa-basic.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/omniauth/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
6
|
-
gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
|
7
|
-
gem.add_development_dependency 'maruku', '~> 0.6'
|
8
|
-
gem.add_development_dependency 'simplecov', '~> 0.4'
|
9
|
-
gem.add_development_dependency 'rack-test', '~> 0.5'
|
10
|
-
gem.add_development_dependency 'rake', '~> 0.8'
|
11
|
-
gem.add_development_dependency 'rspec', '~> 2.5'
|
12
|
-
gem.add_development_dependency 'webmock', '~> 1.6'
|
13
|
-
gem.add_development_dependency 'yard', '~> 0.7'
|
14
|
-
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
15
|
-
gem.name = 'oa-basic'
|
16
|
-
gem.version = OmniAuth::Version::STRING
|
17
|
-
gem.description = %q{HTTP Basic strategies for OmniAuth.}
|
18
|
-
gem.summary = gem.description
|
19
|
-
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
20
|
-
gem.homepage = 'http://github.com/intridea/omniauth'
|
21
|
-
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
22
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
|
23
|
-
gem.files = `git ls-files`.split("\n")
|
24
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
-
gem.require_paths = ['lib']
|
26
|
-
gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
|
27
|
-
end
|
data/oa-core/Gemfile
DELETED
data/oa-core/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (c) 2010-2011 Michael Bleigh and Intridea, Inc.
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|
data/oa-core/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Autotest.add_discovery { "rspec2" }
|
data/oa-core/lib/oa-core.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'omniauth/core'
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'omniauth/core'
|
2
|
-
|
3
|
-
module OmniAuth
|
4
|
-
class Builder < ::Rack::Builder
|
5
|
-
def initialize(app, &block)
|
6
|
-
@app = app
|
7
|
-
super(&block)
|
8
|
-
end
|
9
|
-
|
10
|
-
def on_failure(&block)
|
11
|
-
OmniAuth.config.on_failure = block
|
12
|
-
end
|
13
|
-
|
14
|
-
def configure(&block)
|
15
|
-
OmniAuth.configure(&block)
|
16
|
-
end
|
17
|
-
|
18
|
-
def provider(klass, *args, &block)
|
19
|
-
if klass.is_a?(Class)
|
20
|
-
middleware = klass
|
21
|
-
else
|
22
|
-
middleware = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(klass.to_s)}")
|
23
|
-
end
|
24
|
-
|
25
|
-
use middleware, *args, &block
|
26
|
-
end
|
27
|
-
|
28
|
-
def call(env)
|
29
|
-
@ins << @app unless @ins.include?(@app)
|
30
|
-
to_app.call(env)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,135 +0,0 @@
|
|
1
|
-
require 'rack'
|
2
|
-
require 'singleton'
|
3
|
-
|
4
|
-
module OmniAuth
|
5
|
-
module Strategies; end
|
6
|
-
|
7
|
-
autoload :Builder, 'omniauth/builder'
|
8
|
-
autoload :Strategy, 'omniauth/strategy'
|
9
|
-
autoload :Test, 'omniauth/test'
|
10
|
-
autoload :Form, 'omniauth/form'
|
11
|
-
|
12
|
-
def self.strategies
|
13
|
-
@@strategies ||= []
|
14
|
-
end
|
15
|
-
|
16
|
-
class Configuration
|
17
|
-
include Singleton
|
18
|
-
|
19
|
-
@@defaults = {
|
20
|
-
:path_prefix => '/auth',
|
21
|
-
:on_failure => Proc.new do |env|
|
22
|
-
message_key = env['omniauth.error.type']
|
23
|
-
new_path = "#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
|
24
|
-
[302, {'Location' => new_path, 'Content-Type'=> 'text/html'}, []]
|
25
|
-
end,
|
26
|
-
:form_css => Form::DEFAULT_CSS,
|
27
|
-
:test_mode => false,
|
28
|
-
:allowed_request_methods => [:get, :post],
|
29
|
-
:mock_auth => {
|
30
|
-
:default => {
|
31
|
-
'provider' => 'default',
|
32
|
-
'uid' => '1234',
|
33
|
-
'user_info' => {
|
34
|
-
'name' => 'Bob Example'
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
|
40
|
-
def self.defaults
|
41
|
-
@@defaults
|
42
|
-
end
|
43
|
-
|
44
|
-
def initialize
|
45
|
-
@@defaults.each_pair{|k,v| self.send("#{k}=",v)}
|
46
|
-
end
|
47
|
-
|
48
|
-
def on_failure(&block)
|
49
|
-
if block_given?
|
50
|
-
@on_failure = block
|
51
|
-
else
|
52
|
-
@on_failure
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def add_mock(provider, mock={})
|
57
|
-
# Stringify keys recursively one level.
|
58
|
-
mock.stringify_keys!
|
59
|
-
mock.keys.each do|key|
|
60
|
-
if mock[key].is_a? Hash
|
61
|
-
mock[key].stringify_keys!
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Merge with the default mock and ensure provider is correct.
|
66
|
-
mock = self.mock_auth[:default].dup.merge(mock)
|
67
|
-
mock["provider"] = provider.to_s
|
68
|
-
|
69
|
-
# Add it to the mocks.
|
70
|
-
self.mock_auth[provider.to_sym] = mock
|
71
|
-
end
|
72
|
-
|
73
|
-
attr_writer :on_failure
|
74
|
-
attr_accessor :path_prefix, :allowed_request_methods, :form_css, :test_mode, :mock_auth, :full_host
|
75
|
-
end
|
76
|
-
|
77
|
-
def self.config
|
78
|
-
Configuration.instance
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.configure
|
82
|
-
yield config
|
83
|
-
end
|
84
|
-
|
85
|
-
def self.mock_auth_for(provider)
|
86
|
-
config.mock_auth[provider.to_sym] || config.mock_auth[:default]
|
87
|
-
end
|
88
|
-
|
89
|
-
module Utils
|
90
|
-
CAMELIZE_SPECIAL = {
|
91
|
-
'oauth' => 'OAuth',
|
92
|
-
'oauth2' => 'OAuth2',
|
93
|
-
'openid' => 'OpenID',
|
94
|
-
'open_id' => 'OpenID',
|
95
|
-
'github' => 'GitHub',
|
96
|
-
'tripit' => 'TripIt',
|
97
|
-
'soundcloud' => 'SoundCloud',
|
98
|
-
'smugmug' => 'SmugMug',
|
99
|
-
'cas' => 'CAS',
|
100
|
-
'trademe' => 'TradeMe',
|
101
|
-
'ldap' => 'LDAP'
|
102
|
-
}
|
103
|
-
|
104
|
-
module_function
|
105
|
-
|
106
|
-
def form_css
|
107
|
-
"<style type='text/css'>#{OmniAuth.config.form_css}</style>"
|
108
|
-
end
|
109
|
-
|
110
|
-
def deep_merge(hash, other_hash)
|
111
|
-
target = hash.dup
|
112
|
-
|
113
|
-
other_hash.keys.each do |key|
|
114
|
-
if other_hash[key].is_a? ::Hash and hash[key].is_a? ::Hash
|
115
|
-
target[key] = deep_merge(target[key],other_hash[key])
|
116
|
-
next
|
117
|
-
end
|
118
|
-
|
119
|
-
target[key] = other_hash[key]
|
120
|
-
end
|
121
|
-
|
122
|
-
target
|
123
|
-
end
|
124
|
-
|
125
|
-
def camelize(word, first_letter_in_uppercase = true)
|
126
|
-
return CAMELIZE_SPECIAL[word.to_s] if CAMELIZE_SPECIAL[word.to_s]
|
127
|
-
|
128
|
-
if first_letter_in_uppercase
|
129
|
-
word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
|
130
|
-
else
|
131
|
-
word.first + camelize(word)[1..-1]
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|