clandestine 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -9
- data/.rspec +2 -0
- data/README.md +30 -18
- data/Rakefile +0 -24
- data/bin/clandestine +1 -1
- data/clandestine.gemspec +3 -1
- data/lib/clandestine.rb +1 -9
- data/lib/clandestine/clandestine_error.rb +4 -0
- data/lib/clandestine/command_line_options.rb +52 -0
- data/lib/clandestine/command_line_runner.rb +86 -0
- data/lib/clandestine/commands.rb +52 -0
- data/lib/clandestine/commands/add.rb +29 -0
- data/lib/clandestine/commands/delete.rb +25 -0
- data/lib/clandestine/commands/get.rb +37 -0
- data/lib/clandestine/commands/remove_safe.rb +18 -0
- data/lib/clandestine/commands/update.rb +32 -0
- data/lib/clandestine/crypt.rb +44 -21
- data/lib/clandestine/io.rb +32 -0
- data/lib/clandestine/password_generator.rb +18 -0
- data/lib/clandestine/safe.rb +71 -44
- data/lib/clandestine/safe_authentication.rb +18 -0
- data/lib/clandestine/safe_location.rb +3 -0
- data/lib/clandestine/version.rb +1 -1
- data/spec/commands_spec.rb +98 -0
- data/spec/crypt_spec.rb +20 -5
- data/spec/safe_authentication_spec.rb +30 -0
- data/spec/spec_helper.rb +0 -8
- metadata +50 -12
- data/lib/clandestine/config.rb +0 -25
- data/lib/clandestine/guard.rb +0 -217
- data/spec/config_spec.rb +0 -47
- data/spec/guard_spec.rb +0 -127
- data/spec/safe_spec.rb +0 -40
data/spec/safe_spec.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Clandestine::Safe do
|
4
|
-
include Clandestine::Crypt
|
5
|
-
before :each do
|
6
|
-
@safe = Clandestine::Safe.new "#{ENV['HOME']}/.tmp_pswds"
|
7
|
-
Clandestine::Safe.instance_eval do
|
8
|
-
attr_reader :safe_location
|
9
|
-
end
|
10
|
-
end
|
11
|
-
after :each do
|
12
|
-
@safe.self_destruct
|
13
|
-
end
|
14
|
-
it "should create a new safe if one doesn't already exist" do
|
15
|
-
File.exists?(@safe.safe_location).should eql true
|
16
|
-
end
|
17
|
-
it "should remove broken sym link of file doesn't exist" do
|
18
|
-
FileUtils.ln_s "#{ENV['HOME']}/.doesnt_exist", @safe.safe_location, :force => true
|
19
|
-
@safe = Clandestine::Safe.new "#{ENV['HOME']}/.tmp_pswds"
|
20
|
-
File.exists?("#{ENV['HOME']}/.doesnt_exist").should eql false
|
21
|
-
end
|
22
|
-
it "should lock data" do
|
23
|
-
data = "gmail:password"
|
24
|
-
@safe.lock(data, "password")
|
25
|
-
decrypt(IO.readlines(@safe.safe_location).to_s, "password").should eql data
|
26
|
-
end
|
27
|
-
it "should unlock data" do
|
28
|
-
@safe.lock "gmail:password", "password"
|
29
|
-
@safe.unlock("password").should eql "gmail:password"
|
30
|
-
end
|
31
|
-
it "should know if it's empty" do
|
32
|
-
@safe.empty?.should eql true
|
33
|
-
end
|
34
|
-
it "should remove sym link when self destructing" do
|
35
|
-
FileUtils.ln_s("#{ENV['HOME']}/.tmp_pswds_lnk", @safe.safe_location, :force => true)
|
36
|
-
@safe.self_destruct
|
37
|
-
File.exists?("#{ENV['HOME']}/.tmp_pswds_lnk").should eql false
|
38
|
-
File.exists?(@safe.safe_location).should eql false
|
39
|
-
end
|
40
|
-
end
|