Skip to content

Commit 024b83e

Browse files
committed
fix: bcrypt salt must be 22 characters long
In addition to bcrypt salt rejecting underscores amongst other characters it must also be exactly 22 characters long.
1 parent 262a313 commit 024b83e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

utils/kayobe-automation-redact

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ import base64
66
import sys
77

88
annotation_exceptions = {
9-
'prometheus_bcrypt_salt': 'prometheusbcryptsalt'
9+
'prometheus_bcrypt_salt': {'original': 'prometheusbcryptsalt.o', 'changed': 'prometheusbcryptsalt.c'},
1010
}
1111

12+
1213
def annotate(ctx, value):
1314
if not isinstance(value, str):
14-
return value
15-
path_str = ctx['path'][0]
16-
if path_str in annotation_exceptions:
17-
return f"{annotation_exceptions[path_str]}.{value}"
15+
return value
16+
path_str = *map(str, ctx['path']),
17+
if path_str[0] in annotation_exceptions:
18+
if isinstance(annotation_exceptions[path_str[0]], str):
19+
return annotation_exceptions[path_str[0]]
20+
else:
21+
return annotation_exceptions[path_str[0]][value]
1822
else:
19-
return f"{path_str}.{value}"
23+
return f"{'_'.join(path_str)}.{value}"
24+
2025

2126
def redact_int(ctx, x):
2227
# For numbers we can't indicate change with a string, so use sentinal values

0 commit comments

Comments
 (0)