gitlab_quality-test_tooling 1.10.0 → 1.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aa86323a85f779b89a3d26bd9e2b78e2166d4aaf1fdd18c5b3c26e67edbed1f
4
- data.tar.gz: 9096461ccb4f8527f0347c4987e405d0ef39ff45aa890468968b773372f854a0
3
+ metadata.gz: 021ba0cb90bad4c0b19863f72833bd2c4afc9e67c8ffccc82ed8faafd99cb651
4
+ data.tar.gz: 965d8b9a2afd8c3679fa0fbd58c0aac7865134430cca0af96eaf20c29c4cce45
5
5
  SHA512:
6
- metadata.gz: 3c6e475336007851d1fd92e18d3ec622ef1ea505b5a603b344eef1a36139a6be1cafc67c12758ce37b045eacb12812fe52aad58a80829336502b6edff48f17ca
7
- data.tar.gz: 4047f4eb355bb0247366d838367d2cf9628b3fe35b43ffe75760fc7578cc3bbeaa8ccb77ddc7c84184dbcfe2dbf888c5c679e9a600560d229193a3da055203cf
6
+ metadata.gz: b6b98c6fee95ea011fafda00a24a3bf57ecd110832e7dd4eaa68a8104cf963fe4a70dc62e5b17376436df041a6fbc2a1f322aecf53356284d4b2c85b43d07c2e
7
+ data.tar.gz: e317015e67335421cec8593bf4713cf1cd07996eba501a9fe77315120ba057893a03678d851673ad39d3959db23ad94378dfb24b1bbb2e3bc7958d187c351c5d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (1.10.0)
4
+ gitlab_quality-test_tooling (1.10.1)
5
5
  activesupport (>= 6.1, < 7.2)
6
6
  amatch (~> 0.4.1)
7
7
  gitlab (~> 4.19)
@@ -29,7 +29,9 @@ module GitlabQuality
29
29
  end
30
30
 
31
31
  exception['message'].gsub!(/(private_token=)[\w-]+/, '********')
32
+ exception['message'].gsub!(/("Authorization": \[\n\s*"token )([\w-]+)/, '\1********')
32
33
  exception.content = exception.content.gsub(/(private_token=)[\w-]+/, '********')
34
+ exception.content = exception.content.gsub(/("Authorization": \[\n\s*"token )([\w-]+)/, '\1********')
33
35
  {
34
36
  'message' => "#{exception['type']}: #{exception['message']}",
35
37
  'stacktrace' => trace.slice(0..spec_file_first_index).join("\n"),
@@ -5,6 +5,7 @@ module GitlabQuality
5
5
  module TestResult
6
6
  class JsonTestResult < BaseTestResult
7
7
  PRIVATE_TOKEN_REGEX = /(private_token=)[\w-]+/
8
+ AUTHENTICATION_TOKEN_REGEX = /("Authorization": \[\n\s*"token )([\w-]+)/
8
9
 
9
10
  OTHER_TESTS_MAX_DURATION = 45.40 # seconds
10
11
 
@@ -144,8 +145,8 @@ module GitlabQuality
144
145
  line.include?(File.basename(report['file_path']))
145
146
  end
146
147
 
147
- message = redact_private_token(exception['message'])
148
- message_lines = Array(exception['message_lines']).map { |line| redact_private_token(line) }
148
+ message = redact_private_and_auth_tokens(exception['message'])
149
+ message_lines = Array(exception['message_lines']).map { |line| redact_private_and_auth_tokens(line) }
149
150
 
150
151
  {
151
152
  'message' => "#{exception['class']}: #{message}",
@@ -193,8 +194,9 @@ module GitlabQuality
193
194
  message_lines.is_a?(Array) ? message_lines.join("\n") : message_lines
194
195
  end
195
196
 
196
- def redact_private_token(text)
197
- text.gsub(PRIVATE_TOKEN_REGEX, '********')
197
+ def redact_private_and_auth_tokens(text)
198
+ private_redacted = text.gsub(PRIVATE_TOKEN_REGEX, '********')
199
+ private_redacted.gsub(AUTHENTICATION_TOKEN_REGEX, '\1********')
198
200
  end
199
201
  end
200
202
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "1.10.0"
5
+ VERSION = "1.10.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_quality-test_tooling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-03 00:00:00.000000000 Z
11
+ date: 2024-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control