Skip to content

Commit 0e4d352

Browse files
Add BSON binary subtype 8 (#1524)
1 parent 098ae16 commit 0e4d352

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

bson/src/main/org/bson/BsonBinarySubType.java

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ public enum BsonBinarySubType {
6666
*/
6767
COLUMN((byte) 0x07),
6868

69+
/**
70+
* Sensitive data (e.g., HMAC keys) that should be excluded from server-side logging.
71+
*
72+
* @since 5.3
73+
*/
74+
SENSITIVE((byte) 0x08),
75+
6976
/**
7077
* User defined binary data.
7178
*/

bson/src/test/resources/bson/binary.json

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
"canonical_bson": "1D000000057800100000000773FFD26444B34C6990E8E7D1DFC035D400",
5656
"canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"07\"}}}"
5757
},
58+
{
59+
"description": "subtype 0x08",
60+
"canonical_bson": "1D000000057800100000000873FFD26444B34C6990E8E7D1DFC035D400",
61+
"canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"08\"}}}"
62+
},
5863
{
5964
"description": "subtype 0x80",
6065
"canonical_bson": "0F0000000578000200000080FFFF00",

bson/src/test/unit/org/bson/BsonBinarySubTypeSpecification.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ class BsonBinarySubTypeSpecification extends Specification {
3333
5 | false
3434
6 | false
3535
7 | false
36+
8 | false
3637
}
3738
}

0 commit comments

Comments
 (0)