bschoening commented on code in PR #1288:
URL:
https://github.com/apache/cassandra-python-driver/pull/1288#discussion_r3171738184
##########
cassandra/metadata.py:
##########
@@ -19,7 +19,7 @@
from collections import defaultdict
from collections.abc import Mapping
from functools import total_ordering
-from hashlib import md5
+import hashlib
Review Comment:
would prefer we keep the narrow import scope on a security librarry.
##########
cassandra/metadata.py:
##########
@@ -1864,7 +1864,7 @@ class MD5Token(HashToken):
def hash_fn(cls, key):
if isinstance(key, str):
key = key.encode('UTF-8')
- return abs(varint_unpack(md5(key).digest()))
+ return
abs(varint_unpack(hashlib.md5(key,usedforsecurity=False).digest()))
Review Comment:
@absurdfarce could move the import into Class MD5Token and only import if
it's instantiated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]