diff --git a/CHANGELOG.md b/CHANGELOG.md
index 710f79969..892e2b124 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,27 @@
# Changelog
+## [1.3.29] - 12/12/2024
+
+## [1.3.28] - 12/03/2024
+
+## [1.3.27] - 12/02/2024
+
+## [1.3.26] - 11/22/2024
+
+### Fixes
+* Infer the replayability of `InputStream` using `markSupported()` when setting `isOneShot`
+
+## [1.3.25] - 11/20/2024
+
+## [1.3.23] - 11/14/2024
+
+### Fixes
+* Fix application of `:content-type` for event stream inputs in the `smithy.protocols#rpcv2Cbor` protocol
+
+## [1.3.22] - 11/14/2024
+
+## [1.3.21] - 11/13/2024
+
## [1.3.20] - 11/07/2024
## [1.3.19] - 11/05/2024
@@ -52,7 +74,7 @@
## [1.3.8] - 08/29/2024
### Fixes
-* [#1126](https://github.com/awslabs/smithy-kotlin/issues/1126) Correct deserialization of nested map/list types in unions
+* [#1126](https://github.com/smithy-lang/smithy-kotlin/issues/1126) Correct deserialization of nested map/list types in unions
## [1.3.7] - 08/26/2024
@@ -69,7 +91,7 @@
## [1.3.4] - 08/12/2024
### Features
-* [#1087](https://github.com/awslabs/smithy-kotlin/issues/1087) Introduce new Micrometer telemetry provider. **Note**: This new provider (like the rest of the telemetry system) is marked `@ExperimentalApi` and could see backwards-incompatible API changes in future releases.
+* [#1087](https://github.com/smithy-lang/smithy-kotlin/issues/1087) Introduce new Micrometer telemetry provider. **Note**: This new provider (like the rest of the telemetry system) is marked `@ExperimentalApi` and could see backwards-incompatible API changes in future releases.
* Add new `ISO_8601_FULL` timestamp format for untruncated precision
### Fixes
@@ -188,12 +210,12 @@
## [1.1.4] - 04/17/2024
### Features
-* [#428](https://github.com/awslabs/smithy-kotlin/issues/428) ⚠️ **IMPORTANT**: Add new @SdkDsl DSL marker to all generated structure builders, clarifying DSL scopes when building complex types. See the [**Scope control applied to DSL builders** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1280) for more details.
+* [#428](https://github.com/smithy-lang/smithy-kotlin/issues/428) ⚠️ **IMPORTANT**: Add new @SdkDsl DSL marker to all generated structure builders, clarifying DSL scopes when building complex types. See the [**Scope control applied to DSL builders** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1280) for more details.
### Fixes
* [#900](https://github.com/awslabs/aws-sdk-kotlin/issues/900) Correctly generate waiters and paginators for resource operations
* [#1281](https://github.com/awslabs/aws-sdk-kotlin/issues/1281) Lazily resolve proxy environment variables
-* [#1061](https://github.com/awslabs/smithy-kotlin/issues/1061) Correctly handle async cancellation of call context in OkHttp engine
+* [#1061](https://github.com/smithy-lang/smithy-kotlin/issues/1061) Correctly handle async cancellation of call context in OkHttp engine
## [1.1.3] - 04/02/2024
@@ -208,8 +230,8 @@
## [1.1.0] - 03/18/2024
### Fixes
-* [#1045](https://github.com/awslabs/smithy-kotlin/issues/1045) ⚠️ **IMPORTANT**: Fix codegen for map shapes which use string enums as map keys. See the [**Map key changes** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1258) for more details
-* [#1041](https://github.com/awslabs/smithy-kotlin/issues/1041) ⚠️ **IMPORTANT**: Disable [OkHttp's transparent response decompression](https://square.github.io/okhttp/features/calls/#rewriting-requests) by manually specifying `Accept-Encoding: identity` in requests. See the [**Disabling automatic response decompression** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1259) for more details.
+* [#1045](https://github.com/smithy-lang/smithy-kotlin/issues/1045) ⚠️ **IMPORTANT**: Fix codegen for map shapes which use string enums as map keys. See the [**Map key changes** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1258) for more details
+* [#1041](https://github.com/smithy-lang/smithy-kotlin/issues/1041) ⚠️ **IMPORTANT**: Disable [OkHttp's transparent response decompression](https://square.github.io/okhttp/features/calls/#rewriting-requests) by manually specifying `Accept-Encoding: identity` in requests. See the [**Disabling automatic response decompression** breaking change announcement](https://github.com/awslabs/aws-sdk-kotlin/discussions/1259) for more details.
## [1.0.20] - 03/15/2024
@@ -260,7 +282,7 @@
## [1.0.13] - 02/07/2024
### Fixes
-* [#1031](https://github.com/awslabs/smithy-kotlin/issues/1031) Correctly parse URLs which contain the `@` symbol in the path and/or fragment (but not in the userinfo)
+* [#1031](https://github.com/smithy-lang/smithy-kotlin/issues/1031) Correctly parse URLs which contain the `@` symbol in the path and/or fragment (but not in the userinfo)
## [1.0.12] - 01/31/2024
@@ -296,7 +318,7 @@
### Features
* Generate KDoc samples from modeled examples
-* [#955](https://github.com/awslabs/smithy-kotlin/issues/955) Added support for [request compression](https://smithy.io/2.0/spec/behavior-traits.html#requestcompression-trait)
+* [#955](https://github.com/smithy-lang/smithy-kotlin/issues/955) Added support for [request compression](https://smithy.io/2.0/spec/behavior-traits.html#requestcompression-trait)
## [1.0.5] - 12/19/2023
@@ -451,7 +473,7 @@
* [#745](https://github.com/awslabs/aws-sdk-kotlin/issues/745) Add a response length validation interceptor
### Fixes
-* [#880](https://github.com/awslabs/smithy-kotlin/issues/880) Enforce `maxConnections` for CRT HTTP engine
+* [#880](https://github.com/smithy-lang/smithy-kotlin/issues/880) Enforce `maxConnections` for CRT HTTP engine
### Miscellaneous
* **BREAKING**: Remove `maxConnections` from generic HTTP engine config since it can't be enforced for OkHttp.
@@ -460,12 +482,12 @@
### Features
* Add experimental support for OpenTelemetry based telemetry provider
-* [#146](https://github.com/awslabs/smithy-kotlin/issues/146) Enable endpoint discovery
-* [#898](https://github.com/awslabs/smithy-kotlin/issues/898) BREAKING: introduce `maxConcurrency` HTTP engine setting and rename OkHttp specific `maxConnectionsPerHost` to `maxConcurrencyPerHost`.
+* [#146](https://github.com/smithy-lang/smithy-kotlin/issues/146) Enable endpoint discovery
+* [#898](https://github.com/smithy-lang/smithy-kotlin/issues/898) BREAKING: introduce `maxConcurrency` HTTP engine setting and rename OkHttp specific `maxConnectionsPerHost` to `maxConcurrencyPerHost`.
### Fixes
* [#905](https://github.com/awslabs/aws-sdk-kotlin/issues/905) Retry connection reset errors in OkHttp engine
-* [#888](https://github.com/awslabs/smithy-kotlin/issues/888) Correct URL encoding in endpoint resolution
+* [#888](https://github.com/smithy-lang/smithy-kotlin/issues/888) Correct URL encoding in endpoint resolution
### Miscellaneous
* **BREAKING**: Refactor observability API and configuration. See the [discussion](https://github.com/awslabs/aws-sdk-kotlin/discussions/981) post from the AWS SDK for Kotlin for more information.
@@ -479,7 +501,7 @@
## [0.22.0] - 06/29/2023
### Features
-* [#213](https://github.com/awslabs/smithy-kotlin/issues/213) Add support for `BigInteger` and `BigDecimal` in Smithy models
+* [#213](https://github.com/smithy-lang/smithy-kotlin/issues/213) Add support for `BigInteger` and `BigDecimal` in Smithy models
* [#701](https://github.com/awslabs/aws-sdk-kotlin/issues/701) **Breaking**: Simplify mechanisms for setting/updating retry strategies in client config. See [this discussion post](https://github.com/awslabs/aws-sdk-kotlin/discussions/964) for more details.
* [#701](https://github.com/awslabs/aws-sdk-kotlin/issues/701) Add adaptive retry mode
@@ -489,11 +511,11 @@
## [0.21.3] - 06/19/2023
### Features
-* [#718](https://github.com/awslabs/smithy-kotlin/issues/718) Support Smithy default trait
+* [#718](https://github.com/smithy-lang/smithy-kotlin/issues/718) Support Smithy default trait
### Fixes
-* [#867](https://github.com/awslabs/smithy-kotlin/issues/867) Add fully qualified name hint for collection types
-* [#828](https://github.com/awslabs/smithy-kotlin/issues/828) Use correct precedence order for determining restJson error codes
+* [#867](https://github.com/smithy-lang/smithy-kotlin/issues/867) Add fully qualified name hint for collection types
+* [#828](https://github.com/smithy-lang/smithy-kotlin/issues/828) Use correct precedence order for determining restJson error codes
## [0.21.2] - 06/08/2023
@@ -511,7 +533,7 @@
## [0.21.0] - 05/25/2023
### Features
-* [#755](https://github.com/awslabs/smithy-kotlin/issues/755) **Breaking**: Refresh presigning APIs to simplify usage and add new capabilities. See [this discussion post](https://github.com/awslabs/aws-sdk-kotlin/discussions/925) for more information.
+* [#755](https://github.com/smithy-lang/smithy-kotlin/issues/755) **Breaking**: Refresh presigning APIs to simplify usage and add new capabilities. See [this discussion post](https://github.com/awslabs/aws-sdk-kotlin/discussions/925) for more information.
## [0.20.0] - 05/18/2023
@@ -533,7 +555,7 @@
## [0.18.0] - 05/04/2023
### Features
-* [#661](https://github.com/awslabs/smithy-kotlin/issues/661) **Breaking**: Add HTTP engine configuration for minimum TLS version. See the [BREAKING: Streamlined TLS configuration](https://github.com/awslabs/aws-sdk-kotlin/discussions/909) discussion post for more details.
+* [#661](https://github.com/smithy-lang/smithy-kotlin/issues/661) **Breaking**: Add HTTP engine configuration for minimum TLS version. See the [BREAKING: Streamlined TLS configuration](https://github.com/awslabs/aws-sdk-kotlin/discussions/909) discussion post for more details.
* BREAKING: rename SdkLogMode to LogMode
* [#432](https://github.com/awslabs/aws-sdk-kotlin/issues/432) Enable resolving LogMode from environment
@@ -552,7 +574,7 @@
## [0.17.3] - 04/20/2023
This release is identical to
-[0.17.2](https://github.com/awslabs/smithy-kotlin/blob/main/CHANGELOG.md#0172---04202023).
+[0.17.2](https://github.com/smithy-lang/smithy-kotlin/blob/main/CHANGELOG.md#0172---04202023).
## [0.17.2] - 04/20/2023
@@ -572,7 +594,7 @@ This release is identical to
## [0.17.0] - 04/13/2023
### Fixes
-* [#818](https://github.com/awslabs/smithy-kotlin/issues/818) Allow requests with zero content length in the CRT HTTP engine
+* [#818](https://github.com/smithy-lang/smithy-kotlin/issues/818) Allow requests with zero content length in the CRT HTTP engine
### Miscellaneous
* **BREAKING**: Refactor identity and authentication APIs
@@ -580,7 +602,7 @@ This release is identical to
## [0.16.6] - 04/06/2023
### Features
-* [#752](https://github.com/awslabs/smithy-kotlin/issues/752) Add intEnum support.
+* [#752](https://github.com/smithy-lang/smithy-kotlin/issues/752) Add intEnum support.
## [0.16.5] - 03/30/2023
@@ -608,7 +630,7 @@ This release is identical to
## [0.16.0] - 02/23/2023
### Fixes
-* [#805](https://github.com/awslabs/smithy-kotlin/issues/805) Fix a bug where system time jumps could cause unexpected retry behavior
+* [#805](https://github.com/smithy-lang/smithy-kotlin/issues/805) Fix a bug where system time jumps could cause unexpected retry behavior
### Miscellaneous
* Refactor: move `EndpointProvider` out of http package into `aws.smithy.kotlin.runtime.client.endpoints`
@@ -642,7 +664,7 @@ This release is identical to
## [0.15.1] - 02/02/2023
### Features
-* [#446](https://github.com/awslabs/smithy-kotlin/issues/446) Implement flexible checksums customization
+* [#446](https://github.com/smithy-lang/smithy-kotlin/issues/446) Implement flexible checksums customization
* Add support for unsigned `aws-chunked` requests
### Miscellaneous
@@ -654,8 +676,8 @@ This release is identical to
* Allow config override for one or more operations with an existing service client.
### Fixes
-* [#781](https://github.com/awslabs/smithy-kotlin/issues/781) Lazily open random access files to prevent exhausting file handles in highly concurrent scenarios
-* [#784](https://github.com/awslabs/smithy-kotlin/issues/784) Include exceptions in logging from trace probes
+* [#781](https://github.com/smithy-lang/smithy-kotlin/issues/781) Lazily open random access files to prevent exhausting file handles in highly concurrent scenarios
+* [#784](https://github.com/smithy-lang/smithy-kotlin/issues/784) Include exceptions in logging from trace probes
### Miscellaneous
* Upgrade dependencies
@@ -666,8 +688,8 @@ This release is identical to
## [0.14.3] - 01/12/2023
### Features
-* [#122](https://github.com/awslabs/smithy-kotlin/issues/122) Add capability to intercept SDK operations
-* [#745](https://github.com/awslabs/smithy-kotlin/issues/745) Add KMP DNS resolver
+* [#122](https://github.com/smithy-lang/smithy-kotlin/issues/122) Add capability to intercept SDK operations
+* [#745](https://github.com/smithy-lang/smithy-kotlin/issues/745) Add KMP DNS resolver
### Miscellaneous
* Add design document for per-op config.
@@ -688,8 +710,8 @@ This release is identical to
### Fixes
* [#759](https://github.com/awslabs/aws-sdk-kotlin/issues/759) Allow root trace spans to inherit their parent from current context
-* [#763](https://github.com/awslabs/smithy-kotlin/issues/763) Respect @sensitive trait when applied to container shape
-* [#759](https://github.com/awslabs/smithy-kotlin/issues/759) Fix `aws-chunked` requests in the CRT HTTP engine
+* [#763](https://github.com/smithy-lang/smithy-kotlin/issues/763) Respect @sensitive trait when applied to container shape
+* [#759](https://github.com/smithy-lang/smithy-kotlin/issues/759) Fix `aws-chunked` requests in the CRT HTTP engine
## [0.14.0] - 12/01/2022
@@ -705,7 +727,7 @@ This release is identical to
### Features
* **BREAKING** Implement codegen and update runtime for smithy-modeled endpoint resolution.
-* [#677](https://github.com/awslabs/smithy-kotlin/issues/677) Add a new tracing framework for centralized handling of log messages and metric events and providing easy integration points for connecting to downstream tracing systems (e.g., kotlin-logging)
+* [#677](https://github.com/smithy-lang/smithy-kotlin/issues/677) Add a new tracing framework for centralized handling of log messages and metric events and providing easy integration points for connecting to downstream tracing systems (e.g., kotlin-logging)
* [#747](https://github.com/awslabs/aws-sdk-kotlin/issues/747) Add aws-chunked content encoding
* Implement common-Kotlin URL parsing and IPv4/v6 address validation.
@@ -747,7 +769,7 @@ This release is identical to
### Fixes
* [#715](https://github.com/awslabs/aws-sdk-kotlin/issues/715) Enable intra-repo links in API ref docs
-* [#714](https://github.com/awslabs/smithy-kotlin/issues/714) Properly parse timestamps when format override is applied to target shapes
+* [#714](https://github.com/smithy-lang/smithy-kotlin/issues/714) Properly parse timestamps when format override is applied to target shapes
## [0.12.8] - 10/03/2022
@@ -773,7 +795,7 @@ This release is identical to
### Fixes
* Fix occasional stream leak due to race condition in CRT engine
-* [#678](https://github.com/awslabs/smithy-kotlin/issues/678) Fix the calculation of file lengths on `ByteStream`s from `Path`s
+* [#678](https://github.com/smithy-lang/smithy-kotlin/issues/678) Fix the calculation of file lengths on `ByteStream`s from `Path`s
* Properly check if a member can be nullable
### Miscellaneous
@@ -819,10 +841,10 @@ This release is identical to
### Features
* Add support for NOT, OR, and AND JMESPath expressions in waiters
-* [#123](https://github.com/awslabs/smithy-kotlin/issues/123) Add support for smithy Document type.
+* [#123](https://github.com/smithy-lang/smithy-kotlin/issues/123) Add support for smithy Document type.
### Miscellaneous
-* [#599](https://github.com/awslabs/smithy-kotlin/issues/599) Upgrade Smithy version to 1.22
+* [#599](https://github.com/smithy-lang/smithy-kotlin/issues/599) Upgrade Smithy version to 1.22
## [0.11.1] - 07/01/2022
@@ -836,25 +858,25 @@ This release is identical to
### Features
* (breaking) Use kotlin nullability to represent null Documents instead of an explicit subclass.
-* [#494](https://github.com/awslabs/smithy-kotlin/issues/494) Add support for HTTP proxies
+* [#494](https://github.com/smithy-lang/smithy-kotlin/issues/494) Add support for HTTP proxies
### Fixes
* [#638](https://github.com/awslabs/aws-sdk-kotlin/issues/638) Fix ktor engine representation of empty payload
-* [#139](https://github.com/awslabs/smithy-kotlin/issues/139) Validate that members bound to URI paths are non-null at object construction
+* [#139](https://github.com/smithy-lang/smithy-kotlin/issues/139) Validate that members bound to URI paths are non-null at object construction
### Miscellaneous
-* [#629](https://github.com/awslabs/smithy-kotlin/issues/629) Refactor to bind directly to okhttp and remove ktor as a middleman
+* [#629](https://github.com/smithy-lang/smithy-kotlin/issues/629) Refactor to bind directly to okhttp and remove ktor as a middleman
## [0.10.2] - 06/09/2022
### Fixes
* [#619](https://github.com/awslabs/aws-sdk-kotlin/issues/619) Fix bugs with signing for query parameters containing '+' and '%'
-* [#657](https://github.com/awslabs/smithy-kotlin/issues/657) Fix bug in URI encoding during signing when dealing with special characters like '<', '>', and '/'
+* [#657](https://github.com/smithy-lang/smithy-kotlin/issues/657) Fix bug in URI encoding during signing when dealing with special characters like '<', '>', and '/'
## [0.10.1] - 06/02/2022
### Features
-* [#617](https://github.com/awslabs/smithy-kotlin/issues/617) Add a new non-CRT SigV4 signer and use it as the default. This removes the CRT as a hard dependency for using the SDK (although the CRT signer can still be used via explicit configuration on client creation).
+* [#617](https://github.com/smithy-lang/smithy-kotlin/issues/617) Add a new non-CRT SigV4 signer and use it as the default. This removes the CRT as a hard dependency for using the SDK (although the CRT signer can still be used via explicit configuration on client creation).
### Fixes
* [#473](https://github.com/awslabs/aws-sdk-kotlin/issues/473) Upgrade aws-crt-kotlin to latest
@@ -874,7 +896,7 @@ This release is identical to
## [0.9.2] - 05/19/2022
### Features
-* [#129](https://github.com/awslabs/smithy-kotlin/issues/129) Allow omission of input in service method calls where no parameters are required.
+* [#129](https://github.com/smithy-lang/smithy-kotlin/issues/129) Allow omission of input in service method calls where no parameters are required.
### Fixes
* Handle invalid (empty) description term headers when generating documentation.
@@ -887,7 +909,7 @@ This release is identical to
* [#530](https://github.com/awslabs/aws-sdk-kotlin/issues/530) Add partial-file ByteStream support.
### Fixes
-* [#136](https://github.com/awslabs/smithy-kotlin/issues/136) Convert HTML to Markdown for improved Dokka compatibility.
+* [#136](https://github.com/smithy-lang/smithy-kotlin/issues/136) Convert HTML to Markdown for improved Dokka compatibility.
### Miscellaneous
* [#575](https://github.com/awslabs/aws-sdk-kotlin/issues/575) Add support for getting all env vars and system properties (i.e., not just by a single key)
@@ -901,8 +923,8 @@ This release is identical to
## [0.8.5] - 04/21/2022
### Fixes
-* set Content-Type header on empty bodies with Ktor if canonical request includes it [#630](https://github.com/awslabs/smithy-kotlin/pull/630)
-* coroutine leak in ktor engine [#628](https://github.com/awslabs/smithy-kotlin/pull/628)
+* set Content-Type header on empty bodies with Ktor if canonical request includes it [#630](https://github.com/smithy-lang/smithy-kotlin/pull/630)
+* coroutine leak in ktor engine [#628](https://github.com/smithy-lang/smithy-kotlin/pull/628)
## [0.8.4] - 04/21/2022
@@ -911,87 +933,87 @@ NOTE: Do not use. No difference from 0.8.3
## [0.8.3] - 04/14/2022
### Fixes
-* only set Content-Type when body is non-empty [#619](https://github.com/awslabs/smithy-kotlin/pull/619)
+* only set Content-Type when body is non-empty [#619](https://github.com/smithy-lang/smithy-kotlin/pull/619)
## [0.8.2] - 04/07/2022
### Fixes
-* remove maxTime from StandardRetryStrategy [#624](https://github.com/awslabs/smithy-kotlin/pull/624)
-* readAvailable fallback behavior [#620](https://github.com/awslabs/smithy-kotlin/pull/620)
+* remove maxTime from StandardRetryStrategy [#624](https://github.com/smithy-lang/smithy-kotlin/pull/624)
+* readAvailable fallback behavior [#620](https://github.com/smithy-lang/smithy-kotlin/pull/620)
## [0.8.1] - 03/31/2022
### New features
-* implement KMP XML serde and remove XmlPull dependency [#615](https://github.com/awslabs/smithy-kotlin/pull/615)
+* implement KMP XML serde and remove XmlPull dependency [#615](https://github.com/smithy-lang/smithy-kotlin/pull/615)
### Fixes
-* respect hostname immutability in endpoints to disable host prefixing [#612](https://github.com/awslabs/smithy-kotlin/pull/612)
+* respect hostname immutability in endpoints to disable host prefixing [#612](https://github.com/smithy-lang/smithy-kotlin/pull/612)
## [0.8.0] - 03/24/2022
### Breaking changes
-* introduce opaque KMP default HTTP client engine [#606](https://github.com/awslabs/smithy-kotlin/pull/606)
+* introduce opaque KMP default HTTP client engine [#606](https://github.com/smithy-lang/smithy-kotlin/pull/606)
### New features
-* bootstrap event streams [#597](https://github.com/awslabs/smithy-kotlin/pull/597)
+* bootstrap event streams [#597](https://github.com/smithy-lang/smithy-kotlin/pull/597)
### Fixes
-* temporarily handle httpchecksum trait the same as httpchecksumrequired [#608](https://github.com/awslabs/smithy-kotlin/pull/608)
+* temporarily handle httpchecksum trait the same as httpchecksumrequired [#608](https://github.com/smithy-lang/smithy-kotlin/pull/608)
### Miscellaneous
-* add convenience function for decoding URL components [#607](https://github.com/awslabs/smithy-kotlin/pull/607)
-* fix pagination design docs [#600](https://github.com/awslabs/smithy-kotlin/pull/600)
+* add convenience function for decoding URL components [#607](https://github.com/smithy-lang/smithy-kotlin/pull/607)
+* fix pagination design docs [#600](https://github.com/smithy-lang/smithy-kotlin/pull/600)
## [0.7.8] - 02/17/2022
### New features
-* add DSL overloads to paginator methods [#591](https://github.com/awslabs/smithy-kotlin/pull/591)
+* add DSL overloads to paginator methods [#591](https://github.com/smithy-lang/smithy-kotlin/pull/591)
### Fixes
-* ignore redirect statuses in Ktor engine [#590](https://github.com/awslabs/smithy-kotlin/pull/590)
-* handle stream response exceptions properly in Ktor engine [#589](https://github.com/awslabs/smithy-kotlin/pull/589)
+* ignore redirect statuses in Ktor engine [#590](https://github.com/smithy-lang/smithy-kotlin/pull/590)
+* handle stream response exceptions properly in Ktor engine [#589](https://github.com/smithy-lang/smithy-kotlin/pull/589)
### Miscellaneous
-* coroutine version bump to 1.6.0 and Duration stabilization [#580](https://github.com/awslabs/smithy-kotlin/pull/580)
-* dokka upgrade [#588](https://github.com/awslabs/smithy-kotlin/pull/588)
-* upgrade smithy to 1.17.0 [#587](https://github.com/awslabs/smithy-kotlin/pull/587)
+* coroutine version bump to 1.6.0 and Duration stabilization [#580](https://github.com/smithy-lang/smithy-kotlin/pull/580)
+* dokka upgrade [#588](https://github.com/smithy-lang/smithy-kotlin/pull/588)
+* upgrade smithy to 1.17.0 [#587](https://github.com/smithy-lang/smithy-kotlin/pull/587)
## [0.7.7] - 02/04/2022
### New features
-* implement waiters codegen [#584](https://github.com/awslabs/smithy-kotlin/pull/584)
-* Kotlin MP gradle file generation [#577](https://github.com/awslabs/smithy-kotlin/pull/577)
-* allow custom rendering of config properties [#568](https://github.com/awslabs/smithy-kotlin/pull/568)
+* implement waiters codegen [#584](https://github.com/smithy-lang/smithy-kotlin/pull/584)
+* Kotlin MP gradle file generation [#577](https://github.com/smithy-lang/smithy-kotlin/pull/577)
+* allow custom rendering of config properties [#568](https://github.com/smithy-lang/smithy-kotlin/pull/568)
### Miscellaneous
-* event stream design [#576](https://github.com/awslabs/smithy-kotlin/pull/576)
+* event stream design [#576](https://github.com/smithy-lang/smithy-kotlin/pull/576)
## [0.7.6] - 01/13/2022
### New features
-* Paginator codegen using Kotlin Flow [#557](https://github.com/awslabs/smithy-kotlin/pull/557)
-* allow nullable LazyAsyncValue; add test utils for constructing http traffic from JSON [#561](https://github.com/awslabs/smithy-kotlin/pull/561)
+* Paginator codegen using Kotlin Flow [#557](https://github.com/smithy-lang/smithy-kotlin/pull/557)
+* allow nullable LazyAsyncValue; add test utils for constructing http traffic from JSON [#561](https://github.com/smithy-lang/smithy-kotlin/pull/561)
### Fixes
-* paginator generation for models that specify non-string cursor [#566](https://github.com/awslabs/smithy-kotlin/pull/566)
-* Fix smithy sdk no default client [#564](https://github.com/awslabs/smithy-kotlin/pull/564)
+* paginator generation for models that specify non-string cursor [#566](https://github.com/smithy-lang/smithy-kotlin/pull/566)
+* Fix smithy sdk no default client [#564](https://github.com/smithy-lang/smithy-kotlin/pull/564)
## [0.7.5] - 01/06/2022
### New features
-* upgrade to Kotlin 1.6.10 [#551](https://github.com/awslabs/smithy-kotlin/pull/551)
-* allow query params to be set from resolved endpoints [#554](https://github.com/awslabs/smithy-kotlin/pull/554)
-* sha1 hash; expose json utils [#548](https://github.com/awslabs/smithy-kotlin/pull/548)
+* upgrade to Kotlin 1.6.10 [#551](https://github.com/smithy-lang/smithy-kotlin/pull/551)
+* allow query params to be set from resolved endpoints [#554](https://github.com/smithy-lang/smithy-kotlin/pull/554)
+* sha1 hash; expose json utils [#548](https://github.com/smithy-lang/smithy-kotlin/pull/548)
### Fixes
-* only retry client errors if metadata allows [#560](https://github.com/awslabs/smithy-kotlin/pull/560)
+* only retry client errors if metadata allows [#560](https://github.com/smithy-lang/smithy-kotlin/pull/560)
## [0.7.4-beta] - 12/09/2021
**WARNING: Beta releases may contain bugs and no guarantee is made about API stability. They are not recommended for production use!**
### New features
-* add call logging at DEBUG level [#547](https://github.com/awslabs/smithy-kotlin/pull/547)
+* add call logging at DEBUG level [#547](https://github.com/smithy-lang/smithy-kotlin/pull/547)
## [0.7.3-beta] - 12/01/2021
@@ -1003,20 +1025,20 @@ NOTE: Do not use. No difference from 0.8.3
**WARNING: Alpha releases may contain bugs and no guarantee is made about API stability. They are not recommended for production use!**
### Fixes
-* Fix nested struct dsl builder function codegen [#538](https://github.com/awslabs/smithy-kotlin/pull/538)
-* remove leaky trace logging from XML serde [#537](https://github.com/awslabs/smithy-kotlin/pull/537)
-* fix rendering of middleware without configure [#535](https://github.com/awslabs/smithy-kotlin/pull/535)
+* Fix nested struct dsl builder function codegen [#538](https://github.com/smithy-lang/smithy-kotlin/pull/538)
+* remove leaky trace logging from XML serde [#537](https://github.com/smithy-lang/smithy-kotlin/pull/537)
+* fix rendering of middleware without configure [#535](https://github.com/smithy-lang/smithy-kotlin/pull/535)
## [0.7.1-alpha] - 11/04/2021
**WARNING: Alpha releases may contain bugs and no guarantee is made about API stability. They are not recommended for production use!**
### New features
-* add convenience extension method for detecting if a Shape has the Streaming trait [#512](https://github.com/awslabs/smithy-kotlin/pull/512)
+* add convenience extension method for detecting if a Shape has the Streaming trait [#512](https://github.com/smithy-lang/smithy-kotlin/pull/512)
### Fixes
-* delegate when to set content-type to binding resolver; fix content-length for empty bodies [#525](https://github.com/awslabs/smithy-kotlin/pull/525)
-* Update regex to handle version segments greater than 9 [#521](https://github.com/awslabs/smithy-kotlin/pull/521)
+* delegate when to set content-type to binding resolver; fix content-length for empty bodies [#525](https://github.com/smithy-lang/smithy-kotlin/pull/525)
+* Update regex to handle version segments greater than 9 [#521](https://github.com/smithy-lang/smithy-kotlin/pull/521)
## [0.7.0-alpha] - 10/28/2021
@@ -1024,18 +1046,18 @@ NOTE: Do not use. No difference from 0.8.3
### New Features
-* add endpoint configuration and middleware by default [#507](https://github.com/awslabs/smithy-kotlin/pull/507)
+* add endpoint configuration and middleware by default [#507](https://github.com/smithy-lang/smithy-kotlin/pull/507)
## [0.6.0-alpha] - 10/21/2021
**WARNING: Alpha releases may contain bugs and no guarantee is made about API stability. They are not recommended for production use!**
### Fixes
-* emulate a real response body more closely to help catch subtle codegen bugs [#505](https://github.com/awslabs/smithy-kotlin/pull/505)
-* **BREAKING**: overhaul client config property generation [#504](https://github.com/awslabs/smithy-kotlin/pull/504)
+* emulate a real response body more closely to help catch subtle codegen bugs [#505](https://github.com/smithy-lang/smithy-kotlin/pull/505)
+* **BREAKING**: overhaul client config property generation [#504](https://github.com/smithy-lang/smithy-kotlin/pull/504)
### Misc
-* Bump Kotlin and Dokka versions to latest release [#506](https://github.com/awslabs/smithy-kotlin/pull/506)
+* Bump Kotlin and Dokka versions to latest release [#506](https://github.com/smithy-lang/smithy-kotlin/pull/506)
## [0.5.1-alpha] - 10/14/2021
@@ -1043,10 +1065,10 @@ NOTE: Do not use. No difference from 0.8.3
### New features
-* http client engine config [#493](https://github.com/awslabs/smithy-kotlin/pull/493)
-* add codegen wrappers for retries [#490](https://github.com/awslabs/smithy-kotlin/pull/490)
+* http client engine config [#493](https://github.com/smithy-lang/smithy-kotlin/pull/493)
+* add codegen wrappers for retries [#490](https://github.com/smithy-lang/smithy-kotlin/pull/490)
### Fixes
-* remove gson from dependencies [#496](https://github.com/awslabs/smithy-kotlin/pull/496)
+* remove gson from dependencies [#496](https://github.com/smithy-lang/smithy-kotlin/pull/496)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a48ecefd7..e0c24fffb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -84,7 +84,7 @@ of your request may disagree and ask that you add one anyway.
"type": "feature",
"description": "Add multiplatform support for URL parsing",
"issues": [
- "awslabs/smithy-kotlin#12345"
+ "smithy-lang/smithy-kotlin#12345"
]
}
```
diff --git a/README.md b/README.md
index 0ff20aa52..3d1a54aa4 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Smithy Kotlin
+# Smithy Kotlin
[Smithy](https://smithy.io/2.0/index.html) code generators for [Kotlin](https://kotlinlang.org/).
diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts
index c0e23752f..51b05616c 100644
--- a/bom/build.gradle.kts
+++ b/bom/build.gradle.kts
@@ -69,8 +69,7 @@ fun DependencyConstraintHandler.api(constraintNotation: Any) =
createBomConstraintsAndVersionCatalog()
-configurePublishing("smithy-kotlin")
-
+configurePublishing("smithy-kotlin", "smithy-lang")
publishing {
publications {
create("bom", MavenPublication::class) {
diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts
index cf86fad97..96a7442a5 100644
--- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts
+++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts
@@ -107,4 +107,4 @@ publishing {
}
}
-configurePublishing("smithy-kotlin")
+configurePublishing("smithy-kotlin", "smithy-lang")
diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RestJson1.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RestJson1.kt
index 1a64f4765..dcf2f0a81 100644
--- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RestJson1.kt
+++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RestJson1.kt
@@ -46,7 +46,7 @@ class RestJson1 : JsonHttpBindingProtocolGenerator() {
// restjson1 has some different semantics and expectations around empty structures bound via @httpPayload trait
// * empty structures get serialized to `{}`
- // see: https://github.com/awslabs/smithy/pull/924
+ // see: https://github.com/smithy-lang/smithy/pull/924
val requestBindings = resolver.requestBindings(op)
val httpPayload = requestBindings.firstOrNull { it.location == HttpBinding.Location.PAYLOAD }
if (httpPayload != null) {
@@ -58,7 +58,7 @@ class RestJson1 : JsonHttpBindingProtocolGenerator() {
write("builder.body = #T.fromBytes(#S.encodeToByteArray())", RuntimeTypes.Http.HttpBody, "{}")
}
// Content-Type still needs to be set for non-structured payloads
- // https://github.com/awslabs/smithy/blob/main/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy#L174
+ // https://github.com/smithy-lang/smithy/blob/main/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy#L174
write("builder.headers.setMissing(\"Content-Type\", #S)", resolver.determineRequestContentType(op))
}
}
diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2Cbor.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2Cbor.kt
index 9b6f354b7..117574da4 100644
--- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2Cbor.kt
+++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2Cbor.kt
@@ -139,7 +139,12 @@ class RpcV2Cbor : AwsHttpBindingProtocolGenerator() {
writer: KotlinWriter,
resolver: HttpBindingResolver,
) {
- writer.write("builder.headers.setMissing(\"Content-Type\", #S)", resolver.determineRequestContentType(op))
+ val contentTypeHeader = when {
+ op.isInputEventStream(ctx.model) -> "application/vnd.amazon.eventstream"
+ else -> "application/cbor"
+ }
+
+ writer.write("builder.headers.setMissing(\"Content-Type\", #S)", contentTypeHeader)
}
class RpcV2CborHttpBindingResolver(
@@ -152,7 +157,6 @@ class RpcV2Cbor : AwsHttpBindingProtocolGenerator() {
"application/cbor",
TimestampFormatTrait.Format.UNKNOWN,
) {
-
override fun httpTrait(operationShape: OperationShape): HttpTrait = HttpTrait
.builder()
.code(200)
@@ -160,9 +164,6 @@ class RpcV2Cbor : AwsHttpBindingProtocolGenerator() {
.uri(UriPattern.parse("/service/${serviceShape.id.name}/operation/${operationShape.id.name}"))
.build()
- override fun determineRequestContentType(operationShape: OperationShape): String = when {
- operationShape.isInputEventStream(model) -> "application/vnd.amazon.eventstream"
- else -> "application/cbor"
- }
+ override fun determineRequestContentType(operationShape: OperationShape): String = "application/cbor"
}
}
diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/eventstream/EventStreamParserGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/eventstream/EventStreamParserGenerator.kt
index 92845b590..914fc5be4 100644
--- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/eventstream/EventStreamParserGenerator.kt
+++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/eventstream/EventStreamParserGenerator.kt
@@ -28,6 +28,7 @@ val RPC_BOUND_PROTOCOLS = setOf(
"awsJson1_1",
"awsQuery",
"ec2Query",
+ "rpcv2Cbor",
)
/**
diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/xml/RestXmlSerdeDescriptorGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/xml/RestXmlSerdeDescriptorGenerator.kt
index e71d2db27..37916b4db 100644
--- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/xml/RestXmlSerdeDescriptorGenerator.kt
+++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/xml/RestXmlSerdeDescriptorGenerator.kt
@@ -34,7 +34,7 @@ class RestXmlSerdeDescriptorGenerator(
val serialName = getSerialName(member, nameSuffix)
if (serialName.equals("message", ignoreCase = true)) {
// Need to be able to read error messages from "Message" or "message"
- // https://github.com/awslabs/smithy-kotlin/issues/352
+ // https://github.com/smithy-lang/smithy-kotlin/issues/352
traitList.add(RuntimeTypes.Serde.SerdeXml.XmlAliasName, serialName.toggleFirstCharacterCase().dq())
}
}
diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2CborTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2CborTest.kt
index f31f749fd..17a7c0f3d 100644
--- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2CborTest.kt
+++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols/RpcV2CborTest.kt
@@ -20,7 +20,7 @@ class RpcV2CborTest {
@service(sdkId: "CborExample")
service CborExample {
version: "1.0.0",
- operations: [GetFoo, GetFooStreaming]
+ operations: [GetFoo, GetFooStreaming, PutFooStreaming]
}
@http(method: "POST", uri: "/foo")
@@ -34,7 +34,29 @@ class RpcV2CborTest {
}
}
+ @http(method: "POST", uri: "/put-foo-streaming")
+ operation PutFooStreaming {
+ input: PutFooStreamingInput
+ }
+
+ structure PutFooStreamingInput {
+ room: String
+ messages: PublishEvents
+ }
+
// Model taken from https://smithy.io/2.0/spec/streaming.html#event-streams
+ @streaming
+ union PublishEvents {
+ message: Message
+ leave: LeaveEvent
+ }
+
+ structure Message {
+ message: String
+ }
+
+ structure LeaveEvent {}
+
@streaming
union FooEvents {
up: Movement
@@ -98,4 +120,29 @@ class RpcV2CborTest {
""".replaceIndent(" ")
getFooMethod.shouldContainOnlyOnceWithDiff(expectedHeaderMutation)
}
+
+ @Test
+ fun testEventStreamContentTypeHeaders() {
+ val ctx = model.newTestContext("CborExample")
+
+ val generator = RpcV2Cbor()
+ generator.generateProtocolClient(ctx.generationCtx)
+
+ ctx.generationCtx.delegator.finalize()
+ ctx.generationCtx.delegator.flushWriters()
+
+ val serializer = ctx.manifest.expectFileString("/src/main/kotlin/com/test/serde/PutFooStreamingOperationSerializer.kt")
+
+ // Event stream messages should have `:content-type: application/cbor`
+ val encodeMessage = serializer.lines("private fun encodePutFooStreamingPublishEventsEventMessage(input: PublishEvents): Message = buildMessage {", "}")
+ encodeMessage.shouldContainOnlyOnceWithDiff(
+ """
+ addHeader(":content-type", HeaderValue.String("application/cbor"))
+ """.trimIndent(),
+ )
+
+ // Event stream requests should have Content-Type=application/vnd.amazon.eventstream
+ val serializeBody = serializer.lines(" override suspend fun serialize(context: ExecutionContext, input: PutFooStreamingRequest): HttpRequestBuilder {", "}")
+ serializeBody.shouldContainOnlyOnceWithDiff("""builder.headers.setMissing("Content-Type", "application/vnd.amazon.eventstream")""")
+ }
}
diff --git a/codegen/smithy-kotlin-codegen-testutils/build.gradle.kts b/codegen/smithy-kotlin-codegen-testutils/build.gradle.kts
index b5c04ada2..3bd714fb6 100644
--- a/codegen/smithy-kotlin-codegen-testutils/build.gradle.kts
+++ b/codegen/smithy-kotlin-codegen-testutils/build.gradle.kts
@@ -86,4 +86,4 @@ publishing {
}
}
-configurePublishing("smithy-kotlin")
+configurePublishing("smithy-kotlin", "smithy-lang")
diff --git a/codegen/smithy-kotlin-codegen/build.gradle.kts b/codegen/smithy-kotlin-codegen/build.gradle.kts
index 00b5f520f..0381edb03 100644
--- a/codegen/smithy-kotlin-codegen/build.gradle.kts
+++ b/codegen/smithy-kotlin-codegen/build.gradle.kts
@@ -122,4 +122,4 @@ publishing {
}
}
-configurePublishing("smithy-kotlin")
+configurePublishing("smithy-kotlin", "smithy-lang")
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/CodegenVisitor.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/CodegenVisitor.kt
index 67dafcb49..4adf42b91 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/CodegenVisitor.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/CodegenVisitor.kt
@@ -61,7 +61,7 @@ class CodegenVisitor(context: PluginContext) : ShapeVisitor.Default() {
// Model pre-processing:
// 1. Start with the model from the plugin context
// 2. Apply integrations
- // 3. Flatten error shapes (see: https://github.com/awslabs/smithy/pull/919)
+ // 3. Flatten error shapes (see: https://github.com/smithy-lang/smithy/pull/919)
// 4. Normalize the operations
for (integration in integrations) {
if (integration.enabledForService(resolvedModel, settings)) {
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/integration/SectionWriter.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/integration/SectionWriter.kt
index 5a8ecd1e1..af25792ff 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/integration/SectionWriter.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/integration/SectionWriter.kt
@@ -28,7 +28,7 @@ fun interface SectionWriter {
* evaluated [SectionWriter] associated with the same [SectionId]. For writers that wish to
* append to any pre-existing codegen strings in the section, they must explicitly write
* the contents of previousValue to the writer. See the
- * [CodeWriter](https://github.com/awslabs/smithy/blob/main/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java)
+ * [CodeWriter](https://github.com/smithy-lang/smithy/blob/main/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java)
* documentation for more details
*/
fun write(writer: KotlinWriter, previousValue: String?)
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ShapeValueGenerator.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ShapeValueGenerator.kt
index 3ac683da8..371fd9857 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ShapeValueGenerator.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ShapeValueGenerator.kt
@@ -78,7 +78,7 @@ class ShapeValueGenerator(
private fun classDeclaration(writer: KotlinWriter, shape: StructureShape, block: () -> Unit) {
val symbol = symbolProvider.toSymbol(shape)
// invoke the generated DSL builder for the class
- writer.writeInline("#L {", symbol.name)
+ writer.writeInline("#T {", symbol)
.ensureNewline()
.indent()
.call { block() }
@@ -129,7 +129,7 @@ class ShapeValueGenerator(
val suffix = when {
shape.isEnum -> {
val symbol = symbolProvider.toSymbol(shape)
- writer.writeInline("#L.fromValue(", symbol.name)
+ writer.writeInline("#T.fromValue(", symbol)
")"
}
@@ -222,7 +222,7 @@ class ShapeValueGenerator(
val currSymbol = generator.symbolProvider.toSymbol(currShape)
val memberName = generator.symbolProvider.toMemberName(member)
val variantName = memberName.replaceFirstChar { c -> c.uppercaseChar() }
- writer.writeInline("${currSymbol.name}.$variantName(")
+ writer.writeInline("#T.#L(", currSymbol, variantName)
generator.instantiateShapeInline(writer, memberShape, valueNode)
writer.writeInline(")")
}
@@ -243,14 +243,14 @@ class ShapeValueGenerator(
ShapeType.DOUBLE,
ShapeType.FLOAT,
-> {
- val symbolName = generator.symbolProvider.toSymbol(currShape).name
+ val symbol = generator.symbolProvider.toSymbol(currShape)
val symbolMember = when (node.value) {
"Infinity" -> "POSITIVE_INFINITY"
"-Infinity" -> "NEGATIVE_INFINITY"
"NaN" -> "NaN"
- else -> throw CodegenException("""Cannot interpret $symbolName value "${node.value}".""")
+ else -> throw CodegenException("""Cannot interpret $symbol value "${node.value}".""")
}
- writer.writeInline("#L", "$symbolName.$symbolMember")
+ writer.writeInline("#T.#L", symbol, symbolMember)
}
ShapeType.BIG_INTEGER -> writer.writeInline("#T(#S)", RuntimeTypes.Core.Content.BigInteger, node.value)
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt
index fc7d5a684..0587f2ed2 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt
@@ -249,6 +249,7 @@ abstract class HttpBindingProtocolGenerator : ProtocolGenerator {
if (op.isInputEventStream(ctx.model)) {
val eventStreamSerializeFn = eventStreamRequestHandler(ctx, op)
writer.write("builder.body = #T(context, input)", eventStreamSerializeFn)
+ renderContentTypeHeader(ctx, op, writer, resolver)
} else {
renderSerializeHttpBody(ctx, op, writer)
}
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/XmlSerdeDescriptorGenerator.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/XmlSerdeDescriptorGenerator.kt
index a5f47cf3c..356bf1f38 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/XmlSerdeDescriptorGenerator.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/XmlSerdeDescriptorGenerator.kt
@@ -35,7 +35,7 @@ open class XmlSerdeDescriptorGenerator(
val objTraits = mutableListOf()
val serialName = when {
// FIXME - we should be able to remove special casing of errors here which is protocol specific
- // see https://github.com/awslabs/smithy-kotlin/issues/350
+ // see https://github.com/smithy-lang/smithy-kotlin/issues/350
objectShape.hasTrait() -> "Error"
objectShape.hasTrait() -> objectShape.expectTrait().value
objectShape.hasTrait() -> objectShape.expectTrait().archetype.name
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests/SmokeTestsRunnerGenerator.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests/SmokeTestsRunnerGenerator.kt
index 1b9aa8032..df8eeda53 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests/SmokeTestsRunnerGenerator.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests/SmokeTestsRunnerGenerator.kt
@@ -6,10 +6,9 @@ import software.amazon.smithy.kotlin.codegen.integration.SectionId
import software.amazon.smithy.kotlin.codegen.integration.SectionKey
import software.amazon.smithy.kotlin.codegen.model.getTrait
import software.amazon.smithy.kotlin.codegen.model.hasTrait
-import software.amazon.smithy.kotlin.codegen.model.isStringEnumShape
+import software.amazon.smithy.kotlin.codegen.rendering.ShapeValueGenerator
import software.amazon.smithy.kotlin.codegen.rendering.endpoints.EndpointParametersGenerator
import software.amazon.smithy.kotlin.codegen.rendering.endpoints.EndpointProviderGenerator
-import software.amazon.smithy.kotlin.codegen.rendering.protocol.stringToNumber
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds.ClientConfig.EndpointParams
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds.ClientConfig.EndpointProvider
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds.ClientConfig.Name
@@ -17,7 +16,6 @@ import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSecti
import software.amazon.smithy.kotlin.codegen.rendering.util.format
import software.amazon.smithy.kotlin.codegen.utils.dq
import software.amazon.smithy.kotlin.codegen.utils.toCamelCase
-import software.amazon.smithy.kotlin.codegen.utils.toPascalCase
import software.amazon.smithy.kotlin.codegen.utils.topDownOperations
import software.amazon.smithy.model.node.*
import software.amazon.smithy.model.shapes.*
@@ -32,6 +30,7 @@ object SmokeTestSectionIds {
object HttpEngineOverride : SectionId
object ServiceFilter : SectionId
object SkipTags : SectionId
+ object SmokeTestsFile : SectionId
object ClientConfig : SectionId {
val Name: SectionKey = SectionKey("aws.smithy.kotlin#SmokeTestClientConfigName")
val Value: SectionKey = SectionKey("aws.smithy.kotlin#SmokeTestClientConfigValue")
@@ -61,16 +60,18 @@ class SmokeTestsRunnerGenerator(
ctx: CodegenContext,
) {
internal fun render() {
- writer.write("private var exitCode = 0")
- renderEnvironmentVariables()
- writer.declareSection(SmokeTestSectionIds.AdditionalEnvironmentVariables)
- writer.write("")
- writer.withBlock("public suspend fun main() {", "}") {
- renderFunctionCalls()
- write("#T(exitCode)", RuntimeTypes.Core.SmokeTests.exitProcess)
+ writer.declareSection(SmokeTestSectionIds.SmokeTestsFile) {
+ writer.write("private var exitCode = 0")
+ renderEnvironmentVariables()
+ writer.declareSection(SmokeTestSectionIds.AdditionalEnvironmentVariables)
+ writer.write("")
+ writer.withBlock("public suspend fun main() {", "}") {
+ renderFunctionCalls()
+ write("#T(exitCode)", RuntimeTypes.Core.SmokeTests.exitProcess)
+ }
+ writer.write("")
+ renderFunctions()
}
- writer.write("")
- renderFunctions()
}
private fun renderEnvironmentVariables() {
@@ -134,8 +135,7 @@ class SmokeTestsRunnerGenerator(
}
write("")
withInlineBlock("try {", "} ") {
- renderClient(testCase)
- renderOperation(operation, testCase)
+ renderTestCase(operation, testCase)
}
withBlock("catch (exception: Exception) {", "}") {
renderCatchBlock(testCase)
@@ -143,9 +143,11 @@ class SmokeTestsRunnerGenerator(
}
}
- private fun renderClient(testCase: SmokeTestCase) {
- writer.withInlineBlock("#L {", "}", service) {
+ private fun renderTestCase(operation: OperationShape, testCase: SmokeTestCase) {
+ writer.withBlock("#T {", "}", service) {
renderClientConfig(testCase)
+ closeAndOpenBlock("}.#T { client ->", RuntimeTypes.Core.IO.use)
+ renderOperation(operation, testCase)
}
}
@@ -161,10 +163,8 @@ class SmokeTestsRunnerGenerator(
return
}
- testCase.clientConfig!!.forEach { config ->
- val name = config.key.value.toCamelCase()
- val value = config.value.format()
-
+ testCase.clientConfig.forEach { (name, unformattedValue) ->
+ val value = unformattedValue.format()
writer.declareSection(
SmokeTestSectionIds.ClientConfig,
mapOf(
@@ -174,33 +174,23 @@ class SmokeTestsRunnerGenerator(
EndpointParams to EndpointParametersGenerator.getSymbol(settings),
),
) {
- writer.writeInline("#L = #L", name, value)
+ writer.write("#L = #L", name, value)
}
}
}
private fun renderOperation(operation: OperationShape, testCase: SmokeTestCase) {
- val operationSymbol = symbolProvider.toSymbol(model.getShape(operation.input.get()).get())
-
- writer.withBlock(".#T { client ->", "}", RuntimeTypes.Core.IO.use) {
- withBlock("client.#L(", ")", operation.defaultName()) {
- withBlock("#L {", "}", operationSymbol) {
- renderOperationParameters(operation, testCase)
- }
- }
- }
- }
+ val inputParams = testCase.params.getOrNull()
- private fun renderOperationParameters(operation: OperationShape, testCase: SmokeTestCase) {
- if (!testCase.hasOperationParameters) return
+ writer.writeInline("client.#L", operation.defaultName())
- val paramsToShapes = mapOperationParametersToModeledShapes(operation)
-
- testCase.operationParameters.forEach { param ->
- val paramName = param.key.value.toCamelCase()
- writer.writeInline("#L = ", paramName)
- val paramShape = paramsToShapes[paramName] ?: throw IllegalArgumentException("Unable to find shape for operation parameter '$paramName' in smoke test '${testCase.functionName}'.")
- renderOperationParameter(paramName, param.value, paramShape, testCase)
+ if (inputParams == null) {
+ writer.write("()")
+ } else {
+ writer.withBlock("(", ")") {
+ val inputShape = model.expectShape(operation.input.get())
+ ShapeValueGenerator(model, symbolProvider).instantiateShapeInline(writer, inputShape, inputParams)
+ }
}
}
@@ -228,56 +218,6 @@ class SmokeTestsRunnerGenerator(
}
// Helpers
- /**
- * Renders a [SmokeTestCase] operation parameter
- */
- private fun renderOperationParameter(
- paramName: String,
- node: Node,
- shape: Shape,
- testCase: SmokeTestCase,
- ) {
- when {
- // String enum
- node is StringNode && shape.isStringEnumShape -> {
- val enumSymbol = symbolProvider.toSymbol(shape)
- val enumValue = node.value.toPascalCase()
- writer.write("#T.#L", enumSymbol, enumValue)
- }
- // Int enum
- node is NumberNode && shape is IntEnumShape -> {
- val enumSymbol = symbolProvider.toSymbol(shape)
- val enumValue = node.format()
- writer.write("#T.fromValue(#L.toInt())", enumSymbol, enumValue)
- }
- // Number
- node is NumberNode && shape is NumberShape -> writer.write("#L.#L", node.format(), stringToNumber(shape))
- // Object
- node is ObjectNode -> {
- val shapeSymbol = symbolProvider.toSymbol(shape)
- writer.withBlock("#T {", "}", shapeSymbol) {
- node.members.forEach { member ->
- val memberName = member.key.value.toCamelCase()
- val memberShape = shape.allMembers[member.key.value] ?: throw IllegalArgumentException("Unable to find shape for operation parameter '$paramName' in smoke test '${testCase.functionName}'.")
- writer.writeInline("#L = ", memberName)
- renderOperationParameter(memberName, member.value, memberShape, testCase)
- }
- }
- }
- // List
- node is ArrayNode && shape is CollectionShape -> {
- writer.withBlock("listOf(", ")") {
- node.elements.forEach { element ->
- renderOperationParameter(paramName, element, model.expectShape(shape.member.target), testCase)
- writer.write(",")
- }
- }
- }
- // Everything else
- else -> writer.write("#L", node.format())
- }
- }
-
/**
* Tries to get the specific exception required in the failure criterion of a test.
* If no specific exception is required we default to the generic smoke tests failure exception.
@@ -304,14 +244,6 @@ class SmokeTestsRunnerGenerator(
writer.write("println(#S)", testResult)
}
- /**
- * Maps an operations parameters to their shapes
- */
- private fun mapOperationParametersToModeledShapes(operation: OperationShape): Map =
- model.getShape(operation.inputShape).get().allMembers.map { (key, value) ->
- key.toCamelCase() to model.getShape(value.target).get()
- }.toMap()
-
/**
* Derives a function name for a [SmokeTestCase]
*/
@@ -345,8 +277,12 @@ class SmokeTestsRunnerGenerator(
/**
* Get the client configuration required for a [SmokeTestCase]
*/
- private val SmokeTestCase.clientConfig: MutableMap?
- get() = this.vendorParams.get().members
+ private val SmokeTestCase.clientConfig: Map
+ get() = vendorParams
+ .getOrNull()
+ ?.members
+ ?.mapKeys { (key, _) -> key.value }
+ .orEmpty()
// Constants
private val model = ctx.model
diff --git a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/utils/CaseUtils.kt b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/utils/CaseUtils.kt
index 6a8b23769..577126480 100644
--- a/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/utils/CaseUtils.kt
+++ b/codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/utils/CaseUtils.kt
@@ -11,7 +11,7 @@ private val completeWords = listOf("ipv4", "ipv6", "sigv4", "mib", "gib", "kib",
* Split a string on word boundaries
*/
fun String.splitOnWordBoundaries(): List {
- // This is taken from Rust: https://github.com/awslabs/smithy-rs/pull/3037/files#diff-4175c66ee81a450fcf1cd3e256f36ae2c8e0b30b910be8ca505135fbe215144d
+ // This is taken from Rust: https://github.com/smithy-lang/smithy-rs/pull/3037/files#diff-4175c66ee81a450fcf1cd3e256f36ae2c8e0b30b910be8ca505135fbe215144d
// with minor changes (s3 and iot as whole words). Previously we used the Java v2 implementation
// https://github.com/aws/aws-sdk-java-v2/blob/2.20.162/utils/src/main/java/software/amazon/awssdk/utils/internal/CodegenNamingUtils.java#L36
// but this has some edge cases it doesn't handle well
diff --git a/codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGeneratorTest.kt b/codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGeneratorTest.kt
index 06091e3a9..3c15579da 100644
--- a/codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGeneratorTest.kt
+++ b/codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGeneratorTest.kt
@@ -488,8 +488,8 @@ internal class SmokeTestOperationDeserializer: HttpDeserializer.NonStreaming
client.testOperation(
- com.test.model.TestOperationRequest {
+ TestOperationRequest {
bar = "2"
}
)
@@ -143,11 +145,10 @@ class SmokeTestsRunnerGeneratorTest {
}
try {
- com.test.TestClient {
-
+ TestClient {
}.use { client ->
client.testOperation(
- com.test.model.TestOperationRequest {
+ TestOperationRequest {
bar = "föö"
}
)
@@ -179,12 +180,11 @@ class SmokeTestsRunnerGeneratorTest {
}
try {
- com.test.TestClient {
+ TestClient {
interceptors.add(SmokeTestsInterceptor())
-
}.use { client ->
client.testOperation(
- com.test.model.TestOperationRequest {
+ TestOperationRequest {
bar = "föö"
}
)
diff --git a/docs/design/binary-streaming.md b/docs/design/binary-streaming.md
index c6dc2563b..f4f1f43f0 100644
--- a/docs/design/binary-streaming.md
+++ b/docs/design/binary-streaming.md
@@ -628,7 +628,7 @@ The issue with going that route is two fold:
# Revision history
-* 11/29/2022 - SDK I/O refactor (see [#751](https://github.com/awslabs/smithy-kotlin/pull/751))
+* 11/29/2022 - SDK I/O refactor (see [#751](https://github.com/smithy-lang/smithy-kotlin/pull/751))
* 11/15/2021 - Update code snippets from builder refactoring
* 6/03/2021 - Initial upload
* 6/11/2020 - Created
diff --git a/docs/design/flexible-checksums.md b/docs/design/flexible-checksums.md
index 280db97f5..bbe6d1fa5 100644
--- a/docs/design/flexible-checksums.md
+++ b/docs/design/flexible-checksums.md
@@ -33,9 +33,9 @@ of injecting the `Content-MD5` header.
## Checksum Algorithms
-The SDK needs to support the following checksum algorithms: CRC32C, CRC32, SHA-1, SHA-256. All of them are [already implemented for JVM](https://github.com/awslabs/smithy-kotlin/tree/5773afb348c779b9e4aa9689836844f21a571908/runtime/hashing/jvm/src/aws/smithy/kotlin/runtime/hashing).
+The SDK needs to support the following checksum algorithms: CRC32C, CRC32, SHA-1, SHA-256. All of them are [already implemented for JVM](https://github.com/smithy-lang/smithy-kotlin/tree/5773afb348c779b9e4aa9689836844f21a571908/runtime/hashing/jvm/src/aws/smithy/kotlin/runtime/hashing).
-As part of this feature, CRC32C was implemented in **smithy-kotlin** [PR#724](https://github.com/awslabs/smithy-kotlin/pull/724).
+As part of this feature, CRC32C was implemented in **smithy-kotlin** [PR#724](https://github.com/smithy-lang/smithy-kotlin/pull/724).
This algorithm is essentially the same as CRC32, but uses a different polynomial under the hood.
The SDK uses [`java.util.zip`'s implementation of CRC32](https://docs.oracle.com/javase/8/docs/api/java/util/zip/CRC32.html),
but this package only began shipping CRC32C in Java 9. The SDK requires Java 8, so this was implemented rather than importing it as a dependency.
@@ -47,7 +47,7 @@ using SHA-256, the header containing the checksum will be `x-amz-checksum-sha256
# Implementation
-This feature can be implemented by adding two new [interceptors](https://github.com/awslabs/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/docs/design/interceptors.md):
+This feature can be implemented by adding two new [interceptors](https://github.com/smithy-lang/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/docs/design/interceptors.md):
one for calculating checksums for requests, and one for validating checksums present in responses.
## Requests
@@ -104,7 +104,7 @@ and the checksum will be calculated internally using the selected checksum algor
When a user sets the member represented by the `requestAlgorithmMember` property, they are opting-in to sending request checksums.
This property is modeled as an enum value, so validation needs to be done prior to using it. The enum is generated from the service model,
-but the set of possible enum values is constrained by the [`httpChecksum` trait specification](#checksum-algorithms). The following code will match a `String` to a [`HashFunction`](https://github.com/awslabs/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/hashing/common/src/aws/smithy/kotlin/runtime/hashing/HashFunction.kt).
+but the set of possible enum values is constrained by the [`httpChecksum` trait specification](#checksum-algorithms). The following code will match a `String` to a [`HashFunction`](https://github.com/smithy-lang/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/hashing/common/src/aws/smithy/kotlin/runtime/hashing/HashFunction.kt).
```kotlin
public fun String.toHashFunction(): HashFunction? {
return when (this.lowercase()) {
@@ -131,7 +131,7 @@ An exception will be thrown if the algorithm can't be parsed or if it's not supp
Note that because users select an algorithm from a code-generated enum, accidentally selecting an unsupported algorithm is unlikely.
### Computing and Injecting Checksums
-Next the SDK will compute and inject the checksum. If the body is smaller than the `aws-chunked` threshold ([1MB today](https://github.com/awslabs/smithy-kotlin/blob/9b9297c690d9a01777447f437f0e91562e146bf9/runtime/auth/aws-signing-common/common/src/aws/smithy/kotlin/runtime/auth/awssigning/middleware/AwsSigningMiddleware.kt#L38)),
+Next the SDK will compute and inject the checksum. If the body is smaller than the `aws-chunked` threshold ([1MB today](https://github.com/smithy-lang/smithy-kotlin/blob/9b9297c690d9a01777447f437f0e91562e146bf9/runtime/auth/aws-signing-common/common/src/aws/smithy/kotlin/runtime/auth/awssigning/middleware/AwsSigningMiddleware.kt#L38)),
the checksum will be immediately computed and injected under the appropriate header name.
Otherwise, if the request body is large enough to be uploaded with `aws-chunked`, the SDK will append the checksum header name to the `x-amz-trailer` header.
@@ -152,10 +152,10 @@ x-amz-trailer-signature: + \r\n
\r\n
```
-To calculate the checksum while the payload is being written, the body will be wrapped in either a [`HashingSource`](https://github.com/awslabs/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/io/common/src/aws/smithy/kotlin/runtime/io/HashingSource.kt)
-or a [`HashingByteReadChannel`](https://github.com/awslabs/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/io/common/src/aws/smithy/kotlin/runtime/io/HashingByteReadChannel.kt),
-depending on its type. These are new types which are constructed with an [`SdkSource`](https://github.com/awslabs/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/io/common/src/aws/smithy/kotlin/runtime/io/SdkSource.kt) or
-[`SdkByteReadChannel`](https://github.com/awslabs/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/io/common/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannel.kt),
+To calculate the checksum while the payload is being written, the body will be wrapped in either a [`HashingSource`](https://github.com/smithy-lang/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/io/common/src/aws/smithy/kotlin/runtime/io/HashingSource.kt)
+or a [`HashingByteReadChannel`](https://github.com/smithy-lang/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/io/common/src/aws/smithy/kotlin/runtime/io/HashingByteReadChannel.kt),
+depending on its type. These are new types which are constructed with an [`SdkSource`](https://github.com/smithy-lang/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/io/common/src/aws/smithy/kotlin/runtime/io/SdkSource.kt) or
+[`SdkByteReadChannel`](https://github.com/smithy-lang/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/io/common/src/aws/smithy/kotlin/runtime/io/SdkByteReadChannel.kt),
respectively, along with a `HashFunction`. These constructs will use the provided hash function to compute the checksum as the data is being read.
Later in the request's lifecycle, this hashing body will be wrapped once more in an `aws-chunked` body. This body is used to format the
@@ -211,7 +211,7 @@ The same is done for `HashingByteReadChannel` using a `CompletingByteReadChannel
There are many places during the request's lifecycle where trailing headers could be mutated.
-The trailing headers will be added as a member in the [`HttpRequestBuilder`](https://github.com/awslabs/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/request/HttpRequestBuilder.kt)
+The trailing headers will be added as a member in the [`HttpRequestBuilder`](https://github.com/smithy-lang/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/request/HttpRequestBuilder.kt)
, which is where `Headers` are already stored. This will enable the trailing headers to be modified wherever the `HttpRequest` is accessible.
The `HttpRequestBuilder` signature is updated to the following:
@@ -252,8 +252,8 @@ This allows users to add custom interceptors which modify the validation opt-in
The `modifyBeforeDeserialization` hook's purpose is to validate the checksum before the response is deserialized into its output type.
First, the body will be wrapped in a `HashingSource`/`HashingByteReadChannel`. This will calculate the checksum as the body is being consumed.
-The response body will also be wrapped in a [`ChecksumValidatingSource`](https://github.com/awslabs/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptor.kt#L88-L100)
-/[`ChecksumValidatingByteReadChannel`](https://github.com/awslabs/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptor.kt#L102-L114).
+The response body will also be wrapped in a [`ChecksumValidatingSource`](https://github.com/smithy-lang/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptor.kt#L88-L100)
+/[`ChecksumValidatingByteReadChannel`](https://github.com/smithy-lang/smithy-kotlin/blob/354c6cf011190bb4dff349d0c4a812c1de609d18/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptor.kt#L102-L114).
This is a new type which takes an expected checksum and an underlying hashing data source. After the underlying data is fully consumed, the checksum is digested and validated.
Below is the implementation of the `ChecksumValidatingSource`, which performs checksum validation after the underlying `HashingSource` is fully consumed:
@@ -370,7 +370,7 @@ The accepted design choice is to store trailing headers in the `HttpRequest`.
Alternatively, the trailing headers could have been stored in the `ExecutionContext` or `HttpBody`.
### ExecutionContext
-The SDK uses [`ExecutionContext`](https://github.com/awslabs/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/client/ExecutionContext.kt)
+The SDK uses [`ExecutionContext`](https://github.com/smithy-lang/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/client/ExecutionContext.kt)
as a property bag, storing a variety of properties related to the execution of a request.
To add the trailing headers to this property bag, a new `AttributeKey` would be added. This can then be used to lookup
@@ -386,7 +386,7 @@ Cons:
### HttpBody
-By adding the trailing headers to [HttpBody](https://github.com/awslabs/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/HttpBody.kt),
+By adding the trailing headers to [HttpBody](https://github.com/smithy-lang/smithy-kotlin/blob/5773afb348c779b9e4aa9689836844f21a571908/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/HttpBody.kt),
users can modify the trailing headers anywhere they have access to the request body.
Pros:
@@ -397,7 +397,7 @@ Cons:
and headers don't really fit in here
Ultimately, it was decided to store trailing headers in the `HttpRequest` (specifically,
-[`HttpRequestBuilder`](https://github.com/awslabs/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/request/HttpRequestBuilder.kt)
+[`HttpRequestBuilder`](https://github.com/smithy-lang/smithy-kotlin/blob/a250c3e3e3e54ef35990a1609fb380a91b70cf4b/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/request/HttpRequestBuilder.kt)
) because that is where regular headers are already stored.
## Synchronous Checksum Validation
diff --git a/docs/design/interceptors.md b/docs/design/interceptors.md
index 250c042d7..5ca15ba6b 100644
--- a/docs/design/interceptors.md
+++ b/docs/design/interceptors.md
@@ -599,9 +599,9 @@ require an explicit `copy` to mutate. The assumption of immutability of these ty
### Retry and Signing Middleware
Every hook defined in the `Interceptor` interface can be implemented as part of
-[SdkOperationExecution](https://github.com/awslabs/smithy-kotlin/blob/v0.14.0/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecution.kt#L36)
+[SdkOperationExecution](https://github.com/smithy-lang/smithy-kotlin/blob/v0.14.0/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecution.kt#L36)
with the exception of the retry (attempt) and signing related hooks. These two capabilities are currently implemented in
-terms of [Middleware](https://github.com/awslabs/smithy-kotlin/blob/v0.14.0/runtime/io/common/src/aws/smithy/kotlin/runtime/io/middleware/Middleware.kt#L13).
+terms of [Middleware](https://github.com/smithy-lang/smithy-kotlin/blob/v0.14.0/runtime/io/common/src/aws/smithy/kotlin/runtime/io/middleware/Middleware.kt#L13).
The anticipation is that these middleware components will be pulled into `SdkOperationExecution` as explicit phases
(similar to serialization and deserialization). The middleware as it exists today will be removed and relocated to these
new explicit phases. This should be safe to do as every operation typically has a retry and signing middleware and those
diff --git a/docs/design/kotlin-smithy-sdk.md b/docs/design/kotlin-smithy-sdk.md
index 3a5133ee7..a8b6fe56a 100644
--- a/docs/design/kotlin-smithy-sdk.md
+++ b/docs/design/kotlin-smithy-sdk.md
@@ -543,7 +543,7 @@ use the provided enum name.
The value will be stored as an abstract property on the sealed class and each variant will have to override it. This
allows enums to be applied to other types in the future if Smithy
-[evolves to allow it](https://github.com/awslabs/smithy/issues/98).
+[evolves to allow it](https://github.com/smithy-lang/smithy/issues/98).
```
@enum("YES": {}, "NO": {})
diff --git a/docs/design/modeled-errors.md b/docs/design/modeled-errors.md
index c48731573..017282abf 100644
--- a/docs/design/modeled-errors.md
+++ b/docs/design/modeled-errors.md
@@ -179,11 +179,11 @@ public open class AwsServiceException : ServiceException {
These two fields `requestId` and `errorCode` both result in conflicts in a handful of models (and subsequently fails to compile) because the errors themselves have fields with matching names.
-See: https://github.com/awslabs/smithy-kotlin/issues/110
+See: https://github.com/smithy-lang/smithy-kotlin/issues/110
As you can see this inherits from another type `ServiceException` which defines several other (un-modeled) fields further increasing the chance of a conflict. This also means that future modifications to the hierarchy could be difficult due to possible conflicts.
-The exception hierarchy is defined [here](https://github.com/awslabs/smithy-kotlin/blob/v0.1.0-M0/client-runtime/client-rt-core/common/src/software/aws/clientrt/Exceptions.kt) and further extended [here](https://github.com/awslabs/aws-sdk-kotlin/blob/v0.1.0-M0/client-runtime/aws-client-rt/common/src/aws/sdk/kotlin/runtime/Exceptions.kt).
+The exception hierarchy is defined [here](https://github.com/smithy-lang/smithy-kotlin/blob/v0.1.0-M0/client-runtime/client-rt-core/common/src/software/aws/clientrt/Exceptions.kt) and further extended [here](https://github.com/awslabs/aws-sdk-kotlin/blob/v0.1.0-M0/client-runtime/aws-client-rt/common/src/aws/sdk/kotlin/runtime/Exceptions.kt).
#### 2. A desire to remove mutability
diff --git a/docs/design/structured-concurrency.md b/docs/design/structured-concurrency.md
index 9ac712f2d..3bd829894 100644
--- a/docs/design/structured-concurrency.md
+++ b/docs/design/structured-concurrency.md
@@ -18,9 +18,9 @@ used by the SDK. It is meant to be a living document and provide additional cont
The SDK has three implementations of `CoroutineScope`:
-1. [ExecutionContext](https://github.com/awslabs/smithy-kotlin/blob/main/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/operation/ExecutionContext.kt)
-2. [HttpClientEngine](https://github.com/awslabs/smithy-kotlin/blob/main/runtime/protocol/http-client/common/src/aws/smithy/kotlin/runtime/http/engine/HttpClientEngine.kt)
-3. [HttpCall](https://github.com/awslabs/smithy-kotlin/blob/main/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/response/HttpCall.kt)
+1. [ExecutionContext](https://github.com/smithy-lang/smithy-kotlin/blob/main/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/operation/ExecutionContext.kt)
+2. [HttpClientEngine](https://github.com/smithy-lang/smithy-kotlin/blob/main/runtime/protocol/http-client/common/src/aws/smithy/kotlin/runtime/http/engine/HttpClientEngine.kt)
+3. [HttpCall](https://github.com/smithy-lang/smithy-kotlin/blob/main/runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/response/HttpCall.kt)
`ExecutionContext` implements `CoroutineScope` to provide a place for any background work to be done as part of implementing an operation.
diff --git a/docs/design/waiters.md b/docs/design/waiters.md
index 5ea14716e..9f9c758aa 100644
--- a/docs/design/waiters.md
+++ b/docs/design/waiters.md
@@ -376,7 +376,7 @@ val matcher: (DescribeBatchPredictionsOutput) -> Boolean = {
```
Smithy provides
-[a JMESPath parser](https://github.com/awslabs/smithy/tree/main/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath)
+[a JMESPath parser](https://github.com/smithy-lang/smithy/tree/main/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath)
with visitor pattern that can be used for codegenning path-based matchers.
#### Rejected alternatives
diff --git a/gradle.properties b/gradle.properties
index 37632b01d..f35cfc1d5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -13,7 +13,7 @@ kotlinx.atomicfu.enableNativeIrTransformation=false
org.gradle.jvmargs=-Xmx2G -XX:MaxMetaspaceSize=1G
# SDK
-sdkVersion=1.3.21-SNAPSHOT
+sdkVersion=1.3.30-SNAPSHOT
# codegen
-codegenVersion=0.33.21-SNAPSHOT
\ No newline at end of file
+codegenVersion=0.33.30-SNAPSHOT
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index eb5170e4c..0683bfc2e 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,7 +2,7 @@
kotlin-version = "2.0.21"
dokka-version = "1.9.10"
-aws-kotlin-repo-tools-version = "0.4.13"
+aws-kotlin-repo-tools-version = "0.4.16"
# libs
coroutines-version = "1.9.0"
diff --git a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt
index cd2b7d363..7fc20ddb8 100644
--- a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt
+++ b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt
@@ -77,7 +77,7 @@ class DefaultCanonicalizerTest {
assertEquals(expectedHeaders, actual.request.headers.entries())
}
- // Targeted test for proper URI path escaping. See https://github.com/awslabs/smithy-kotlin/issues/657
+ // Targeted test for proper URI path escaping. See https://github.com/smithy-lang/smithy-kotlin/issues/657
@Test
fun testEscapablePath() {
val uri = Url.Builder()
diff --git a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt
index 2ce1de1d0..fc5c23304 100644
--- a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt
+++ b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt
@@ -84,7 +84,7 @@ class DefaultSignatureCalculatorTest {
fun testChunkStringToSign() {
// Test event stream signing
// https://docs.aws.amazon.com/transcribe/latest/dg/streaming-http2.html
- // Adapted from: https://github.com/awslabs/smithy-rs/blob/v0.38.0/aws/rust-runtime/aws-sigv4/src/event_stream.rs#L166
+ // Adapted from: https://github.com/smithy-lang/smithy-rs/blob/v0.38.0/aws/rust-runtime/aws-sigv4/src/event_stream.rs#L166
val tests = listOf(
ChunkStringToSignTest(AwsSignatureType.HTTP_REQUEST_CHUNK, HashSpecification.EmptyBody.hash),
ChunkStringToSignTest(
diff --git a/runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/SigningSuiteTestBaseJVM.kt b/runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/SigningSuiteTestBaseJVM.kt
index 2b006bed6..904aef564 100644
--- a/runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/SigningSuiteTestBaseJVM.kt
+++ b/runtime/auth/aws-signing-tests/jvm/src/aws/smithy/kotlin/runtime/auth/awssigning/tests/SigningSuiteTestBaseJVM.kt
@@ -103,7 +103,7 @@ public actual abstract class SigningSuiteTestBase : HasSigner {
}
protected open val disabledTests: Set = setOf(
- // TODO https://github.com/awslabs/smithy-kotlin/issues/653
+ // TODO https://github.com/smithy-lang/smithy-kotlin/issues/653
// ktor-http-cio parser doesn't support parsing multiline headers since they are deprecated in RFC7230
"get-header-value-multiline",
// ktor fails to parse with space in it (expects it to be a valid request already encoded)
diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts
index d02316058..82a5b5fe5 100644
--- a/runtime/build.gradle.kts
+++ b/runtime/build.gradle.kts
@@ -28,8 +28,7 @@ subprojects {
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
}
- configurePublishing("smithy-kotlin")
-
+ configurePublishing("smithy-kotlin", "smithy-lang")
kotlin {
explicitApi()
diff --git a/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt b/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt
index dacf2c4aa..ac53fc26a 100644
--- a/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt
+++ b/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt
@@ -36,7 +36,7 @@ class AwsJsonProtocolTest {
assertEquals("application/x-amz-json-1.1", request.headers["Content-Type"])
// ensure we use the original shape id name, NOT the one from the context
- // see: https://github.com/awslabs/smithy-kotlin/issues/316
+ // see: https://github.com/smithy-lang/smithy-kotlin/issues/316
assertEquals("FooService_blah.Bar", request.headers["X-Amz-Target"])
}
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/ConnectionIdleMonitor.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/ConnectionIdleMonitor.kt
index 5d845c0c4..f64a6b5f8 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/ConnectionIdleMonitor.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/ConnectionIdleMonitor.kt
@@ -5,14 +5,7 @@
package aws.smithy.kotlin.runtime.http.engine.okhttp
import aws.smithy.kotlin.runtime.telemetry.logging.logger
-import kotlinx.coroutines.CoroutineName
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.cancelAndJoin
-import kotlinx.coroutines.isActive
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.*
import okhttp3.Call
import okhttp3.Connection
import okhttp3.ConnectionListener
@@ -24,14 +17,23 @@ import okio.source
import java.net.SocketException
import java.net.SocketTimeoutException
import java.util.concurrent.ConcurrentHashMap
+import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.coroutineContext
import kotlin.time.Duration
import kotlin.time.measureTime
@OptIn(ExperimentalOkHttpApi::class)
internal class ConnectionIdleMonitor(val pollInterval: Duration) : ConnectionListener() {
+ private val monitorScope = CoroutineScope(Dispatchers.IO + SupervisorJob())
private val monitors = ConcurrentHashMap()
+ fun close(): Unit = runBlocking {
+ val monitorJob = requireNotNull(monitorScope.coroutineContext[Job]) {
+ "Connection idle monitor scope cannot be cancelled because it does not have a job: $this"
+ }
+ monitorJob.cancelAndJoin()
+ }
+
private fun Call.callContext() =
request()
.tag(SdkRequestTag::class.java)
@@ -58,12 +60,11 @@ internal class ConnectionIdleMonitor(val pollInterval: Duration) : ConnectionLis
override fun connectionReleased(connection: Connection, call: Call) {
val connId = System.identityHashCode(connection)
- val context = call.callContext()
- val scope = CoroutineScope(context)
- val monitor = scope.launch(CoroutineName("okhttp-conn-monitor-for-$connId")) {
- doMonitor(connection)
+ val callContext = call.callContext()
+ val monitor = monitorScope.launch(CoroutineName("okhttp-conn-monitor-for-$connId")) {
+ doMonitor(connection, callContext)
}
- context.logger().trace { "Launched coroutine $monitor to monitor $connection" }
+ callContext.logger().trace { "Launched coroutine $monitor to monitor $connection" }
// Non-locking map access is okay here because this code will only execute synchronously as part of a
// `connectionReleased` event and will be complete before any future `connectionAcquired` event could fire for
@@ -71,8 +72,8 @@ internal class ConnectionIdleMonitor(val pollInterval: Duration) : ConnectionLis
monitors[connection] = monitor
}
- private suspend fun doMonitor(conn: Connection) {
- val logger = coroutineContext.logger()
+ private suspend fun doMonitor(conn: Connection, callContext: CoroutineContext) {
+ val logger = callContext.logger()
val socket = conn.socket()
val source = try {
@@ -111,6 +112,7 @@ internal class ConnectionIdleMonitor(val pollInterval: Duration) : ConnectionLis
logger.trace { "Attempting to reset soTimeout..." }
try {
conn.socket().soTimeout = oldTimeout
+ logger.trace { "soTimeout reset." }
} catch (e: Throwable) {
logger.warn(e) { "Failed to reset socket timeout on $conn. Connection may be unstable now." }
}
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt
index 2818aaac7..061c22a13 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt
@@ -15,9 +15,9 @@ import aws.smithy.kotlin.runtime.net.TlsVersion
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.fromEpochMilliseconds
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.job
import okhttp3.*
+import okhttp3.ConnectionPool
import okhttp3.coroutines.executeAsync
import java.util.concurrent.TimeUnit
import kotlin.time.toJavaDuration
@@ -44,7 +44,8 @@ public class OkHttpEngine(
}
private val metrics = HttpClientMetrics(TELEMETRY_SCOPE, config.telemetryProvider)
- private val client = config.buildClient(metrics)
+ private val connectionIdleMonitor = config.connectionIdlePollingInterval?.let { ConnectionIdleMonitor(it) }
+ private val client = config.buildClientWithConnectionListener(metrics, connectionIdleMonitor)
override suspend fun roundTrip(context: ExecutionContext, request: HttpRequest): HttpCall {
val callContext = callContext()
@@ -52,7 +53,6 @@ public class OkHttpEngine(
val engineRequest = request.toOkHttpRequest(context, callContext, metrics)
val engineCall = client.newCall(engineRequest)
- @OptIn(ExperimentalCoroutinesApi::class)
val engineResponse = mapOkHttpExceptions { engineCall.executeAsync() }
val response = engineResponse.toSdkResponse()
@@ -71,17 +71,17 @@ public class OkHttpEngine(
}
override fun shutdown() {
+ connectionIdleMonitor?.close()
client.connectionPool.evictAll()
client.dispatcher.executorService.shutdown()
metrics.close()
}
}
-/**
- * Convert SDK version of HTTP configuration to OkHttp specific configuration and return the configured client
- */
-@InternalApi
-public fun OkHttpEngineConfig.buildClient(metrics: HttpClientMetrics): OkHttpClient {
+private fun OkHttpEngineConfig.buildClientFromConfig(
+ metrics: HttpClientMetrics,
+ poolOverride: ConnectionPool? = null,
+): OkHttpClient {
val config = this
return OkHttpClient.Builder().apply {
@@ -99,20 +99,11 @@ public fun OkHttpEngineConfig.buildClient(metrics: HttpClientMetrics): OkHttpCli
readTimeout(config.socketReadTimeout.toJavaDuration())
writeTimeout(config.socketWriteTimeout.toJavaDuration())
- @OptIn(ExperimentalOkHttpApi::class)
- val connectionListener = if (config.connectionIdlePollingInterval == null) {
- ConnectionListener.NONE
- } else {
- ConnectionIdleMonitor(connectionIdlePollingInterval)
- }
-
// use our own pool configured with the timeout settings taken from config
- @OptIn(ExperimentalOkHttpApi::class)
- val pool = ConnectionPool(
+ val pool = poolOverride ?: ConnectionPool(
maxIdleConnections = 5, // The default from the no-arg ConnectionPool() constructor
keepAliveDuration = config.connectionIdleTimeout.inWholeMilliseconds,
TimeUnit.MILLISECONDS,
- connectionListener = connectionListener,
)
connectionPool(pool)
@@ -147,6 +138,34 @@ public fun OkHttpEngineConfig.buildClient(metrics: HttpClientMetrics): OkHttpCli
}.build()
}
+/**
+ * Convert SDK version of HTTP configuration to OkHttp specific configuration and return the configured client
+ */
+// Used by OkHttp4Engine - OkHttp4 does NOT have `connectionListener`
+// TODO - Refactor in next minor version - Move this to OkHttp4Engine and make it private
+@InternalApi
+public fun OkHttpEngineConfig.buildClient(
+ metrics: HttpClientMetrics,
+): OkHttpClient = this.buildClientFromConfig(metrics)
+
+/**
+ * Convert SDK version of HTTP configuration to OkHttp specific configuration and return the configured client
+ */
+// Used by OkHttpEngine - OkHttp5 does have `connectionListener`
+@OptIn(ExperimentalOkHttpApi::class)
+private fun OkHttpEngineConfig.buildClientWithConnectionListener(
+ metrics: HttpClientMetrics,
+ connectionListener: ConnectionIdleMonitor?,
+): OkHttpClient = this.buildClientFromConfig(
+ metrics,
+ ConnectionPool(
+ maxIdleConnections = 5, // The default from the no-arg ConnectionPool() constructor
+ keepAliveDuration = this.connectionIdleTimeout.inWholeMilliseconds,
+ timeUnit = TimeUnit.MILLISECONDS,
+ connectionListener = connectionListener ?: ConnectionListener.NONE,
+ ),
+)
+
private fun minTlsConnectionSpec(tlsContext: TlsContext): ConnectionSpec {
val minVersion = tlsContext.minVersion ?: TlsVersion.TLS_1_2
val okHttpTlsVersions = SdkTlsVersion
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtils.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtils.kt
index 329897967..c287228fd 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtils.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtils.kt
@@ -93,7 +93,7 @@ public fun Headers.toOkHttpHeaders(): OkHttpHeaders = OkHttpHeaders.Builder().al
}
if ("Accept-Encoding" !in this) {
- // Disable OkHttp transparent response decompression. See https://github.com/awslabs/smithy-kotlin/issues/1041
+ // Disable OkHttp transparent response decompression. See https://github.com/smithy-lang/smithy-kotlin/issues/1041
okHeaders.addUnsafeNonAscii("Accept-Encoding", "identity")
}
}.build()
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpRequestTest.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpRequestTest.kt
index 00fd2a912..16f677300 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpRequestTest.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpRequestTest.kt
@@ -86,7 +86,7 @@ class OkHttpRequestTest {
assertEquals(listOf("\uD83E\uDD7D"), actual.headers("foo"))
}
- // https://github.com/awslabs/smithy-kotlin/issues/1041
+ // https://github.com/smithy-lang/smithy-kotlin/issues/1041
@Test
fun itAddsAcceptEncodingHeader() {
val url = Url.parse("https://aws.amazon.com")
@@ -103,7 +103,7 @@ class OkHttpRequestTest {
assertEquals(listOf("identity"), actual.headers("Accept-Encoding"))
}
- // https://github.com/awslabs/smithy-kotlin/issues/1041
+ // https://github.com/smithy-lang/smithy-kotlin/issues/1041
@Test
fun itDoesNotModifyAcceptEncodingHeaderIfAlreadySet() {
val url = Url.parse("https://aws.amazon.com")
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/StreamingRequestBodyTest.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/StreamingRequestBodyTest.kt
index 6f25a1680..eb0a96a32 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/StreamingRequestBodyTest.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/test/aws/smithy/kotlin/runtime/http/engine/okhttp/StreamingRequestBodyTest.kt
@@ -114,7 +114,7 @@ class StreamingRequestBodyTest {
job.cancel()
withTimeout(2.seconds) {
- // See https://github.com/awslabs/smithy-kotlin/issues/739
+ // See https://github.com/smithy-lang/smithy-kotlin/issues/739
// writeTo() should end up blocked waiting for data that will never come.
// If the job used in the implementation isn't tied to the parent coroutine correctly
// it will block forever
diff --git a/runtime/protocol/http-client-engines/http-client-engine-okhttp4/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp4/OkHttp4Engine.kt b/runtime/protocol/http-client-engines/http-client-engine-okhttp4/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp4/OkHttp4Engine.kt
index 422d3952c..ff5982320 100644
--- a/runtime/protocol/http-client-engines/http-client-engine-okhttp4/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp4/OkHttp4Engine.kt
+++ b/runtime/protocol/http-client-engines/http-client-engine-okhttp4/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp4/OkHttp4Engine.kt
@@ -70,6 +70,12 @@ public class OkHttp4Engine(
}
}
}
+
+ override fun shutdown() {
+ client.connectionPool.evictAll()
+ client.dispatcher.executorService.shutdown()
+ metrics.close()
+ }
}
// Copied from okhttp3 5.x:
diff --git a/runtime/protocol/http-client-engines/test-suite/common/test/aws/smithy/kotlin/runtime/http/test/UploadTest.kt b/runtime/protocol/http-client-engines/test-suite/common/test/aws/smithy/kotlin/runtime/http/test/UploadTest.kt
index affa8884b..17c9cb1dd 100644
--- a/runtime/protocol/http-client-engines/test-suite/common/test/aws/smithy/kotlin/runtime/http/test/UploadTest.kt
+++ b/runtime/protocol/http-client-engines/test-suite/common/test/aws/smithy/kotlin/runtime/http/test/UploadTest.kt
@@ -137,7 +137,7 @@ class UploadTest : AbstractEngineTest() {
@Test
fun testUploadWithWrappedStream() = testEngines {
// test custom ByteStream behavior
- // see https://github.com/awslabs/smithy-kotlin/issues/613
+ // see https://github.com/smithy-lang/smithy-kotlin/issues/613
test { _, client ->
val data = ByteArray(1024 * 1024) { it.toByte() }
val sha = data.sha256().encodeToHex()
diff --git a/runtime/protocol/http-client-engines/test-suite/jvm/test/aws/smithy/kotlin/runtime/http/test/FileUploadDownloadTest.kt b/runtime/protocol/http-client-engines/test-suite/jvm/test/aws/smithy/kotlin/runtime/http/test/FileUploadDownloadTest.kt
index 302c8c857..c743cb038 100644
--- a/runtime/protocol/http-client-engines/test-suite/jvm/test/aws/smithy/kotlin/runtime/http/test/FileUploadDownloadTest.kt
+++ b/runtime/protocol/http-client-engines/test-suite/jvm/test/aws/smithy/kotlin/runtime/http/test/FileUploadDownloadTest.kt
@@ -80,7 +80,7 @@ class FileUploadDownloadTest : AbstractEngineTest() {
}
}
- // https://github.com/awslabs/smithy-kotlin/issues/1041
+ // https://github.com/smithy-lang/smithy-kotlin/issues/1041
@Test
fun testDownloadCompressedPayload() = testEngines {
test { _, client ->
diff --git a/runtime/runtime-core/api/runtime-core.api b/runtime/runtime-core/api/runtime-core.api
index 237aac6f7..942f99e34 100644
--- a/runtime/runtime-core/api/runtime-core.api
+++ b/runtime/runtime-core/api/runtime-core.api
@@ -103,6 +103,7 @@ public final class aws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetri
public static final field WAITER Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public fun getIdentifier ()Ljava/lang/String;
+ public fun toString ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static fun values ()[Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
}
diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtils.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtils.kt
index 774b0c9d9..fa9c41652 100644
--- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtils.kt
+++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtils.kt
@@ -90,4 +90,7 @@ public enum class SmithyBusinessMetric(public override val identifier: String) :
SERVICE_ENDPOINT_OVERRIDE("N"),
ACCOUNT_ID_BASED_ENDPOINT("O"),
SIGV4A_SIGNING("S"),
+ ;
+
+ override fun toString(): String = identifier
}
diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtilsTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtilsTest.kt
index f5ff6ac72..308ec0e76 100644
--- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtilsTest.kt
+++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtilsTest.kt
@@ -7,6 +7,7 @@ package aws.smithy.kotlin.runtime.businessmetrics
import aws.smithy.kotlin.runtime.collections.get
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import kotlin.test.Test
+import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -55,4 +56,12 @@ class BusinessMetricsUtilsTest {
executionContext.removeBusinessMetric(SmithyBusinessMetric.GZIP_REQUEST_COMPRESSION)
assertFalse(executionContext.containsBusinessMetric(SmithyBusinessMetric.GZIP_REQUEST_COMPRESSION))
}
+
+ @Test
+ fun businessMetricToString() {
+ val businessMetricToString = SmithyBusinessMetric.GZIP_REQUEST_COMPRESSION.toString()
+ val businessMetricIdentifier = SmithyBusinessMetric.GZIP_REQUEST_COMPRESSION.identifier
+
+ assertEquals(businessMetricIdentifier, businessMetricToString)
+ }
}
diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseRfc5322Test.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseRfc5322Test.kt
index 97388a7aa..70b9629ab 100644
--- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseRfc5322Test.kt
+++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseRfc5322Test.kt
@@ -34,7 +34,7 @@ class ParseRfc5322Test {
ParseTest("Sun, 06 Nov 1994 08:49:37 UTC", 1994, 11, 6, 8, 49, 37, 0, 0),
ParseTest("Sun, 06 Nov 1994 08:49:37 UT", 1994, 11, 6, 8, 49, 37, 0, 0),
ParseTest("Sun, 06 Nov 1994 08:49:37 Z", 1994, 11, 6, 8, 49, 37, 0, 0),
- // fractional seconds (required by awsJson1.1 apparently). See: https://github.com/awslabs/smithy/blob/master/smithy-aws-protocol-tests/model/awsJson1_1/kitchen-sink.smithy#L682
+ // fractional seconds (required by awsJson1.1 apparently). See: https://github.com/smithy-lang/smithy/blob/master/smithy-aws-protocol-tests/model/awsJson1_1/kitchen-sink.smithy#L682
ParseTest("Sun, 06 Nov 1994 08:49:37.001 GMT", 1994, 11, 6, 8, 49, 37, 1_000_000, 0),
)
diff --git a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/content/ByteStreamJVM.kt b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/content/ByteStreamJVM.kt
index 0ab9140ef..1d6124357 100644
--- a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/content/ByteStreamJVM.kt
+++ b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/content/ByteStreamJVM.kt
@@ -117,7 +117,7 @@ public fun InputStream.asByteStream(contentLength: Long? = null): ByteStream.Sou
val source = source()
return object : ByteStream.SourceStream() {
override val contentLength: Long? = contentLength
- override val isOneShot: Boolean = true
+ override val isOneShot: Boolean = !markSupported()
override fun readFrom(): SdkSource = source
}
}
diff --git a/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/content/ByteStreamJVMTest.kt b/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/content/ByteStreamJVMTest.kt
index ec2ca6cb2..054387b2e 100644
--- a/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/content/ByteStreamJVMTest.kt
+++ b/runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/content/ByteStreamJVMTest.kt
@@ -8,6 +8,7 @@ package aws.smithy.kotlin.runtime.content
import aws.smithy.kotlin.runtime.testing.RandomTempFile
import kotlinx.coroutines.test.runTest
import java.io.ByteArrayOutputStream
+import java.io.InputStream
import java.io.OutputStream
import java.nio.file.Files
import kotlin.test.*
@@ -159,7 +160,7 @@ class ByteStreamJVMTest {
binaryData.inputStream().use { inputStream ->
val byteStream = inputStream.asByteStream()
assertNull(byteStream.contentLength)
- assertTrue(byteStream.isOneShot)
+ assertFalse(byteStream.isOneShot)
val output = byteStream.toByteArray()
assertContentEquals(binaryData, output)
@@ -169,6 +170,23 @@ class ByteStreamJVMTest {
@Test
fun testInputStreamAsByteStreamWithLength() = runTest {
binaryData.inputStream().use { inputStream ->
+ val byteStream = inputStream.asByteStream(binaryData.size.toLong())
+ assertEquals(binaryData.size.toLong(), byteStream.contentLength)
+ assertFalse(byteStream.isOneShot)
+
+ val output = byteStream.toByteArray()
+ assertContentEquals(binaryData, output)
+ }
+ }
+
+ @Test
+ fun testOneShotInputStream() = runTest {
+ class NonReplayableInputStream(val delegate: InputStream) : InputStream() {
+ override fun read(): Int = delegate.read()
+ override fun markSupported(): Boolean = false
+ }
+
+ NonReplayableInputStream(binaryData.inputStream()).use { inputStream ->
val byteStream = inputStream.asByteStream(binaryData.size.toLong())
assertEquals(binaryData.size.toLong(), byteStream.contentLength)
assertTrue(byteStream.isOneShot)
diff --git a/runtime/serde/serde-form-url/common/src/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializer.kt b/runtime/serde/serde-form-url/common/src/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializer.kt
index a515e0c18..ddbc1c59f 100644
--- a/runtime/serde/serde-form-url/common/src/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializer.kt
+++ b/runtime/serde/serde-form-url/common/src/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializer.kt
@@ -169,7 +169,7 @@ private class FormUrlStructSerializer(
override fun structField(descriptor: SdkFieldDescriptor, block: StructSerializer.() -> Unit) {
// FIXME - do we even use this function in any of the formats? It seems like we go through `field(.., SdkSerializable)` ??
- // https://github.com/awslabs/smithy-kotlin/issues/314
+ // https://github.com/smithy-lang/smithy-kotlin/issues/314
TODO("Not yet implemented")
}
diff --git a/runtime/serde/serde-xml/common/test/aws/smithy/kotlin/runtime/serde/xml/XmlStreamWriterTest.kt b/runtime/serde/serde-xml/common/test/aws/smithy/kotlin/runtime/serde/xml/XmlStreamWriterTest.kt
index 2e6ae311f..482629f03 100644
--- a/runtime/serde/serde-xml/common/test/aws/smithy/kotlin/runtime/serde/xml/XmlStreamWriterTest.kt
+++ b/runtime/serde/serde-xml/common/test/aws/smithy/kotlin/runtime/serde/xml/XmlStreamWriterTest.kt
@@ -73,7 +73,7 @@ class XmlStreamWriterTest {
}
// The following escape tests were adapted from
- // https://github.com/awslabs/smithy-rs/blob/c15289a7163cb6344b088a0ee39244df2967070a/rust-runtime/smithy-xml/src/unescape.rs
+ // https://github.com/smithy-lang/smithy-rs/blob/c15289a7163cb6344b088a0ee39244df2967070a/rust-runtime/smithy-xml/src/unescape.rs
@Test
fun itHandlesEscaping() {
val testCases = mapOf(
diff --git a/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlMapTest.kt b/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlMapTest.kt
index 0cd961424..bc611c82d 100644
--- a/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlMapTest.kt
+++ b/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlMapTest.kt
@@ -246,7 +246,7 @@ class XmlMapTest : AbstractXmlTest() {
@Test
fun testEnumKeyMap() {
- // see also https://github.com/awslabs/smithy-kotlin/issues/1045
+ // see also https://github.com/smithy-lang/smithy-kotlin/issues/1045
val expected = StructType {
enumKeyMap = mapOf(
FooEnum.Foo to 1,
diff --git a/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlUnionTest.kt b/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlUnionTest.kt
index 5ec3f5446..114a1a7f5 100644
--- a/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlUnionTest.kt
+++ b/tests/codegen/serde-tests/src/test/kotlin/aws/smithy/kotlin/tests/serde/XmlUnionTest.kt
@@ -266,7 +266,7 @@ class XmlUnionTest : AbstractXmlTest() {
testRoundTrip(expected, payload, ::serializeStructTypeDocument, ::deserializeStructTypeDocument)
}
- // FIXME - https://github.com/awslabs/smithy-kotlin/issues/1040
+ // FIXME - https://github.com/smithy-lang/smithy-kotlin/issues/1040
// @Test
// fun testUnitField() { }