docs: Various cleanup of outdated comments and docstrings (#31754)
- Remove pylint warning suppression from SHAKE-128 hexdigest calls; these are no longer needed as of astroid 2.12.12. For background, see issue <https://github.com/PyCQA/pylint/issues/4039>. Also, correct a comment that referred to SHAKE-256 instead of SHAKE-128. - Replace "released" with "beta" in several places where there was a copy & paste error in dark_lang. Add mention of `beta_lang` to a docstring where it was omitted. - Remove comment regarding Mongo startup; the code it referred to has since been removed. - Fix typos.
This commit is contained in:
@@ -196,7 +196,7 @@ class TrackMiddleware(MiddlewareMixin):
|
||||
# This assumes that session_key is high-entropy and unpredictable (which
|
||||
# it should be anyway.)
|
||||
#
|
||||
# Use SHAKE256 from SHA-3 hash family to generate a hash of arbitrary
|
||||
# Use SHAKE-128 from SHA-3 hash family to generate a hash of arbitrary
|
||||
# length.
|
||||
hasher = hashlib.shake_128()
|
||||
# This is one of several uses of SECRET_KEY.
|
||||
@@ -209,9 +209,7 @@ class TrackMiddleware(MiddlewareMixin):
|
||||
# heads-up to data researchers.
|
||||
hasher.update(settings.SECRET_KEY.encode())
|
||||
hasher.update(session_key.encode())
|
||||
# pylint doesn't know that SHAKE's hexdigest takes an arg:
|
||||
# https://github.com/PyCQA/pylint/issues/4039
|
||||
return hasher.hexdigest(16) # pylint: disable=too-many-function-args
|
||||
return hasher.hexdigest(16)
|
||||
|
||||
def get_user_primary_key(self, request):
|
||||
"""Gets the primary key of the logged in Django user"""
|
||||
|
||||
Reference in New Issue
Block a user