leeloo 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 236ca14fba0124365c37165ecd103e9342bc8c981ef4ed23bbf4afb73752e7b4
4
- data.tar.gz: 53d104d94f393fb44e2532f7e59b91164461b14710d504b71730d5a8e549c8d9
3
+ metadata.gz: dd35144ab160594e6b4c3d05ea7eeaf175cc99fb79fc3b93cea31000df120ab3
4
+ data.tar.gz: 32537a5e8670c43d6463e1d713a61f49a7601d435957ecd98eeaf48c2a8658bd
5
5
  SHA512:
6
- metadata.gz: 82d0d1f608c8adece27b0ff8e40c6eb01a953b1d46cdc3e28f7bfa86031a73b4989f11c9519491b6a9c1db7b3a05bd8d15f32ddb3b42aad805652fd459bb115a
7
- data.tar.gz: 12b643a433090504e471723ed2aa519c4aee77f5fb70151a9766f78a7f62b52b6db909b6c377a3cb4762fb2959b93ea5715fbe42887e782353cc68f4a0674aca
6
+ metadata.gz: 8469474876e92a015bce39b25cfc418c1f9d55b763b8de44763121eb4e379c64716c43b2fd2789c536cf0a8891e828e0c1782519ae3d549054f8527a2bd2c50a
7
+ data.tar.gz: d98949b84ac056b71302f038748da0ad6986a81af3a63fad52b73c7db204c91d87e8cd4b4b6db02c4049e379a9817278b77d453bf04b53f6f46089317e12c907
@@ -43,6 +43,11 @@ module Leeloo
43
43
  end
44
44
  end
45
45
 
46
+ command :init do |c|
47
+ c.syntax = 'leeloo init'
48
+ c.description = "Just to be compatible with passwordstore.org"
49
+ end
50
+
46
51
  command :list do |c|
47
52
  c.syntax = 'leeloo list [options]'
48
53
  c.description = "Display secrets list of stored on a keystore"
@@ -79,7 +84,7 @@ module Leeloo
79
84
  end
80
85
  end
81
86
 
82
- command "keystore remove" do |c|
87
+ command :"keystore remove" do |c|
83
88
  c.syntax = 'leeloo keystore remove <name>'
84
89
  c.description = "remove a keystore (path/to/keystore is not destroyed)"
85
90
 
@@ -92,7 +97,7 @@ module Leeloo
92
97
  end
93
98
  end
94
99
 
95
- command "keystore add" do |c|
100
+ command :"keystore add" do |c|
96
101
  c.syntax = 'leeloo keystore add <name> <path/to/keystore>'
97
102
  c.description = "add a keystore"
98
103
 
@@ -106,7 +111,7 @@ module Leeloo
106
111
  end
107
112
  end
108
113
 
109
- command "keystore default" do |c|
114
+ command :"keystore default" do |c|
110
115
  c.syntax = 'leeloo keystore default name'
111
116
  c.description = "set the default keystore"
112
117
 
@@ -131,7 +136,7 @@ module Leeloo
131
136
  end
132
137
  end
133
138
 
134
- command "key sync" do |c|
139
+ command :"key sync" do |c|
135
140
  c.syntax = 'leeloo keys sync'
136
141
  c.description = "synchronize secrets with keys"
137
142
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -143,7 +148,7 @@ module Leeloo
143
148
  end
144
149
  end
145
150
 
146
- command "key add" do |c|
151
+ command :"key add" do |c|
147
152
  c.syntax = 'leeloo key add <email>'
148
153
  c.description = "add a dedicated key"
149
154
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -157,7 +162,7 @@ module Leeloo
157
162
  end
158
163
  end
159
164
 
160
- command "key remove" do |c|
165
+ command :"key remove" do |c|
161
166
  c.syntax = 'leeloo key remove <email>'
162
167
  c.description = "remove a dedicated key"
163
168
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -202,6 +207,23 @@ module Leeloo
202
207
  ctl.display
203
208
  end
204
209
  end
210
+ alias_command :insert, :write
211
+
212
+ command :generate do |c|
213
+ c.syntax = 'leeloo generate <name> <number of randomized characters>'
214
+ c.description = "Generate a secret from a keystore"
215
+ c.option '--keystore STRING', String, 'a selected keystore'
216
+ c.option '--clipboard', nil, 'copy to clipboard'
217
+
218
+ c.action do |args, options|
219
+ abort "name or number are missing" unless args.length == 2
220
+ name = args.first
221
+ options.__hash__[:generate] = args.last.to_i
222
+ ctl = SecretController.new(options)
223
+ ctl.write(name)
224
+ ctl.display
225
+ end
226
+ end
205
227
 
206
228
  command :translate do |c|
207
229
  c.syntax = 'leeloo translate'
@@ -229,8 +251,9 @@ module Leeloo
229
251
  puts "done."
230
252
  end
231
253
  end
254
+ alias_command :rm, :remove
232
255
 
233
- command "keystore sync" do |c|
256
+ command :"keystore sync" do |c|
234
257
  c.syntax = 'leeloo sync'
235
258
  c.description = "Synchronize a keystore"
236
259
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -242,7 +265,7 @@ module Leeloo
242
265
  end
243
266
  end
244
267
 
245
- command "keystore export" do |c|
268
+ command :"keystore export" do |c|
246
269
  c.syntax = 'leeloo export'
247
270
  c.description = "Export all secrets from a keystore"
248
271
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -253,7 +276,7 @@ module Leeloo
253
276
  end
254
277
  end
255
278
 
256
- command "keystore init" do |c|
279
+ command :"keystore init" do |c|
257
280
  c.syntax = 'leeloo init'
258
281
  c.description = "Initialize a keystore"
259
282
  c.option '--keystore STRING', String, 'a selected keystore'
@@ -83,8 +83,8 @@ module Leeloo
83
83
  phrase = SecureRandom.base64(32).truncate(@options.generate.to_i) if @options.generate
84
84
 
85
85
  unless phrase
86
- phrase = password "secret"
87
- confirm = password "confirm it"
86
+ phrase = password "Enter password for #{name}"
87
+ confirm = password "Confirm it"
88
88
  abort "not the same secret" unless phrase == confirm
89
89
  end
90
90
 
@@ -72,6 +72,7 @@ module Leeloo
72
72
  def initialize name, path
73
73
  super name
74
74
  @path = path
75
+ FileUtils.touch "#{@path}/.gpg-id"
75
76
  FileUtils.mkdir_p "#{@path}/secrets"
76
77
  end
77
78
 
@@ -1,4 +1,4 @@
1
1
  module Leeloo
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.5.2'.freeze
3
3
  DESCRIPTION = "The easiest way to share securely your secrets".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leeloo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sylvek