omniauth-rightsignature 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +60 -0
- data/.travis.yml +26 -0
- data/.yardopts +4 -0
- data/Gemfile +33 -0
- data/Gemfile.rack-1.3.x +25 -0
- data/Guardfile +10 -0
- data/LICENSE.md +19 -0
- data/README.md +167 -0
- data/Rakefile +17 -0
- data/lib/omniauth/auth_hash.rb +54 -0
- data/lib/omniauth/builder.rb +62 -0
- data/lib/omniauth/failure_endpoint.rb +44 -0
- data/lib/omniauth/form.css +81 -0
- data/lib/omniauth/form.rb +111 -0
- data/lib/omniauth/rightsignature/version.rb +5 -0
- data/lib/omniauth/strategies/rightsignature.rb +44 -0
- data/lib/omniauth/strategy.rb +501 -0
- data/lib/omniauth/test.rb +8 -0
- data/lib/omniauth/version.rb +3 -0
- data/lib/omniauth-rightsignature.rb +1 -0
- data/lib/omniauth.rb +170 -0
- data/omniauth-rightsignature.gemspec +24 -0
- data/spec/helper.rb +55 -0
- data/spec/omniauth/auth_hash_spec.rb +109 -0
- data/spec/omniauth/builder_spec.rb +50 -0
- data/spec/omniauth/failure_endpoint_spec.rb +58 -0
- data/spec/omniauth/form_spec.rb +23 -0
- data/spec/omniauth/strategies/developer_spec.rb +73 -0
- data/spec/omniauth/strategy_spec.rb +765 -0
- data/spec/omniauth_spec.rb +145 -0
- metadata +35 -3
@@ -0,0 +1,145 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe OmniAuth do
|
4
|
+
describe '.strategies' do
|
5
|
+
it 'increases when a new strategy is made' do
|
6
|
+
expect do
|
7
|
+
class ExampleStrategy
|
8
|
+
include OmniAuth::Strategy
|
9
|
+
end
|
10
|
+
end.to change(OmniAuth.strategies, :size).by(1)
|
11
|
+
expect(OmniAuth.strategies.last).to eq(ExampleStrategy)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'configuration' do
|
16
|
+
describe '.defaults' do
|
17
|
+
it 'is a hash of default configuration' do
|
18
|
+
expect(OmniAuth::Configuration.defaults).to be_kind_of(Hash)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'is callable from .configure' do
|
23
|
+
OmniAuth.configure do |c|
|
24
|
+
expect(c).to be_kind_of(OmniAuth::Configuration)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
before do
|
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
|
34
|
+
end
|
35
|
+
|
36
|
+
after do
|
37
|
+
OmniAuth.configure do |config|
|
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
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'is able to set the path' do
|
47
|
+
OmniAuth.configure do |config|
|
48
|
+
config.path_prefix = '/awesome'
|
49
|
+
end
|
50
|
+
|
51
|
+
expect(OmniAuth.config.path_prefix).to eq('/awesome')
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'is able to set the on_failure rack app' do
|
55
|
+
OmniAuth.configure do |config|
|
56
|
+
config.on_failure do
|
57
|
+
'yoyo'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
expect(OmniAuth.config.on_failure.call).to eq('yoyo')
|
62
|
+
end
|
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
|
92
|
+
before do
|
93
|
+
OmniAuth.config.add_mock(:facebook, :uid => '12345', :info => {:name => 'Joe', :email => 'joe@example.com'})
|
94
|
+
end
|
95
|
+
it 'default is AuthHash' do
|
96
|
+
OmniAuth.configure do |config|
|
97
|
+
expect(config.mock_auth[:default]).to be_kind_of(OmniAuth::AuthHash)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
it 'facebook is AuthHash' do
|
101
|
+
OmniAuth.configure do |config|
|
102
|
+
expect(config.mock_auth[:facebook]).to be_kind_of(OmniAuth::AuthHash)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
it 'sets facebook attributes' do
|
106
|
+
OmniAuth.configure do |config|
|
107
|
+
expect(config.mock_auth[:facebook].uid).to eq('12345')
|
108
|
+
expect(config.mock_auth[:facebook].info.name).to eq('Joe')
|
109
|
+
expect(config.mock_auth[:facebook].info.email).to eq('joe@example.com')
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
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')
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
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'})
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe '.camelize' do
|
130
|
+
it 'works on normal cases' do
|
131
|
+
{
|
132
|
+
'some_word' => 'SomeWord',
|
133
|
+
'AnotherWord' => 'AnotherWord',
|
134
|
+
'one' => 'One',
|
135
|
+
'three_words_now' => 'ThreeWordsNow',
|
136
|
+
}.each_pair { |k, v| expect(OmniAuth::Utils.camelize(k)).to eq(v) }
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'works in special cases that have been added' do
|
140
|
+
OmniAuth.config.add_camelization('oauth', 'OAuth')
|
141
|
+
expect(OmniAuth::Utils.camelize(:oauth)).to eq('OAuth')
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-rightsignature
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deepikaa Subramaniam
|
@@ -113,8 +113,40 @@ email: deepikaa.subramaniam@citrix.com
|
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
116
|
-
files:
|
117
|
-
|
116
|
+
files:
|
117
|
+
- ".gitignore"
|
118
|
+
- ".rspec"
|
119
|
+
- ".rubocop.yml"
|
120
|
+
- ".travis.yml"
|
121
|
+
- ".yardopts"
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.rack-1.3.x
|
124
|
+
- Guardfile
|
125
|
+
- LICENSE.md
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- lib/omniauth-rightsignature.rb
|
129
|
+
- lib/omniauth.rb
|
130
|
+
- lib/omniauth/auth_hash.rb
|
131
|
+
- lib/omniauth/builder.rb
|
132
|
+
- lib/omniauth/failure_endpoint.rb
|
133
|
+
- lib/omniauth/form.css
|
134
|
+
- lib/omniauth/form.rb
|
135
|
+
- lib/omniauth/rightsignature/version.rb
|
136
|
+
- lib/omniauth/strategies/rightsignature.rb
|
137
|
+
- lib/omniauth/strategy.rb
|
138
|
+
- lib/omniauth/test.rb
|
139
|
+
- lib/omniauth/version.rb
|
140
|
+
- omniauth-rightsignature.gemspec
|
141
|
+
- spec/helper.rb
|
142
|
+
- spec/omniauth/auth_hash_spec.rb
|
143
|
+
- spec/omniauth/builder_spec.rb
|
144
|
+
- spec/omniauth/failure_endpoint_spec.rb
|
145
|
+
- spec/omniauth/form_spec.rb
|
146
|
+
- spec/omniauth/strategies/developer_spec.rb
|
147
|
+
- spec/omniauth/strategy_spec.rb
|
148
|
+
- spec/omniauth_spec.rb
|
149
|
+
homepage: https://github.com/DeepikaaSubramaniam21/omniauth-rightsignature/
|
118
150
|
licenses: []
|
119
151
|
metadata: {}
|
120
152
|
post_install_message:
|