Skip to content

Commit 30e3a83

Browse files
committed
Revert "feat: add support for account ID in IMDS credentials (#1573)"
This reverts commit a707e1b.
1 parent d78dd1c commit 30e3a83

File tree

20 files changed

+805
-1074
lines changed

20 files changed

+805
-1074
lines changed

aws-runtime/aws-config/api/aws-config.api

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredential
7777

7878
public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
7979
public fun <init> ()V
80-
public fun <init> (Ljava/lang/String;Laws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider;Laws/smithy/kotlin/runtime/util/PlatformProvider;)V
81-
public synthetic fun <init> (Ljava/lang/String;Laws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider;Laws/smithy/kotlin/runtime/util/PlatformProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
8280
public fun <init> (Ljava/lang/String;Lkotlin/Lazy;Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;Laws/smithy/kotlin/runtime/time/Clock;)V
8381
public synthetic fun <init> (Ljava/lang/String;Lkotlin/Lazy;Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;Laws/smithy/kotlin/runtime/time/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
8482
public fun close ()V
@@ -259,7 +257,6 @@ public final class aws/sdk/kotlin/runtime/config/AwsSdkSetting {
259257
public final fun getAwsContainerCredentialsFullUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
260258
public final fun getAwsContainerCredentialsRelativeUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
261259
public final fun getAwsDisableRequestCompression ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
262-
public final fun getAwsEc2InstanceProfileName ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
263260
public final fun getAwsEc2MetadataDisabled ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
264261
public final fun getAwsEc2MetadataServiceEndpoint ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
265262
public final fun getAwsEc2MetadataServiceEndpointMode ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
@@ -405,13 +402,6 @@ public final class aws/sdk/kotlin/runtime/config/imds/ImdsClient$Companion {
405402
public final fun invoke (Lkotlin/jvm/functions/Function1;)Laws/sdk/kotlin/runtime/config/imds/ImdsClient;
406403
}
407404

408-
public final class aws/sdk/kotlin/runtime/config/imds/ImdsResolversKt {
409-
public static final fun resolveDisableEc2Metadata (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
410-
public static synthetic fun resolveDisableEc2Metadata$default (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
411-
public static final fun resolveEc2InstanceProfileName (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
412-
public static synthetic fun resolveEc2InstanceProfileName$default (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
413-
}
414-
415405
public abstract interface class aws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider : java/io/Closeable {
416406
public abstract fun get (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
417407
}
@@ -513,8 +503,6 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsProfileKt {
513503
public static synthetic fun getBooleanOrNull$default (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/Boolean;
514504
public static final fun getCredentialProcess (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
515505
public static final fun getDisableRequestCompression (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
516-
public static final fun getEc2InstanceProfileName (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
517-
public static final fun getEc2MetadataDisabled (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
518506
public static final fun getEndpointUrl (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Laws/smithy/kotlin/runtime/net/url/Url;
519507
public static final fun getIgnoreEndpointUrls (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
520508
public static final fun getIntOrNull (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Integer;

aws-runtime/aws-config/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir
88

99
plugins {
1010
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
11-
alias(libs.plugins.kotlinx.serialization)
1211
}
1312

1413
description = "Support for AWS configuration"
@@ -53,7 +52,6 @@ kotlin {
5352
implementation(libs.kotlinx.coroutines.test)
5453
implementation(libs.smithy.kotlin.http.test)
5554
implementation(libs.kotlinx.serialization.json)
56-
implementation(libs.kotest.framework.datatest)
5755
}
5856
}
5957
jvmTest {

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentialsProvider.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import aws.smithy.kotlin.runtime.util.PlatformProvider
4141
* @param region the region to make credentials requests to.
4242
* @return the newly-constructed credentials provider
4343
*/
44-
public class DefaultChainCredentialsProvider(
44+
public class DefaultChainCredentialsProvider constructor(
4545
public val profileName: String? = null,
4646
public val platformProvider: PlatformProvider = PlatformProvider.System,
4747
httpClient: HttpClientEngine? = null,
@@ -51,11 +51,6 @@ public class DefaultChainCredentialsProvider(
5151
private val manageEngine = httpClient == null
5252
private val engine = httpClient ?: DefaultHttpEngine()
5353

54-
private val imdsClient = ImdsClient {
55-
platformProvider = this@DefaultChainCredentialsProvider.platformProvider
56-
engine = this@DefaultChainCredentialsProvider.engine
57-
}
58-
5954
private val chain = CredentialsProviderChain(
6055
SystemPropertyCredentialsProvider(platformProvider::getProperty),
6156
EnvironmentCredentialsProvider(platformProvider::getenv),
@@ -64,7 +59,12 @@ public class DefaultChainCredentialsProvider(
6459
ProfileCredentialsProvider(profileName = profileName, platformProvider = platformProvider, httpClient = engine, region = region),
6560
EcsCredentialsProvider(platformProvider, engine),
6661
ImdsCredentialsProvider(
67-
client = imdsClient,
62+
client = lazy {
63+
ImdsClient {
64+
platformProvider = this@DefaultChainCredentialsProvider.platformProvider
65+
engine = this@DefaultChainCredentialsProvider.engine
66+
}
67+
},
6868
platformProvider = platformProvider,
6969
),
7070
)
@@ -75,7 +75,6 @@ public class DefaultChainCredentialsProvider(
7575

7676
override fun close() {
7777
provider.close()
78-
imdsClient.close()
7978
if (manageEngine) {
8079
engine.closeIfCloseable()
8180
}

0 commit comments

Comments
 (0)