class OpenSecret::Login

The login use case is given the domain name and if needs be it collects the password then (if correct) logs the user in.

Here are some key facts about the login command

Attributes

domain_name[W]
master_p4ss[W]

Public Instance Methods

execute() click to toggle source
# File lib/usecase/login.rb, line 23
    def execute

      return unless ops_key_exists?

      unless ( OpenKey::KeyApi.is_domain_keys_setup?( @domain_name ) )
        print_not_initialized
        return
      end

############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below
############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below
############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below
############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below
############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below
############## Call [[ KeyApi.is_logged_in? ]] - then print msg and skip password collection below

      domain_secret = OpenKey::KeyPass.password_from_shell( false )

############## Use [[ KeyApi.valid_password? ]] and give error if not valid
############## Use [[ KeyApi.valid_password? ]] and give error if not valid
############## Use [[ KeyApi.valid_password? ]] and give error if not valid
############## Use [[ KeyApi.valid_password? ]] and give error if not valid
############## Use [[ KeyApi.valid_password? ]] and give error if not valid

      OpenKey::KeyApi.do_login( @domain_name, domain_secret, create_header() )

      view_uc = View.new
      view_uc.flow_of_events

    end
pre_validation() click to toggle source

Perform pre-conditional validations in preparation to executing the main flow of events for this use case. This method may throw the below exceptions.

@raise [SafeDirNotConfigured] if the safe's url has not been configured @raise [EmailAddrNotConfigured] if the email address has not been configured @raise [StoreUrlNotConfigured] if the crypt store url is not configured

# File lib/usecase/login.rb, line 61
def pre_validation

end