PYTHON-4468 Hide the value of sensitive subtype binary objects (#1649)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
This commit is contained in:
parent
49987e6a8a
commit
ac66c9dfd2
@ -364,4 +364,7 @@ class Binary(bytes):
|
||||
return not self == other
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"Binary({bytes.__repr__(self)}, {self.__subtype})"
|
||||
if self.__subtype == SENSITIVE_SUBTYPE:
|
||||
return f"<Binary(REDACTED, {self.__subtype})>"
|
||||
else:
|
||||
return f"Binary({bytes.__repr__(self)}, {self.__subtype})"
|
||||
|
||||
@ -6,6 +6,8 @@ Changes in Version 4.8.0
|
||||
|
||||
The handshake metadata for "os.name" on Windows has been simplified to "Windows" to improve import time.
|
||||
|
||||
The repr of ``bson.binary.Binary`` is now redacted when the subtype is SENSITIVE_SUBTYPE(8).
|
||||
|
||||
.. warning:: PyMongo 4.8 drops support for Python 3.7 and PyPy 3.8: Python 3.8+ or PyPy 3.9+ is now required.
|
||||
|
||||
Changes in Version 4.7.3
|
||||
|
||||
@ -100,3 +100,4 @@ The following is a list of people who have contributed to
|
||||
- Stephan Hof (stephan-hof)
|
||||
- Casey Clements (caseyclements)
|
||||
- Ivan Lukyanchikov (ilukyanchikov)
|
||||
- Terry Patterson
|
||||
|
||||
Loading…
Reference in New Issue
Block a user