Skip to content

Commit

Permalink
fix for invalid characters in bcrypt salt
Browse files Browse the repository at this point in the history
  • Loading branch information
g0rgamesh committed Apr 22, 2024
1 parent 3632586 commit b9a0d75
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/kayobe-automation-redact
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@ import hashlib
import base64
import sys

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

def annotate(ctx, value):
if not isinstance(value, str):
return value
path_str = map(str, ctx['path'])
return f"{'.'.join(path_str)}.{ value }"
if not isinstance(value, str):
return value
path_str = *map(str, ctx['path']),
if path_str in annotation_exceptions:
if isinstance(annotation_exceptions[path_str], str):
return f"{annotation_exceptions[path_str]}.{value}"
else:
return annotation_exceptions[path_str][value]
else:
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 b9a0d75

Please sign in to comment.