@@ -219,7 +219,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasic
219
219
220
220
var credential = provider . GetCredentialAsync ( input ) ;
221
221
222
- VerifyBasicAuthFlowRan ( password , true , input , credential , null ) ;
222
+ VerifyBasicAuthFlowRan ( password , true , input , credential ) ;
223
223
224
224
VerifyOAuthFlowDidNotRun ( password , true , input , credential ) ;
225
225
}
@@ -327,7 +327,7 @@ public void BitbucketHostProvider_GetCredentialAsync_AlwaysRefreshCredentials_Is
327
327
328
328
if ( alwaysRefreshCredentialsBool )
329
329
{
330
- VerifyBasicAuthFlowRan ( password , true , input , credential , null ) ;
330
+ VerifyBasicAuthFlowRan ( password , true , input , credential ) ;
331
331
}
332
332
else
333
333
{
@@ -450,21 +450,13 @@ private static InputArguments MockInput(string protocol, string host, string use
450
450
} ) ;
451
451
}
452
452
453
- private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , Task < ICredential > credential ,
454
- string preconfiguredAuthModes )
453
+ private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , Task < ICredential > credential )
455
454
{
456
455
Assert . Equal ( expected , credential != null ) ;
457
456
458
457
var remoteUri = input . GetRemoteUri ( ) ;
459
458
460
459
bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
461
-
462
- // check username/password for Bitbucket.org
463
- if ( ( preconfiguredAuthModes == null && BITBUCKET_DOT_ORG_HOST == remoteUri . Host )
464
- || ( preconfiguredAuthModes != null && preconfiguredAuthModes . Contains ( "oauth" ) ) )
465
- {
466
- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
467
- }
468
460
}
469
461
470
462
private void VerifyInteractiveBasicAuthFlowRan ( string password , InputArguments input , Task < ICredential > credential )
@@ -473,12 +465,6 @@ private void VerifyInteractiveBasicAuthFlowRan(string password, InputArguments i
473
465
474
466
// verify users was prompted for username/password credentials
475
467
bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
476
-
477
- // check username/password for Bitbucket.org
478
- if ( BITBUCKET_DOT_ORG_HOST == remoteUri . Host )
479
- {
480
- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
481
- }
482
468
}
483
469
484
470
private void VerifyBasicAuthFlowNeverRan ( string password , InputArguments input , bool storedAccount ,
@@ -527,13 +513,7 @@ private void VerifyOAuthFlowRan(string password, bool storedAccount, bool expect
527
513
{
528
514
// prompt user for basic auth, if basic auth is not excluded
529
515
bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
530
-
531
- // check if entered Basic Auth credentials work, if basic auth is not excluded
532
- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
533
516
}
534
-
535
- // Basic Auth 403-ed so push user through OAuth flow
536
- bitbucketAuthentication . Verify ( m => m . ShowOAuthRequiredPromptAsync ( ) , Times . Once ) ;
537
517
}
538
518
}
539
519
0 commit comments