@@ -550,7 +550,7 @@ describe('OIDC Auth Spec Tests', function () {
550
550
describe ( '4.4 Speculative Authentication should be ignored on Reauthentication' , function ( ) {
551
551
let utilClient : MongoClient ;
552
552
const callbackSpy = sinon . spy ( createCallback ( ) ) ;
553
- const commands = [ ] ;
553
+ const saslStarts = [ ] ;
554
554
// - Create an OIDC configured client.
555
555
// - Populate the *Client Cache* with a valid access token to enforce Speculative Authentication.
556
556
// - Perform an `insert` operation that succeeds.
@@ -584,9 +584,8 @@ describe('OIDC Auth Spec Tests', function () {
584
584
monitorCommands : true
585
585
} ) ;
586
586
client . on ( 'commandStarted' , event => {
587
- console . log ( event ) ;
588
587
if ( event . commandName === 'saslStart' ) {
589
- commands . push ( event ) ;
588
+ saslStarts . push ( event ) ;
590
589
}
591
590
} ) ;
592
591
const provider = client . s . authProviders . getOrCreateProvider ( 'MONGODB-OIDC' , {
@@ -595,18 +594,21 @@ describe('OIDC Auth Spec Tests', function () {
595
594
const token = await readFile ( path . join ( process . env . OIDC_TOKEN_DIR , 'test_user1' ) , {
596
595
encoding : 'utf8'
597
596
} ) ;
597
+
598
598
provider . workflow . cache . put ( { accessToken : token } ) ;
599
599
collection = client . db ( 'test' ) . collection ( 'test' ) ;
600
+
600
601
await collection . insertOne ( { name : 'test' } ) ;
601
602
expect ( callbackSpy ) . to . not . have . been . called ;
602
- expect ( commands ) . to . be . empty ;
603
+ expect ( saslStarts ) . to . be . empty ;
603
604
604
605
utilClient = new MongoClient ( uriSingle , {
605
606
authMechanismProperties : {
606
607
OIDC_CALLBACK : createCallback ( )
607
608
} ,
608
609
retryReads : false
609
610
} ) ;
611
+
610
612
await utilClient
611
613
. db ( )
612
614
. admin ( )
@@ -633,7 +635,7 @@ describe('OIDC Auth Spec Tests', function () {
633
635
it ( 'successfully authenticates' , async function ( ) {
634
636
await collection . insertOne ( { name : 'test' } ) ;
635
637
expect ( callbackSpy ) . to . have . been . calledOnce ;
636
- expect ( commands . length ) . to . equal ( 1 ) ;
638
+ expect ( saslStarts . length ) . to . equal ( 1 ) ;
637
639
} ) ;
638
640
} ) ;
639
641
} ) ;
0 commit comments