omniauth_openid_connect_test 0.3.6

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.
@@ -0,0 +1,51 @@
1
+ class StrategyTestCase < MiniTest::Test
2
+ class DummyApp
3
+ def call(env); end
4
+ end
5
+
6
+ attr_accessor :identifier, :secret
7
+
8
+ def setup
9
+ @identifier = '1234'
10
+ @secret = '1234asdgat3'
11
+ end
12
+
13
+ def client
14
+ strategy.client
15
+ end
16
+
17
+ def user_info
18
+ @user_info ||= OpenIDConnect::ResponseObject::UserInfo.new(
19
+ sub: SecureRandom.hex(16),
20
+ name: Faker::Name.name,
21
+ email: Faker::Internet.email,
22
+ nickname: Faker::Name.first_name,
23
+ preferred_username: Faker::Internet.user_name,
24
+ given_name: Faker::Name.first_name,
25
+ family_name: Faker::Name.last_name,
26
+ gender: 'female',
27
+ picture: Faker::Internet.url + '.png',
28
+ phone_number: Faker::PhoneNumber.phone_number,
29
+ website: Faker::Internet.url,
30
+ )
31
+ end
32
+
33
+ def request
34
+ @request ||= stub('Request').tap do |request|
35
+ request.stubs(:params).returns({})
36
+ request.stubs(:cookies).returns({})
37
+ request.stubs(:env).returns({})
38
+ request.stubs(:scheme).returns({})
39
+ request.stubs(:ssl?).returns(false)
40
+ end
41
+ end
42
+
43
+ def strategy
44
+ @strategy ||= OmniAuth::Strategies::OpenIDConnect.new(DummyApp.new).tap do |strategy|
45
+ strategy.options.client_options.identifier = @identifier
46
+ strategy.options.client_options.secret = @secret
47
+ strategy.stubs(:request).returns(request)
48
+ strategy.stubs(:user_info).returns(user_info)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,16 @@
1
+ lib = File.expand_path('../../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'simplecov'
5
+ require 'coveralls'
6
+ require 'minitest/autorun'
7
+ require 'mocha/minitest'
8
+ require 'faker'
9
+ require 'active_support'
10
+ require 'omniauth_openid_connect'
11
+ require_relative 'strategy_test_case'
12
+
13
+ SimpleCov.command_name 'test'
14
+ SimpleCov.start
15
+ Coveralls.wear!
16
+ OmniAuth.config.test_mode = true
metadata ADDED
@@ -0,0 +1,258 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth_openid_connect_test
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.6
5
+ platform: ruby
6
+ authors:
7
+ - John Bohn
8
+ - Ilya Shcherbinin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2021-08-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: addressable
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '2.5'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '2.5'
28
+ - !ruby/object:Gem::Dependency
29
+ name: omniauth
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '2.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: openid_connect
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.1'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.1'
56
+ - !ruby/object:Gem::Dependency
57
+ name: coveralls
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.8'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.8'
70
+ - !ruby/object:Gem::Dependency
71
+ name: faker
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.6'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.6'
84
+ - !ruby/object:Gem::Dependency
85
+ name: guard
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '2.14'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '2.14'
98
+ - !ruby/object:Gem::Dependency
99
+ name: guard-bundler
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '2.2'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '2.2'
112
+ - !ruby/object:Gem::Dependency
113
+ name: guard-minitest
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '2.4'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '2.4'
126
+ - !ruby/object:Gem::Dependency
127
+ name: minitest
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '5.1'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '5.1'
140
+ - !ruby/object:Gem::Dependency
141
+ name: mocha
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '1.7'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '1.7'
154
+ - !ruby/object:Gem::Dependency
155
+ name: rake
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '12.0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '12.0'
168
+ - !ruby/object:Gem::Dependency
169
+ name: rubocop
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '0.63'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '0.63'
182
+ - !ruby/object:Gem::Dependency
183
+ name: simplecov
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: '0.12'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: '0.12'
196
+ description: OpenID Connect Strategy for OmniAuth.
197
+ email:
198
+ - jjbohn@gmail.com
199
+ - m0n9oose@gmail.com
200
+ - burak.akca834@gmail.com
201
+ executables: []
202
+ extensions: []
203
+ extra_rdoc_files: []
204
+ files:
205
+ - ".github/config/rubocop_linter_action.yml"
206
+ - ".github/stale.yml"
207
+ - ".github/workflows/rubocop.yml"
208
+ - ".gitignore"
209
+ - ".rubocop.yml"
210
+ - ".travis.yml"
211
+ - CHANGELOG.md
212
+ - Gemfile
213
+ - Guardfile
214
+ - LICENSE.txt
215
+ - README.md
216
+ - Rakefile
217
+ - lib/omniauth/openid_connect.rb
218
+ - lib/omniauth/openid_connect/errors.rb
219
+ - lib/omniauth/openid_connect/version.rb
220
+ - lib/omniauth/strategies/openid_connect.rb
221
+ - lib/omniauth_openid_connect.rb
222
+ - omniauth_openid_connect_test.gemspec
223
+ - test/fixtures/id_token.txt
224
+ - test/fixtures/jwks.json
225
+ - test/fixtures/test.crt
226
+ - test/lib/omniauth/strategies/openid_connect_test.rb
227
+ - test/strategy_test_case.rb
228
+ - test/test_helper.rb
229
+ homepage: https://github.com/burakakca/omniauth_openid_connect
230
+ licenses:
231
+ - MIT
232
+ metadata: {}
233
+ post_install_message:
234
+ rdoc_options: []
235
+ require_paths:
236
+ - lib
237
+ required_ruby_version: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - ">="
240
+ - !ruby/object:Gem::Version
241
+ version: '0'
242
+ required_rubygems_version: !ruby/object:Gem::Requirement
243
+ requirements:
244
+ - - ">="
245
+ - !ruby/object:Gem::Version
246
+ version: '0'
247
+ requirements: []
248
+ rubygems_version: 3.1.4
249
+ signing_key:
250
+ specification_version: 4
251
+ summary: OpenID Connect Strategy for OmniAuth
252
+ test_files:
253
+ - test/fixtures/id_token.txt
254
+ - test/fixtures/jwks.json
255
+ - test/fixtures/test.crt
256
+ - test/lib/omniauth/strategies/openid_connect_test.rb
257
+ - test/strategy_test_case.rb
258
+ - test/test_helper.rb