diff --git a/src/binary.ts b/src/binary.ts index 6c4d54fc6..84182fb2b 100644 --- a/src/binary.ts +++ b/src/binary.ts @@ -56,6 +56,8 @@ export class Binary extends BSONValue { static readonly SUBTYPE_ENCRYPTED = 6; /** Column BSON type */ static readonly SUBTYPE_COLUMN = 7; + /** Sensitive BSON type */ + static readonly SUBTYPE_SENSITIVE = 8; /** User BSON type */ static readonly SUBTYPE_USER_DEFINED = 128; diff --git a/src/constants.ts b/src/constants.ts index 1311ef064..a71f7993e 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -109,6 +109,9 @@ export const BSON_BINARY_SUBTYPE_ENCRYPTED = 6; /** Column BSON type @internal */ export const BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Sensitive BSON type @internal */ +export const BSON_BINARY_SUBTYPE_SENSITIVE = 8; + /** Binary User Defined Type @internal */ export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; diff --git a/test/node/constants.test.ts b/test/node/constants.test.ts index 77d17e941..b4e262bee 100644 --- a/test/node/constants.test.ts +++ b/test/node/constants.test.ts @@ -19,6 +19,8 @@ describe('BSON Constants', () => { | "\x04" UUID | "\x05" MD5 | "\x06" Encrypted BSON value + | "\x07" Column BSON value + | "\x08" Sensitive BSON value | "\x80" User defined */ it('Default should be 0', () => { @@ -55,6 +57,11 @@ describe('BSON Constants', () => { expect(constants.BSON_BINARY_SUBTYPE_COLUMN).to.equal(7); expect(Binary.SUBTYPE_COLUMN).to.equal(7); }); + + it('Sensitive should be 8', () => { + expect(constants.BSON_BINARY_SUBTYPE_SENSITIVE).to.equal(8); + expect(Binary.SUBTYPE_SENSITIVE).to.equal(8); + }); }); context('BSON Type indicators', () => { /* diff --git a/test/node/specs/bson-corpus/binary.json b/test/node/specs/bson-corpus/binary.json index beb2e07a7..20aaef743 100644 --- a/test/node/specs/bson-corpus/binary.json +++ b/test/node/specs/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",