Skip to content

Commit b44919f

Browse files
committed
special handling for token removed
1 parent f73c65b commit b44919f

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

lib/java_buildpack/util/sanitizer.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,8 @@ def handle_params(params)
3636

3737
query_params = ''
3838

39-
params.each do |key, value|
40-
match = key.match(keywords)
41-
42-
if match
43-
params[key] = if match[0] == 'Api-Token' && value =~ /dt\w*/
44-
value.gsub(/(dt\w*\.\w*)\.\w*/, '\1.REDACTED')
45-
else
46-
'***'
47-
end
48-
end
49-
39+
params.each do |key, _|
40+
params[key] = '***' if key.match(keywords)
5041
query_params += key + '=' + params[key] + '&'
5142
end
5243

spec/java_buildpack/util/sanitize_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'&password=***'\
3838
'&include=java'\
3939
'&bitness=64'\
40-
'&Api-Token=dt0c01.H67ALCXCXK7PWAAOQLENSRET.REDACTED'\
40+
'&Api-Token=***'\
4141
'&secret-token=***'\
4242
'&token=***')
4343
end

0 commit comments

Comments
 (0)