File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -69,6 +69,15 @@ class OpMsgBodySection {
6969 }
7070}
7171
72+ class OpMsgSecurityTokenSection {
73+ kind = 'SecurityToken' as const ;
74+ body : BSONBuffer ;
75+
76+ constructor ( body : BSONBuffer ) {
77+ this . body = body ;
78+ }
79+ }
80+
7281class OpMsgDocumentSequenceSection {
7382 kind = 'DocumentSequence' as const ;
7483 docSequenceId : string ;
@@ -92,7 +101,7 @@ class OpMsgUnknownSection {
92101class OpMsg {
93102 opCode = 'OP_MSG' as const ;
94103 flagBits : number ;
95- sections : ( OpMsgBodySection | OpMsgDocumentSequenceSection | OpMsgUnknownSection ) [ ] ;
104+ sections : ( OpMsgBodySection | OpMsgDocumentSequenceSection | OpMsgSecurityTokenSection | OpMsgUnknownSection ) [ ] ;
96105 checksum : number | null ;
97106
98107 constructor ( values : Pick < OpMsg , 'flagBits' | 'sections' | 'checksum' > ) {
@@ -134,6 +143,13 @@ class OpMsg {
134143 sections . push ( new OpMsgDocumentSequenceSection ( docSequenceId , objects ) ) ;
135144 }
136145 break ;
146+ case 2 : {
147+ const bsonSize = dv . getUint32 ( i + 1 , true ) ;
148+ sections . push ( new OpMsgSecurityTokenSection (
149+ new BSONBuffer ( new Uint8Array ( dv . buffer , dv . byteOffset + i + 1 , bsonSize ) ) ) ) ;
150+ i += 1 + bsonSize ;
151+ }
152+ break ;
137153 default : {
138154 sections . push ( new OpMsgUnknownSection ( kind ) ) ;
139155 i = length ;
You can’t perform that action at this time.
0 commit comments