gds-sso 16.0.0 → 16.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,3 @@
1
+ class SerializableUser
2
+ include GDS::SSO::User
3
+ 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 + "/config/database.yml")).result
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
@@ -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.0.0
4
+ version: 16.0.1
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: 2020-11-12 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -282,7 +282,10 @@ files:
282
282
  - spec/requests/end_to_end_spec.rb
283
283
  - spec/spec_helper.rb
284
284
  - spec/support/backport_controller_test_params.rb
285
+ - spec/support/controller_spy.rb
286
+ - spec/support/serializable_user.rb
285
287
  - spec/support/signon_integration_helpers.rb
288
+ - spec/support/test_user.rb
286
289
  - spec/support/timecop.rb
287
290
  - spec/unit/api_access_spec.rb
288
291
  - spec/unit/bearer_token_spec.rb
@@ -310,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
313
  - !ruby/object:Gem::Version
311
314
  version: '0'
312
315
  requirements: []
313
- rubygems_version: 3.1.4
316
+ rubygems_version: 3.1.6
314
317
  signing_key:
315
318
  specification_version: 4
316
319
  summary: Client for GDS' OAuth 2-based SSO
@@ -329,6 +332,9 @@ test_files:
329
332
  - spec/internal/log/test.log
330
333
  - spec/internal/db/schema.rb
331
334
  - spec/internal/db/combustion_test.sqlite
335
+ - spec/support/serializable_user.rb
336
+ - spec/support/controller_spy.rb
337
+ - spec/support/test_user.rb
332
338
  - spec/support/backport_controller_test_params.rb
333
339
  - spec/support/signon_integration_helpers.rb
334
340
  - spec/support/timecop.rb