Skip to content

Commit 612a109

Browse files
authored
CSHARP-4739: Added BsonBinarySubType.Sensitive (0x08). (#1168)
1 parent b4754f0 commit 612a109

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

specifications/bson-corpus/tests/binary.json

Lines changed: 5 additions & 0 deletions
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",

src/MongoDB.Bson/ObjectModel/BsonBinarySubType.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public enum BsonBinarySubType
5757
/// </summary>
5858
Column = 0x07,
5959
/// <summary>
60+
/// Sensitive data.
61+
/// </summary>
62+
Sensitive = 0x08,
63+
/// <summary>
6064
/// User defined binary data.
6165
/// </summary>
6266
UserDefined = 0x80

tests/MongoDB.Bson.Tests/IO/BsonStreamExtensionsTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public void BackpatchSize_should_throw_when_stream_is_null()
108108
[InlineData(5, BsonBinarySubType.MD5)]
109109
[InlineData(6, BsonBinarySubType.Encrypted)]
110110
[InlineData(7, BsonBinarySubType.Column)]
111+
[InlineData(8, BsonBinarySubType.Sensitive)]
111112
[InlineData(0x80, BsonBinarySubType.UserDefined)]
112113
public void ReadBinarySubType_should_return_expected_result(int n, BsonBinarySubType expectedResult)
113114
{
@@ -497,6 +498,7 @@ public void static_constructor_should_initialize_validBsonTypes()
497498
[InlineData(BsonBinarySubType.MD5, 5)]
498499
[InlineData(BsonBinarySubType.Encrypted, 6)]
499500
[InlineData(BsonBinarySubType.Column, 7)]
501+
[InlineData(BsonBinarySubType.Sensitive, 8)]
500502
[InlineData(BsonBinarySubType.UserDefined, 0x80)]
501503
public void WriteBinarySubType_should_have_expected_effect(
502504
BsonBinarySubType value,

0 commit comments

Comments
 (0)