omniauth 1.1.4 → 1.2.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +82 -0
- data/.travis.yml +42 -0
- data/Gemfile +37 -0
- data/Gemfile.rack-1.3.x +24 -0
- data/Guardfile +10 -0
- data/README.md +4 -4
- data/Rakefile +12 -1
- data/certs/sferik.pem +20 -0
- data/lib/omniauth.rb +51 -33
- data/lib/omniauth/auth_hash.rb +9 -6
- data/lib/omniauth/builder.rb +12 -2
- data/lib/omniauth/failure_endpoint.rb +5 -5
- data/lib/omniauth/form.css +81 -0
- data/lib/omniauth/form.rb +11 -95
- data/lib/omniauth/strategies/developer.rb +3 -5
- data/lib/omniauth/strategy.rb +61 -47
- data/lib/omniauth/test.rb +0 -4
- data/lib/omniauth/test/phony_session.rb +4 -1
- data/lib/omniauth/test/strategy_macros.rb +1 -6
- data/lib/omniauth/test/strategy_test_case.rb +9 -14
- data/lib/omniauth/version.rb +1 -1
- data/omniauth.gemspec +5 -7
- data/spec/helper.rb +15 -6
- data/spec/omniauth/auth_hash_spec.rb +42 -39
- data/spec/omniauth/builder_spec.rb +13 -13
- data/spec/omniauth/failure_endpoint_spec.rb +22 -17
- data/spec/omniauth/form_spec.rb +8 -8
- data/spec/omniauth/strategies/developer_spec.rb +29 -25
- data/spec/omniauth/strategy_spec.rb +300 -219
- data/spec/omniauth_spec.rb +65 -31
- metadata +30 -20
- metadata.gz.sig +0 -0
data/spec/omniauth_spec.rb
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
describe OmniAuth do
|
4
|
-
describe
|
5
|
-
it
|
6
|
-
expect
|
4
|
+
describe '.strategies' do
|
5
|
+
it 'increases when a new strategy is made' do
|
6
|
+
expect do
|
7
7
|
class ExampleStrategy
|
8
8
|
include OmniAuth::Strategy
|
9
9
|
end
|
10
|
-
|
10
|
+
end.to change(OmniAuth.strategies, :size).by(1)
|
11
11
|
expect(OmniAuth.strategies.last).to eq(ExampleStrategy)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
context
|
16
|
-
describe
|
17
|
-
it
|
15
|
+
context 'configuration' do
|
16
|
+
describe '.defaults' do
|
17
|
+
it 'is a hash of default configuration' do
|
18
18
|
expect(OmniAuth::Configuration.defaults).to be_kind_of(Hash)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
it
|
22
|
+
it 'is callable from .configure' do
|
23
23
|
OmniAuth.configure do |c|
|
24
24
|
expect(c).to be_kind_of(OmniAuth::Configuration)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
before do
|
29
|
-
@old_path_prefix
|
30
|
-
@old_on_failure
|
29
|
+
@old_path_prefix = OmniAuth.config.path_prefix
|
30
|
+
@old_on_failure = OmniAuth.config.on_failure
|
31
|
+
@old_before_callback_phase = OmniAuth.config.before_callback_phase
|
32
|
+
@old_before_options_phase = OmniAuth.config.before_options_phase
|
33
|
+
@old_before_request_phase = OmniAuth.config.before_request_phase
|
31
34
|
end
|
32
35
|
|
33
36
|
after do
|
34
37
|
OmniAuth.configure do |config|
|
35
|
-
config.path_prefix
|
36
|
-
config.on_failure
|
38
|
+
config.path_prefix = @old_path_prefix
|
39
|
+
config.on_failure = @old_on_failure
|
40
|
+
config.before_callback_phase = @old_before_callback_phase
|
41
|
+
config.before_options_phase = @old_before_options_phase
|
42
|
+
config.before_request_phase = @old_before_request_phase
|
37
43
|
end
|
38
44
|
end
|
39
45
|
|
40
|
-
it
|
46
|
+
it 'is able to set the path' do
|
41
47
|
OmniAuth.configure do |config|
|
42
48
|
config.path_prefix = '/awesome'
|
43
49
|
end
|
@@ -45,7 +51,7 @@ describe OmniAuth do
|
|
45
51
|
expect(OmniAuth.config.path_prefix).to eq('/awesome')
|
46
52
|
end
|
47
53
|
|
48
|
-
it
|
54
|
+
it 'is able to set the on_failure rack app' do
|
49
55
|
OmniAuth.configure do |config|
|
50
56
|
config.on_failure do
|
51
57
|
'yoyo'
|
@@ -54,21 +60,49 @@ describe OmniAuth do
|
|
54
60
|
|
55
61
|
expect(OmniAuth.config.on_failure.call).to eq('yoyo')
|
56
62
|
end
|
57
|
-
|
63
|
+
|
64
|
+
it 'is able to set hook on option_call' do
|
65
|
+
OmniAuth.configure do |config|
|
66
|
+
config.before_options_phase do
|
67
|
+
'yoyo'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
expect(OmniAuth.config.before_options_phase.call).to eq('yoyo')
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'is able to set hook on request_call' do
|
74
|
+
OmniAuth.configure do |config|
|
75
|
+
config.before_request_phase do
|
76
|
+
'heyhey'
|
77
|
+
end
|
78
|
+
end
|
79
|
+
expect(OmniAuth.config.before_request_phase.call).to eq('heyhey')
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'is able to set hook on callback_call' do
|
83
|
+
OmniAuth.configure do |config|
|
84
|
+
config.before_callback_phase do
|
85
|
+
'heyhey'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
expect(OmniAuth.config.before_callback_phase.call).to eq('heyhey')
|
89
|
+
end
|
90
|
+
|
91
|
+
describe 'mock auth' do
|
58
92
|
before do
|
59
|
-
OmniAuth.config.add_mock(:facebook, :uid => '12345'
|
93
|
+
OmniAuth.config.add_mock(:facebook, :uid => '12345', :info => {:name => 'Joe', :email => 'joe@example.com'})
|
60
94
|
end
|
61
|
-
it
|
95
|
+
it 'default is AuthHash' do
|
62
96
|
OmniAuth.configure do |config|
|
63
97
|
expect(config.mock_auth[:default]).to be_kind_of(OmniAuth::AuthHash)
|
64
98
|
end
|
65
99
|
end
|
66
|
-
it
|
100
|
+
it 'facebook is AuthHash' do
|
67
101
|
OmniAuth.configure do |config|
|
68
102
|
expect(config.mock_auth[:facebook]).to be_kind_of(OmniAuth::AuthHash)
|
69
103
|
end
|
70
104
|
end
|
71
|
-
it
|
105
|
+
it 'sets facebook attributes' do
|
72
106
|
OmniAuth.configure do |config|
|
73
107
|
expect(config.mock_auth[:facebook].uid).to eq('12345')
|
74
108
|
expect(config.mock_auth[:facebook].info.name).to eq('Joe')
|
@@ -78,31 +112,31 @@ describe OmniAuth do
|
|
78
112
|
end
|
79
113
|
end
|
80
114
|
|
81
|
-
describe
|
82
|
-
it
|
83
|
-
OmniAuth.
|
84
|
-
expect(OmniAuth.logger).to eq(
|
115
|
+
describe '.logger' do
|
116
|
+
it 'calls through to the configured logger' do
|
117
|
+
allow(OmniAuth).to receive(:config).and_return(double(:logger => 'foo'))
|
118
|
+
expect(OmniAuth.logger).to eq('foo')
|
85
119
|
end
|
86
120
|
end
|
87
121
|
|
88
|
-
describe
|
89
|
-
describe
|
90
|
-
it
|
91
|
-
expect(OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}})).to eq(
|
122
|
+
describe '::Utils' do
|
123
|
+
describe '.deep_merge' do
|
124
|
+
it 'combines hashes' do
|
125
|
+
expect(OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}})).to eq('abc' => {'def' => 123, 'foo' => 'bar'})
|
92
126
|
end
|
93
127
|
end
|
94
128
|
|
95
|
-
describe
|
96
|
-
it
|
129
|
+
describe '.camelize' do
|
130
|
+
it 'works on normal cases' do
|
97
131
|
{
|
98
132
|
'some_word' => 'SomeWord',
|
99
133
|
'AnotherWord' => 'AnotherWord',
|
100
134
|
'one' => 'One',
|
101
135
|
'three_words_now' => 'ThreeWordsNow'
|
102
|
-
}.each_pair{ |k,v| expect(OmniAuth::Utils.camelize(k)).to eq(v) }
|
136
|
+
}.each_pair { |k, v| expect(OmniAuth::Utils.camelize(k)).to eq(v) }
|
103
137
|
end
|
104
138
|
|
105
|
-
it
|
139
|
+
it 'works in special cases that have been added' do
|
106
140
|
OmniAuth.config.add_camelization('oauth', 'OAuth')
|
107
141
|
expect(OmniAuth::Utils.camelize(:oauth)).to eq('OAuth')
|
108
142
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
@@ -30,54 +30,54 @@ cert_chain:
|
|
30
30
|
Sf3lVKpBCWgRpGTvy45XVpB+59y33PJmEuQ1PTEOYvQyao9UKMAAaAN/7qWQtjl0
|
31
31
|
hlw=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: hashie
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '1.2'
|
42
|
-
- - <
|
42
|
+
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '3'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- -
|
49
|
+
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '1.2'
|
52
|
-
- - <
|
52
|
+
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rack
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
83
|
description: A generalized Rack framework for multiple-provider authentication.
|
@@ -88,23 +88,33 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .
|
91
|
+
- ".gemtest"
|
92
|
+
- ".gitignore"
|
93
|
+
- ".rspec"
|
94
|
+
- ".rubocop.yml"
|
95
|
+
- ".travis.yml"
|
96
|
+
- ".yardopts"
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.rack-1.3.x
|
99
|
+
- Guardfile
|
92
100
|
- LICENSE.md
|
93
101
|
- README.md
|
94
102
|
- Rakefile
|
95
|
-
-
|
103
|
+
- certs/sferik.pem
|
104
|
+
- lib/omniauth.rb
|
96
105
|
- lib/omniauth/auth_hash.rb
|
97
106
|
- lib/omniauth/builder.rb
|
98
107
|
- lib/omniauth/failure_endpoint.rb
|
108
|
+
- lib/omniauth/form.css
|
99
109
|
- lib/omniauth/form.rb
|
100
110
|
- lib/omniauth/strategies/developer.rb
|
101
111
|
- lib/omniauth/strategy.rb
|
112
|
+
- lib/omniauth/test.rb
|
102
113
|
- lib/omniauth/test/phony_session.rb
|
103
114
|
- lib/omniauth/test/strategy_macros.rb
|
104
115
|
- lib/omniauth/test/strategy_test_case.rb
|
105
|
-
- lib/omniauth/test.rb
|
106
116
|
- lib/omniauth/version.rb
|
107
|
-
-
|
117
|
+
- omniauth.gemspec
|
108
118
|
- spec/helper.rb
|
109
119
|
- spec/omniauth/auth_hash_spec.rb
|
110
120
|
- spec/omniauth/builder_spec.rb
|
@@ -123,17 +133,17 @@ require_paths:
|
|
123
133
|
- lib
|
124
134
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
135
|
requirements:
|
126
|
-
- -
|
136
|
+
- - ">="
|
127
137
|
- !ruby/object:Gem::Version
|
128
138
|
version: '0'
|
129
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
140
|
requirements:
|
131
|
-
- -
|
141
|
+
- - ">="
|
132
142
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.3.
|
143
|
+
version: 1.3.5
|
134
144
|
requirements: []
|
135
145
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.2.0
|
137
147
|
signing_key:
|
138
148
|
specification_version: 4
|
139
149
|
summary: A generalized Rack framework for multiple-provider authentication.
|
metadata.gz.sig
CHANGED
Binary file
|