@@ -63,17 +63,17 @@ public void Aws_authentication_should_should_have_expected_result()
63
63
[ SkippableFact ]
64
64
public void Ecs_should_fill_AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ( )
65
65
{
66
- var isEcs = Environment . GetEnvironmentVariable ( "AWS_ECS_TEST " ) != null ;
66
+ var isEcs = Environment . GetEnvironmentVariable ( "AWS_ECS_ENABLED " ) != null ;
67
67
var awsContainerRelativeUri = Environment . GetEnvironmentVariable ( "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" ) ;
68
- awsContainerRelativeUri . Should ( ) . Match ( v => isEcs ? v != null : v == null ) ;
68
+ ( awsContainerRelativeUri != null ) . Should ( ) . Be ( isEcs ) ;
69
69
}
70
70
71
71
[ SkippableFact ]
72
- public void AwsSdk_should_support_all_required_callbacks ( )
72
+ public void AwsSdk_should_support_all_required_handlers ( )
73
73
{
74
74
var credentialsGeneratorsDelegatesEnumerator = FallbackCredentialsFactory . CredentialsGenerators . GetEnumerator ( ) ;
75
75
76
- // Attempt 1
76
+ // AppConfigAWSCredentials
77
77
AWSCredentials credentials = null ;
78
78
if ( Type . GetType ( "Amazon.Runtime.AppConfigAWSCredentials" , throwOnError : false ) != null )
79
79
{
@@ -82,6 +82,7 @@ public void AwsSdk_should_support_all_required_callbacks()
82
82
appConfigAWSCredentialsException . Message . Should ( ) . Contain ( "The app.config/web.config files for the application did not contain credential information" ) ;
83
83
}
84
84
85
+ // AssumeRoleWithWebIdentityCredentials.FromEnvironmentVariables()
85
86
var exception = Record . Exception ( ( ) => RunTestCase ( ) ) ;
86
87
if ( Environment . GetEnvironmentVariable ( "AWS_WEB_IDENTITY_TOKEN_FILE" ) != null )
87
88
{
@@ -95,7 +96,7 @@ public void AwsSdk_should_support_all_required_callbacks()
95
96
exception . Message . Should ( ) . Contain ( "webIdentityTokenFile" ) ;
96
97
}
97
98
98
- // Attempt 2
99
+ // GetAWSCredentials (Profile)
99
100
exception = Record . Exception ( ( ) => RunTestCase ( ) ) ;
100
101
if ( IsWithAwsProfileOnMachine ( ) )
101
102
{
@@ -106,26 +107,24 @@ public void AwsSdk_should_support_all_required_callbacks()
106
107
else
107
108
{
108
109
// otherwise fail
109
- exception . Message . Should ( ) . Contain ( "Credential profile " ) . And . Subject . Should ( ) . Contain ( "is not valid " ) ;
110
+ exception . Message . Should ( ) . Contain ( "Credential" ) . And . Subject . Should ( ) . Contain ( "profile " ) ;
110
111
}
111
112
112
- // Attempt 3
113
- credentialsGeneratorsDelegatesEnumerator . MoveNext ( ) . Should ( ) . BeTrue ( ) ;
113
+ // EnvironmentVariablesAWSCredentials
114
114
exception = Record . Exception ( ( ) => RunTestCase ( ) ) ;
115
115
if ( Environment . GetEnvironmentVariable ( "AWS_ACCESS_KEY_ID" ) != null && Environment . GetEnvironmentVariable ( "AWS_SECRET_ACCESS_KEY" ) != null )
116
116
{
117
117
// environment variables code path
118
118
exception . Should ( ) . BeNull ( ) ;
119
- credentials . Should ( ) . BeOfType < ImmutableCredentials > ( ) ;
119
+ credentials . Should ( ) . BeOfType < EnvironmentVariablesAWSCredentials > ( ) ;
120
120
}
121
121
else
122
122
{
123
123
// otherwise fail
124
124
exception . Message . Should ( ) . Contain ( "The environment variables" ) . And . Subject . Contains ( "were not set with AWS credentials" ) ;
125
125
}
126
126
127
- // Attempt 4
128
- credentialsGeneratorsDelegatesEnumerator . MoveNext ( ) . Should ( ) . BeTrue ( ) ;
127
+ // ECSEC2CredentialsWrapper
129
128
exception = Record . Exception ( ( ) => RunTestCase ( ) ) ;
130
129
if ( Environment . GetEnvironmentVariable ( "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" ) != null || Environment . GetEnvironmentVariable ( "AWS_CONTAINER_CREDENTIALS_FULL_URI" ) != null )
131
130
{
0 commit comments