govuk_publishing_components 23.7.6 → 23.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1edd09d1efa0a5d378ebd7a13383f7de12dc41f7928e36c3b12194cfb96afe32
4
- data.tar.gz: d81001fc9228d15ac67b2b42b7ede030969e0d8b02551e92682aa9737c0a76aa
3
+ metadata.gz: 4bcf906c61bd12c5c7a7eaa0f3a948c0e17cf23b3590e4640ea3b91fd8b20494
4
+ data.tar.gz: 367dd5afad155e02d182cb8b4b48dc6740a24b7888111b947c4cc486d963bfad
5
5
  SHA512:
6
- metadata.gz: 896f5562e07f5ccb4d35c35002f03a883941eb92dc3b7e73e594ff6acd50f39416789ee345e25a5ed560469ee308a85a1df7ee084cf23e240ba5c90fa80565cc
7
- data.tar.gz: 31e88d2547c8bfb98f70d69e4ec403e9a920a1b6796be51fe9101b1cd77893bca6945339c327ae2726e68c5690caccdbd3497d279b27f84f0f55a89bb9c3a28e
6
+ metadata.gz: 1b5fe1817e673d9d5a2bffcecccf1434d34f1b13643df275fccca45a2f478b4a56f9e27b486713faa6fa5bb48c21a4999b293d5b6aabec468a899a28345bcfef
7
+ data.tar.gz: 8086257659e01ac460d9fdf0cde17fc20378bc24bfcb35bfa00cea04247c2ebacc3237d72f4fe1a2e027c1433fb93c2f65be07fc0fbefcfd7d09c9bd499c9b8e
@@ -8,6 +8,11 @@
8
8
  var POSTCODE_PATTERN = /[A-PR-UWYZ][A-HJ-Z]?[0-9][0-9A-HJKMNPR-Y]?(?:[\s+]|%20)*[0-9][ABD-HJLNPQ-Z]{2}/gi
9
9
  var DATE_PATTERN = /\d{4}(-?)\d{2}(-?)\d{2}/g
10
10
 
11
+ // specific URL parameters to be redacted from accounts URLs
12
+ var RESET_PASSWORD_TOKEN_PATTERN = /reset_password_token=[a-zA-Z0-9-]+/g
13
+ var UNLOCK_TOKEN_PATTERN = /unlock_token=[a-zA-Z0-9-]+/g
14
+ var STATE_PATTERN = /state=.[^&]+/g
15
+
11
16
  function shouldStripDates () {
12
17
  return ($('meta[name="govuk:static-analytics:strip-dates"]').length > 0)
13
18
  }
@@ -35,6 +40,10 @@
35
40
 
36
41
  pii.prototype.stripPIIFromString = function (string) {
37
42
  var stripped = string.replace(EMAIL_PATTERN, '[email]')
43
+ stripped = stripped.replace(RESET_PASSWORD_TOKEN_PATTERN, 'reset_password_token=[reset_password_token]')
44
+ stripped = stripped.replace(UNLOCK_TOKEN_PATTERN, 'unlock_token=[unlock_token]')
45
+ stripped = stripped.replace(STATE_PATTERN, 'state=[state]')
46
+
38
47
  if (this.stripDatePII === true) {
39
48
  stripped = stripped.replace(DATE_PATTERN, '[date]')
40
49
  }
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.7.6".freeze
2
+ VERSION = "23.7.7".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.7.6
4
+ version: 23.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config