class OpenSecret::Open

The open use case allows us to add (put), subtract (del)ete, change (update) and list the secrets within an envelope (outer path) at a given position (inner path), whether that envelope exists or not.

Also see the reopen command which only differs from open in that it fails if the path specified does not exist in either the sealed or session envelopes.

The Open Path Parameter

Open must be called with a single path parameter with an optional single colon separating the outer (path to envelope) from the inner (path within envelope).

Open (Path) Pre-Conditions

The domain must have been initialized on this machine stating the path to the base folder that contains the key and crypt material.

To open a path these conditions must be true.

Observable Value

The observable value delivered by [open] boils down to

Attributes

env_path[W]

The two paths that have been posted to the open command. First is a relative path to the obfuscated envelope and then the path in envelope to the point of interest.

key_path[W]

The two paths that have been posted to the open command. First is a relative path to the obfuscated envelope and then the path in envelope to the point of interest.

Public Instance Methods

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

  return unless ops_key_exists?
  master_db = OpenKey::KeyApi.read_master_db()

  master_db[ ENV_PATH ] = @env_path
  master_db[ KEY_PATH ] = @key_path

  OpenKey::KeyApi.write_master_db( create_header(), master_db )

  # Show the mini dictionary at the opened chapter and verse location
  # More work is needed when for when only the chapter is opened in
  # which case we should show the list of verses and perhaps the count
  # of key value pairs each verse contains.
  Show.new.flow_of_events

end