Commit b5c5c10
Changed files (4)
lib
spec
lib/tfa/cli.rb
@@ -80,7 +80,7 @@ module TFA
end
def yaml_storage
- @yaml_storage ||= SecureProxy.new(Storage.new(yaml_path), ->{ passphrase })
+ @yaml_storage ||= SecureStorage.new(Storage.new(yaml_path), ->{ passphrase })
end
def filename
lib/tfa/secure_proxy.rb → lib/tfa/secure_storage.rb
@@ -1,5 +1,5 @@
module TFA
- class SecureProxy
+ class SecureStorage
def initialize(original, passphrase_request)
@original = original
@passphrase_request = passphrase_request
@@ -45,8 +45,8 @@ module TFA
if was_encrypted
encrypted_content = IO.read(@original.path)
decrypt!
+ original_sha256 = Digest::SHA256.file(@original.path)
end
- original_sha256 = Digest::SHA256.file(@original.path)
result = @original.public_send(name, *args, &block)
if was_encrypted
new_sha256 = Digest::SHA256.file(@original.path)
lib/tfa.rb
@@ -7,7 +7,7 @@ require "rotp"
require "yaml/store"
require "tfa/cli"
-require "tfa/secure_proxy"
+require "tfa/secure_storage"
require "tfa/storage"
require "tfa/totp_command"
require "tfa/version"
spec/lib/secure_proxy_spec.rb → spec/lib/secure_storage_spec.rb
@@ -1,5 +1,5 @@
module TFA
- describe SecureProxy do
+ describe SecureStorage do
subject { described_class.new(original, passphrase) }
let(:original) { Tempfile.new('tfa') }
let(:passphrase) { -> { SecureRandom.uuid } }