class Cql::Client::CredentialsAuthenticationStep

@private

Public Class Methods

new(credentials) click to toggle source
# File lib/cql/client/connector.rb, line 177
def initialize(credentials)
  @credentials = credentials
end

Public Instance Methods

run(pending_connection) click to toggle source
# File lib/cql/client/connector.rb, line 181
def run(pending_connection)
  if pending_connection.authentication_class
    if @credentials
      request = Protocol::CredentialsRequest.new(@credentials)
      pending_connection.execute(request).map(pending_connection)
    else
      Future.failed(AuthenticationError.new('Server requested authentication, but no credentials provided'))
    end
  else
    Future.resolved(pending_connection)
  end
end