trocla 0.0.12 → 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/Gemfile +17 -5
- data/README.md +56 -1
- data/bin/trocla +10 -2
- data/lib/VERSION +2 -2
- data/lib/trocla.rb +30 -13
- data/lib/trocla/encryptions.rb +53 -0
- data/lib/trocla/encryptions/none.rb +10 -0
- data/lib/trocla/encryptions/ssl.rb +48 -0
- data/lib/trocla/util.rb +7 -1
- data/spec/spec_helper.rb +40 -0
- data/spec/trocla/encryptions/ssl_spec.rb +53 -0
- data/spec/trocla_spec.rb +7 -7
- data/trocla.gemspec +16 -13
- metadata +21 -18
- data/Gemfile.lock +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ad3b2b69741ce17e589140b7090df303bdaf47
|
4
|
+
data.tar.gz: 591f3017a167c65b611efb10f8df06697b3988d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5020ec59b39e4e260955a9b8b3bd54bdd1c018c4fc3223f098130179a50d924fc1a4aad542895c92990170444d227a92d2f225b522be259973a3f2a570857c7
|
7
|
+
data.tar.gz: 619b079e82c5e251ff61e0791245ea43adc139aa1d7e32f543acb6185faae8c5dc4fe30befb2a8c8997c9f979ca0ffa9e8369670117b10f3c0deaf24bcf6e230
|
data/Gemfile
CHANGED
@@ -3,15 +3,27 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
|
7
|
-
gem "
|
6
|
+
if RUBY_VERSION.to_f > 1.8
|
7
|
+
gem "moneta"
|
8
|
+
gem "highline"
|
9
|
+
else
|
10
|
+
gem "moneta", "~> 0.7.20"
|
11
|
+
gem "highline", "~> 1.6.2"
|
12
|
+
end
|
13
|
+
|
8
14
|
gem "bcrypt"
|
9
15
|
|
10
16
|
# Add dependencies to develop your gem here.
|
11
17
|
# Include everything needed to run rake, tests, features, etc.
|
12
18
|
group :development do
|
13
|
-
gem "rspec", "~> 2.4"
|
14
|
-
gem "rdoc", "~> 3.8"
|
15
19
|
gem "mocha"
|
16
|
-
|
20
|
+
if RUBY_VERSION.to_f > 1.8
|
21
|
+
gem "rspec"
|
22
|
+
gem "rdoc"
|
23
|
+
gem "jeweler"
|
24
|
+
else
|
25
|
+
gem "rspec", "~> 2.4"
|
26
|
+
gem "rdoc", "~> 3.8"
|
27
|
+
gem "jeweler", "~> 1.6"
|
28
|
+
end
|
17
29
|
end
|
data/README.md
CHANGED
@@ -57,6 +57,17 @@ You can pass these additional requirements as yaml-based strings to the format:
|
|
57
57
|
|
58
58
|
This will create a pgsql password hash using the username user1.
|
59
59
|
|
60
|
+
Valid global options are:
|
61
|
+
|
62
|
+
* length: int - Define any lenght that a newly created password should have. Default: 12 - or whatever you define in your global settings.
|
63
|
+
* charset: (default|alphanumeric|shellsafe) - Which set of chars should be used for a random password? Default: default - or whatever you define in your global settings.
|
64
|
+
|
65
|
+
Example:
|
66
|
+
|
67
|
+
trocla create some_shellsafe_password plain 'charset: shellsafe'
|
68
|
+
trocla create another_alphanumeric_20_char_password plain "charset: alphanumeric
|
69
|
+
length: 20"
|
70
|
+
|
60
71
|
### get
|
61
72
|
|
62
73
|
Get simply returns a stored password. It will not create a new password.
|
@@ -125,8 +136,52 @@ to address.
|
|
125
136
|
|
126
137
|
Simply build and install the gem.
|
127
138
|
|
139
|
+
## Configuration
|
140
|
+
|
141
|
+
Trocla can be configured in /etc/troclarc.yaml and in ~/.troclarc.yaml. A sample configuration file can be found in `lib/trocla/default_config.yaml`.
|
142
|
+
|
143
|
+
### Storage backends
|
144
|
+
|
145
|
+
Trocla can store your passwords in all backends supported by moneta. A simple YAML file configuration may look as follows:
|
146
|
+
|
147
|
+
```YAML
|
148
|
+
adapter: :YAML
|
149
|
+
adapter_options:
|
150
|
+
:file: '/tmp/trocla.yaml'
|
151
|
+
```
|
152
|
+
|
153
|
+
In environments with multiple Puppet masters using an existing DB cluster might make sense. The configured user needs to be granted at least SELECT, INSERT, UPDATE, DELETE and CREATE permissions on your database:
|
154
|
+
|
155
|
+
```YAML
|
156
|
+
adapter: :Sequel
|
157
|
+
adapter_options:
|
158
|
+
:db: 'mysql://db.server.name'
|
159
|
+
:user: 'trocla'
|
160
|
+
:password: '***'
|
161
|
+
:database: 'trocladb'
|
162
|
+
:table: 'trocla'
|
163
|
+
```
|
164
|
+
|
165
|
+
These examples are by no way complete, moneta has much more to offer.
|
166
|
+
|
167
|
+
### SSL encryption
|
168
|
+
|
169
|
+
You might want to let Trocla encrypt all your passwords
|
170
|
+
|
171
|
+
```YAML
|
172
|
+
encryption: :ssl
|
173
|
+
ssl_options:
|
174
|
+
:private_key: '/var/lib/puppet/ssl/private_keys/trocla.pem'
|
175
|
+
:public_key: '/var/lib/puppet/ssl/public_keys/trocla.pem'
|
176
|
+
```
|
177
|
+
|
128
178
|
## Update & Changes
|
129
179
|
|
180
|
+
### to 0.1.0
|
181
|
+
|
182
|
+
1. Supporting encryption of the backends. Many thanks to Thomas Gelf
|
183
|
+
1. Adding a windows safe password charset
|
184
|
+
|
130
185
|
### to 0.0.12
|
131
186
|
|
132
187
|
1. change from sha1 signature for the x509 format to sha2
|
@@ -152,6 +207,6 @@ Simply build and install the gem.
|
|
152
207
|
|
153
208
|
## Copyright
|
154
209
|
|
155
|
-
Copyright (c)
|
210
|
+
Copyright (c) 2015 mh. See LICENSE.txt for
|
156
211
|
further details.
|
157
212
|
|
data/bin/trocla
CHANGED
@@ -6,7 +6,7 @@ require 'trocla'
|
|
6
6
|
require 'optparse'
|
7
7
|
require 'yaml'
|
8
8
|
|
9
|
-
options = { :config_file => nil, :ask_password => true }
|
9
|
+
options = { :config_file => nil, :ask_password => true, :trace => false }
|
10
10
|
|
11
11
|
OptionParser.new do |opts|
|
12
12
|
opts.on("--version", "-V", "Version information") do
|
@@ -23,6 +23,10 @@ OptionParser.new do |opts|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
opts.on("--trace", "Show stack trace on failure") do
|
27
|
+
options[:trace] = true
|
28
|
+
end
|
29
|
+
|
26
30
|
opts.on("--no-random") do
|
27
31
|
options['random'] = false
|
28
32
|
end
|
@@ -111,7 +115,11 @@ if !(ARGV.length < 2) && (action=ARGV.shift) && actions.include?(action)
|
|
111
115
|
puts result.is_a?(String) ? result : result.inspect
|
112
116
|
end
|
113
117
|
rescue Exception => e
|
114
|
-
|
118
|
+
unless e.message == 'exit'
|
119
|
+
STDERR.puts "Action failed with the following message: #{e.message}"
|
120
|
+
STDERR.puts "(See full trace by running task with --trace)"
|
121
|
+
end
|
122
|
+
raise e if options[:trace]
|
115
123
|
exit 1
|
116
124
|
end
|
117
125
|
else
|
data/lib/VERSION
CHANGED
data/lib/trocla.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'trocla/version'
|
2
2
|
require 'trocla/util'
|
3
3
|
require 'trocla/formats'
|
4
|
+
require 'trocla/encryptions'
|
4
5
|
|
5
6
|
class Trocla
|
6
7
|
|
@@ -30,8 +31,8 @@ class Trocla
|
|
30
31
|
set_password(key,format,self.formats(format).format(plain_pwd,options))
|
31
32
|
end
|
32
33
|
|
33
|
-
def get_password(key,format)
|
34
|
-
cache.fetch(key,{})[format]
|
34
|
+
def get_password(key, format)
|
35
|
+
decrypt(cache.fetch(key, {})[format])
|
35
36
|
end
|
36
37
|
|
37
38
|
def reset_password(key,format,options={})
|
@@ -41,27 +42,38 @@ class Trocla
|
|
41
42
|
|
42
43
|
def delete_password(key,format=nil)
|
43
44
|
if format.nil?
|
44
|
-
cache.delete(key)
|
45
|
+
decrypt(cache.delete(key))
|
45
46
|
else
|
46
47
|
old_val = (h = cache.fetch(key,{})).delete(format)
|
47
48
|
h.empty? ? cache.delete(key) : cache[key] = h
|
48
|
-
old_val
|
49
|
+
decrypt(old_val)
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
53
|
def set_password(key,format,password)
|
53
54
|
if (format == 'plain')
|
54
|
-
h = (cache[key] = { 'plain' => password })
|
55
|
+
h = (cache[key] = { 'plain' => encrypt(password) })
|
55
56
|
else
|
56
|
-
h = (cache[key] = cache.fetch(key,{}).merge({ format => password }))
|
57
|
+
h = (cache[key] = cache.fetch(key,{}).merge({ format => encrypt(password) }))
|
57
58
|
end
|
58
|
-
h[format]
|
59
|
+
decrypt h[format]
|
59
60
|
end
|
60
61
|
|
61
62
|
def formats(format)
|
62
63
|
(@format_cache||={})[format] ||= Trocla::Formats[format].new(self)
|
63
64
|
end
|
64
65
|
|
66
|
+
def encryption
|
67
|
+
enc = config['encryption']
|
68
|
+
enc ||= :none
|
69
|
+
@encryption ||= Trocla::Encryptions[enc].new(self)
|
70
|
+
@encryption
|
71
|
+
end
|
72
|
+
|
73
|
+
def config
|
74
|
+
@config ||= read_config
|
75
|
+
end
|
76
|
+
|
65
77
|
private
|
66
78
|
def cache
|
67
79
|
@cache ||= build_cache
|
@@ -73,10 +85,6 @@ class Trocla
|
|
73
85
|
Moneta.new(lconfig['adapter'], lconfig['adapter_options']||{})
|
74
86
|
end
|
75
87
|
|
76
|
-
def config
|
77
|
-
@config ||= read_config
|
78
|
-
end
|
79
|
-
|
80
88
|
def read_config
|
81
89
|
if @config_file.nil?
|
82
90
|
default_config
|
@@ -86,9 +94,18 @@ class Trocla
|
|
86
94
|
end
|
87
95
|
end
|
88
96
|
|
97
|
+
def encrypt(value)
|
98
|
+
encryption.encrypt(value)
|
99
|
+
end
|
100
|
+
|
101
|
+
def decrypt(value)
|
102
|
+
return nil if value.nil?
|
103
|
+
encryption.decrypt(value)
|
104
|
+
end
|
105
|
+
|
89
106
|
def default_config
|
90
|
-
|
91
|
-
|
107
|
+
require 'yaml'
|
108
|
+
YAML.load(File.read(File.expand_path(File.join(File.dirname(__FILE__),'trocla','default_config.yaml'))))
|
92
109
|
end
|
93
110
|
|
94
111
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
class Trocla::Encryptions
|
2
|
+
|
3
|
+
class Base
|
4
|
+
attr_reader :trocla
|
5
|
+
def initialize(trocla)
|
6
|
+
@trocla = trocla
|
7
|
+
end
|
8
|
+
|
9
|
+
def encrypt(value)
|
10
|
+
raise NoMethodError.new("#{self.class.name} needs to implement 'encrypt()'")
|
11
|
+
end
|
12
|
+
|
13
|
+
def decrypt(value)
|
14
|
+
raise NoMethodError.new("#{self.class.name} needs to implement 'decrypt()'")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class << self
|
19
|
+
def [](enc)
|
20
|
+
encryptions[enc.to_s.downcase]
|
21
|
+
end
|
22
|
+
|
23
|
+
def all
|
24
|
+
Dir[ path '*' ].collect do |enc|
|
25
|
+
File.basename(enc, '.rb').downcase
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def available?(encryption)
|
30
|
+
all.include?(encryption.to_s.downcase)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
def encryptions
|
35
|
+
@@encryptions ||= Hash.new do |hash, encryption|
|
36
|
+
encryption = encryption.to_s.downcase
|
37
|
+
if File.exists?( path encryption )
|
38
|
+
require "trocla/encryptions/#{encryption}"
|
39
|
+
class_name = "Trocla::Encryptions::#{encryption.capitalize}"
|
40
|
+
hash[encryption] = (eval class_name)
|
41
|
+
else
|
42
|
+
raise "Encryption #{encryption} is not supported!"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def path(encryption)
|
48
|
+
File.expand_path(
|
49
|
+
File.join(File.dirname(__FILE__), 'encryptions', "#{encryption}.rb")
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
require 'base64'
|
3
|
+
|
4
|
+
class Trocla::Encryptions::Ssl < Trocla::Encryptions::Base
|
5
|
+
def encrypt(value)
|
6
|
+
if option :use_base64
|
7
|
+
Base64.encode64(public_key.public_encrypt(value))
|
8
|
+
else
|
9
|
+
public_key.public_encrypt(value)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def decrypt(value)
|
14
|
+
if option :use_base64
|
15
|
+
private_key.private_decrypt(Base64.decode64(value))
|
16
|
+
else
|
17
|
+
private_key.private_decrypt(value)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def private_key
|
23
|
+
pass = nil
|
24
|
+
file = require_option(:private_key)
|
25
|
+
@private_key ||= OpenSSL::PKey::RSA.new(File.read(file), nil)
|
26
|
+
end
|
27
|
+
|
28
|
+
def public_key
|
29
|
+
file = require_option(:public_key)
|
30
|
+
@public_key ||= OpenSSL::PKey::RSA.new(File.read(file), nil)
|
31
|
+
end
|
32
|
+
|
33
|
+
def config
|
34
|
+
@config = @trocla.config['ssl_options']
|
35
|
+
@config ||= Hash.new
|
36
|
+
end
|
37
|
+
|
38
|
+
def option(key)
|
39
|
+
config[key]
|
40
|
+
end
|
41
|
+
|
42
|
+
def require_option(key)
|
43
|
+
val = option(key)
|
44
|
+
raise "Config error: 'ssl_options' => :#{key} is not defined" if val.nil?
|
45
|
+
val
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
data/lib/trocla/util.rb
CHANGED
@@ -4,7 +4,6 @@ class Trocla
|
|
4
4
|
class << self
|
5
5
|
def random_str(length=12, charset='default')
|
6
6
|
_charsets = charsets[charset] || charsets['default']
|
7
|
-
_charsets_size = _charsets_size
|
8
7
|
(1..length).collect{|a| _charsets[SecureRandom.random_number(_charsets.size)] }.join.to_s
|
9
8
|
end
|
10
9
|
|
@@ -20,6 +19,7 @@ class Trocla
|
|
20
19
|
'default' => chars,
|
21
20
|
'alphanumeric' => alphanumeric,
|
22
21
|
'shellsafe' => shellsafe,
|
22
|
+
'windowssafe' => windowssafe,
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
@@ -29,6 +29,9 @@ class Trocla
|
|
29
29
|
def shellsafe
|
30
30
|
@shellsafe ||= alphanumeric + shellsafe_chars
|
31
31
|
end
|
32
|
+
def windowssafe
|
33
|
+
@windowssafe ||= alphanumeric + windowssafe_chars
|
34
|
+
end
|
32
35
|
def alphanumeric
|
33
36
|
@alphanumeric ||= ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
|
34
37
|
end
|
@@ -38,6 +41,9 @@ class Trocla
|
|
38
41
|
def shellsafe_chars
|
39
42
|
@shellsafe_chars ||= "+%/@=?_.,:".split(//)
|
40
43
|
end
|
44
|
+
def windowssafe_chars
|
45
|
+
@windowssafe_chars ||= "+%/@=?_.,".split(//)
|
46
|
+
end
|
41
47
|
end
|
42
48
|
end
|
43
49
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
4
|
require 'mocha'
|
5
|
+
require 'yaml'
|
5
6
|
require 'trocla'
|
6
7
|
|
7
8
|
# Requires supporting files with custom matchers and macros, etc,
|
@@ -24,6 +25,45 @@ def test_config
|
|
24
25
|
@config
|
25
26
|
end
|
26
27
|
|
28
|
+
def ssl_test_config
|
29
|
+
return @ssl_config unless @ssl_config.nil?
|
30
|
+
@ssl_config = test_config
|
31
|
+
@ssl_config['encryption'] = :ssl
|
32
|
+
@ssl_config['ssl_options'] = {
|
33
|
+
:private_key => data_dir('trocla.key'),
|
34
|
+
:public_key => data_dir('trocla.pub')
|
35
|
+
}
|
36
|
+
@ssl_config['adapter'] = :YAML
|
37
|
+
@ssl_config['adapter_options'] = {
|
38
|
+
:file => trocla_yaml_file
|
39
|
+
}
|
40
|
+
@ssl_config
|
41
|
+
end
|
42
|
+
|
27
43
|
def base_dir
|
28
44
|
File.dirname(__FILE__)+'/../'
|
29
45
|
end
|
46
|
+
|
47
|
+
def data_dir(file = nil)
|
48
|
+
File.expand_path(File.join(base_dir, 'spec/data', file))
|
49
|
+
end
|
50
|
+
|
51
|
+
def trocla_yaml_file
|
52
|
+
data_dir('trocla_store.yaml')
|
53
|
+
end
|
54
|
+
|
55
|
+
def generate_ssl_keys
|
56
|
+
require 'openssl'
|
57
|
+
rsa_key = OpenSSL::PKey::RSA.new(4096)
|
58
|
+
File.open(data_dir('trocla.key'), 'w') { |f| f.write(rsa_key.to_pem) }
|
59
|
+
File.open(data_dir('trocla.pub'), 'w') { |f| f.write(rsa_key.public_key.to_pem) }
|
60
|
+
end
|
61
|
+
|
62
|
+
def remove_ssl_keys
|
63
|
+
File.unlink(data_dir('trocla.key'))
|
64
|
+
File.unlink(data_dir('trocla.pub'))
|
65
|
+
end
|
66
|
+
|
67
|
+
def remove_yaml_store
|
68
|
+
File.unlink(trocla_yaml_file)
|
69
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "Trocla::Encryptions::Ssl" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
generate_ssl_keys
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:all) do
|
10
|
+
remove_ssl_keys
|
11
|
+
end
|
12
|
+
|
13
|
+
before(:each) do
|
14
|
+
expect_any_instance_of(Trocla).to receive(:read_config).and_return(ssl_test_config)
|
15
|
+
@trocla = Trocla.new
|
16
|
+
end
|
17
|
+
|
18
|
+
after(:each) do
|
19
|
+
remove_yaml_store
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "encrypt" do
|
23
|
+
it "should be able to store random passwords" do
|
24
|
+
@trocla.password('random1', 'plain').length.should eql(12)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should be able to retrieve stored random passwords" do
|
28
|
+
stored = @trocla.password('random1', 'plain')
|
29
|
+
retrieved = @trocla.password('random1', 'plain')
|
30
|
+
retrieved_again = @trocla.password('random1', 'plain')
|
31
|
+
retrieved.should eql(stored)
|
32
|
+
retrieved_again.should eql(stored)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should be able to read encrypted passwords" do
|
36
|
+
@trocla.set_password('some_pass', 'plain', 'super secret')
|
37
|
+
@trocla.get_password('some_pass', 'plain').should eql('super secret')
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should not store plaintext passwords" do
|
41
|
+
@trocla.set_password('noplain', 'plain', 'plaintext_password')
|
42
|
+
File.readlines(trocla_yaml_file).grep(/plaintext_password/).should be_empty
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should make sure identical passwords do not match when stored" do
|
46
|
+
@trocla.set_password('one_key', 'plain', 'super secret')
|
47
|
+
@trocla.set_password('another_key', 'plain', 'super secret')
|
48
|
+
yaml = YAML.load_file(trocla_yaml_file)
|
49
|
+
yaml['one_key']['plain'].should_not eql(yaml['another_key']['plain'])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
data/spec/trocla_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe "Trocla" do
|
4
4
|
|
5
5
|
before(:each) do
|
6
|
-
Trocla.
|
6
|
+
expect_any_instance_of(Trocla).to receive(:read_config).and_return(test_config)
|
7
7
|
@trocla = Trocla.new
|
8
8
|
end
|
9
9
|
|
@@ -112,12 +112,6 @@ describe "Trocla" do
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
describe "VERSION" do
|
116
|
-
it "should return a version" do
|
117
|
-
Trocla::VERSION::STRING.should_not be_empty
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
115
|
def format_options
|
122
116
|
@format_options ||= Hash.new({}).merge({
|
123
117
|
'pgsql' => { 'username' => 'test' },
|
@@ -126,3 +120,9 @@ describe "Trocla" do
|
|
126
120
|
end
|
127
121
|
|
128
122
|
end
|
123
|
+
|
124
|
+
describe "VERSION" do
|
125
|
+
it "should return a version" do
|
126
|
+
Trocla::VERSION::STRING.should_not be_empty
|
127
|
+
end
|
128
|
+
end
|
data/trocla.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: trocla 0.0
|
5
|
+
# stub: trocla 0.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "trocla"
|
9
|
-
s.version = "0.0
|
9
|
+
s.version = "0.1.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["mh"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-03-21"
|
15
15
|
s.description = "Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival."
|
16
16
|
s.email = "mh+trocla@immerda.ch"
|
17
17
|
s.executables = ["trocla"]
|
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
|
|
24
24
|
".rspec",
|
25
25
|
".travis.yml",
|
26
26
|
"Gemfile",
|
27
|
-
"Gemfile.lock",
|
28
27
|
"LICENSE.txt",
|
29
28
|
"README.md",
|
30
29
|
"Rakefile",
|
@@ -32,6 +31,9 @@ Gem::Specification.new do |s|
|
|
32
31
|
"lib/VERSION",
|
33
32
|
"lib/trocla.rb",
|
34
33
|
"lib/trocla/default_config.yaml",
|
34
|
+
"lib/trocla/encryptions.rb",
|
35
|
+
"lib/trocla/encryptions/none.rb",
|
36
|
+
"lib/trocla/encryptions/ssl.rb",
|
35
37
|
"lib/trocla/formats.rb",
|
36
38
|
"lib/trocla/formats/bcrypt.rb",
|
37
39
|
"lib/trocla/formats/md5crypt.rb",
|
@@ -47,6 +49,7 @@ Gem::Specification.new do |s|
|
|
47
49
|
"lib/trocla/version.rb",
|
48
50
|
"spec/data/.keep",
|
49
51
|
"spec/spec_helper.rb",
|
52
|
+
"spec/trocla/encryptions/ssl_spec.rb",
|
50
53
|
"spec/trocla/util_spec.rb",
|
51
54
|
"spec/trocla_spec.rb",
|
52
55
|
"trocla.gemspec"
|
@@ -60,29 +63,29 @@ Gem::Specification.new do |s|
|
|
60
63
|
s.specification_version = 4
|
61
64
|
|
62
65
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
63
|
-
s.add_runtime_dependency(%q<moneta>, ["
|
66
|
+
s.add_runtime_dependency(%q<moneta>, [">= 0"])
|
64
67
|
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
65
68
|
s.add_runtime_dependency(%q<bcrypt>, [">= 0"])
|
66
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.4"])
|
67
|
-
s.add_development_dependency(%q<rdoc>, ["~> 3.8"])
|
68
69
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
70
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
71
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
69
72
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
70
73
|
else
|
71
|
-
s.add_dependency(%q<moneta>, ["
|
74
|
+
s.add_dependency(%q<moneta>, [">= 0"])
|
72
75
|
s.add_dependency(%q<highline>, [">= 0"])
|
73
76
|
s.add_dependency(%q<bcrypt>, [">= 0"])
|
74
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
75
|
-
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
76
77
|
s.add_dependency(%q<mocha>, [">= 0"])
|
78
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
79
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
77
80
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
78
81
|
end
|
79
82
|
else
|
80
|
-
s.add_dependency(%q<moneta>, ["
|
83
|
+
s.add_dependency(%q<moneta>, [">= 0"])
|
81
84
|
s.add_dependency(%q<highline>, [">= 0"])
|
82
85
|
s.add_dependency(%q<bcrypt>, [">= 0"])
|
83
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
84
|
-
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
85
86
|
s.add_dependency(%q<mocha>, [">= 0"])
|
87
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
88
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
86
89
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
87
90
|
end
|
88
91
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trocla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: moneta
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,35 +53,35 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rdoc
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -122,7 +122,6 @@ files:
|
|
122
122
|
- ".rspec"
|
123
123
|
- ".travis.yml"
|
124
124
|
- Gemfile
|
125
|
-
- Gemfile.lock
|
126
125
|
- LICENSE.txt
|
127
126
|
- README.md
|
128
127
|
- Rakefile
|
@@ -130,6 +129,9 @@ files:
|
|
130
129
|
- lib/VERSION
|
131
130
|
- lib/trocla.rb
|
132
131
|
- lib/trocla/default_config.yaml
|
132
|
+
- lib/trocla/encryptions.rb
|
133
|
+
- lib/trocla/encryptions/none.rb
|
134
|
+
- lib/trocla/encryptions/ssl.rb
|
133
135
|
- lib/trocla/formats.rb
|
134
136
|
- lib/trocla/formats/bcrypt.rb
|
135
137
|
- lib/trocla/formats/md5crypt.rb
|
@@ -145,6 +147,7 @@ files:
|
|
145
147
|
- lib/trocla/version.rb
|
146
148
|
- spec/data/.keep
|
147
149
|
- spec/spec_helper.rb
|
150
|
+
- spec/trocla/encryptions/ssl_spec.rb
|
148
151
|
- spec/trocla/util_spec.rb
|
149
152
|
- spec/trocla_spec.rb
|
150
153
|
- trocla.gemspec
|
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
bcrypt (3.1.7)
|
5
|
-
diff-lcs (1.1.3)
|
6
|
-
git (1.2.5)
|
7
|
-
highline (1.6.2)
|
8
|
-
jeweler (1.6.4)
|
9
|
-
bundler (~> 1.0)
|
10
|
-
git (>= 1.2.5)
|
11
|
-
rake
|
12
|
-
mocha (0.9.12)
|
13
|
-
moneta (0.7.20)
|
14
|
-
rake (0.9.2)
|
15
|
-
rdoc (3.8)
|
16
|
-
rspec (2.4.0)
|
17
|
-
rspec-core (~> 2.4.0)
|
18
|
-
rspec-expectations (~> 2.4.0)
|
19
|
-
rspec-mocks (~> 2.4.0)
|
20
|
-
rspec-core (2.4.0)
|
21
|
-
rspec-expectations (2.4.0)
|
22
|
-
diff-lcs (~> 1.1.2)
|
23
|
-
rspec-mocks (2.4.0)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
bcrypt
|
30
|
-
highline
|
31
|
-
jeweler
|
32
|
-
mocha
|
33
|
-
moneta (~> 0.7)
|
34
|
-
rdoc (~> 3.8)
|
35
|
-
rspec (~> 2.4)
|