Class: HrrRbSsh::Authentication::Method::KeyboardInteractive::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport, username, submethods, variables, authentication_methods) ⇒ Context

Returns a new instance of Context.



21
22
23
24
25
26
27
28
29
30
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 21

def initialize transport, username, submethods, variables, authentication_methods
  @transport = transport
  @username = username
  @submethods = submethods
  @variables = variables
  @vars = variables
  @authentication_methods = authentication_methods

  @logger = Logger.new self.class.name
end

Instance Attribute Details

#authentication_methodsObject (readonly)

Returns the value of attribute authentication_methods.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def authentication_methods
  @authentication_methods
end

#info_responseObject (readonly)

Returns the value of attribute info_response.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def info_response
  @info_response
end

#submethodsObject (readonly)

Returns the value of attribute submethods.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def submethods
  @submethods
end

#usernameObject (readonly)

Returns the value of attribute username.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def username
  @username
end

#variablesObject (readonly)

Returns the value of attribute variables.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def variables
  @variables
end

#varsObject (readonly)

Returns the value of attribute vars.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 13

def vars
  @vars
end

Instance Method Details

#info_request(name, instruction, language_tag, prompts) ⇒ Object



32
33
34
35
36
37
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/context.rb', line 32

def info_request name, instruction, language_tag, prompts
  @logger.info { "send userauth info request" }
  @transport.send InfoRequest.new(name, instruction, language_tag, prompts).to_payload
  @logger.info { "receive userauth info response" }
  @info_response = InfoResponse.new @transport.receive
end