-
-
Notifications
You must be signed in to change notification settings - Fork 57
Instrument AWSClient WIP #348
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 9 commits
e6bbd06
114a5ea
b941592
a397d51
b500d2c
d1d5ac4
35386b4
5d38cf7
78c1c31
c490c24
f56fc2f
7d47822
a35c193
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,16 @@ | |
//===----------------------------------------------------------------------===// | ||
|
||
import AWSSignerV4 | ||
import Logging | ||
import Baggage | ||
import BaggageLogging | ||
import NIO | ||
import NIOConcurrencyHelpers | ||
|
||
/// Protocol providing future holding a credential | ||
public protocol CredentialProvider: CustomStringConvertible { | ||
func getCredential(on eventLoop: EventLoop, logger: Logger) -> EventLoopFuture<Credential> | ||
typealias Context = BaggageLogging.LoggingBaggageContextCarrier | ||
|
||
func getCredential(on eventLoop: EventLoop, context: CredentialProvider.Context) -> EventLoopFuture<Credential> | ||
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. I see you have replaced |
||
func shutdown(on eventLoop: EventLoop) -> EventLoopFuture<Void> | ||
} | ||
|
||
|
@@ -34,13 +37,22 @@ extension CredentialProvider { | |
/// A helper struct to defer the creation of a `CredentialProvider` until after the AWSClient has been created. | ||
public struct CredentialProviderFactory { | ||
/// The initialization context for a `ContextProvider` | ||
public struct Context { | ||
public struct Context: BaggageLogging.LoggingBaggageContextCarrier { | ||
/// The `AWSClient`s internal `HTTPClient` | ||
public let httpClient: AWSHTTPClient | ||
/// The `EventLoop` that the `CredentialProvider` should use for credential refreshs | ||
public let eventLoop: EventLoop | ||
/// The `Logger` attached to the AWSClient | ||
public let logger: Logger | ||
public var logger: Logger // TODO: should not need to be mutable | ||
/// The context baggage. | ||
public var baggage: BaggageContext | ||
|
||
public init(httpClient: AWSHTTPClient, eventLoop: EventLoop, context: BaggageLogging.LoggingBaggageContextCarrier) { | ||
self.httpClient = httpClient | ||
self.eventLoop = eventLoop | ||
self.logger = context.logger | ||
self.baggage = context.baggage | ||
} | ||
} | ||
|
||
private let cb: (Context) -> CredentialProvider | ||
|
Uh oh!
There was an error while loading. Please reload this page.