class OpenSecret::Init
The init use case initializes opensecret thus preparing it for the ability to lock secrets, unlock them, transport their keys and much more.
opensecret is a (glorified) placeholder. It takes things in now, keeps them safe and gives them back later, in a helpful manner.
Alternat Error Flows¶ ↑
An error will be thrown
-
if opensecret cannot create, extend, read or write the drive folder
-
if the domain is already in the configuration file
-
if domain has non alphanums, excl hyphens, underscores, @ symbols, periods
-
if domain does not begin or end with alphanums.
-
if non alpha-nums (excl at signs) appear consecutively
-
if no alpha-nums appear in the string
-
if the domain string's length is less than 5
-
if “base.opensecret.io” appears twice (or more) in a directory tree
Attributes
Public Instance Methods
The init use case prepares opensecret so that you can open an envelope, put secrets into it and then seal (lock) it. Locking effectively writes crypted blocks to both keystore and crypt store.
# File lib/usecase/init.rb, line 33 def execute return unless ops_key_exists? OpenKey::KeyApi.init_app_domain( @domain_name, @base_path ) keys_setup = OpenKey::KeyApi.is_domain_keys_setup?( @domain_name ) if ( keys_setup ) print_already_initialized return end domain_password = OpenKey::KeyPass.password_from_shell( true ) OpenKey::KeyApi.setup_domain_keys( @domain_name, domain_password, create_header() ) print_domain_initialized # --> unless @base_path.nil? # --> key_api.register_keystore( @base_path ) # --> end end
# File lib/usecase/init.rb, line 56 def pre_validation end