Skip to content

Commit

Permalink
Merge branch 'main' into jbe/spr2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins committed Nov 9, 2024
2 parents ea4d3e1 + dbad1ce commit 19ebbef
Show file tree
Hide file tree
Showing 1,603 changed files with 48,064 additions and 26,583 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class STSWebIdentityAWSCredentialIdentityResolverTests: XCTestCase {
// MARK: - TEST CASE

// Confirm STS web identity credentials provider works by validating response.
func testGetCallerIdentity() async throws {
func xtestGetCallerIdentity() async throws {
let response = try await webIdentityStsClient.getCallerIdentity(
input: GetCallerIdentityInput()
)
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import PackageDescription

// MARK: - Dynamic Content

let clientRuntimeVersion: Version = "0.88.0"
let clientRuntimeVersion: Version = "0.89.0"
let crtVersion: Version = "0.37.0"

let packageScope = "aws-sdk-swift"
Expand Down
2 changes: 1 addition & 1 deletion Package.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.34
1.0.36
2 changes: 1 addition & 1 deletion Package.version.next
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.35
1.0.37
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ public enum AWSRetryErrorInfoProvider: RetryErrorInfoProvider {

public static func errorInfo(for error: Error) -> RetryErrorInfo? {

// Look for a header with a retry after value; use it as retry after hint
var retryAfterHint: TimeInterval?
if let headers = (error as? HTTPError)?.httpResponse.headers,
let delayString = headers.value(for: "Retry-After") ?? headers.value(for: "X-Amz-Retry-After"),
let delay = TimeInterval(delayString) {
retryAfterHint = delay
}

// Determine based on properties if this error is a timeout error.
var isTimeout = false

Expand All @@ -75,32 +67,32 @@ public enum AWSRetryErrorInfoProvider: RetryErrorInfoProvider {
// Handle certain CRT errors as transient errors
if case CommonRunTimeError.crtError(let crtError) = error {
if transientCRTErrorCodes.contains(crtError.code) {
return RetryErrorInfo(errorType: .transient, retryAfterHint: retryAfterHint, isTimeout: isTimeout)
return RetryErrorInfo(errorType: .transient, retryAfterHint: nil, isTimeout: isTimeout)
}
}

if let serviceError = error as? ServiceError, let code = serviceError.typeName {
// Handle the throttling error codes as errors of retry type "throttling".
if throttlingErrorCodes.contains(code) {
return RetryErrorInfo(errorType: .throttling, retryAfterHint: retryAfterHint, isTimeout: false)
return RetryErrorInfo(errorType: .throttling, retryAfterHint: nil, isTimeout: false)
}
// Handle the transient error codes as errors of retry type "transient".
if transientErrorCodes.contains(code) {
return RetryErrorInfo(errorType: .transient, retryAfterHint: retryAfterHint, isTimeout: isTimeout)
return RetryErrorInfo(errorType: .transient, retryAfterHint: nil, isTimeout: isTimeout)
}
}

if let httpError = error as? HTTPError {
// Handle the transient and timeout HTTP status codes as errors of retry type "transient".
if (transientStatusCodes + timeoutStatusCodes).contains(httpError.httpResponse.statusCode.rawValue) {
return RetryErrorInfo(errorType: .transient, retryAfterHint: retryAfterHint, isTimeout: isTimeout)
return RetryErrorInfo(errorType: .transient, retryAfterHint: nil, isTimeout: isTimeout)
}
}

if let modeledError = error as? ModeledError, type(of: modeledError).typeName == "IDPCommunicationError" {

// Handle a modeled IDPCommunicationError (comes from STS) as an error of retry type "transient".
return RetryErrorInfo(errorType: .transient, retryAfterHint: retryAfterHint, isTimeout: isTimeout)
return RetryErrorInfo(errorType: .transient, retryAfterHint: nil, isTimeout: isTimeout)
}

// If custom AWS error matching fails, use the default error info provider to finish matching.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@ class AWSRetryErrorInfoProviderTests: XCTestCase {
}
}

// MARK: - Retry after hint

func test_retryAfterHint_setsRetryAfterHintWhenRetryAfterHeaderIsSetWithSeconds() throws {
let error = try TestHTTPError(statusCode: 500, headers: ["retry-after": "2.8"])
let errorInfo = AWSRetryErrorInfoProvider.errorInfo(for: error)
XCTAssertEqual(errorInfo?.retryAfterHint, 2.8)
}

func test_retryAfterHint_setsRetryAfterHintWhenXAmzRetryAfterHeaderIsSetWithSeconds() throws {
let error = try TestHTTPError(statusCode: 500, headers: ["x-amz-retry-after": "2.7"])
let errorInfo = AWSRetryErrorInfoProvider.errorInfo(for: error)
XCTAssertEqual(errorInfo?.retryAfterHint, 2.7)
}

// MARK: - isTimeout

func test_isTimeout_setsIsTimeoutWhenHTTPStatusCodeIndicatesTimeout() throws {
Expand Down
31 changes: 14 additions & 17 deletions Sources/Services/AWSACM/Package.swift.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
exact: "0.0.1"
),
.package(
id: "aws-sdk-swift.smithy-swift",
url: "https://github.com/smithy-lang/smithy-swift",
exact: "0.0.1"
),
],
Expand All @@ -38,55 +38,52 @@ let package = Package(
),
.product(
name: "ClientRuntime",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyIdentity",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyRetriesAPI",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyHTTPAPI",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyHTTPAuthAPI",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "Smithy",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyRetries",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyJSON",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyReadWrite",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyTimestamps",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyWaitersAPI",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
.product(
name: "SmithyTestUtil",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
],
resources: [
.process("Resources")
]
),
.testTarget(
Expand All @@ -95,7 +92,7 @@ let package = Package(
"AWSACM",
.product(
name: "SmithyTestUtil",
package: "aws-sdk-swift.smithy-swift"
package: "smithy-swift"
),
]
)
Expand Down
Loading

0 comments on commit 19ebbef

Please sign in to comment.