Class: HrrRbSsh::Authentication::Method::Password::Context

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

Instance Attribute Summary collapse

Attributes included from Loggable

#log_key, #logger

Instance Method Summary collapse

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn

Constructor Details

#initialize(username, password, variables, authentication_methods, logger: nil) ⇒ Context

Returns a new instance of Context.



20
21
22
23
24
25
26
27
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 20

def initialize username, password, variables, authentication_methods, logger: nil
  self.logger = logger
  @username = username
  @password = password
  @variables = variables
  @vars = variables
  @authentication_methods = authentication_methods
end

Instance Attribute Details

#authentication_methodsObject (readonly)

Returns the value of attribute authentication_methods.



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

def authentication_methods
  @authentication_methods
end

#passwordObject (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



13
14
15
# File 'lib/hrr_rb_ssh/authentication/method/password/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/password/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/password/context.rb', line 13

def vars
  @vars
end

Instance Method Details

#verify(username, password) ⇒ Object



29
30
31
32
33
# File 'lib/hrr_rb_ssh/authentication/method/password/context.rb', line 29

def verify username, password
  log_info { "verify username and password" }
  log_debug { "username is #{username}, @username is #{@username}, and password is #{password}, @password is #{@password}" }
  username == @username and password == @password
end