sesame-cli 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +16 -0
- data/README.md +36 -22
- data/Rakefile +14 -16
- data/VERSION +1 -1
- data/bin/sesame +12 -10
- data/lib/sesame/cave.rb +101 -61
- data/lib/sesame/dict.rb +7 -5
- data/lib/sesame/fail.rb +2 -0
- data/lib/sesame/jinn.rb +134 -84
- data/lib/sesame/lang/en.yml +2 -0
- data/lib/sesame.rb +2 -0
- data/sesame-cli.gemspec +12 -6
- data/spec/cave_spec.rb +188 -0
- data/spec/dict_spec.rb +13 -0
- data/spec/jinn_spec.rb +7 -0
- data/spec/spec_helper.rb +9 -4
- metadata +22 -5
- data/sesame.gemspec +0 -99
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e9e49b899f85759b86942eb6a051205e3db2f5adef20d6026ca31862b2724af
|
4
|
+
data.tar.gz: 84ae67770bb80de8854a1044b35f4b19364715383b18065507ba5cc5c8e9e183
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '07078b42b50a933caeb46187d494fb0981439a963d48e3445e0b3b6c6ef3e8328460ea39baa994152dd28c319d44aebf9f7a46b6b486f245de16b62b3e113834'
|
7
|
+
data.tar.gz: 14607f8208e44a33833ca234ebf5c441a0e2bdca8e3eb02336a70cd14ec63260979f06a83ef7e85d76f2da25332598238a3a7ddd0d4f08589a60c330fe91e3ac
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gem 'bases', '~> 1.0'
|
4
6
|
gem 'clipboard', '~> 1.1'
|
@@ -15,6 +17,7 @@ group :development do
|
|
15
17
|
gem 'jeweler', '~> 2.3.9'
|
16
18
|
gem 'rdoc', '~> 6.0'
|
17
19
|
gem 'rspec', '~> 3.7'
|
20
|
+
gem 'rubocop', '~> 0.55'
|
18
21
|
gem 'simplecov', '~> 0.15'
|
19
22
|
gem 'yard', '~> 0.9'
|
20
23
|
end
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,7 @@ GEM
|
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
addressable (2.4.0)
|
5
|
+
ast (2.4.0)
|
5
6
|
awesome_print (1.8.0)
|
6
7
|
bases (1.0.2)
|
7
8
|
builder (3.2.3)
|
@@ -54,8 +55,13 @@ GEM
|
|
54
55
|
multi_json (~> 1.3)
|
55
56
|
multi_xml (~> 0.5)
|
56
57
|
rack (>= 1.2, < 3)
|
58
|
+
parallel (1.12.1)
|
59
|
+
parser (2.5.1.0)
|
60
|
+
ast (~> 2.4.0)
|
61
|
+
powerpack (0.1.1)
|
57
62
|
psych (3.0.2)
|
58
63
|
rack (2.0.4)
|
64
|
+
rainbow (3.0.0)
|
59
65
|
rake (12.3.1)
|
60
66
|
rbnacl (5.0.0)
|
61
67
|
ffi
|
@@ -75,6 +81,14 @@ GEM
|
|
75
81
|
diff-lcs (>= 1.2.0, < 2.0)
|
76
82
|
rspec-support (~> 3.7.0)
|
77
83
|
rspec-support (3.7.1)
|
84
|
+
rubocop (0.55.0)
|
85
|
+
parallel (~> 1.10)
|
86
|
+
parser (>= 2.5)
|
87
|
+
powerpack (~> 0.1)
|
88
|
+
rainbow (>= 2.2.2, < 4.0)
|
89
|
+
ruby-progressbar (~> 1.7)
|
90
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
91
|
+
ruby-progressbar (1.9.0)
|
78
92
|
semver2 (3.4.2)
|
79
93
|
simplecov (0.16.1)
|
80
94
|
docile (~> 1.1)
|
@@ -83,6 +97,7 @@ GEM
|
|
83
97
|
simplecov-html (0.10.2)
|
84
98
|
slop (4.6.2)
|
85
99
|
thread_safe (0.3.6)
|
100
|
+
unicode-display_width (1.3.2)
|
86
101
|
yard (0.9.12)
|
87
102
|
|
88
103
|
PLATFORMS
|
@@ -101,6 +116,7 @@ DEPENDENCIES
|
|
101
116
|
rbnacl-libsodium (~> 1.0)
|
102
117
|
rdoc (~> 6.0)
|
103
118
|
rspec (~> 3.7)
|
119
|
+
rubocop (~> 0.55)
|
104
120
|
simplecov (~> 0.15)
|
105
121
|
slop (~> 4.6)
|
106
122
|
yard (~> 0.9)
|
data/README.md
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
Sesame
|
6
6
|
======
|
7
7
|
|
8
|
-
Sesame is a simple password manager for the command-line.
|
8
|
+
Sesame is a simple password manager for the command-line. See the [full
|
9
|
+
documentation](http://www.rubydoc.info/gems/sesame-cli).
|
9
10
|
|
10
11
|
Creating a Cave
|
11
12
|
---------------
|
@@ -20,7 +21,7 @@ passphrase; omit `--echo` to have this copied to the clipboard instead.
|
|
20
21
|
|
21
22
|
```
|
22
23
|
$ gem install sesame
|
23
|
-
$ sesame --echo
|
24
|
+
$ sesame --echo --interactive
|
24
25
|
╔═════════════════════════════════════╗
|
25
26
|
║ ┏━━━┓ ┏━━━┓ ┏━━━┓ ┏━┓ ┏┓ ┏┓ ┏━━━┓ ║
|
26
27
|
║ ┗━╋━┓ ┣━━┫ ┗━╋━┓ ┏┻━┻┓ ┃┗┳┛┃ ┣━━┫ ║
|
@@ -44,9 +45,9 @@ mammal glue wage paper store detail weave date
|
|
44
45
|
sky tea ant ice
|
45
46
|
```
|
46
47
|
|
47
|
-
You will notice that Sesame enters interactive mode
|
48
|
-
multiple commands in a single session.
|
49
|
-
cave will be locked with a short code.
|
48
|
+
You will notice that Sesame enters interactive mode when the `--interactive`
|
49
|
+
argument is given, allowing you to issue multiple commands in a single session.
|
50
|
+
When you exit from interactive mode, the cave will be locked with a short code.
|
50
51
|
|
51
52
|
Remembering the Passphrase
|
52
53
|
--------------------------
|
@@ -58,7 +59,7 @@ home, from the front door to the bathroom).
|
|
58
59
|
|
59
60
|
* I enter the front door. On the side table a mammal is glueing their wages together.
|
60
61
|
* Turning left into the kitchen, I see the drawer where I store my paper.
|
61
|
-
* Looking down the corridor, I notice a detailed
|
62
|
+
* Looking down the corridor, I notice a detailed weaving of a date on the bathroom door.
|
62
63
|
|
63
64
|
Lame perhaps, but easier to remember than `58qWT6jHpA566MX` (and just as
|
64
65
|
secure).
|
@@ -100,9 +101,9 @@ Listing Services
|
|
100
101
|
```
|
101
102
|
> list
|
102
103
|
🧞 - "Behold! Tremble in awe at the greatness of these heroes!"
|
103
|
-
|
104
|
-
facebook
|
104
|
+
facebook (lloyd@kranzky.com)
|
105
105
|
google (2)
|
106
|
+
twitter (kranzky)
|
106
107
|
```
|
107
108
|
|
108
109
|
If several user accounts exist for the same service, a number will be displayed
|
@@ -135,8 +136,19 @@ particular service. The `next` command allows you to do that.
|
|
135
136
|
|
136
137
|
```
|
137
138
|
> next google lloyd@kranzky.com
|
139
|
+
🧞 - "I have recast the magic words for lloyd@kranzky.com of google..."
|
140
|
+
chore proud barrel docile
|
138
141
|
```
|
139
142
|
|
143
|
+
You can also update the lock code in a similar way.
|
144
|
+
|
145
|
+
```
|
146
|
+
> next sesame
|
147
|
+
🧞 - "I shall forge you a new key for locking your cave."
|
148
|
+
```
|
149
|
+
|
150
|
+
The new code will be used when you next exit from interactive mode.
|
151
|
+
|
140
152
|
Removing a Service
|
141
153
|
------------------
|
142
154
|
|
@@ -144,6 +156,8 @@ You can delete services from your cave.
|
|
144
156
|
|
145
157
|
```
|
146
158
|
> delete google pazu@kranzky.com
|
159
|
+
🧞 - "These magic words for pazy@kranzky.com of google are no more..."
|
160
|
+
lazy cape green badge
|
147
161
|
```
|
148
162
|
|
149
163
|
Recovering a Lost Cave
|
@@ -167,25 +181,26 @@ Run with the `--help` argument to view all options.
|
|
167
181
|
$ sesame --help
|
168
182
|
usage: ./bin/sesame [options]
|
169
183
|
-p, --path the path to the sesame cave; overrides $SESAME_PATH and .sesamerc
|
170
|
-
-
|
171
|
-
-u, --user the username for the given service (e.g. user@test.com)
|
172
|
-
-o, --offset the password index for the service and username (defaults to 0)
|
184
|
+
-q, --quiet silence the welcome banner and the jinn
|
173
185
|
-e, --echo display passwords in plain text instead of adding to the clipboard
|
174
|
-
-i, --interactive launch an interactive cli, allowing commands to be issued
|
175
186
|
-r, --reconstruct reconstruct a sesame cave from an existing passphrase
|
176
|
-
-
|
187
|
+
-k, --lock create a temporary lock; no passphrase required on next run
|
188
|
+
-x, --expunge remove the temporary lock; full passphrase required on next run
|
189
|
+
-i, --interactive launch an interactive cli, allowing commands to be issued
|
177
190
|
-c, --command the command to execute; one of: list, get, add, next, delete
|
178
191
|
-l, --list show all services and usernames
|
179
192
|
-a, --add add a new service and username
|
180
|
-
-g, --get get the
|
181
|
-
-n, --next generate a new password for
|
193
|
+
-g, --get get the password for a service and username
|
194
|
+
-n, --next generate a new password for a service and username
|
182
195
|
-d, --delete remove an existing service and username
|
183
|
-
-
|
196
|
+
-s, --service the name of the service (e.g. Facebook)
|
197
|
+
-u, --user the username for the service (e.g. user@test.com)
|
198
|
+
-o, --offset the password offset to use (overrides current)
|
184
199
|
-v, --version print the version and exit
|
185
200
|
-h, --help all of that up there ^
|
186
201
|
```
|
187
202
|
|
188
|
-
You can issue commands directly,
|
203
|
+
You can issue commands directly, rather than running in interactive mode.
|
189
204
|
|
190
205
|
```
|
191
206
|
$ sesame -qegs twitter
|
@@ -205,15 +220,14 @@ stored.
|
|
205
220
|
|
206
221
|
Sesame will also look for a file named `.sesamerc` or `sesame.cfg` in the
|
207
222
|
current directory and in your home directory. This file should be in the JSON
|
208
|
-
format, and can specify the `path`, `
|
209
|
-
example
|
223
|
+
format, and can specify the `path`, `echo`, `interactive` and `quiet` options.
|
224
|
+
For example:
|
210
225
|
|
211
226
|
```
|
212
227
|
{
|
213
228
|
"path": "~/Dropbox",
|
214
|
-
"
|
215
|
-
"
|
216
|
-
"quiet": "true"
|
229
|
+
"interactive": false,
|
230
|
+
"quiet": true
|
217
231
|
}
|
218
232
|
```
|
219
233
|
|
data/Rakefile
CHANGED
@@ -1,28 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'bundler'
|
5
5
|
begin
|
6
6
|
Bundler.setup(:default, :development)
|
7
7
|
rescue Bundler::BundlerError => e
|
8
|
-
|
9
|
-
|
8
|
+
warn e.message
|
9
|
+
warn 'Run `bundle install` to install missing gems'
|
10
10
|
exit e.status_code
|
11
11
|
end
|
12
12
|
require 'rake'
|
13
13
|
|
14
14
|
require 'jeweler'
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
|
-
|
17
|
-
gem.
|
18
|
-
gem.
|
19
|
-
gem.
|
20
|
-
gem.
|
21
|
-
gem.
|
22
|
-
gem.
|
23
|
-
gem.
|
24
|
-
gem.required_ruby_version = "~> 2.1"
|
25
|
-
# dependencies defined in Gemfile
|
16
|
+
gem.name = 'sesame-cli'
|
17
|
+
gem.homepage = 'http://github.com/kranzky/sesame-cli'
|
18
|
+
gem.license = 'UNLICENSE'
|
19
|
+
gem.summary = %(🧞 - "Sesame is a simple password manager for the command-line!")
|
20
|
+
gem.description = %(🧞 - "Sesame is a simple password manager for the command-line!")
|
21
|
+
gem.email = 'jasonhutchens@gmail.com'
|
22
|
+
gem.authors = ['Jason Hutchens', 'Jack Casey']
|
23
|
+
gem.required_ruby_version = '~> 2.1'
|
26
24
|
end
|
27
25
|
Jeweler::RubygemsDotOrgTasks.new
|
28
26
|
|
@@ -32,13 +30,13 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
32
30
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
31
|
end
|
34
32
|
|
35
|
-
desc
|
33
|
+
desc 'Code coverage detail'
|
36
34
|
task :simplecov do
|
37
|
-
ENV['COVERAGE'] =
|
35
|
+
ENV['COVERAGE'] = 'true'
|
38
36
|
Rake::Task['spec'].execute
|
39
37
|
end
|
40
38
|
|
41
|
-
task :
|
39
|
+
task default: :spec
|
42
40
|
|
43
41
|
require 'yard'
|
44
42
|
YARD::Rake::YardocTask.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/sesame
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'sesame'
|
4
5
|
require 'slop'
|
@@ -7,20 +8,21 @@ opts =
|
|
7
8
|
begin
|
8
9
|
Slop.parse do |o|
|
9
10
|
o.string '-p', '--path', 'the path to the sesame cave; overrides $SESAME_PATH and .sesamerc'
|
10
|
-
o.
|
11
|
-
o.string '-u', '--user', 'the username for the given service (e.g. user@test.com)'
|
12
|
-
o.integer '-o', '--offset', 'the password index for the service and username (defaults to 0)'
|
11
|
+
o.bool '-q', '--quiet', 'silence the welcome banner and the jinn'
|
13
12
|
o.bool '-e', '--echo', 'display passwords in plain text instead of adding to the clipboard'
|
14
|
-
o.bool '-i', '--interactive', 'launch an interactive cli, allowing commands to be issued'
|
15
13
|
o.bool '-r', '--reconstruct', 'reconstruct a sesame cave from an existing passphrase'
|
16
|
-
o.bool '-
|
14
|
+
o.bool '-k', '--lock', 'create a temporary lock; no passphrase required on next run'
|
15
|
+
o.bool '-x', '--expunge', 'remove the temporary lock; full passphrase required on next run'
|
16
|
+
o.bool '-i', '--interactive', 'launch an interactive cli, allowing commands to be issued'
|
17
17
|
o.string '-c', '--command', 'the command to execute; one of: list, get, add, next, delete'
|
18
18
|
o.bool '-l', '--list', 'show all services and usernames'
|
19
19
|
o.bool '-a', '--add', 'add a new service and username'
|
20
|
-
o.bool '-g', '--get', 'get the
|
21
|
-
o.bool '-n', '--next', 'generate a new password for
|
20
|
+
o.bool '-g', '--get', 'get the password for a service and username'
|
21
|
+
o.bool '-n', '--next', 'generate a new password for a service and username'
|
22
22
|
o.bool '-d', '--delete', 'remove an existing service and username'
|
23
|
-
o.
|
23
|
+
o.string '-s', '--service', 'the name of the service (e.g. Facebook)'
|
24
|
+
o.string '-u', '--user', 'the username for the service (e.g. user@test.com)'
|
25
|
+
o.integer '-o', '--offset', 'the password offset to use (overrides current)'
|
24
26
|
o.on '-v', '--version', 'print the version and exit' do
|
25
27
|
say(File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')))
|
26
28
|
exit
|
@@ -31,10 +33,10 @@ opts =
|
|
31
33
|
end
|
32
34
|
end
|
33
35
|
rescue Slop::Error => e
|
34
|
-
say(e.message +
|
36
|
+
say(e.message + ' (try --help)')
|
35
37
|
exit 1
|
36
38
|
end
|
37
|
-
if opts.arguments.count
|
39
|
+
if opts.arguments.count.positive?
|
38
40
|
say("extraneous arguments: #{opts.arguments.join(' ')} (try --help)")
|
39
41
|
exit 1
|
40
42
|
end
|