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

Attributes

base_path[W]
domain_name[W]
master_p4ss[W]

Public Instance Methods

execute() click to toggle source

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
pre_validation() click to toggle source
# File lib/usecase/init.rb, line 56
def pre_validation
end