Skip to content

Commit

Permalink
Fix issue aws#135
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteCarra committed Sep 18, 2017
1 parent 568e336 commit 4113efb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public enum AwsSystemSetting implements SystemSetting {
* This allows a service running in an elastic container to automatically load its credentials without needing to configure
* them in the {@link ClientBuilder}.
*
* This is not used if the {@link #AWS_CONTAINER_CREDENTIALS_PATH} is not specified.
* This is not used if the {@link #AWS_CONTAINER_CREDENTIALS_RELATIVE_URI} is not specified.
*/
AWS_CONTAINER_SERVICE_ENDPOINT("aws.containerServiceEndpoint", "http://169.254.170.2"),

Expand All @@ -145,7 +145,7 @@ public enum AwsSystemSetting implements SystemSetting {
*
* @see #AWS_CONTAINER_SERVICE_ENDPOINT
*/
AWS_CONTAINER_CREDENTIALS_PATH("aws.containerCredentialsPath", null),
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI("aws.containerCredentialsPath", null),

/**
* Whether CBOR optimization should automatically be used if its support is found on the classpath and the service supports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String toString() {
}

private static boolean isEnabled() {
return AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_PATH.getStringValue().isPresent();
return AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.getStringValue().isPresent();
}

/**
Expand All @@ -97,7 +97,7 @@ private static class EcsCredentialsEndpointProvider extends CredentialsEndpointP
@Override
public URI getCredentialsEndpoint() throws URISyntaxException {
return new URI(AwsSystemSetting.AWS_CONTAINER_SERVICE_ENDPOINT.getStringValueOrThrow() +
AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_PATH.getStringValueOrThrow());
AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.getStringValueOrThrow());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testEnvVariableNotSet() {
@Test
public void testGetCredentialsReturnsValidResponseFromEcsEndpoint() {
try {
System.setProperty(AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_PATH.property(), "");
System.setProperty(AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.property(), "");

stubForSuccessResponse();

Expand All @@ -79,7 +79,7 @@ public void testGetCredentialsReturnsValidResponseFromEcsEndpoint() {
assertThat(credentials.secretAccessKey()).isEqualTo(SECRET_ACCESS_KEY);
assertThat(credentials.sessionToken()).isEqualTo(TOKEN);
} finally {
System.clearProperty(AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_PATH.property());
System.clearProperty(AwsSystemSetting.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.property());
}
}

Expand Down

0 comments on commit 4113efb

Please sign in to comment.