DeferredCredentialProvider

public class DeferredCredentialProvider : CredentialProvider
extension DeferredCredentialProvider: CustomStringConvertible

Used for wrapping another credential provider whose getCredential method doesn’t return instantly and is only needed to be called once. After the wrapped CredentialProvider has generated a credential this is returned instead of calling the wrapped CredentialProvider's getCredentials again.

  • Create DeferredCredentialProvider.

    Declaration

    Swift

    public init(context: CredentialProviderFactory.Context, provider: CredentialProvider)

    Parameters

    eventLoop

    EventLoop that getCredential should run on

    provider

    Credential provider to wrap

  • Shutdown credential provider

    Declaration

    Swift

    public func shutdown(on eventLoop: EventLoop) -> EventLoopFuture<Void>
  • Return credentials. If still in process of the getting credentials then return future result of startupPromise otherwise return credentials store in class

    Declaration

    Swift

    public func getCredential(on eventLoop: EventLoop, logger: Logger) -> EventLoopFuture<Credential>

    Parameters

    eventLoop

    EventLoop to run off

    Return Value

    EventLoopFuture that will hold credentials

  • Declaration

    Swift

    public var description: String { get }