passwordsafe 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/History.md +10 -0
- data/README.md +42 -4
- data/features/get.feature +18 -0
- data/lib/passwordsafe/cli.rb +11 -0
- data/lib/passwordsafe/version.rb +1 -1
- data/spec/keyring_spec.rb +4 -0
- metadata +5 -3
data/Gemfile.lock
CHANGED
data/History.md
ADDED
data/README.md
CHANGED
@@ -1,14 +1,52 @@
|
|
1
|
-
|
1
|
+
# Password Safe
|
2
2
|
A command line application that can store and retrieve passwords from an encrypted file.
|
3
3
|
|
4
|
-
Based on 'Tutorial: Build your own password safe with Ruby!' at http://rbjl.net/41-tutorial-build-your-own-password-safe-with-ruby
|
4
|
+
Based on 'Tutorial: Build your own password safe with Ruby!' at http://rbjl.net/41-tutorial-build-your-own-password-safe-with-ruby which won't run on my machine. So rather than try to fix it, I decided to build my own, with an actual attempt at testing/BDD. This was primarily done for my own education, tips/suggestions are welcome.
|
5
|
+
|
6
|
+
## Currently implemented
|
7
|
+
**NOTE** This gem is currently in alpha, if you'd like to try it and make suggestions feel free but please do not store valuble information in it yet.
|
8
|
+
|
5
9
|
|
6
|
-
Basic implementation
|
7
10
|
password add name password
|
11
|
+
Use passwordsafe to add a password with NAME to the safe. The utility will prompt for a master password to use to encrypt the file. *Do NOT loose your master password, it is unrecoverable!*
|
8
12
|
|
9
|
-
Not Implemented yet
|
10
13
|
password get name
|
14
|
+
Use passwordsafe to retrive an existing password out of your safe. The utility will prompt for a master password.
|
15
|
+
|
16
|
+
## Not Implemented yet
|
17
|
+
|
11
18
|
password list
|
12
19
|
password remove name
|
13
20
|
password help
|
14
21
|
|
22
|
+
# Note on Patches/Pull Requests
|
23
|
+
|
24
|
+
* Fork the project.
|
25
|
+
* Make your feature addition or bug fix.
|
26
|
+
* Add tests for it. I won't accept pull requests without at least specs, features get you bonus points.
|
27
|
+
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
28
|
+
* Send me a pull request.
|
29
|
+
|
30
|
+
# License
|
31
|
+
|
32
|
+
Copyright (c) 2010 thecatwasnot
|
33
|
+
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
35
|
+
a copy of this software and associated documentation files (the
|
36
|
+
"Software"), to deal in the Software without restriction, including
|
37
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
38
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
39
|
+
permit persons to whom the Software is furnished to do so, subject to
|
40
|
+
the following conditions:
|
41
|
+
|
42
|
+
The above copyright notice and this permission notice shall be
|
43
|
+
included in all copies or substantial portions of the Software.
|
44
|
+
|
45
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
46
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
47
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
48
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
49
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
50
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
51
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
52
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: Get
|
2
|
+
In order get my passwords out of the safe
|
3
|
+
As a user
|
4
|
+
I want to get my passwords from the password safe
|
5
|
+
|
6
|
+
Scenario: Get a password with a name that exists
|
7
|
+
Given A safe exists with masterpassword "masterpa$$" and a "name" key
|
8
|
+
When I run "password get name" interactively
|
9
|
+
And I type "masterpa$$"
|
10
|
+
Then the output should contain "name: "
|
11
|
+
|
12
|
+
@announce
|
13
|
+
Scenario: Get a password with a name that does not exist
|
14
|
+
Given A safe exists with masterpassword "masterpa$$" and a "name" key
|
15
|
+
When I run "password get name2" interactively
|
16
|
+
And I type "masterpa$$"
|
17
|
+
Then the output should contain "name2 does not exist in this safe."
|
18
|
+
|
data/lib/passwordsafe/cli.rb
CHANGED
@@ -18,6 +18,17 @@ module PasswordSafe
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
desc "get NAME", "Get an existing password with name NAME from keyring"
|
22
|
+
def get name
|
23
|
+
safe = make_safe
|
24
|
+
password = PasswordSafe::Keyring.new(safe).get name
|
25
|
+
if password.nil?
|
26
|
+
puts "#{name} does not exist in this safe."
|
27
|
+
else
|
28
|
+
puts "#{name}: #{password}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
21
32
|
no_tasks do
|
22
33
|
def make_safe filename = DEFAULTSAFE
|
23
34
|
masterpass = ask("Enter your master password: ") { |q| q.echo = "x" }
|
data/lib/passwordsafe/version.rb
CHANGED
data/spec/keyring_spec.rb
CHANGED
@@ -49,6 +49,10 @@ describe PasswordSafe::Keyring do
|
|
49
49
|
@keyring = PasswordSafe::Keyring.new(@safe)
|
50
50
|
@keyring.get("name").should eq("password")
|
51
51
|
end
|
52
|
+
it "returns nil if the key does not exist" do
|
53
|
+
@keyring = PasswordSafe::Keyring.new(@safe)
|
54
|
+
@keyring.get("name").should be_nil
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
context "list" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- thecatwasnot
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-23 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -110,10 +110,12 @@ files:
|
|
110
110
|
- .rvmrc
|
111
111
|
- Gemfile
|
112
112
|
- Gemfile.lock
|
113
|
+
- History.md
|
113
114
|
- README.md
|
114
115
|
- Rakefile
|
115
116
|
- bin/password
|
116
117
|
- features/add.feature
|
118
|
+
- features/get.feature
|
117
119
|
- features/step_definitions/safe_steps.rb
|
118
120
|
- features/support/env.rb
|
119
121
|
- lib/passwordsafe.rb
|