gds-sso 17.0.0 → 17.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -20
- data/lib/gds-sso/bearer_token.rb +2 -2
- data/lib/gds-sso/version.rb +1 -1
- data/lib/gds-sso.rb +1 -1
- data/lib/omniauth/strategies/gds.rb +26 -0
- metadata +61 -94
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f870087f36397c1031d6d643965cc1e23be8bdecf6406ac8b3e348013aea1b
|
4
|
+
data.tar.gz: bc3c98cbf8445456860239438bd879a467687a679458d9de6271e8e8ab6f76ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d50863d1fc36a26d174d39956c1c519d1a8da76bfbf0476702d51c9e1da390abe16a9596cc18a8f762e673376d7d87bf8a0a58af879e9149a5f29f7c54170523
|
7
|
+
data.tar.gz: 007121f42d7fc57174af25b0181f02bafa3b0503fc81255991cd38688ec8e9523f5bc9024b6c500b20847eb398454918f48113a5f1bce61c66366433060e648f
|
data/Rakefile
CHANGED
@@ -1,24 +1,8 @@
|
|
1
|
-
require "bundler/setup"
|
2
1
|
require "bundler/gem_tasks"
|
3
|
-
|
4
|
-
Bundler::GemHelper.install_tasks
|
5
|
-
|
6
2
|
require "rspec/core/rake_task"
|
7
|
-
|
8
|
-
RSpec::Core::RakeTask.new(:spec) do |task|
|
9
|
-
task.pattern = "spec/**/*_spec.rb"
|
10
|
-
end
|
11
|
-
|
12
|
-
namespace :spec do
|
13
|
-
desc "Run integration specs"
|
14
|
-
RSpec::Core::RakeTask.new(:integration) do |task|
|
15
|
-
task.pattern = "spec/integration/**/*_spec.rb"
|
16
|
-
end
|
17
|
-
end
|
3
|
+
require "rubocop/rake_task"
|
18
4
|
|
19
|
-
|
20
|
-
|
21
|
-
sh "bundle exec rubocop --format clang"
|
22
|
-
end
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
RuboCop::RakeTask.new
|
23
7
|
|
24
|
-
task default: %i[spec
|
8
|
+
task default: %i[rubocop spec]
|
data/lib/gds-sso/bearer_token.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "json"
|
2
2
|
require "oauth2"
|
3
3
|
require "gds-sso/version"
|
4
4
|
|
@@ -35,7 +35,7 @@ module GDS
|
|
35
35
|
# structure. Here we're addressing signon directly so
|
36
36
|
# we need to transform the response ourselves.
|
37
37
|
def self.omniauth_style_response(response_body)
|
38
|
-
input =
|
38
|
+
input = JSON.parse(response_body).fetch("user")
|
39
39
|
|
40
40
|
{
|
41
41
|
"uid" => input["uid"],
|
data/lib/gds-sso/version.rb
CHANGED
data/lib/gds-sso.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "omniauth-oauth2"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
class OmniAuth::Strategies::Gds < OmniAuth::Strategies::OAuth2
|
5
|
+
uid { user["uid"] }
|
6
|
+
|
7
|
+
info do
|
8
|
+
{
|
9
|
+
name: user["name"],
|
10
|
+
email: user["email"],
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
extra do
|
15
|
+
{
|
16
|
+
user: user,
|
17
|
+
permissions: user["permissions"],
|
18
|
+
organisation_slug: user["organisation_slug"],
|
19
|
+
organisation_content_id: user["organisation_content_id"],
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def user
|
24
|
+
@user ||= JSON.parse(access_token.get("/user.json?client_id=#{CGI.escape(options.client_id)}").body).fetch("user")
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,83 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 17.
|
4
|
+
version: 17.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: oauth2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: oauth2
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '3'
|
37
|
-
type: :runtime
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '1'
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '3'
|
26
|
+
version: '2.0'
|
47
27
|
- !ruby/object:Gem::Dependency
|
48
28
|
name: omniauth
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
50
30
|
requirements:
|
51
|
-
- - "
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.2'
|
54
|
-
- - "<"
|
31
|
+
- - "~>"
|
55
32
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
33
|
+
version: '2.1'
|
57
34
|
type: :runtime
|
58
35
|
prerelease: false
|
59
36
|
version_requirements: !ruby/object:Gem::Requirement
|
60
37
|
requirements:
|
61
|
-
- - "
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '1.2'
|
64
|
-
- - "<"
|
38
|
+
- - "~>"
|
65
39
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
40
|
+
version: '2.1'
|
67
41
|
- !ruby/object:Gem::Dependency
|
68
|
-
name: omniauth-
|
42
|
+
name: omniauth-oauth2
|
69
43
|
requirement: !ruby/object:Gem::Requirement
|
70
44
|
requirements:
|
71
45
|
- - "~>"
|
72
46
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
47
|
+
version: '1.8'
|
74
48
|
type: :runtime
|
75
49
|
prerelease: false
|
76
50
|
version_requirements: !ruby/object:Gem::Requirement
|
77
51
|
requirements:
|
78
52
|
- - "~>"
|
79
53
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
54
|
+
version: '1.8'
|
81
55
|
- !ruby/object:Gem::Dependency
|
82
56
|
name: plek
|
83
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,14 +72,14 @@ dependencies:
|
|
98
72
|
requirements:
|
99
73
|
- - ">="
|
100
74
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
75
|
+
version: '6'
|
102
76
|
type: :runtime
|
103
77
|
prerelease: false
|
104
78
|
version_requirements: !ruby/object:Gem::Requirement
|
105
79
|
requirements:
|
106
80
|
- - ">="
|
107
81
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
82
|
+
version: '6'
|
109
83
|
- !ruby/object:Gem::Dependency
|
110
84
|
name: warden
|
111
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,128 +112,120 @@ dependencies:
|
|
138
112
|
name: capybara
|
139
113
|
requirement: !ruby/object:Gem::Requirement
|
140
114
|
requirements:
|
141
|
-
- - "
|
115
|
+
- - "~>"
|
142
116
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
117
|
+
version: '3'
|
144
118
|
type: :development
|
145
119
|
prerelease: false
|
146
120
|
version_requirements: !ruby/object:Gem::Requirement
|
147
121
|
requirements:
|
148
|
-
- - "
|
122
|
+
- - "~>"
|
149
123
|
- !ruby/object:Gem::Version
|
150
|
-
version: '
|
124
|
+
version: '3'
|
151
125
|
- !ruby/object:Gem::Dependency
|
152
126
|
name: capybara-mechanize
|
153
127
|
requirement: !ruby/object:Gem::Requirement
|
154
128
|
requirements:
|
155
|
-
- - "
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: '1'
|
158
|
-
type: :development
|
159
|
-
prerelease: false
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
161
|
-
requirements:
|
162
|
-
- - ">="
|
129
|
+
- - "~>"
|
163
130
|
- !ruby/object:Gem::Version
|
164
131
|
version: '1'
|
165
|
-
- !ruby/object:Gem::Dependency
|
166
|
-
name: combustion
|
167
|
-
requirement: !ruby/object:Gem::Requirement
|
168
|
-
requirements:
|
169
132
|
- - ">="
|
170
133
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
134
|
+
version: 1.12.1
|
172
135
|
type: :development
|
173
136
|
prerelease: false
|
174
137
|
version_requirements: !ruby/object:Gem::Requirement
|
175
138
|
requirements:
|
139
|
+
- - "~>"
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '1'
|
176
142
|
- - ">="
|
177
143
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
144
|
+
version: 1.12.1
|
179
145
|
- !ruby/object:Gem::Dependency
|
180
|
-
name:
|
146
|
+
name: combustion
|
181
147
|
requirement: !ruby/object:Gem::Requirement
|
182
148
|
requirements:
|
183
149
|
- - "~>"
|
184
150
|
- !ruby/object:Gem::Version
|
185
|
-
version:
|
151
|
+
version: '1.3'
|
186
152
|
type: :development
|
187
153
|
prerelease: false
|
188
154
|
version_requirements: !ruby/object:Gem::Requirement
|
189
155
|
requirements:
|
190
156
|
- - "~>"
|
191
157
|
- !ruby/object:Gem::Version
|
192
|
-
version:
|
158
|
+
version: '1.3'
|
193
159
|
- !ruby/object:Gem::Dependency
|
194
160
|
name: rake
|
195
161
|
requirement: !ruby/object:Gem::Requirement
|
196
162
|
requirements:
|
197
163
|
- - ">="
|
198
164
|
- !ruby/object:Gem::Version
|
199
|
-
version: '0
|
165
|
+
version: '0'
|
200
166
|
type: :development
|
201
167
|
prerelease: false
|
202
168
|
version_requirements: !ruby/object:Gem::Requirement
|
203
169
|
requirements:
|
204
170
|
- - ">="
|
205
171
|
- !ruby/object:Gem::Version
|
206
|
-
version: '0
|
172
|
+
version: '0'
|
207
173
|
- !ruby/object:Gem::Dependency
|
208
174
|
name: rspec-rails
|
209
175
|
requirement: !ruby/object:Gem::Requirement
|
210
176
|
requirements:
|
211
|
-
- - "
|
177
|
+
- - "~>"
|
212
178
|
- !ruby/object:Gem::Version
|
213
|
-
version: '
|
179
|
+
version: '6'
|
214
180
|
type: :development
|
215
181
|
prerelease: false
|
216
182
|
version_requirements: !ruby/object:Gem::Requirement
|
217
183
|
requirements:
|
218
|
-
- - "
|
184
|
+
- - "~>"
|
219
185
|
- !ruby/object:Gem::Version
|
220
|
-
version: '
|
186
|
+
version: '6'
|
221
187
|
- !ruby/object:Gem::Dependency
|
222
188
|
name: rubocop-govuk
|
223
189
|
requirement: !ruby/object:Gem::Requirement
|
224
190
|
requirements:
|
225
|
-
- -
|
191
|
+
- - '='
|
226
192
|
- !ruby/object:Gem::Version
|
227
|
-
version:
|
193
|
+
version: 4.8.0
|
228
194
|
type: :development
|
229
195
|
prerelease: false
|
230
196
|
version_requirements: !ruby/object:Gem::Requirement
|
231
197
|
requirements:
|
232
|
-
- -
|
198
|
+
- - '='
|
233
199
|
- !ruby/object:Gem::Version
|
234
|
-
version:
|
200
|
+
version: 4.8.0
|
235
201
|
- !ruby/object:Gem::Dependency
|
236
202
|
name: sqlite3
|
237
203
|
requirement: !ruby/object:Gem::Requirement
|
238
204
|
requirements:
|
239
205
|
- - "~>"
|
240
206
|
- !ruby/object:Gem::Version
|
241
|
-
version: '1.
|
207
|
+
version: '1.5'
|
242
208
|
type: :development
|
243
209
|
prerelease: false
|
244
210
|
version_requirements: !ruby/object:Gem::Requirement
|
245
211
|
requirements:
|
246
212
|
- - "~>"
|
247
213
|
- !ruby/object:Gem::Version
|
248
|
-
version: '1.
|
214
|
+
version: '1.5'
|
249
215
|
- !ruby/object:Gem::Dependency
|
250
216
|
name: timecop
|
251
217
|
requirement: !ruby/object:Gem::Requirement
|
252
218
|
requirements:
|
253
|
-
- - "
|
219
|
+
- - "~>"
|
254
220
|
- !ruby/object:Gem::Version
|
255
|
-
version: '0.
|
221
|
+
version: '0.9'
|
256
222
|
type: :development
|
257
223
|
prerelease: false
|
258
224
|
version_requirements: !ruby/object:Gem::Requirement
|
259
225
|
requirements:
|
260
|
-
- - "
|
226
|
+
- - "~>"
|
261
227
|
- !ruby/object:Gem::Version
|
262
|
-
version: '0.
|
228
|
+
version: '0.9'
|
263
229
|
description: Client for GDS' OAuth 2-based SSO
|
264
230
|
email:
|
265
231
|
- govuk-dev@digital.cabinet-office.gov.uk
|
@@ -289,6 +255,7 @@ files:
|
|
289
255
|
- lib/gds-sso/user.rb
|
290
256
|
- lib/gds-sso/version.rb
|
291
257
|
- lib/gds-sso/warden_config.rb
|
258
|
+
- lib/omniauth/strategies/gds.rb
|
292
259
|
- spec/controller/api_user_controller_spec.rb
|
293
260
|
- spec/controller/controller_methods_spec.rb
|
294
261
|
- spec/fixtures/integration/authorize_api_users.sql
|
@@ -337,37 +304,37 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
337
304
|
- !ruby/object:Gem::Version
|
338
305
|
version: '0'
|
339
306
|
requirements: []
|
340
|
-
rubygems_version: 3.3.
|
307
|
+
rubygems_version: 3.3.24
|
341
308
|
signing_key:
|
342
309
|
specification_version: 4
|
343
310
|
summary: Client for GDS' OAuth 2-based SSO
|
344
311
|
test_files:
|
312
|
+
- spec/spec_helper.rb
|
345
313
|
- spec/fixtures/integration/signon.sql
|
346
314
|
- spec/fixtures/integration/authorize_api_users.sql
|
347
315
|
- spec/requests/end_to_end_spec.rb
|
348
|
-
- spec/
|
349
|
-
- spec/
|
316
|
+
- spec/support/controller_spy.rb
|
317
|
+
- spec/support/timecop.rb
|
318
|
+
- spec/support/serializable_user.rb
|
319
|
+
- spec/support/test_user.rb
|
320
|
+
- spec/support/signon_integration_helpers.rb
|
321
|
+
- spec/support/backport_controller_test_params.rb
|
322
|
+
- spec/controller/api_user_controller_spec.rb
|
323
|
+
- spec/controller/controller_methods_spec.rb
|
324
|
+
- spec/internal/config/routes.rb
|
350
325
|
- spec/internal/config/database.yml
|
351
326
|
- spec/internal/config/initializers/gds-sso.rb
|
352
|
-
- spec/internal/config/routes.rb
|
353
327
|
- spec/internal/config/storage.yml
|
354
328
|
- spec/internal/app/models/user.rb
|
355
|
-
- spec/internal/app/controllers/application_controller.rb
|
356
329
|
- spec/internal/app/controllers/example_controller.rb
|
330
|
+
- spec/internal/app/controllers/application_controller.rb
|
357
331
|
- spec/internal/app/assets/config/manifest.js
|
358
332
|
- spec/internal/db/schema.rb
|
359
|
-
- spec/
|
360
|
-
- spec/unit/
|
333
|
+
- spec/internal/public/favicon.ico
|
334
|
+
- spec/unit/mock_bearer_token_spec.rb
|
361
335
|
- spec/unit/bearer_token_spec.rb
|
362
|
-
- spec/unit/
|
336
|
+
- spec/unit/api_access_spec.rb
|
363
337
|
- spec/unit/user_spec.rb
|
364
|
-
- spec/unit/mock_bearer_token_spec.rb
|
365
338
|
- spec/unit/session_serialisation_spec.rb
|
366
|
-
- spec/
|
367
|
-
- spec/
|
368
|
-
- spec/support/signon_integration_helpers.rb
|
369
|
-
- spec/support/backport_controller_test_params.rb
|
370
|
-
- spec/support/controller_spy.rb
|
371
|
-
- spec/support/serializable_user.rb
|
372
|
-
- spec/controller/controller_methods_spec.rb
|
373
|
-
- spec/controller/api_user_controller_spec.rb
|
339
|
+
- spec/unit/config_spec.rb
|
340
|
+
- spec/unit/railtie_spec.rb
|