Skip to content

Commit c95f1d6

Browse files
committed
chore: revert IMDS credentials spec 2.1
1 parent f98dadd commit c95f1d6

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
@@ -280,7 +278,6 @@ public final class aws/sdk/kotlin/runtime/config/AwsSdkSetting {
280278
public final fun getAwsContainerCredentialsFullUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
281279
public final fun getAwsContainerCredentialsRelativeUri ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
282280
public final fun getAwsDisableRequestCompression ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
283-
public final fun getAwsEc2InstanceProfileName ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
284281
public final fun getAwsEc2MetadataDisabled ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
285282
public final fun getAwsEc2MetadataServiceEndpoint ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
286283
public final fun getAwsEc2MetadataServiceEndpointMode ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
@@ -429,13 +426,6 @@ public final class aws/sdk/kotlin/runtime/config/imds/ImdsClient$Companion {
429426
public final fun invoke (Lkotlin/jvm/functions/Function1;)Laws/sdk/kotlin/runtime/config/imds/ImdsClient;
430427
}
431428

432-
public final class aws/sdk/kotlin/runtime/config/imds/ImdsResolversKt {
433-
public static final fun resolveDisableEc2Metadata (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
434-
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;
435-
public static final fun resolveEc2InstanceProfileName (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
436-
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;
437-
}
438-
439429
public abstract interface class aws/sdk/kotlin/runtime/config/imds/InstanceMetadataProvider : java/io/Closeable {
440430
public abstract fun get (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
441431
}
@@ -537,8 +527,6 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsProfileKt {
537527
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;
538528
public static final fun getCredentialProcess (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
539529
public static final fun getDisableRequestCompression (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
540-
public static final fun getEc2InstanceProfileName (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
541-
public static final fun getEc2MetadataDisabled (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
542530
public static final fun getEndpointDiscoveryEnabled (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;
543531
public static final fun getEndpointUrl (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Laws/smithy/kotlin/runtime/net/url/Url;
544532
public static final fun getIgnoreEndpointUrls (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Boolean;

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)