trocla 0.0.9 → 0.0.10
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 +15 -0
- data/.travis.yml +2 -0
- data/Gemfile +4 -6
- data/Gemfile.lock +6 -9
- data/bin/trocla +3 -2
- data/lib/VERSION +1 -1
- data/lib/trocla/default_config.yaml +1 -0
- data/lib/trocla/formats/bcrypt.rb +1 -1
- data/lib/trocla/formats/md5crypt.rb +1 -1
- data/lib/trocla/formats/mysql.rb +2 -2
- data/lib/trocla/formats/pgsql.rb +1 -1
- data/lib/trocla/formats/plain.rb +2 -2
- data/lib/trocla/formats/sha1.rb +7 -0
- data/lib/trocla/formats/sha256crypt.rb +1 -1
- data/lib/trocla/formats/sha512crypt.rb +1 -1
- data/lib/trocla/formats/ssha.rb +1 -1
- data/lib/trocla/formats/x509.rb +128 -0
- data/lib/trocla/formats.rb +14 -6
- data/lib/trocla/util.rb +23 -7
- data/lib/trocla.rb +21 -17
- data/spec/trocla_spec.rb +2 -1
- data/trocla.gemspec +11 -14
- metadata +8 -57
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
M2RkMWM1NDdjNDY3MjU2YWEwZjM2YzA5YjYyOGQ5NjE5MTg2MmE2NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTQ5ZTZlYmM5NjcxZWYwNDRhZWZjZjk5NzJjYWUwNmNlZTAyNDgxYQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
Yzc5NTdkNzgyYmFlZmZlZjcyMWIxMzczY2JlODQ4MDY2NmIzZDMzYzcwN2I5
|
10
|
+
NTNiNTQ2ZjkyZmUwYjkzYzBkOTVhZTU2NjRkZTBiMTQxNjMwYTc4NGFjM2Rh
|
11
|
+
YThmYWE0YmY4NjYzNjM4ZTE3ZjE0YzgzYzRlYzUxZjlhMzhkNDU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YWFiNWFhMzU5MzQ1NmZmYTE4ZGJhOTNiOThlNmI2NzY3ZmZhOWZkMmRhYzE1
|
14
|
+
OTJmZDVmZDUzYmViMWFjNWZmMTQwZGZiZmRlYzMwNzc2YjM0Mjc1NTY2MmQx
|
15
|
+
ZTJiMDNmMmZjYjY2MTViNmFkM2FkMGY3ZmY1NzRiOGRhMTNmNDY=
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -3,17 +3,15 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
gem "moneta", "~> 0.7
|
6
|
+
gem "moneta", "~> 0.7"
|
7
7
|
gem "highline"
|
8
|
-
gem "bcrypt
|
8
|
+
gem "bcrypt"
|
9
9
|
|
10
10
|
# Add dependencies to develop your gem here.
|
11
11
|
# Include everything needed to run rake, tests, features, etc.
|
12
12
|
group :development do
|
13
|
-
gem "rspec", "~> 2.4
|
13
|
+
gem "rspec", "~> 2.4"
|
14
14
|
gem "rdoc", "~> 3.8"
|
15
15
|
gem "mocha"
|
16
|
-
gem "
|
17
|
-
gem "jeweler", "~> 1.6.4"
|
18
|
-
gem "rcov", ">= 0"
|
16
|
+
gem "jeweler"
|
19
17
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
bcrypt
|
4
|
+
bcrypt (3.1.7)
|
5
5
|
diff-lcs (1.1.3)
|
6
6
|
git (1.2.5)
|
7
7
|
highline (1.6.2)
|
@@ -10,9 +10,8 @@ GEM
|
|
10
10
|
git (>= 1.2.5)
|
11
11
|
rake
|
12
12
|
mocha (0.9.12)
|
13
|
-
moneta (0.7.
|
13
|
+
moneta (0.7.20)
|
14
14
|
rake (0.9.2)
|
15
|
-
rcov (0.9.9)
|
16
15
|
rdoc (3.8)
|
17
16
|
rspec (2.4.0)
|
18
17
|
rspec-core (~> 2.4.0)
|
@@ -27,12 +26,10 @@ PLATFORMS
|
|
27
26
|
ruby
|
28
27
|
|
29
28
|
DEPENDENCIES
|
30
|
-
bcrypt
|
31
|
-
bundler (~> 1.2.3)
|
29
|
+
bcrypt
|
32
30
|
highline
|
33
|
-
jeweler
|
31
|
+
jeweler
|
34
32
|
mocha
|
35
|
-
moneta (~> 0.7
|
36
|
-
rcov
|
33
|
+
moneta (~> 0.7)
|
37
34
|
rdoc (~> 3.8)
|
38
|
-
rspec (~> 2.4
|
35
|
+
rspec (~> 2.4)
|
data/bin/trocla
CHANGED
@@ -65,10 +65,11 @@ def set(options)
|
|
65
65
|
password = options.delete(:password) || STDIN.read.chomp
|
66
66
|
end
|
67
67
|
format = options.delete(:trocla_format)
|
68
|
-
Trocla.new(options.delete(:config_file))
|
68
|
+
trocla = Trocla.new(options.delete(:config_file))
|
69
|
+
trocla.set_password(
|
69
70
|
options.delete(:trocla_key),
|
70
71
|
format,
|
71
|
-
|
72
|
+
trocla.formats(format).format(password, options.delete(:other_options).shift.to_s)
|
72
73
|
)
|
73
74
|
""
|
74
75
|
end
|
data/lib/VERSION
CHANGED
data/lib/trocla/formats/mysql.rb
CHANGED
data/lib/trocla/formats/pgsql.rb
CHANGED
data/lib/trocla/formats/plain.rb
CHANGED
data/lib/trocla/formats/ssha.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# salted crypt
|
2
2
|
require 'base64'
|
3
3
|
require 'digest'
|
4
|
-
class Trocla::Formats::Ssha
|
4
|
+
class Trocla::Formats::Ssha < Trocla::Formats::Base
|
5
5
|
def format(plain_password,options={})
|
6
6
|
salt = options['salt'] || Trocla::Util.salt(16)
|
7
7
|
"{SSHA}"+Base64.encode64("#{Digest::SHA1.digest("#{plain_password}#{salt}")}#{salt}").chomp
|
@@ -0,0 +1,128 @@
|
|
1
|
+
class Trocla::Formats::X509 < Trocla::Formats::Base
|
2
|
+
require 'openssl'
|
3
|
+
def format(plain_password,options={})
|
4
|
+
|
5
|
+
if plain_password.match(/-----BEGIN RSA PRIVATE KEY-----.*-----END RSA PRIVATE KEY-----.*-----BEGIN CERTIFICATE-----.*-----END CERTIFICATE-----/m)
|
6
|
+
# just an import, don't generate any new keys
|
7
|
+
return plain_password
|
8
|
+
end
|
9
|
+
|
10
|
+
if options['subject']
|
11
|
+
subject = options['subject']
|
12
|
+
elsif options['CN']
|
13
|
+
subject = ''
|
14
|
+
['C','ST','L','O','OU','CN','emailAddress'].each do |field|
|
15
|
+
subject << "/#{field}=#{options[field]}" if options[field]
|
16
|
+
end
|
17
|
+
else
|
18
|
+
raise "You need to pass \"subject\" or \"CN\" as an option to use this format"
|
19
|
+
end
|
20
|
+
sign_with = options['ca'] || nil
|
21
|
+
keysize = options['keysize'] || 2048
|
22
|
+
serial = options['serial'] || 1
|
23
|
+
days = options['days'] || 365
|
24
|
+
altnames = options['altnames'] || nil
|
25
|
+
altnames.collect { |v| "DNS:#{v}" }.join(', ') if altnames
|
26
|
+
|
27
|
+
begin
|
28
|
+
key = mkkey(keysize)
|
29
|
+
rescue Exception => e
|
30
|
+
raise "Private key for #{subject} creation failed: #{e.message}"
|
31
|
+
end
|
32
|
+
|
33
|
+
if sign_with # certificate signed with CA
|
34
|
+
begin
|
35
|
+
ca = OpenSSL::X509::Certificate.new(getca(sign_with))
|
36
|
+
cakey = OpenSSL::PKey::RSA.new(getca(sign_with))
|
37
|
+
caserial = getserial(sign_with, serial)
|
38
|
+
rescue Exception => e
|
39
|
+
raise "Value of #{sign_with} can't be loaded as CA: #{e.message}"
|
40
|
+
end
|
41
|
+
|
42
|
+
begin
|
43
|
+
subj = OpenSSL::X509::Name.parse(subject)
|
44
|
+
request = mkreq(subj, key.public_key)
|
45
|
+
request.sign(key, OpenSSL::Digest::SHA1.new)
|
46
|
+
rescue Exception => e
|
47
|
+
raise "Certificate request #{subject} creation failed: #{e.message}"
|
48
|
+
end
|
49
|
+
|
50
|
+
begin
|
51
|
+
csr_cert = mkcert(caserial, request.subject, ca, request.public_key, days, altnames)
|
52
|
+
csr_cert.sign(cakey, OpenSSL::Digest::SHA1.new)
|
53
|
+
setserial(sign_with, caserial)
|
54
|
+
rescue Exception => e
|
55
|
+
raise "Certificate #{subject} signing failed: #{e.message}"
|
56
|
+
end
|
57
|
+
|
58
|
+
key.send("to_pem") + csr_cert.send("to_pem")
|
59
|
+
else # self-signed certificate
|
60
|
+
begin
|
61
|
+
subj = OpenSSL::X509::Name.parse(subject)
|
62
|
+
cert = mkcert(serial, subj, nil, key.public_key, days, altnames)
|
63
|
+
cert.sign(key, OpenSSL::Digest::SHA1.new)
|
64
|
+
rescue Exception => e
|
65
|
+
raise "Self-signed certificate #{subject} creation failed: #{e.message}"
|
66
|
+
end
|
67
|
+
|
68
|
+
key.send("to_pem") + cert.send("to_pem")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
private
|
72
|
+
|
73
|
+
# nice help: https://gist.github.com/mitfik/1922961
|
74
|
+
|
75
|
+
def mkkey(len)
|
76
|
+
OpenSSL::PKey::RSA.generate(len)
|
77
|
+
end
|
78
|
+
|
79
|
+
def mkreq(subject,public_key)
|
80
|
+
request = OpenSSL::X509::Request.new
|
81
|
+
request.version = 0
|
82
|
+
request.subject = subject
|
83
|
+
request.public_key = public_key
|
84
|
+
|
85
|
+
request
|
86
|
+
end
|
87
|
+
|
88
|
+
def mkcert(serial,subject,issuer,public_key,days,altnames)
|
89
|
+
cert = OpenSSL::X509::Certificate.new
|
90
|
+
issuer = cert if issuer == nil
|
91
|
+
cert.subject = subject
|
92
|
+
cert.issuer = issuer.subject
|
93
|
+
cert.not_before = Time.now
|
94
|
+
cert.not_after = Time.now + days * 24 * 60 * 60
|
95
|
+
cert.public_key = public_key
|
96
|
+
cert.serial = serial
|
97
|
+
cert.version = 2
|
98
|
+
|
99
|
+
ef = OpenSSL::X509::ExtensionFactory.new
|
100
|
+
ef.subject_certificate = cert
|
101
|
+
ef.issuer_certificate = issuer
|
102
|
+
cert.extensions = [ ef.create_extension("subjectKeyIdentifier", "hash") ]
|
103
|
+
cert.add_extension ef.create_extension("basicConstraints","CA:TRUE", true) if subject == issuer
|
104
|
+
cert.add_extension ef.create_extension("basicConstraints","CA:FALSE", true) if subject != issuer
|
105
|
+
cert.add_extension ef.create_extension("keyUsage", "nonRepudiation, digitalSignature, keyEncipherment", true)
|
106
|
+
cert.add_extension ef.create_extension("subjectAltName", altnames, true) if altnames
|
107
|
+
cert.add_extension ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always")
|
108
|
+
|
109
|
+
cert
|
110
|
+
end
|
111
|
+
|
112
|
+
def getca(ca)
|
113
|
+
trocla.get_password(ca,'x509')
|
114
|
+
end
|
115
|
+
|
116
|
+
def getserial(ca,serial)
|
117
|
+
newser = trocla.get_password("#{ca}_serial",'plain')
|
118
|
+
if newser
|
119
|
+
newser + 1
|
120
|
+
else
|
121
|
+
serial
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def setserial(ca,serial)
|
126
|
+
trocla.set_password("#{ca}_serial",'plain',serial)
|
127
|
+
end
|
128
|
+
end
|
data/lib/trocla/formats.rb
CHANGED
@@ -1,32 +1,40 @@
|
|
1
1
|
class Trocla::Formats
|
2
|
+
|
3
|
+
class Base
|
4
|
+
attr_reader :trocla
|
5
|
+
def initialize(trocla)
|
6
|
+
@trocla = trocla
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
2
10
|
class << self
|
3
11
|
def [](format)
|
4
12
|
formats[format.downcase]
|
5
13
|
end
|
6
|
-
|
14
|
+
|
7
15
|
def all
|
8
16
|
Dir[File.expand_path(File.join(File.dirname(__FILE__),'formats','*.rb'))].collect{|f| File.basename(f,'.rb').downcase }
|
9
17
|
end
|
10
|
-
|
18
|
+
|
11
19
|
def available?(format)
|
12
20
|
all.include?(format.downcase)
|
13
21
|
end
|
14
|
-
|
22
|
+
|
15
23
|
private
|
16
24
|
def formats
|
17
25
|
@@formats ||= Hash.new do |hash, format|
|
18
26
|
format = format.downcase
|
19
27
|
if File.exists?(path(format))
|
20
28
|
require "trocla/formats/#{format}"
|
21
|
-
hash[format] = (eval "Trocla::Formats::#{format.capitalize}")
|
29
|
+
hash[format] = (eval "Trocla::Formats::#{format.capitalize}")
|
22
30
|
else
|
23
31
|
raise "Format #{format} is not supported!"
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
27
|
-
|
35
|
+
|
28
36
|
def path(format)
|
29
37
|
File.expand_path(File.join(File.dirname(__FILE__),'formats',"#{format}.rb"))
|
30
38
|
end
|
31
39
|
end
|
32
|
-
end
|
40
|
+
end
|
data/lib/trocla/util.rb
CHANGED
@@ -2,23 +2,39 @@ require 'securerandom'
|
|
2
2
|
class Trocla
|
3
3
|
class Util
|
4
4
|
class << self
|
5
|
-
def random_str(length=12)
|
6
|
-
|
5
|
+
def random_str(length=12, charset='default')
|
6
|
+
_charsets = charsets[charset]
|
7
|
+
(1..length).collect{|a| _charsets[SecureRandom.random_number(_charsets.size)] }.join.to_s
|
7
8
|
end
|
8
9
|
|
9
10
|
def salt(length=8)
|
10
|
-
(1..length).collect{|a|
|
11
|
+
(1..length).collect{|a| alphanumeric[SecureRandom.random_number(alphanumeric.size)] }.join.to_s
|
11
12
|
end
|
12
13
|
|
13
14
|
private
|
15
|
+
|
16
|
+
def charsets
|
17
|
+
@charsets ||= {
|
18
|
+
'default' => chars,
|
19
|
+
'alphanumeric' => alphanumeric,
|
20
|
+
'shellsafe' => shellsafe,
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
14
24
|
def chars
|
15
|
-
@chars ||=
|
25
|
+
@chars ||= shellsafe + special_chars
|
16
26
|
end
|
17
|
-
def
|
18
|
-
@
|
27
|
+
def shellsafe
|
28
|
+
@chars ||= alphanumeric + shellsafe_chars
|
29
|
+
end
|
30
|
+
def alphanumeric
|
31
|
+
@alphanumeric ||= ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
|
19
32
|
end
|
20
33
|
def special_chars
|
21
|
-
@special_chars ||= "
|
34
|
+
@special_chars ||= "*()&![]{}-".split(//)
|
35
|
+
end
|
36
|
+
def shellsafe_chars
|
37
|
+
@shellsafe_chars ||= "+%/@=?_.,:".split(//)
|
22
38
|
end
|
23
39
|
end
|
24
40
|
end
|
data/lib/trocla.rb
CHANGED
@@ -3,11 +3,11 @@ require 'trocla/util'
|
|
3
3
|
require 'trocla/formats'
|
4
4
|
|
5
5
|
class Trocla
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(config_file=nil)
|
8
8
|
if config_file
|
9
9
|
@config_file = File.expand_path(config_file)
|
10
|
-
elsif File.exists?(def_config_file=File.expand_path('~/.troclarc.yaml')) || File.exists?(def_config_file=File.expand_path('/etc/troclarc.yaml'))
|
10
|
+
elsif File.exists?(def_config_file=File.expand_path('~/.troclarc.yaml')) || File.exists?(def_config_file=File.expand_path('/etc/troclarc.yaml'))
|
11
11
|
@config_file = def_config_file
|
12
12
|
end
|
13
13
|
end
|
@@ -20,27 +20,27 @@ class Trocla
|
|
20
20
|
return password
|
21
21
|
end
|
22
22
|
|
23
|
-
plain_pwd = get_password(key,'plain')
|
23
|
+
plain_pwd = get_password(key,'plain')
|
24
24
|
if options['random'] && plain_pwd.nil?
|
25
|
-
plain_pwd = Trocla::Util.random_str(options['length'])
|
26
|
-
set_password(key,'plain',plain_pwd) unless format == 'plain'
|
25
|
+
plain_pwd = Trocla::Util.random_str(options['length'].to_i,options['charset'])
|
26
|
+
set_password(key,'plain',plain_pwd) unless format == 'plain'
|
27
27
|
elsif !options['random'] && plain_pwd.nil?
|
28
28
|
raise "Password must be present as plaintext if you don't want a random password"
|
29
29
|
end
|
30
|
-
set_password(key,format,
|
30
|
+
set_password(key,format,self.formats(format).format(plain_pwd,options))
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def get_password(key,format)
|
34
34
|
cache.fetch(key,{})[format]
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def reset_password(key,format,options={})
|
38
38
|
set_password(key,format,nil)
|
39
39
|
password(key,format,options)
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def delete_password(key,format=nil)
|
43
|
-
if format.nil?
|
43
|
+
if format.nil?
|
44
44
|
cache.delete(key)
|
45
45
|
else
|
46
46
|
old_val = (h = cache.fetch(key,{})).delete(format)
|
@@ -48,7 +48,7 @@ class Trocla
|
|
48
48
|
old_val
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def set_password(key,format,password)
|
53
53
|
if (format == 'plain')
|
54
54
|
h = (cache[key] = { 'plain' => password })
|
@@ -57,22 +57,26 @@ class Trocla
|
|
57
57
|
end
|
58
58
|
h[format]
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
|
+
def formats(format)
|
62
|
+
(@format_cache||={})[format] ||= Trocla::Formats[format].new(self)
|
63
|
+
end
|
64
|
+
|
61
65
|
private
|
62
66
|
def cache
|
63
67
|
@cache ||= build_cache
|
64
68
|
end
|
65
|
-
|
69
|
+
|
66
70
|
def build_cache
|
67
71
|
require 'moneta'
|
68
72
|
lconfig = config
|
69
73
|
Moneta.new(lconfig['adapter'], lconfig['adapter_options']||{})
|
70
74
|
end
|
71
|
-
|
75
|
+
|
72
76
|
def config
|
73
77
|
@config ||= read_config
|
74
78
|
end
|
75
|
-
|
79
|
+
|
76
80
|
def read_config
|
77
81
|
if @config_file.nil?
|
78
82
|
default_config
|
@@ -81,10 +85,10 @@ class Trocla
|
|
81
85
|
default_config.merge(YAML.load(File.read(@config_file)))
|
82
86
|
end
|
83
87
|
end
|
84
|
-
|
88
|
+
|
85
89
|
def default_config
|
86
90
|
require 'yaml'
|
87
91
|
YAML.load(File.read(File.expand_path(File.join(File.dirname(__FILE__),'trocla','default_config.yaml'))))
|
88
92
|
end
|
89
|
-
|
93
|
+
|
90
94
|
end
|
data/spec/trocla_spec.rb
CHANGED
data/trocla.gemspec
CHANGED
@@ -2,14 +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.10 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "trocla"
|
8
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.10"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["mh"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2014-06-27"
|
13
15
|
s.description = "Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival."
|
14
16
|
s.email = "mh+trocla@immerda.ch"
|
15
17
|
s.executables = ["trocla"]
|
@@ -36,9 +38,11 @@ Gem::Specification.new do |s|
|
|
36
38
|
"lib/trocla/formats/mysql.rb",
|
37
39
|
"lib/trocla/formats/pgsql.rb",
|
38
40
|
"lib/trocla/formats/plain.rb",
|
41
|
+
"lib/trocla/formats/sha1.rb",
|
39
42
|
"lib/trocla/formats/sha256crypt.rb",
|
40
43
|
"lib/trocla/formats/sha512crypt.rb",
|
41
44
|
"lib/trocla/formats/ssha.rb",
|
45
|
+
"lib/trocla/formats/x509.rb",
|
42
46
|
"lib/trocla/util.rb",
|
43
47
|
"lib/trocla/version.rb",
|
44
48
|
"spec/data/.keep",
|
@@ -49,44 +53,37 @@ Gem::Specification.new do |s|
|
|
49
53
|
]
|
50
54
|
s.homepage = "https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/"
|
51
55
|
s.licenses = ["GPLv3"]
|
52
|
-
s.
|
53
|
-
s.rubygems_version = "1.8.25"
|
56
|
+
s.rubygems_version = "2.3.0"
|
54
57
|
s.summary = "Trocla a simple password generator and storage"
|
55
58
|
|
56
59
|
if s.respond_to? :specification_version then
|
57
|
-
s.specification_version =
|
60
|
+
s.specification_version = 4
|
58
61
|
|
59
62
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
63
|
s.add_runtime_dependency(%q<moneta>, ["~> 0.7.2"])
|
61
64
|
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
62
|
-
s.add_runtime_dependency(%q<bcrypt
|
65
|
+
s.add_runtime_dependency(%q<bcrypt>, [">= 0"])
|
63
66
|
s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
|
64
67
|
s.add_development_dependency(%q<rdoc>, ["~> 3.8"])
|
65
68
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
66
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.2.3"])
|
67
69
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
68
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
69
70
|
else
|
70
71
|
s.add_dependency(%q<moneta>, ["~> 0.7.2"])
|
71
72
|
s.add_dependency(%q<highline>, [">= 0"])
|
72
|
-
s.add_dependency(%q<bcrypt
|
73
|
+
s.add_dependency(%q<bcrypt>, [">= 0"])
|
73
74
|
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
74
75
|
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
75
76
|
s.add_dependency(%q<mocha>, [">= 0"])
|
76
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.3"])
|
77
77
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
78
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
79
78
|
end
|
80
79
|
else
|
81
80
|
s.add_dependency(%q<moneta>, ["~> 0.7.2"])
|
82
81
|
s.add_dependency(%q<highline>, [">= 0"])
|
83
|
-
s.add_dependency(%q<bcrypt
|
82
|
+
s.add_dependency(%q<bcrypt>, [">= 0"])
|
84
83
|
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
85
84
|
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
86
85
|
s.add_dependency(%q<mocha>, [">= 0"])
|
87
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.3"])
|
88
86
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
89
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
90
87
|
end
|
91
88
|
end
|
92
89
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trocla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.10
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- mh
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: moneta
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: highline
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,15 +34,13 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
|
-
name: bcrypt
|
42
|
+
name: bcrypt
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rdoc
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: mocha
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,31 +90,13 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: bundler
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 1.2.3
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: 1.2.3
|
126
97
|
- !ruby/object:Gem::Dependency
|
127
98
|
name: jeweler
|
128
99
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
100
|
requirements:
|
131
101
|
- - ~>
|
132
102
|
- !ruby/object:Gem::Version
|
@@ -134,27 +104,10 @@ dependencies:
|
|
134
104
|
type: :development
|
135
105
|
prerelease: false
|
136
106
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
107
|
requirements:
|
139
108
|
- - ~>
|
140
109
|
- !ruby/object:Gem::Version
|
141
110
|
version: 1.6.4
|
142
|
-
- !ruby/object:Gem::Dependency
|
143
|
-
name: rcov
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
150
|
-
type: :development
|
151
|
-
prerelease: false
|
152
|
-
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- - ! '>='
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: '0'
|
158
111
|
description: Trocla helps you to generate random passwords and to store them in various
|
159
112
|
formats (plain, MD5, bcrypt) for later retrival.
|
160
113
|
email: mh+trocla@immerda.ch
|
@@ -183,9 +136,11 @@ files:
|
|
183
136
|
- lib/trocla/formats/mysql.rb
|
184
137
|
- lib/trocla/formats/pgsql.rb
|
185
138
|
- lib/trocla/formats/plain.rb
|
139
|
+
- lib/trocla/formats/sha1.rb
|
186
140
|
- lib/trocla/formats/sha256crypt.rb
|
187
141
|
- lib/trocla/formats/sha512crypt.rb
|
188
142
|
- lib/trocla/formats/ssha.rb
|
143
|
+
- lib/trocla/formats/x509.rb
|
189
144
|
- lib/trocla/util.rb
|
190
145
|
- lib/trocla/version.rb
|
191
146
|
- spec/data/.keep
|
@@ -196,29 +151,25 @@ files:
|
|
196
151
|
homepage: https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/
|
197
152
|
licenses:
|
198
153
|
- GPLv3
|
154
|
+
metadata: {}
|
199
155
|
post_install_message:
|
200
156
|
rdoc_options: []
|
201
157
|
require_paths:
|
202
158
|
- lib
|
203
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
204
|
-
none: false
|
205
160
|
requirements:
|
206
161
|
- - ! '>='
|
207
162
|
- !ruby/object:Gem::Version
|
208
163
|
version: '0'
|
209
|
-
segments:
|
210
|
-
- 0
|
211
|
-
hash: -851903621501958623
|
212
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
-
none: false
|
214
165
|
requirements:
|
215
166
|
- - ! '>='
|
216
167
|
- !ruby/object:Gem::Version
|
217
168
|
version: '0'
|
218
169
|
requirements: []
|
219
170
|
rubyforge_project:
|
220
|
-
rubygems_version:
|
171
|
+
rubygems_version: 2.3.0
|
221
172
|
signing_key:
|
222
|
-
specification_version:
|
173
|
+
specification_version: 4
|
223
174
|
summary: Trocla a simple password generator and storage
|
224
175
|
test_files: []
|