-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apply clock skew interceptor to clients created via
invoke
(#1067
- Loading branch information
Showing
7 changed files
with
119 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "5498a35b-f57f-4c0c-bbf7-43e07830be01", | ||
"type": "bugfix", | ||
"description": "Add config finalization to service clients via new abstract factory class; apply clock skew interceptor to clients created via `invoke`", | ||
"issues": [ | ||
"awslabs/aws-sdk-kotlin#1211" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ime/smithy-client/common/src/aws/smithy/kotlin/runtime/client/AbstractSdkClientFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package aws.smithy.kotlin.runtime.client | ||
|
||
public abstract class AbstractSdkClientFactory< | ||
TConfig : SdkClientConfig, | ||
TConfigBuilder : SdkClientConfig.Builder<TConfig>, | ||
TClient : SdkClient, | ||
TClientBuilder : SdkClient.Builder<TConfig, TConfigBuilder, TClient>, | ||
> : SdkClientFactory<TConfig, TConfigBuilder, TClient, TClientBuilder> { | ||
|
||
/** | ||
* Inject any client-specific config | ||
*/ | ||
protected open fun finalizeConfig(builder: TClientBuilder) { } | ||
|
||
public override operator fun invoke(block: TConfigBuilder.() -> Unit): TClient = builder().apply { | ||
config.apply(block) | ||
finalizeConfig(this) | ||
}.build() | ||
} |