Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #135 #163

Merged
merged 2 commits into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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