Skip to content

Commit

Permalink
fix(cloudwatch-logging): clientruntime name changes for sdk update (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
atierian authored Oct 2, 2023
1 parent 8d358d7 commit 49a0ec4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class AWSCloudWatchLoggingCategoryClient {
private let lock = NSLock()
private let logGroupName: String
private let region: String
private let credentialsProvider: CredentialsProvider
private let credentialsProvider: CredentialsProviding
private let authentication: AuthCategoryUserBehavior
private var loggersByKey: [LoggerKey: AWSCloudWatchLoggingSessionController] = [:]
private let localStoreMaxSizeInMB: Int
Expand All @@ -38,7 +38,7 @@ final class AWSCloudWatchLoggingCategoryClient {

init(
enable: Bool,
credentialsProvider: CredentialsProvider,
credentialsProvider: CredentialsProviding,
authentication: AuthCategoryUserBehavior,
loggingConstraintsResolver: AWSCloudWatchLoggingConstraintsResolver,
logGroupName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class AWSCloudWatchLoggingSessionController {
private let logGroupName: String
private let region: String
private let localStoreMaxSizeInMB: Int
private let credentialsProvider: CredentialsProvider
private let credentialsProvider: CredentialsProviding
private let authentication: AuthCategoryUserBehavior
private let category: String
private var session: AWSCloudWatchLoggingSession?
Expand Down Expand Up @@ -59,7 +59,7 @@ final class AWSCloudWatchLoggingSessionController {
}

/// - Tag: CloudWatchLogSessionController.init
init(credentialsProvider: CredentialsProvider,
init(credentialsProvider: CredentialsProviding,
authentication: AuthCategoryUserBehavior,
logFilter: AWSCloudWatchLoggingFilterBehavior,
category: String,
Expand Down Expand Up @@ -103,10 +103,10 @@ final class AWSCloudWatchLoggingSessionController {

private func createConsumer() throws -> LogBatchConsumer? {
if self.client == nil {
// TODO: FrameworkMetadata Replacement
let configuration = try CloudWatchLogsClient.CloudWatchLogsClientConfiguration(
credentialsProvider: credentialsProvider,
frameworkMetadata: AmplifyAWSServiceConfiguration.frameworkMetaData(),
region: region
region: region,
credentialsProvider: credentialsProvider
)

#if os(iOS) || os(macOS) // no-op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ClientRuntime
public class DefaultRemoteLoggingConstraintsProvider: RemoteLoggingConstraintsProvider {
public let refreshIntervalInSeconds: Int
private let endpoint: URL
private let credentialProvider: CredentialsProvider?
private let credentialProvider: CredentialsProviding?
private let region: String
private let loggingConstraintsLocalStore: LoggingConstraintsLocalStore = UserDefaults.standard

Expand All @@ -31,7 +31,7 @@ public class DefaultRemoteLoggingConstraintsProvider: RemoteLoggingConstraintsPr
public init(
endpoint: URL,
region: String,
credentialProvider: CredentialsProvider? = nil,
credentialProvider: CredentialsProviding? = nil,
refreshIntervalInSeconds: Int = 1200
) {
self.endpoint = endpoint
Expand Down Expand Up @@ -79,7 +79,9 @@ public class DefaultRemoteLoggingConstraintsProvider: RemoteLoggingConstraintsPr
let httpMethod = (request.httpMethod?.uppercased())
.flatMap(HttpMethodType.init(rawValue:)) ?? .get

let queryItems = URLComponents(url: url, resolvingAgainstBaseURL: false)?.queryItems ?? []
let queryItems = URLComponents(url: url, resolvingAgainstBaseURL: false)?
.queryItems?
.map { ClientRuntime.URLQueryItem(name: $0.name, value: $0.value) } ?? []

let requestBuilder = SdkHttpRequestBuilder()
.withHost(host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,15 @@ class MockCloudWatchLogsClient: CloudWatchLogsClientProtocol {
throw MockError.unimplemented
}


func deleteAccountPolicy(input: AWSCloudWatchLogs.DeleteAccountPolicyInput) async throws -> AWSCloudWatchLogs.DeleteAccountPolicyOutputResponse {
throw MockError.unimplemented
}

func describeAccountPolicies(input: AWSCloudWatchLogs.DescribeAccountPoliciesInput) async throws -> AWSCloudWatchLogs.DescribeAccountPoliciesOutputResponse {
throw MockError.unimplemented
}

func putAccountPolicy(input: AWSCloudWatchLogs.PutAccountPolicyInput) async throws -> AWSCloudWatchLogs.PutAccountPolicyOutputResponse {
throw MockError.unimplemented
}
}

0 comments on commit 49a0ec4

Please sign in to comment.