omniauth 0.3.2 → 1.0.0.beta1
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/Gemfile +11 -0
- data/Guardfile +10 -0
- data/{LICENSE.md → LICENSE} +1 -1
- data/README.md +136 -152
- data/Rakefile +6 -0
- data/lib/omniauth.rb +137 -6
- data/lib/omniauth/auth_hash.rb +51 -0
- data/lib/omniauth/builder.rb +33 -0
- data/lib/omniauth/form.rb +191 -0
- data/lib/omniauth/strategies/developer.rb +60 -0
- data/lib/omniauth/strategy.rb +429 -0
- data/lib/omniauth/test.rb +12 -0
- data/lib/omniauth/test/phony_session.rb +8 -0
- data/lib/omniauth/test/strategy_macros.rb +34 -0
- data/lib/omniauth/test/strategy_test_case.rb +49 -0
- data/lib/omniauth/version.rb +1 -17
- data/omniauth.gemspec +28 -0
- data/spec/omniauth/auth_hash_spec.rb +108 -0
- data/spec/omniauth/builder_spec.rb +20 -0
- data/spec/omniauth/strategies/developer_spec.rb +69 -0
- data/spec/omniauth/strategy_spec.rb +601 -0
- data/spec/omniauth_spec.rb +82 -0
- data/spec/spec_helper.rb +12 -0
- metadata +142 -132
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OmniAuth do
|
4
|
+
describe '.strategies' do
|
5
|
+
it 'should increase when a new strategy is made' do
|
6
|
+
lambda{ class ExampleStrategy
|
7
|
+
include OmniAuth::Strategy
|
8
|
+
end }.should change(OmniAuth.strategies, :size).by(1)
|
9
|
+
OmniAuth.strategies.last.should == ExampleStrategy
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'configuration' do
|
14
|
+
describe '.defaults' do
|
15
|
+
it 'should be a hash of default configuration' do
|
16
|
+
OmniAuth::Configuration.defaults.should be_kind_of(Hash)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should be callable from .configure' do
|
21
|
+
OmniAuth.configure do |c|
|
22
|
+
c.should be_kind_of(OmniAuth::Configuration)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
before do
|
27
|
+
@old_path_prefix = OmniAuth.config.path_prefix
|
28
|
+
@old_on_failure = OmniAuth.config.on_failure
|
29
|
+
end
|
30
|
+
|
31
|
+
after do
|
32
|
+
OmniAuth.configure do |config|
|
33
|
+
config.path_prefix = @old_path_prefix
|
34
|
+
config.on_failure = @old_on_failure
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should be able to set the path' do
|
39
|
+
OmniAuth.configure do |config|
|
40
|
+
config.path_prefix = '/awesome'
|
41
|
+
end
|
42
|
+
|
43
|
+
OmniAuth.config.path_prefix.should == '/awesome'
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should be able to set the on_failure rack app' do
|
47
|
+
OmniAuth.configure do |config|
|
48
|
+
config.on_failure do
|
49
|
+
'yoyo'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
OmniAuth.config.on_failure.call.should == 'yoyo'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '::Utils' do
|
58
|
+
describe '.deep_merge' do
|
59
|
+
it 'should combine hashes' do
|
60
|
+
OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}}).should == {
|
61
|
+
'abc' => {'def' => 123, 'foo' => 'bar'}
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '.camelize' do
|
67
|
+
it 'should work on normal cases' do
|
68
|
+
{
|
69
|
+
'some_word' => 'SomeWord',
|
70
|
+
'AnotherWord' => 'AnotherWord',
|
71
|
+
'one' => 'One',
|
72
|
+
'three_words_now' => 'ThreeWordsNow'
|
73
|
+
}.each_pair{ |k,v| OmniAuth::Utils.camelize(k).should == v }
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should work in special cases that have been added' do
|
77
|
+
OmniAuth.config.add_camelization('oauth', 'OAuth')
|
78
|
+
OmniAuth::Utils.camelize(:oauth).should == 'OAuth'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start
|
3
|
+
require 'rspec'
|
4
|
+
require 'rack/test'
|
5
|
+
require 'omniauth'
|
6
|
+
require 'omniauth/test'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.include Rack::Test::Methods
|
10
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
11
|
+
end
|
12
|
+
|
metadata
CHANGED
@@ -1,170 +1,180 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 2
|
10
|
-
version: 0.3.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.beta1
|
5
|
+
prerelease: 6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Michael Bleigh
|
14
9
|
- Erik Michaels-Ober
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
name: oa-basic
|
24
|
-
prerelease: false
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
13
|
+
date: 2011-10-19 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rack
|
17
|
+
requirement: &70214948162300 !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
- 3
|
34
|
-
- 2
|
35
|
-
version: 0.3.2
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
36
23
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: oa-enterprise
|
40
24
|
prerelease: false
|
41
|
-
|
25
|
+
version_requirements: *70214948162300
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: hashie
|
28
|
+
requirement: &70214948161800 !ruby/object:Gem::Requirement
|
42
29
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
segments:
|
48
|
-
- 0
|
49
|
-
- 3
|
50
|
-
- 2
|
51
|
-
version: 0.3.2
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
52
34
|
type: :runtime
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: oa-core
|
56
35
|
prerelease: false
|
57
|
-
|
36
|
+
version_requirements: *70214948161800
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: maruku
|
39
|
+
requirement: &70214948161300 !ruby/object:Gem::Requirement
|
58
40
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
|
64
|
-
- 0
|
65
|
-
- 3
|
66
|
-
- 2
|
67
|
-
version: 0.3.2
|
68
|
-
type: :runtime
|
69
|
-
version_requirements: *id003
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: oa-more
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0.6'
|
45
|
+
type: :development
|
72
46
|
prerelease: false
|
73
|
-
|
47
|
+
version_requirements: *70214948161300
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: simplecov
|
50
|
+
requirement: &70214948160840 !ruby/object:Gem::Requirement
|
74
51
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
|
80
|
-
- 0
|
81
|
-
- 3
|
82
|
-
- 2
|
83
|
-
version: 0.3.2
|
84
|
-
type: :runtime
|
85
|
-
version_requirements: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: oa-oauth
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0.4'
|
56
|
+
type: :development
|
88
57
|
prerelease: false
|
89
|
-
|
58
|
+
version_requirements: *70214948160840
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rack-test
|
61
|
+
requirement: &70214948160380 !ruby/object:Gem::Requirement
|
90
62
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
|
96
|
-
- 0
|
97
|
-
- 3
|
98
|
-
- 2
|
99
|
-
version: 0.3.2
|
100
|
-
type: :runtime
|
101
|
-
version_requirements: *id005
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: oa-openid
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.5'
|
67
|
+
type: :development
|
104
68
|
prerelease: false
|
105
|
-
|
69
|
+
version_requirements: *70214948160380
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: &70214948159920 !ruby/object:Gem::Requirement
|
106
73
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0.8'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70214948159920
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rdiscount
|
83
|
+
requirement: &70214948159460 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.6'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70214948159460
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rspec
|
94
|
+
requirement: &70214948159000 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '2.5'
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *70214948159000
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: yard
|
105
|
+
requirement: &70214948158540 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.7'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *70214948158540
|
114
|
+
description: A generalized Rack framework for multiple-provider authentication.
|
115
|
+
email:
|
120
116
|
- michael@intridea.com
|
121
117
|
- sferik@gmail.com
|
122
118
|
executables: []
|
123
|
-
|
124
119
|
extensions: []
|
125
|
-
|
126
120
|
extra_rdoc_files: []
|
127
|
-
|
128
|
-
|
129
|
-
-
|
130
|
-
-
|
121
|
+
files:
|
122
|
+
- .gemtest
|
123
|
+
- .gitignore
|
124
|
+
- .rspec
|
125
|
+
- .travis.yml
|
126
|
+
- .yardopts
|
127
|
+
- Gemfile
|
128
|
+
- Guardfile
|
129
|
+
- LICENSE
|
131
130
|
- README.md
|
132
|
-
-
|
133
|
-
|
131
|
+
- Rakefile
|
132
|
+
- lib/omniauth.rb
|
133
|
+
- lib/omniauth/auth_hash.rb
|
134
|
+
- lib/omniauth/builder.rb
|
135
|
+
- lib/omniauth/form.rb
|
136
|
+
- lib/omniauth/strategies/developer.rb
|
137
|
+
- lib/omniauth/strategy.rb
|
138
|
+
- lib/omniauth/test.rb
|
139
|
+
- lib/omniauth/test/phony_session.rb
|
140
|
+
- lib/omniauth/test/strategy_macros.rb
|
141
|
+
- lib/omniauth/test/strategy_test_case.rb
|
142
|
+
- lib/omniauth/version.rb
|
143
|
+
- omniauth.gemspec
|
144
|
+
- spec/omniauth/auth_hash_spec.rb
|
145
|
+
- spec/omniauth/builder_spec.rb
|
146
|
+
- spec/omniauth/strategies/developer_spec.rb
|
147
|
+
- spec/omniauth/strategy_spec.rb
|
148
|
+
- spec/omniauth_spec.rb
|
149
|
+
- spec/spec_helper.rb
|
134
150
|
homepage: http://github.com/intridea/omniauth
|
135
151
|
licenses: []
|
136
|
-
|
137
152
|
post_install_message:
|
138
153
|
rdoc_options: []
|
139
|
-
|
140
|
-
require_paths:
|
154
|
+
require_paths:
|
141
155
|
- lib
|
142
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
157
|
none: false
|
144
|
-
requirements:
|
145
|
-
- -
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
|
148
|
-
|
149
|
-
- 0
|
150
|
-
version: "0"
|
151
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
163
|
none: false
|
153
|
-
requirements:
|
154
|
-
- -
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
hash: 23
|
157
|
-
segments:
|
158
|
-
- 1
|
159
|
-
- 3
|
160
|
-
- 6
|
164
|
+
requirements:
|
165
|
+
- - ! '>='
|
166
|
+
- !ruby/object:Gem::Version
|
161
167
|
version: 1.3.6
|
162
168
|
requirements: []
|
163
|
-
|
164
169
|
rubyforge_project:
|
165
|
-
rubygems_version: 1.
|
170
|
+
rubygems_version: 1.8.10
|
166
171
|
signing_key:
|
167
172
|
specification_version: 3
|
168
|
-
summary: Rack
|
169
|
-
test_files:
|
170
|
-
|
173
|
+
summary: A generalized Rack framework for multiple-provider authentication.
|
174
|
+
test_files:
|
175
|
+
- spec/omniauth/auth_hash_spec.rb
|
176
|
+
- spec/omniauth/builder_spec.rb
|
177
|
+
- spec/omniauth/strategies/developer_spec.rb
|
178
|
+
- spec/omniauth/strategy_spec.rb
|
179
|
+
- spec/omniauth_spec.rb
|
180
|
+
- spec/spec_helper.rb
|