govuk_personalisation 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ci.yml +36 -0
- data/.rubocop.yml +1 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -2
- data/govuk_personalisation.gemspec +2 -2
- data/lib/govuk_personalisation/flash.rb +1 -1
- data/lib/govuk_personalisation/urls.rb +9 -4
- data/lib/govuk_personalisation/version.rb +1 -1
- metadata +10 -9
- data/Jenkinsfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bcf8d368f8b0a1b1262d714d53eca96638270d12d9a064bb91439d384b42eb0
|
4
|
+
data.tar.gz: 277a7a1ca1a96370676bbce2548a85a033a73b8c49e1bcae6ca3f56671e45c6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd009d3a20051533961e3c581b178ffde8def6bf2e29fc4b2bde9745626abed38aa8153c8a99153401dac9b2d72d1cfcdfe97cad465f01f512bd8367d018167
|
7
|
+
data.tar.gz: 5c68fbff6fdbb178bb13e07e9002ba934a78e68a40e309de241495cd6eee265ab6ca5be0a8fe0f9bda39aa465e069baac407a433d72b0174d18feb6dfa30c65c
|
@@ -0,0 +1,36 @@
|
|
1
|
+
on: [push, pull_request]
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
# This matrix job runs the test suite against multiple Ruby versions
|
5
|
+
test_matrix:
|
6
|
+
strategy:
|
7
|
+
fail-fast: false
|
8
|
+
matrix:
|
9
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
10
|
+
ruby: ['3.0', 3.1, 3.2]
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v3
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
bundler-cache: true
|
18
|
+
- run: bundle exec rake
|
19
|
+
|
20
|
+
# Branch protection rules cannot directly depend on status checks from matrix jobs.
|
21
|
+
# So instead we define `test` as a dummy job which only runs after the preceding `test_matrix` checks have passed.
|
22
|
+
# Solution inspired by: https://github.community/t/status-check-for-a-matrix-jobs/127354/3
|
23
|
+
test:
|
24
|
+
needs: test_matrix
|
25
|
+
runs-on: ubuntu-latest
|
26
|
+
steps:
|
27
|
+
- run: echo "All matrix tests have passed 🚀"
|
28
|
+
|
29
|
+
publish:
|
30
|
+
needs: test
|
31
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
32
|
+
permissions:
|
33
|
+
contents: write
|
34
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yml@main
|
35
|
+
secrets:
|
36
|
+
GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.5
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,18 @@
|
|
1
|
+
# 0.14.0
|
2
|
+
|
3
|
+
- Use GOVUK_ENVIRONMENT as a backstop for DIGITAL_IDENTITY_ENVIRONMENT ([#53](https://github.com/alphagov/govuk_personalisation/pull/53))
|
4
|
+
- Drop Ruby 2.7 support ([#51](https://github.com/alphagov/govuk_personalisation/pull/51))
|
5
|
+
|
6
|
+
# 0.13.0
|
7
|
+
|
8
|
+
- Minimum Ruby version is now 2.7.6 ([#39](https://github.com/alphagov/govuk_personalisation/pull/39))
|
9
|
+
- Modify Digital Identity URI to `home.account.gov.uk` ([#43](https://github.com/alphagov/govuk_personalisation/pull/43))
|
10
|
+
|
1
11
|
# 0.12.0
|
2
12
|
|
3
13
|
- Set account home to Digital Identity URI ([#36](https://github.com/alphagov/govuk_personalisation/pull/36))
|
4
14
|
- Add `GovukPersonalisation::Urls.manage_email` link ([#38](https://github.com/alphagov/govuk_personalisation/pull/38))
|
5
15
|
|
6
|
-
|
7
16
|
# 0.11.2
|
8
17
|
|
9
18
|
- Add support for Rails 7 ([#33](https://github.com/alphagov/govuk_personalisation/pull/33))
|
@@ -21,10 +30,12 @@
|
|
21
30
|
- Make session-change events uncacheable ([#24](https://github.com/alphagov/govuk_personalisation/pull/24))
|
22
31
|
|
23
32
|
# 0.10.0
|
33
|
+
|
24
34
|
- Add `url_with_analytics` helper to allow apps to access the URL used for `redirect_with_analytics` ([#22](https://github.com/alphagov/govuk_personalisation/pull/22))
|
25
35
|
|
26
36
|
# 0.9.0
|
27
|
-
|
37
|
+
|
38
|
+
- Add `redirect_with_analytics` helper, attaches \_ga and cookie_consent values from existing params to redirects. ([#19](https://github.com/alphagov/govuk_personalisation/pull/19))
|
28
39
|
- Add `GovukPersonalisation::Redirect` and `.build_url` helper to construct valid URLs with additional parameters. ([#19](https://github.com/alphagov/govuk_personalisation/pull/19))
|
29
40
|
|
30
41
|
# 0.8.0
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.description = "A gem to hold shared code which other GOV.UK apps will use to implement accounts-related functionality."
|
15
15
|
spec.homepage = "https://github.com/alphagov/govuk_personalisation"
|
16
16
|
spec.license = "MIT"
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0")
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -33,5 +33,5 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "pry-byebug"
|
34
34
|
spec.add_development_dependency "rake"
|
35
35
|
spec.add_development_dependency "rspec-rails"
|
36
|
-
spec.add_development_dependency "rubocop-govuk"
|
36
|
+
spec.add_development_dependency "rubocop-govuk", "4.11.0"
|
37
37
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module GovukPersonalisation::Flash
|
4
4
|
SESSION_SEPARATOR = "$$"
|
5
5
|
MESSAGE_SEPARATOR = ","
|
6
|
-
MESSAGE_REGEX = /\A[a-zA-Z0-9._
|
6
|
+
MESSAGE_REGEX = /\A[a-zA-Z0-9._-]+\z/
|
7
7
|
|
8
8
|
# Splits the session header into a session value (suitable for using
|
9
9
|
# in account-api calls) and flash messages.
|
@@ -95,11 +95,16 @@ module GovukPersonalisation::Urls
|
|
95
95
|
#
|
96
96
|
# @return [String] the domain
|
97
97
|
def self.digital_identity_domain
|
98
|
-
|
99
|
-
|
100
|
-
"#{environment}.account.gov.uk"
|
98
|
+
if digital_identity_environment
|
99
|
+
"home.#{digital_identity_environment}.account.gov.uk"
|
101
100
|
else
|
102
|
-
"account.gov.uk"
|
101
|
+
"home.account.gov.uk"
|
103
102
|
end
|
104
103
|
end
|
104
|
+
|
105
|
+
def self.digital_identity_environment
|
106
|
+
return ENV["DIGITAL_IDENTITY_ENVIRONMENT"] if ENV["DIGITAL_IDENTITY_ENVIRONMENT"]
|
107
|
+
|
108
|
+
ENV["GOVUK_ENVIRONMENT"] == "production" ? nil : ENV["GOVUK_ENVIRONMENT"]
|
109
|
+
end
|
105
110
|
end
|
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.14.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:
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|
@@ -118,16 +118,16 @@ dependencies:
|
|
118
118
|
name: rubocop-govuk
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - '='
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: 4.11.0
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - '='
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: 4.11.0
|
131
131
|
description: A gem to hold shared code which other GOV.UK apps will use to implement
|
132
132
|
accounts-related functionality.
|
133
133
|
email:
|
@@ -136,13 +136,14 @@ executables: []
|
|
136
136
|
extensions: []
|
137
137
|
extra_rdoc_files: []
|
138
138
|
files:
|
139
|
+
- ".github/dependabot.yml"
|
140
|
+
- ".github/workflows/ci.yml"
|
139
141
|
- ".gitignore"
|
140
142
|
- ".rspec"
|
141
143
|
- ".rubocop.yml"
|
142
144
|
- ".ruby-version"
|
143
145
|
- CHANGELOG.md
|
144
146
|
- Gemfile
|
145
|
-
- Jenkinsfile
|
146
147
|
- LICENCE
|
147
148
|
- README.md
|
148
149
|
- Rakefile
|
@@ -169,14 +170,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
170
|
requirements:
|
170
171
|
- - ">="
|
171
172
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
173
|
+
version: '3.0'
|
173
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
175
|
requirements:
|
175
176
|
- - ">="
|
176
177
|
- !ruby/object:Gem::Version
|
177
178
|
version: '0'
|
178
179
|
requirements: []
|
179
|
-
rubygems_version: 3.
|
180
|
+
rubygems_version: 3.4.15
|
180
181
|
signing_key:
|
181
182
|
specification_version: 4
|
182
183
|
summary: A gem to hold shared code which other GOV.UK apps will use to implement accounts-related
|