Class: Keepasshttp::KeyStore::Plain

Inherits:
Object
  • Object
show all
Defined in:
lib/keepasshttp/key_store.rb

Overview

The most simple but unsecure way wo store your session key (so you don’t have to reenter the label over and over again). Use this only for testing!

Direct Known Subclasses

SshAgent

Constant Summary collapse

PATH =

TODO, make the PATH adjustable

File.join(Dir.home, '.keepasshttp-ruby')

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/keepasshttp/key_store.rb', line 40

def self.available?
  File.exist?(PATH) && File.size(PATH).positive?
end

.loadObject



36
37
38
# File 'lib/keepasshttp/key_store.rb', line 36

def self.load
  YAML.load_file(PATH)
end

.save(params = {}) ⇒ Object



32
33
34
# File 'lib/keepasshttp/key_store.rb', line 32

def self.save(params = {})
  File.write(PATH, params.to_yaml)
end