Skip to content

Commit

Permalink
fix no identity provider configured and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Dec 28, 2023
1 parent 0b2de9c commit 0bbf1ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changes/f0f7ca8d-5690-4449-ace1-e826656a662c.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "f0f7ca8d-5690-4449-ace1-e826656a662c",
"type": "bugfix",
"description": "(**S3**) Fix default exceution context attributes",
"description": "(**s3**) Fix default execution context attributes",
"issues": [
"awslabs/aws-sdk-kotlin#1165"
]
Expand Down
12 changes: 12 additions & 0 deletions services/s3/common/test/aws/sdk/kotlin/services/s3/DefaultsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
package aws.sdk.kotlin.services.s3

import aws.sdk.kotlin.runtime.client.AwsClientOption
import aws.smithy.kotlin.runtime.auth.AuthSchemeId
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSignedBodyHeader
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSigningAttributes
import aws.smithy.kotlin.runtime.client.RequestInterceptorContext
import aws.smithy.kotlin.runtime.client.SdkClientOption
import aws.smithy.kotlin.runtime.collections.get
import aws.smithy.kotlin.runtime.http.auth.*
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
import aws.smithy.kotlin.runtime.httptest.buildTestConnection
import aws.smithy.kotlin.runtime.identity.IdentityProvider
import aws.smithy.kotlin.runtime.identity.IdentityProviderConfig
import aws.smithy.kotlin.runtime.io.use
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
Expand All @@ -29,9 +34,16 @@ class DefaultsTest {
@Test
fun testDefaultExecutionContext() = runTest {
val mockEngine = buildTestConnection { expect() }
val noAuth = object : AuthScheme {
override val schemeId: AuthSchemeId = AuthSchemeId.AwsSigV4
override val signer: HttpSigner = AnonymousHttpSigner
override fun identityProvider(identityProviderConfig: IdentityProviderConfig): IdentityProvider = AnonymousIdentityProvider
}

S3Client {
region = "us-east-1"
httpClient = mockEngine
authSchemes = listOf(noAuth)
interceptors += object : HttpInterceptor {
override fun readBeforeExecution(context: RequestInterceptorContext<Any>) {
assertNotNull(context.executionContext[SdkClientOption.ClientName])
Expand Down

0 comments on commit 0bbf1ee

Please sign in to comment.