Skip to content

Commit

Permalink
fix: bcrypt salt must be 22 characters long
Browse files Browse the repository at this point in the history
In addition to bcrypt salt rejecting underscores amongst other
characters it must also be exactly 22 characters long.
  • Loading branch information
jackhodgkiss committed Dec 29, 2023
1 parent 262a313 commit aa8ec22
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions utils/kayobe-automation-redact
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ import base64
import sys

annotation_exceptions = {
'prometheus_bcrypt_salt': 'prometheusbcryptsalt'
'prometheus_bcrypt_salt': {'original': 'prometheusbcryptsalt.o', 'changed': 'prometheusbcryptsalt.c'},
}

def annotate(ctx, value):
if not isinstance(value, str):
return value
return value
path_str = ctx['path'][0]
if path_str in annotation_exceptions:
return f"{annotation_exceptions[path_str]}.{value}"
if isinstance(annotation_exceptions[path_str], str):
return f"{annotation_exceptions[path_str]}.{value}"
else:
return annotation_exceptions[path_str][value]
else:
return f"{path_str}.{value}"
return f"{path_str}.{value}"

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

0 comments on commit aa8ec22

Please sign in to comment.