govuk_personalisation 0.14.0 → 0.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bcf8d368f8b0a1b1262d714d53eca96638270d12d9a064bb91439d384b42eb0
4
- data.tar.gz: 277a7a1ca1a96370676bbce2548a85a033a73b8c49e1bcae6ca3f56671e45c6f
3
+ metadata.gz: 871e48e51f4a9c01f79d171f71e6fe5658cd2244383646a4067fb5f6c71a0dc5
4
+ data.tar.gz: 46945612a7a4c42d5c8e2b9cb92a6d080fd2c49456414045b8b9bd5e9bd98792
5
5
  SHA512:
6
- metadata.gz: 1cd009d3a20051533961e3c581b178ffde8def6bf2e29fc4b2bde9745626abed38aa8153c8a99153401dac9b2d72d1cfcdfe97cad465f01f512bd8367d018167
7
- data.tar.gz: 5c68fbff6fdbb178bb13e07e9002ba934a78e68a40e309de241495cd6eee265ab6ca5be0a8fe0f9bda39aa465e069baac407a433d72b0174d18feb6dfa30c65c
6
+ metadata.gz: 4fa1377a4de65067c052d465c85d98c62b4b2e97ad42957661608207977cd803ac6f9dcdc139874e847ce0c94d047479f30767303d7013361c245f4caf2a2b40
7
+ data.tar.gz: 7e08d033229d35b8a5009900aeff3f156ce3591285aed1b06d6b3e33609c9e5ca3d9babeb6142f797e78c80760d80e21b76bf4a2f29fd0371a9ec7435b68d1b3
@@ -1,6 +1,27 @@
1
1
  on: [push, pull_request]
2
2
 
3
3
  jobs:
4
+ snyk-security:
5
+ name: SNYK security analysis
6
+ uses: alphagov/govuk-infrastructure/.github/workflows/snyk-security.yml@main
7
+ with:
8
+ skip_sca: true
9
+ secrets: inherit
10
+ permissions:
11
+ contents: read
12
+ security-events: write
13
+ actions: read
14
+
15
+ codeql-sast:
16
+ name: CodeQL SAST scan
17
+ uses: alphagov/govuk-infrastructure/.github/workflows/codeql-analysis.yml@main
18
+ permissions:
19
+ security-events: write
20
+
21
+ dependency-review:
22
+ name: Dependency Review scan
23
+ uses: alphagov/govuk-infrastructure/.github/workflows/dependency-review.yml@main
24
+
4
25
  # This matrix job runs the test suite against multiple Ruby versions
5
26
  test_matrix:
6
27
  strategy:
@@ -10,7 +31,7 @@ jobs:
10
31
  ruby: ['3.0', 3.1, 3.2]
11
32
  runs-on: ubuntu-latest
12
33
  steps:
13
- - uses: actions/checkout@v3
34
+ - uses: actions/checkout@v4
14
35
  - uses: ruby/setup-ruby@v1
15
36
  with:
16
37
  ruby-version: ${{ matrix.ruby }}
