diff --git a/bson/binary.py b/bson/binary.py index 9a0c061382..0727bd17c0 100644 --- a/bson/binary.py +++ b/bson/binary.py @@ -183,6 +183,13 @@ class UuidRepresentation: .. versionadded:: 4.0 """ +SENSITIVE_SUBTYPE = 8 +"""BSON binary subtype for sensitive data. + +.. versionadded:: 4.5 +""" + + USER_DEFINED_SUBTYPE = 128 """BSON binary subtype for any user defined structure. """ diff --git a/doc/api/bson/binary.rst b/doc/api/bson/binary.rst index b9673d70d9..c933a687b9 100644 --- a/doc/api/bson/binary.rst +++ b/doc/api/bson/binary.rst @@ -15,6 +15,7 @@ .. autodata:: CSHARP_LEGACY .. autodata:: MD5_SUBTYPE .. autodata:: COLUMN_SUBTYPE + .. autodata:: SENSITIVE_SUBTYPE .. autodata:: USER_DEFINED_SUBTYPE .. autoclass:: UuidRepresentation diff --git a/test/bson_corpus/binary.json b/test/bson_corpus/binary.json index beb2e07a70..20aaef743b 100644 --- a/test/bson_corpus/binary.json +++ b/test/bson_corpus/binary.json @@ -55,6 +55,11 @@ "canonical_bson": "1D000000057800100000000773FFD26444B34C6990E8E7D1DFC035D400", "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"07\"}}}" }, + { + "description": "subtype 0x08", + "canonical_bson": "1D000000057800100000000873FFD26444B34C6990E8E7D1DFC035D400", + "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"08\"}}}" + }, { "description": "subtype 0x80", "canonical_bson": "0F0000000578000200000080FFFF00",