Class: HrrRbSsh::Authentication::Method::KeyboardInteractive::InfoResponse
- Inherits:
-
Object
- Object
- HrrRbSsh::Authentication::Method::KeyboardInteractive::InfoResponse
- Includes:
- Loggable
- Defined in:
- lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb
Instance Attribute Summary collapse
-
#num_responses ⇒ Object
readonly
Returns the value of attribute num_responses.
-
#responses ⇒ Object
readonly
Returns the value of attribute responses.
Attributes included from Loggable
Instance Method Summary collapse
-
#initialize(payload, logger: nil) ⇒ InfoResponse
constructor
A new instance of InfoResponse.
Methods included from Loggable
#log_debug, #log_error, #log_fatal, #log_info, #log_warn
Constructor Details
#initialize(payload, logger: nil) ⇒ InfoResponse
Returns a new instance of InfoResponse.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 17 def initialize payload, logger: nil self.logger = logger case payload[0,1].unpack("C")[0] when Message::SSH_MSG_USERAUTH_INFO_RESPONSE::VALUE = Message::SSH_MSG_USERAUTH_INFO_RESPONSE.new(logger: logger).decode payload @num_responses = [:'num-responses'] @responses = Array.new([:'num-responses']){ |i| [:"response[#{i+1}]"] } else raise "Expected SSH_MSG_USERAUTH_INFO_RESPONSE, but got message number #{payload[0,1].unpack("C")[0]}" end end |
Instance Attribute Details
#num_responses ⇒ Object (readonly)
Returns the value of attribute num_responses.
13 14 15 |
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 13 def num_responses @num_responses end |
#responses ⇒ Object (readonly)
Returns the value of attribute responses.
13 14 15 |
# File 'lib/hrr_rb_ssh/authentication/method/keyboard_interactive/info_response.rb', line 13 def responses @responses end |