@@ -0,0 +1,6 @@
1
+ api_version: 1
2
+ auto_merge:
3
+ - dependency: rubocop-govuk
4
+ allowed_semver_bumps:
5
+ - patch
6
+ - minor
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 0.16.0
2
+
3
+ - Update minimum required Ruby version ([#67](https://github.com/alphagov/govuk_personalisation/pull/67))
4
+ - Map our environments correctly to DI/One Login's environments. ([#63](https://github.com/alphagov/govuk_personalisation/pull/63))
5
+
6
+ # 0.15.0
7
+
8
+ - Update URLs and method names for One Login ([#56](https://github.com/alphagov/govuk_personalisation/pull/56))
9
+ - Note that this release deprecates the your_account, manage, security, and feedback methods of GovukPersonalisation::Urls, but retains them as aliases to allow easier transition. They will be removed in a later release.
10
+
1
11
  # 0.14.0
2
12
 
3
13
  - Use GOVUK_ENVIRONMENT as a backstop for DIGITAL_IDENTITY_ENVIRONMENT ([#53](https://github.com/alphagov/govuk_personalisation/pull/53))
@@ -33,5 +33,6 @@ 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", "4.11.0"
36
+ spec.add_development_dependency "rubocop-govuk", "4.14.0"
37
+ spec.add_development_dependency "simplecov"
37
38
  end
@@ -22,32 +22,41 @@ module GovukPersonalisation::Urls
22
22
  find_govuk_url(var: "SIGN_OUT", application: "email-alert-frontend", path: "/email/manage")
23
23
  end
24
24
 
25
- # Find the external URL for the "your account" page
25
+ # Find the external URL for the "your services" page on One Login
26
26
  #
27
27
  # @return [String] the URL
28
+ def self.one_login_your_services
29
+ find_external_url(var: "ONE_LOGIN_YOUR_SERVICES", url: "https://#{digital_identity_domain('home')}")
30
+ end
31
+
28
32
  def self.your_account
29
- find_external_url(var: "YOUR_ACCOUNT", url: "https://#{digital_identity_domain}")
33
+ one_login_your_services
30
34
  end
31
35
 
32
- # Find the external URL for the "manage" page
36
+ # Find the external URL for the "security" page on One Login
33
37
  #
34
38
  # @return [String] the URL
39
+ def self.one_login_security
40
+ find_external_url(var: "ONE_LOGIN_SECURITY", url: "https://#{digital_identity_domain('home')}/security")
41
+ end
42
+
35
43
  def self.manage
36
- find_external_url(var: "MANAGE", url: "https://#{digital_identity_domain}?link=manage-account")
44
+ one_login_security
37
45
  end
38
46
 
39
- # Find the external URL for the "security" page
40
- #
41
- # @return [String] the URL
42
47
  def self.security
43
- find_external_url(var: "SECURITY", url: "https://#{digital_identity_domain}?link=security-privacy")
48
+ one_login_security
44
49
  end
45
50
 
46
- # Find the external URL for the "feedback" page
51
+ # Find the external URL for the "feedback" page on One Login
47
52
  #
48
53
  # @return [String] the URL
54
+ def self.one_login_feedback
55
+ find_external_url(var: "ONE_LOGIN_FEEDBACK", url: "https://#{digital_identity_domain('signin')}/support?supportType=PUBLIC")
56
+ end
57
+
49
58
  def self.feedback
50
- find_external_url(var: "FEEDBACK", url: "https://signin.account.gov.uk/support")
59
+ one_login_feedback
51
60
  end
52
61
 
53
62
  # Finds a URL on www.gov.uk. This method is used so we can have
@@ -91,20 +100,25 @@ module GovukPersonalisation::Urls
91
100
  ENV.fetch("GOVUK_PERSONALISATION_#{var}_URI", url)
92
101
  end
93
102
 
94
- # Gets the Digital Identity domain for the current environment
95
- #
96
- # @return [String] the domain
97
- def self.digital_identity_domain
98
- if digital_identity_environment
99
- "home.#{digital_identity_environment}.account.gov.uk"
103
+ def self.digital_identity_domain(host)
104
+ if ["production", nil].include?(digital_identity_environment)
105
+ "#{host}.account.gov.uk"
100
106
  else
101
- "home.account.gov.uk"
107
+ "#{host}.#{digital_identity_environment}.account.gov.uk"
102
108
  end
103
109
  end
104
110
 
111
+ # DI/One Login's environments don't map exactly to ours - their staging points to
112
+ # our integration and vice versa. So translate here.
113
+ DIGITAL_IDENTITY_ENVIRONMENT_MAP = {
114
+ "production" => "production",
115
+ "staging" => "integration",
116
+ "integration" => "staging",
117
+ }.freeze
118
+
105
119
  def self.digital_identity_environment
106
120
  return ENV["DIGITAL_IDENTITY_ENVIRONMENT"] if ENV["DIGITAL_IDENTITY_ENVIRONMENT"]
107
121
 
108
- ENV["GOVUK_ENVIRONMENT"] == "production" ? nil : ENV["GOVUK_ENVIRONMENT"]
122
+ DIGITAL_IDENTITY_ENVIRONMENT_MAP[ENV["GOVUK_ENVIRONMENT"]] || ENV["GOVUK_ENVIRONMENT"]
109
123
  end
110
124
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GovukPersonalisation
4
- VERSION = "0.14.0"
4
+ VERSION = "0.16.0"
5
5
  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.14.0
4
+ version: 0.16.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: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek
@@ -120,14 +120,28 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 4.11.0
123
+ version: 4.14.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: 4.11.0
130
+ version: 4.14.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: simplecov
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
131
145
  description: A gem to hold shared code which other GOV.UK apps will use to implement
132
146
  accounts-related functionality.
133
147
  email:
@@ -139,6 +153,7 @@ files:
139
153
  - ".github/dependabot.yml"
140
154
  - ".github/workflows/ci.yml"
141
155
  - ".gitignore"
156
+ - ".govuk_dependabot_merger.yml"
142
157
  - ".rspec"
143
158
  - ".rubocop.yml"
144
159
  - ".ruby-version"
@@ -177,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
192
  - !ruby/object:Gem::Version
178
193
  version: '0'
179
194
  requirements: []
180
- rubygems_version: 3.4.15
195
+ rubygems_version: 3.5.6
181
196
  signing_key:
182
197
  specification_version: 4
183
198
  summary: A gem to hold shared code which other GOV.UK apps will use to implement accounts-related