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 +4 -4
- data/lib/gds-sso/lint/user_spec.rb +18 -1
- data/lib/gds-sso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 006b7a16f52c7a8013c5bf88cf8afeb9dbe9676a444618b80cb47c546bc8dda7
|
4
|
+
data.tar.gz: 19796282c692f14f5e5cfc6ee7dd823835d536a804470745affdd42cf1ca78c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/gds-sso/version.rb
CHANGED