Class: SafeDb::Token

Inherits:
UseCase show all
Defined in:
lib/usecase/token.rb

Overview

The token use case prints out an encrypted session token tied to the workstation and shell environment. See the root README.md on how to export it and create a simple command alias for it in the ~/.bash_aliases script which is executed when the shell starts.

Constant Summary

Constants inherited from UseCase

UseCase::APP_DIR_NAME, UseCase::COMMANDMENT, UseCase::ENV_VAR_KEY_NAME, UseCase::ENV_VAR_PREFIX_A, UseCase::ENV_VAR_PREFIX_B, UseCase::FILE_CONTENT_KEY, UseCase::FILE_KEY_PREFIX, UseCase::FILE_NAME_KEY

Instance Attribute Summary

Attributes inherited from UseCase

#from_script

Instance Method Summary collapse

Methods inherited from UseCase

#check_post_conditions, #check_pre_conditions, #cleanup, #config_directory, #config_file, #flow_of_events, #get_master_database, #initialize, #post_validation

Constructor Details

This class inherits a constructor from SafeDb::UseCase

Instance Method Details

#executeObject



12
13
14
15
16
# File 'lib/usecase/token.rb', line 12

def execute

  print KeyLocal.generate_shell_key_and_token()

end

#pre_validationObject

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

Raises:

  • (SafeDirNotConfigured)

    if the safe’s url has not been configured

  • (EmailAddrNotConfigured)

    if the email address has not been configured

  • (StoreUrlNotConfigured)

    if the crypt store url is not configured



25
26
27
28
# File 'lib/usecase/token.rb', line 25

def pre_validation


end