leeloo 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/leeloo/command.rb +20 -4
- data/lib/leeloo/config.rb +0 -1
- data/lib/leeloo/keystore.rb +0 -2
- data/lib/leeloo/secret.rb +1 -5
- data/lib/leeloo/version.rb +1 -1
- metadata +29 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a71ff0f147184d98a7f954f587008bf7126e4d01
|
4
|
+
data.tar.gz: 01043110f55a3eb80bcf7af3666b0b42462f59cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187671978bdf140b3d9288341f30e88275ccc4771a34ad290ed51eda6c5ebfe59e6daddfc9057c1f1330a0999a6dac30c3c35822d97a899f0fdb02f378c99393
|
7
|
+
data.tar.gz: b781a38102ce27b6d9e851d99e7031f9a9faee7f348b229e26e52809d49db6d345e78a4900c525ad02a86043eab59b135771c59d7e8d9b3f22af6ed2e6c8df59
|
data/lib/leeloo/command.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'commander/import'
|
2
2
|
require 'securerandom'
|
3
|
+
require 'clipboard'
|
3
4
|
|
4
5
|
module Leeloo
|
5
6
|
class Command
|
@@ -16,7 +17,7 @@ module Leeloo
|
|
16
17
|
program :help, 'GitHub', 'https://github.com/sylvek'
|
17
18
|
program :help_formatter, :compact
|
18
19
|
|
19
|
-
default_command :list
|
20
|
+
default_command :"list keystore"
|
20
21
|
|
21
22
|
command :"init" do |c|
|
22
23
|
c.syntax = 'leeloo init'
|
@@ -24,10 +25,11 @@ module Leeloo
|
|
24
25
|
c.action do |args, options|
|
25
26
|
|
26
27
|
Config::init
|
28
|
+
say "Initialization completed"
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
30
|
-
command :"list" do |c|
|
32
|
+
command :"list keystore" do |c|
|
31
33
|
c.syntax = 'leeloo list'
|
32
34
|
c.description = "Display keystores list"
|
33
35
|
c.action do |args, options|
|
@@ -46,6 +48,7 @@ module Leeloo
|
|
46
48
|
Secret::list Config.get_keystore(options.keystore)
|
47
49
|
end
|
48
50
|
end
|
51
|
+
alias_command :list, :"list secret"
|
49
52
|
|
50
53
|
command :"add keystore" do |c|
|
51
54
|
c.syntax = 'leeloo add keystore <name> <path>'
|
@@ -59,10 +62,11 @@ module Leeloo
|
|
59
62
|
|
60
63
|
Keystore.add_keystore name, keystore
|
61
64
|
Config.add_keystore name, keystore
|
65
|
+
say "keystore #{name} added"
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
65
|
-
command :"sync
|
69
|
+
command :"sync secret" do |c|
|
66
70
|
c.syntax = 'leeloo recrypt secrets'
|
67
71
|
c.description = "(re)sync all secrets from a given keystore (private by default)"
|
68
72
|
c.option '--keystore STRING', String, 'a selected keystore'
|
@@ -70,8 +74,10 @@ module Leeloo
|
|
70
74
|
c.action do |args, options|
|
71
75
|
options.default :keystore => 'private'
|
72
76
|
Secret.sync_secrets Config.get_keystore(options.keystore)
|
77
|
+
say "keystore synced successfully"
|
73
78
|
end
|
74
79
|
end
|
80
|
+
alias_command :sync, :"sync secret"
|
75
81
|
|
76
82
|
command :"add secret" do |c|
|
77
83
|
c.syntax = 'leeloo add secret <name>'
|
@@ -79,6 +85,7 @@ module Leeloo
|
|
79
85
|
c.option '--keystore STRING', String, 'a selected keystore'
|
80
86
|
c.option '--generate INTEGER', Integer, 'a number of randomized characters'
|
81
87
|
c.option '--stdin', nil, 'secret given by stdin pipe'
|
88
|
+
c.option '--clipboard', nil, 'copy to clipboard'
|
82
89
|
|
83
90
|
c.action do |args, options|
|
84
91
|
abort "name is missing" unless args.length == 1
|
@@ -98,13 +105,18 @@ module Leeloo
|
|
98
105
|
end
|
99
106
|
|
100
107
|
Secret.add_secret keystore, name, secret
|
108
|
+
say "#{name} added successfully"
|
109
|
+
Clipboard.copy secret if options.clipboard
|
101
110
|
end
|
102
111
|
end
|
112
|
+
alias_command :add, :"add secret"
|
113
|
+
alias_command :insert, :"add secret"
|
103
114
|
|
104
115
|
command :"read secret" do |c|
|
105
116
|
c.syntax = 'leeloo read secret <name>'
|
106
117
|
c.description = "Display a secret from a keystore (private by default)"
|
107
118
|
c.option '--keystore STRING', String, 'a selected keystore'
|
119
|
+
c.option '--clipboard', nil, 'copy to clipboard'
|
108
120
|
|
109
121
|
c.action do |args, options|
|
110
122
|
abort "name is missing" unless args.length == 1
|
@@ -113,8 +125,12 @@ module Leeloo
|
|
113
125
|
options.default :keystore => 'private'
|
114
126
|
keystore = Config.get_keystore(options.keystore)
|
115
127
|
|
116
|
-
Secret.read_secret keystore, name
|
128
|
+
secret = Secret.read_secret keystore, name
|
129
|
+
say secret unless options.clipboard
|
130
|
+
Clipboard.copy secret if options.clipboard
|
117
131
|
end
|
132
|
+
alias_command :read, :"read secret"
|
133
|
+
alias_command :get, :"read secret"
|
118
134
|
end
|
119
135
|
end
|
120
136
|
end
|
data/lib/leeloo/config.rb
CHANGED
data/lib/leeloo/keystore.rb
CHANGED
data/lib/leeloo/secret.rb
CHANGED
@@ -24,13 +24,11 @@ module Leeloo
|
|
24
24
|
g = Git.open keystore
|
25
25
|
g.add "#{keystore}/secrets/#{name}"
|
26
26
|
g.commit "secret #{name} added"
|
27
|
-
|
28
|
-
say "#{name} added successfully"
|
29
27
|
end
|
30
28
|
|
31
29
|
def self.read_secret(keystore, name)
|
32
30
|
crypto = GPGME::Crypto.new
|
33
|
-
|
31
|
+
crypto.decrypt File.open("#{keystore}/secrets/#{name}")
|
34
32
|
end
|
35
33
|
|
36
34
|
def self.sync_secrets keystore
|
@@ -56,8 +54,6 @@ module Leeloo
|
|
56
54
|
end
|
57
55
|
|
58
56
|
g.commit "sync"
|
59
|
-
|
60
|
-
say "keystore synced successfully"
|
61
57
|
end
|
62
58
|
|
63
59
|
def self.find_secrets path
|
data/lib/leeloo/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvek
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: clipboard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: ffi
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.9'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.9'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: bundler
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|