Skip to content

Commit 03156f5

Browse files
authored
refactor!: restructure aws-runtime (#337)
1 parent 0bed43b commit 03156f5

File tree

88 files changed

+233
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+233
-213
lines changed

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

Lines changed: 0 additions & 11 deletions
This file was deleted.

aws-runtime/auth/jvm/src/aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsProviderJvm.kt

Lines changed: 0 additions & 21 deletions
This file was deleted.

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,27 @@ description = "Support for AWS configuration"
77
extra["moduleName"] = "aws.sdk.kotlin.runtime.config"
88

99
val smithyKotlinVersion: String by project
10+
val crtKotlinVersion: String by project
11+
12+
val kotestVersion: String by project
1013

1114
kotlin {
1215
sourceSets {
1316
commonMain {
1417
dependencies {
1518
api(project(":aws-runtime:aws-core"))
19+
api(project(":aws-runtime:aws-types"))
1620
implementation("aws.smithy.kotlin:logging:$smithyKotlinVersion")
1721
implementation("aws.smithy.kotlin:http:$smithyKotlinVersion")
1822
implementation("aws.smithy.kotlin:utils:$smithyKotlinVersion")
1923
implementation(project(":aws-runtime:http-client-engine-crt"))
20-
implementation(project(":aws-runtime:protocols:http"))
24+
implementation(project(":aws-runtime:aws-http"))
25+
26+
27+
// credential providers
28+
implementation("aws.sdk.kotlin.crt:aws-crt-kotlin:$crtKotlinVersion")
29+
implementation(project(":aws-runtime:crt-util"))
30+
2131
}
2232
}
2333
commonTest {
@@ -30,5 +40,10 @@ kotlin {
3040
implementation("io.mockk:mockk:$mockkVersion")
3141
}
3242
}
43+
jvmTest {
44+
dependencies {
45+
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
46+
}
47+
}
3348
}
3449
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
package aws.sdk.kotlin.runtime.auth.credentials
77

8-
import aws.sdk.kotlin.runtime.AwsSdkSetting
98
import aws.sdk.kotlin.runtime.ConfigurationException
9+
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
1010
import aws.smithy.kotlin.runtime.util.Platform
1111

1212
/**
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
package aws.sdk.kotlin.runtime.auth.credentials
77

88
import aws.sdk.kotlin.crt.auth.credentials.build
9+
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
10+
import aws.sdk.kotlin.runtime.config.resolve
911
import aws.sdk.kotlin.runtime.crt.SdkDefaultIO
12+
import aws.smithy.kotlin.runtime.util.Platform
1013
import aws.sdk.kotlin.crt.auth.credentials.ProfileCredentialsProvider as ProfileCredentialsProviderCrt
1114

1215
/**
@@ -25,16 +28,8 @@ public class ProfileCredentialsProvider public constructor(
2528
override val crtProvider: ProfileCredentialsProviderCrt = ProfileCredentialsProviderCrt.build {
2629
clientBootstrap = SdkDefaultIO.ClientBootstrap
2730
tlsContext = SdkDefaultIO.TlsContext
28-
this.profileName = profileName ?: loadProfileName()
31+
this.profileName = profileName ?: AwsSdkSetting.AwsProfile.resolve(Platform)
2932
this.configFileName = configFileName
3033
this.credentialsFileName = credentialsFileName
3134
}
3235
}
33-
34-
/**
35-
* Attempts to load profile name using the following priority,
36-
* if neither are available, profileName will remain blank.
37-
* 1. JVM System Property
38-
* 2. Environment Variable
39-
*/
40-
internal expect fun loadProfileName(): String?

0 commit comments

Comments
 (0)