-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: apply clock skew interceptor to clients created via invoke
#1067
Conversation
public override operator fun invoke(block: TConfigBuilder.() -> Unit): TClient = builder().apply { | ||
config.apply(block) | ||
finalizeConfig(this) | ||
}.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invoking an abstract class looks a little odd since they aren't meant to be instantiated. I don't have any suggestion here, it just stands out to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite invoking an abstract class. It's an operator defined on an abstract class which will only be callable on a concrete instance. No one's ever going to call AbstractSdkClientFactory.invoke { … }
or AbstractSdkClientFactory().invoke { … }
—both are compile-time errors.
This simply enables classes which inherit AbstractSdkClientFactory
(namely, service client companion objects) to be invoked (e.g., S3Client.invoke { … }
).
Discussed offline and this change is breaking enough that we don't want to push it directly to main. Updated base branch to v1.2. Will pursue a temporary fix strictly within aws-sdk-kotlin codegen until such time as we have another minor version bump. |
* fix: apply clock skew interceptor to clients created via `invoke` (#1067) * bumping version to 1.2.0 * whoops wait, don't bump versions manually; use the changelog mechanism 'requiresMinorVersionBump' * misc: upgrade to OkHttp 5.0.0-alpha.14, Okio 3.9.0, Kotlin 1.9.23 (#1070) * fix: remove draft (#1073) --------- Co-authored-by: Ian Botsford <83236726+ianbotsf@users.noreply.github.com>
Issue #
Addresses awslabs/aws-sdk-kotlin#1211
Description of changes
This change supports adding the clock skew interceptor to clients created via
invoke
(as opposed to viafromEnvironment
) by creating a newAbstractSdkClientFactory
superclass with a non-suspend
finalizeConfig
method and adjusting codegen accordingly.Companion PR: awslabs/aws-sdk-kotlin#1284
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.