Skip to content

Commit

Permalink
Made host resolver a parameter of EcsCredentialsProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez committed Jan 22, 2024
1 parent 62fec1c commit 49ab259
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aws-runtime/aws-config/api/aws-config.api
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentia

public final class aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
public fun <init> ()V
public fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;)V
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Laws/smithy/kotlin/runtime/net/HostResolver;)V
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Laws/smithy/kotlin/runtime/net/HostResolver;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun close ()V
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformProvider;
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private const val PROVIDER_NAME = "EcsContainer"
public class EcsCredentialsProvider(
public val platformProvider: PlatformProvider = PlatformProvider.System,
httpClient: HttpClientEngine? = null,
private val hostResolver: HostResolver = HostResolver.Default,
) : CloseableCredentialsProvider {

private val manageEngine = httpClient == null
Expand Down Expand Up @@ -162,7 +163,7 @@ public class EcsCredentialsProvider(

is Host.Domain -> {
val hostAddresses = try {
HostResolver.Default.resolve(url.host.toString())
hostResolver.resolve(url.host.toString())
} catch (exception: Throwable) {
throw ProviderConfigurationException(
"The container credentials full URI ($uri) is specified via a hostname whose IP address(es) could not be resolved. ${exception.message}",
Expand Down

0 comments on commit 49ab259

Please sign in to comment.