gds-sso 22.1.0 → 22.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69935efadb057e8b8f85cdd7549ff1c07a94d2b50ba25086e64c3f17dc8730c6
4
- data.tar.gz: 28bc82620af28be973c62ef9c2020e072f9971aabfe7f6bce1b17c66d12fa8fd
3
+ metadata.gz: 006b7a16f52c7a8013c5bf88cf8afeb9dbe9676a444618b80cb47c546bc8dda7
4
+ data.tar.gz: 19796282c692f14f5e5cfc6ee7dd823835d536a804470745affdd42cf1ca78c7
5
5
  SHA512:
6
- metadata.gz: a57f468d6a7bed0783851e1364112cbaaeea9ae41ea82b53b90e8231f0b2d9ec8280e69527c19dd79b04c1c127fb83d8f77ad80d69cad9763189abfc04a2a674
7
- data.tar.gz: a6c38c8f82b5006ff4e69a505f7ce1c26a7e5469c816148c930a44225ed048f209ea8891666e9f7eb7d8f0a243a49cfc8f52ae8874037fe3a79b9e7d28ec36aa
6
+ metadata.gz: 93c40856ef0a2442e7cdca2854dff5d34c4d726a573e1dccf2bd5d81b7381d67243026a2ad00a165b6ff189c0ab15ff5cdf0e990ac0c25f00afea2c49cb0bd00
7
+ data.tar.gz: 3e9ed3c8da369905de18e35487c9d60b1a0c49663436bfff8a0e4bfeaf035914026512c47c4ca6f338c025bc878cbd1100ca0eeded22087355c0761b47057066
@@ -49,7 +49,7 @@ RSpec.shared_examples "a gds-sso user class" do
49
49
  end
50
50
 
51
51
  specify "the User class and GDS::SSO::User mixin work together" do
52
- ClimateControl.modify ANONYMOUS_USER_ID_SECRET: "some-anonymous-user-id-secret" do
52
+ with_anonymous_user_id_secret "some-anonymous-user-id-secret" do
53
53
  auth_hash = {
54
54
  "uid" => "12345",
55
55
  "info" => {
@@ -78,4 +78,21 @@ RSpec.shared_examples "a gds-sso user class" do
78
78
  expect(user.organisation_content_id).to eq("91e57ad9-29a3-4f94-9ab4-5e9ae6d13588")
79
79
  end
80
80
  end
81
+
82
+ private
83
+
84
+ def with_anonymous_user_id_secret(value, &block)
85
+ if defined?(ClimateControl)
86
+ ClimateControl.modify(ANONYMOUS_USER_ID_SECRET: value, &block)
87
+ else
88
+ # If ClimateControl isn't available, we fall back to a simpler way of setting / resetting the environment
89
+ # variable. This doesn't account for tests running in parallel though.
90
+ begin
91
+ ENV["ANONYMOUS_USER_ID_SECRET"] = value
92
+ block.call
93
+ ensure
94
+ ENV.delete "ANONYMOUS_USER_ID_SECRET"
95
+ end
96
+ end
97
+ end
81
98
  end
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "22.1.0".freeze
3
+ VERSION = "22.1.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.1.0
4
+ version: 22.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev