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 Mar 7, 2024
1 parent 262a313 commit 4ee379d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions utils/kayobe-automation-redact
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ 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
path_str = ctx['path'][0]
return value
path_str = *map(str, ctx['path']),
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"{'_'.join(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 4ee379d

Please sign in to comment.