govuk_personalisation 0.4.0 → 0.5.0
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/CHANGELOG.md +4 -0
- data/lib/govuk_personalisation/account_concern.rb +8 -8
- data/lib/govuk_personalisation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7494e4a43a49be9a654d9b95ad2a2884575c3d46b8b6e5487b9c472575705ada
|
|
4
|
+
data.tar.gz: 4321076a89efdcc1289d3dccb23eb7c26a87dd877dc63764d1d6da796f18c128
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d772b13491114187dc74f38ceb5959721da4e9df7caa46384fea1e5b7e2f0bdc96486b9e11e1f07a40da625371bfd219f10024d801f417fe23da75ec32ce435
|
|
7
|
+
data.tar.gz: 1e68f1eeb364957909271666d19a12af06c3f64f47744c9e34d7850a99282b67685cace40b997d5b56a4245b1b7501fc8d03e4c2eaec61b8eddd91957604783f
|
data/CHANGELOG.md
CHANGED
|
@@ -6,9 +6,9 @@ module GovukPersonalisation
|
|
|
6
6
|
module AccountConcern
|
|
7
7
|
extend ActiveSupport::Concern
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ACCOUNT_SESSION_INTERNAL_HEADER_NAME = "HTTP_GOVUK_ACCOUNT_SESSION"
|
|
10
|
+
ACCOUNT_SESSION_HEADER_NAME = "GOVUK-Account-Session"
|
|
11
|
+
ACCOUNT_END_SESSION_HEADER_NAME = "GOVUK-Account-End-Session"
|
|
12
12
|
ACCOUNT_SESSION_DEV_COOKIE_NAME = "govuk_account_session"
|
|
13
13
|
|
|
14
14
|
included do
|
|
@@ -23,20 +23,20 @@ module GovukPersonalisation
|
|
|
23
23
|
|
|
24
24
|
def fetch_account_session_header
|
|
25
25
|
@account_session_header =
|
|
26
|
-
if request.headers[
|
|
27
|
-
request.headers[
|
|
26
|
+
if request.headers[ACCOUNT_SESSION_INTERNAL_HEADER_NAME]
|
|
27
|
+
request.headers[ACCOUNT_SESSION_INTERNAL_HEADER_NAME].presence
|
|
28
28
|
elsif Rails.env.development?
|
|
29
29
|
cookies[ACCOUNT_SESSION_DEV_COOKIE_NAME]
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def set_account_vary_header
|
|
34
|
-
response.headers["Vary"] = [response.headers["Vary"],
|
|
34
|
+
response.headers["Vary"] = [response.headers["Vary"], ACCOUNT_SESSION_HEADER_NAME].compact.join(", ")
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def set_account_session_header(govuk_account_session = nil)
|
|
38
38
|
@account_session_header = govuk_account_session if govuk_account_session
|
|
39
|
-
response.headers[
|
|
39
|
+
response.headers[ACCOUNT_SESSION_HEADER_NAME] = @account_session_header
|
|
40
40
|
if Rails.env.development?
|
|
41
41
|
cookies[ACCOUNT_SESSION_DEV_COOKIE_NAME] = {
|
|
42
42
|
value: @account_session_header,
|
|
@@ -46,7 +46,7 @@ module GovukPersonalisation
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def logout!
|
|
49
|
-
response.headers[
|
|
49
|
+
response.headers[ACCOUNT_END_SESSION_HEADER_NAME] = "1"
|
|
50
50
|
@account_session_header = nil
|
|
51
51
|
if Rails.env.development?
|
|
52
52
|
cookies[ACCOUNT_SESSION_DEV_COOKIE_NAME] = {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_personalisation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-06-
|
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|