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
-
its domain name parameter is mandatory
-
it is called at the start of every session
-
it is undone by the logout command
-
it requires the shell token environment variable to be set
-
you can nest login commands thus using multiple domains
-
you can call it with a –with=password switch
-
a space before the command prevents it being logged in .bash_history
-
you can deliver the password in multiple ways
Attributes
Public Instance Methods
# 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
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