-
Notifications
You must be signed in to change notification settings - Fork 35
Refactor NIOHTTPClient to SwiftNIOHTTPClient in SmithySwiftNIO #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
d208926
6cc6593
f91fd18
5ff2c93
21530d9
0e0f62f
3dc7fdf
c8e18b2
48aea8c
42def12
80ad1ed
95812a7
5d1c704
9cf7174
2507525
2bd4de5
fcb21d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,13 +53,16 @@ let package = Package( | |
| .library(name: "SmithyCBOR", targets: ["SmithyCBOR"]), | ||
| .library(name: "SmithyWaitersAPI", targets: ["SmithyWaitersAPI"]), | ||
| .library(name: "SmithyTestUtil", targets: ["SmithyTestUtil"]), | ||
| .library(name: "SmithySwiftNIO", targets: ["SmithySwiftNIO"]), | ||
| .library(name: "SmithyTelemetry", targets: ["SmithyTelemetry"]), | ||
| .library(name: "SmithyHTTPClientAPI", targets: ["SmithyHTTPClientAPI"]), | ||
| ], | ||
| dependencies: { | ||
| var dependencies: [Package.Dependency] = [ | ||
| .package(url: "https://github.com/awslabs/aws-crt-swift.git", exact: "0.54.2"), | ||
| .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), | ||
| .package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "1.13.0"), | ||
| .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.26.0"), | ||
| .package(url: "https://github.com/swift-server/async-http-client.git", exact: "1.22.0"), | ||
| ] | ||
|
|
||
| let isDocCEnabled = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_ENABLE_DOCC"] != nil | ||
|
|
@@ -75,10 +78,27 @@ let package = Package( | |
| .product(name: "Logging", package: "swift-log"), | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "SmithyTelemetry", | ||
| dependencies: [ | ||
| "Smithy", | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "SmithyHTTPClientAPI", | ||
| dependencies: [ | ||
| "Smithy", | ||
| "SmithyHTTPAPI", | ||
| "SmithyTelemetry", | ||
| .product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This CRT dependency is not needed & should be removed. (also, any "API" package shouldn't depend on an external implementation like CRT, per SRA) |
||
| ] | ||
| ), | ||
| .target( | ||
| name: "ClientRuntime", | ||
| dependencies: [ | ||
| "Smithy", | ||
| "SmithyTelemetry", | ||
| "SmithyHTTPClientAPI", | ||
| "SmithyRetriesAPI", | ||
| "SmithyRetries", | ||
| "SmithyXML", | ||
|
|
@@ -98,7 +118,6 @@ let package = Package( | |
| "SmithyChecksums", | ||
| "SmithyCBOR", | ||
| .product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"), | ||
| .product(name: "AsyncHTTPClient", package: "async-http-client"), | ||
| // Only include these on macOS, iOS, tvOS, watchOS, and macCatalyst (visionOS and Linux are excluded) | ||
| .product( | ||
| name: "InMemoryExporter", | ||
|
|
@@ -125,6 +144,19 @@ let package = Package( | |
| .copy("PrivacyInfo.xcprivacy") | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "SmithySwiftNIO", | ||
| dependencies: [ | ||
| "Smithy", | ||
| "SmithyHTTPAPI", | ||
| "SmithyHTTPClient", | ||
|
||
| "SmithyStreams", | ||
| "SmithyHTTPClientAPI", | ||
| "ClientRuntime", | ||
| .product(name: "AsyncHTTPClient", package: "async-http-client"), | ||
| ], | ||
| path: "Sources/SmithySwiftNIO" | ||
| ), | ||
| .target( | ||
| name: "SmithyRetriesAPI" | ||
| ), | ||
|
|
@@ -270,6 +302,13 @@ let package = Package( | |
| ], | ||
| resources: [ .process("Resources") ] | ||
| ), | ||
| .testTarget( | ||
| name: "SmithySwiftNIOTests", | ||
| dependencies: [ | ||
| "SmithySwiftNIO", | ||
| "SmithyTestUtil", | ||
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "SmithyCBORTests", | ||
| dependencies: ["SmithyCBOR", "ClientRuntime", "SmithyTestUtil"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // | ||
| // Copyright Amazon.com Inc. or its affiliates. | ||
| // All Rights Reserved. | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
|
|
||
| import SmithyHTTPClientAPI | ||
|
|
||
| /// Typealias for backward compatibility. | ||
| /// The actual implementation is now in SmithyHTTPClientAPI. | ||
| public typealias TLSConfiguration = SmithyHTTPClientAPI.TLSConfiguration |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,14 +5,8 @@ | |
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
|
|
||
| /// A Telemetry Context is a container that can be associated with Tracers and Metrics. | ||
| /// | ||
| /// Context implementations may be containers for execution-scoped values across API boundaries (both in-process and | ||
| /// distributed). | ||
| public protocol TelemetryContext: Sendable { | ||
| import SmithyTelemetry | ||
|
|
||
| /// Make this context the currently active context. | ||
| /// | ||
| /// - Returns: the scope of the current context | ||
| func makeCurrent() -> TelemetryScope | ||
| } | ||
| /// Typealias for backward compatibility. | ||
| /// The actual implementation is now in SmithyTelemetry. | ||
| public typealias TelemetryContext = SmithyTelemetry.TelemetryContext | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import struct Smithy.AttributeKey | |
| import struct Smithy.Attributes | ||
| import protocol Smithy.LogAgent | ||
| import struct Smithy.SwiftLogger | ||
| import SmithyTelemetry | ||
|
||
|
|
||
| /// Namespace for the Default SDK Telemetry implementations. | ||
| public enum DefaultTelemetry: Sendable { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noting that this needs to be switched to
from:for release...IIRC this is
exactfor testing the minimum supported version?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup exactly, will switch it to from since we can see it passed all integration tests