Sec fixes as raised by bandit (#917)

minor fixes to hashlib and jinja
This commit is contained in:
Hardik Shah 2025-01-31 13:44:26 -08:00 committed by GitHub
parent 7ea14ae62e
commit a7b929f17e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 53 additions and 56 deletions

View file

@ -250,7 +250,9 @@ class ContentBuilder:
value = sample_transformer(object_to_json(example))
hash_string = (
hashlib.md5(json_dump_string(value).encode("utf-8")).digest().hex()
hashlib.sha256(json_dump_string(value).encode("utf-8"))
.digest()
.hex()[:16]
)
name = f"ex-{hash_string}"