gds-sso 16.0.0 → 16.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/authentications_controller.rb +1 -1
- data/lib/gds-sso/version.rb +1 -1
- data/lib/gds-sso.rb +2 -0
- data/spec/controller/controller_methods_spec.rb +0 -14
- data/spec/fixtures/integration/authorize_api_users.sql +2 -2
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/log/test.log +828 -820
- data/spec/support/controller_spy.rb +14 -0
- data/spec/support/serializable_user.rb +3 -0
- data/spec/support/signon_integration_helpers.rb +1 -1
- data/spec/support/test_user.rb +29 -0
- data/spec/unit/session_serialisation_spec.rb +0 -4
- data/spec/unit/user_spec.rb +0 -30
- metadata +38 -26
@@ -0,0 +1,14 @@
|
|
1
|
+
class ControllerSpy < ApplicationController
|
2
|
+
include GDS::SSO::ControllerMethods
|
3
|
+
# rubocop:disable Lint/MissingSuper
|
4
|
+
def initialize(current_user)
|
5
|
+
@current_user = current_user
|
6
|
+
end
|
7
|
+
# rubocop:enable Lint/MissingSuper
|
8
|
+
|
9
|
+
def authenticate_user!
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :current_user
|
14
|
+
end
|
@@ -37,7 +37,7 @@ module SignonIntegrationHelpers
|
|
37
37
|
|
38
38
|
def load_signon_fixture(filename)
|
39
39
|
require "erb"
|
40
|
-
parsed = ERB.new(File.read(signon_path
|
40
|
+
parsed = ERB.new(File.read("#{signon_path}/config/database.yml")).result
|
41
41
|
db = YAML.safe_load(parsed, aliases: true)["test"]
|
42
42
|
|
43
43
|
cmd = "mysql #{db['database']} -u#{db['username']} -p#{db['password']} < #{fixture_file(filename)}"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class TestUser < OpenStruct
|
2
|
+
include GDS::SSO::User
|
3
|
+
|
4
|
+
def self.where(_opts)
|
5
|
+
[]
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create!(options, _scope = {})
|
9
|
+
new(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_attribute(key, value)
|
13
|
+
send("#{key}=".to_sym, value)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update!(options)
|
17
|
+
options.each do |key, value|
|
18
|
+
update_attribute(key, value)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def remotely_signed_out?
|
23
|
+
remotely_signed_out
|
24
|
+
end
|
25
|
+
|
26
|
+
def disabled?
|
27
|
+
disabled
|
28
|
+
end
|
29
|
+
end
|
@@ -2,10 +2,6 @@ require "spec_helper"
|
|
2
2
|
require "active_record"
|
3
3
|
|
4
4
|
describe Warden::SessionSerializer do
|
5
|
-
class SerializableUser
|
6
|
-
include GDS::SSO::User
|
7
|
-
end
|
8
|
-
|
9
5
|
before :each do
|
10
6
|
@old_user_model = GDS::SSO::Config.user_model
|
11
7
|
GDS::SSO::Config.user_model = SerializableUser
|
data/spec/unit/user_spec.rb
CHANGED
@@ -31,36 +31,6 @@ describe GDS::SSO::User do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
context "making sure that the lint spec is valid" do
|
34
|
-
class TestUser < OpenStruct
|
35
|
-
include GDS::SSO::User
|
36
|
-
|
37
|
-
def self.where(_opts)
|
38
|
-
[]
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.create!(options, _scope = {})
|
42
|
-
new(options)
|
43
|
-
end
|
44
|
-
|
45
|
-
def update_attribute(key, value)
|
46
|
-
send("#{key}=".to_sym, value)
|
47
|
-
end
|
48
|
-
|
49
|
-
def update!(options)
|
50
|
-
options.each do |key, value|
|
51
|
-
update_attribute(key, value)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def remotely_signed_out?
|
56
|
-
remotely_signed_out
|
57
|
-
end
|
58
|
-
|
59
|
-
def disabled?
|
60
|
-
disabled
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
34
|
let(:described_class) { TestUser }
|
65
35
|
it_behaves_like "a gds-sso user class"
|
66
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.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:
|
11
|
+
date: 2022-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: omniauth
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.2'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '3.0'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '1.2'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: omniauth-gds
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,7 +288,10 @@ files:
|
|
282
288
|
- spec/requests/end_to_end_spec.rb
|
283
289
|
- spec/spec_helper.rb
|
284
290
|
- spec/support/backport_controller_test_params.rb
|
291
|
+
- spec/support/controller_spy.rb
|
292
|
+
- spec/support/serializable_user.rb
|
285
293
|
- spec/support/signon_integration_helpers.rb
|
294
|
+
- spec/support/test_user.rb
|
286
295
|
- spec/support/timecop.rb
|
287
296
|
- spec/unit/api_access_spec.rb
|
288
297
|
- spec/unit/bearer_token_spec.rb
|
@@ -310,36 +319,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
319
|
- !ruby/object:Gem::Version
|
311
320
|
version: '0'
|
312
321
|
requirements: []
|
313
|
-
rubygems_version: 3.1.
|
322
|
+
rubygems_version: 3.1.6
|
314
323
|
signing_key:
|
315
324
|
specification_version: 4
|
316
325
|
summary: Client for GDS' OAuth 2-based SSO
|
317
326
|
test_files:
|
318
|
-
- spec/
|
319
|
-
- spec/controller/api_user_controller_spec.rb
|
320
|
-
- spec/internal/config/storage.yml
|
321
|
-
- spec/internal/config/routes.rb
|
322
|
-
- spec/internal/config/database.yml
|
323
|
-
- spec/internal/config/initializers/gds-sso.rb
|
324
|
-
- spec/internal/public/favicon.ico
|
325
|
-
- spec/internal/app/assets/config/manifest.js
|
326
|
-
- spec/internal/app/controllers/application_controller.rb
|
327
|
-
- spec/internal/app/controllers/example_controller.rb
|
327
|
+
- spec/requests/end_to_end_spec.rb
|
328
328
|
- spec/internal/app/models/user.rb
|
329
|
-
- spec/internal/
|
330
|
-
- spec/internal/
|
329
|
+
- spec/internal/app/controllers/example_controller.rb
|
330
|
+
- spec/internal/app/controllers/application_controller.rb
|
331
|
+
- spec/internal/app/assets/config/manifest.js
|
331
332
|
- spec/internal/db/combustion_test.sqlite
|
332
|
-
- spec/
|
333
|
-
- spec/
|
334
|
-
- spec/
|
333
|
+
- spec/internal/db/schema.rb
|
334
|
+
- spec/internal/public/favicon.ico
|
335
|
+
- spec/internal/log/test.log
|
336
|
+
- spec/internal/config/routes.rb
|
337
|
+
- spec/internal/config/storage.yml
|
338
|
+
- spec/internal/config/initializers/gds-sso.rb
|
339
|
+
- spec/internal/config/database.yml
|
340
|
+
- spec/fixtures/integration/authorize_api_users.sql
|
341
|
+
- spec/fixtures/integration/signon.sql
|
335
342
|
- spec/spec_helper.rb
|
336
|
-
- spec/
|
343
|
+
- spec/controller/api_user_controller_spec.rb
|
344
|
+
- spec/controller/controller_methods_spec.rb
|
337
345
|
- spec/unit/bearer_token_spec.rb
|
338
|
-
- spec/unit/mock_bearer_token_spec.rb
|
339
346
|
- spec/unit/api_access_spec.rb
|
340
|
-
- spec/unit/
|
347
|
+
- spec/unit/config_spec.rb
|
341
348
|
- spec/unit/session_serialisation_spec.rb
|
349
|
+
- spec/unit/railtie_spec.rb
|
342
350
|
- spec/unit/user_spec.rb
|
343
|
-
- spec/
|
344
|
-
- spec/
|
345
|
-
- spec/
|
351
|
+
- spec/unit/mock_bearer_token_spec.rb
|
352
|
+
- spec/support/test_user.rb
|
353
|
+
- spec/support/controller_spy.rb
|
354
|
+
- spec/support/timecop.rb
|
355
|
+
- spec/support/serializable_user.rb
|
356
|
+
- spec/support/backport_controller_test_params.rb
|
357
|
+
- spec/support/signon_integration_helpers.rb
|