Class: HrrRbSsh::Authentication::Method::None
- Inherits:
-
HrrRbSsh::Authentication::Method
- Object
- HrrRbSsh::Authentication::Method
- HrrRbSsh::Authentication::Method::None
- Defined in:
- lib/hrr_rb_ssh/authentication/method/none.rb,
lib/hrr_rb_ssh/authentication/method/none/context.rb
Defined Under Namespace
Classes: Context
Constant Summary collapse
- NAME =
'none'- PREFERENCE =
0
Instance Method Summary collapse
- #authenticate(userauth_request_message) ⇒ Object
-
#initialize(transport, options, variables, authentication_methods) ⇒ None
constructor
A new instance of None.
- #request_authentication(username, service_name) ⇒ Object
Methods included from SubclassWithPreferenceListable
#[], #inherited, #list_preferred, #list_supported
Constructor Details
#initialize(transport, options, variables, authentication_methods) ⇒ None
Returns a new instance of None.
13 14 15 16 17 18 19 |
# File 'lib/hrr_rb_ssh/authentication/method/none.rb', line 13 def initialize transport, , variables, authentication_methods @logger = Logger.new(self.class.name) @transport = transport @authenticator = .fetch( 'authentication_none_authenticator', Authenticator.new { false } ) @variables = variables @authentication_methods = authentication_methods end |
Instance Method Details
#authenticate(userauth_request_message) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/hrr_rb_ssh/authentication/method/none.rb', line 21 def authenticate @logger.info { "authenticate" } @logger.debug { "userauth request: " + .inspect } context = Context.new([:'user name'], @variables, @authentication_methods) @authenticator.authenticate context end |
#request_authentication(username, service_name) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/hrr_rb_ssh/authentication/method/none.rb', line 28 def request_authentication username, service_name = { :'message number' => Message::SSH_MSG_USERAUTH_REQUEST::VALUE, :"user name" => username, :"service name" => service_name, :"method name" => NAME, } payload = Message::SSH_MSG_USERAUTH_REQUEST.encode @transport.send payload payload = @transport.receive end |