trocla 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -125,6 +125,16 @@ to address.
125
125
 
126
126
  Simply build and install the gem.
127
127
 
128
+ ## Update & Changes
129
+
130
+ ### to 0.0.8
131
+
132
+ 1. be sure to update as well the moneta gem, trocla now uses the official moneta releases and supports current avaiable versions.
133
+ 1. Options for moneta's backends have changed. For example, if you are using the yaml-backend you will likely need to change the adapter option `:path:` to `:file:` to match moneta's new API.
134
+ 1. **IMPORTANT:** If you are using the yaml backend you need to migrate the current data *before* using the new trocla version! You can migrate the datastore by using the following two sed commands: `sed -i 's/^\s\{3\}/ /' /PATH/TO/trocla_data.yaml` && `sed -i '/^\s\{2\}value\:/d' /PATH/TO/trocla_data.yaml`.
135
+ 1. **SECURITY:** Previous versions of trocla used quite a simple random generator. Especially in combination with the puppet `fqdn_rand` function, you likely have very predictable random passwords and I recommend you to regenerate all randomly generated passwords! Now!
136
+ 1. We now support reading passwords from files, which means that you can now also easily add multi-line passwords. Have a look at the documentation above.
137
+
128
138
  ## Contributing to trocla
129
139
 
130
140
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
data/bin/trocla CHANGED
@@ -55,8 +55,8 @@ end
55
55
  def set(options)
56
56
  if options.delete(:ask_password)
57
57
  require 'highline/import'
58
- password = ask("Enter your password: ") { |q| q.echo = "x" }
59
- pwd2 = ask("Repeat password: ") { |q| q.echo = "x" }
58
+ password = ask("Enter your password: ") { |q| q.echo = "x" }.to_s
59
+ pwd2 = ask("Repeat password: ") { |q| q.echo = "x" }.to_s
60
60
  unless password == pwd2
61
61
  STDERR.puts "Passwords did not match, exiting!"
62
62
  exit 1
@@ -64,10 +64,11 @@ def set(options)
64
64
  else
65
65
  password = options.delete(:password) || STDIN.read.chomp
66
66
  end
67
+ format = options.delete(:trocla_format)
67
68
  Trocla.new(options.delete(:config_file)).set_password(
68
69
  options.delete(:trocla_key),
69
- options.delete(:trocla_format),
70
- password
70
+ format,
71
+ Trocla::Formats[format].format(password, options.delete(:other_options).shift.to_s)
71
72
  )
72
73
  ""
73
74
  end
data/lib/VERSION CHANGED
@@ -1,4 +1,4 @@
1
1
  major:0
2
2
  minor:0
3
- patch:8
3
+ patch:9
4
4
  build:
@@ -0,0 +1,9 @@
1
+ # salted crypt
2
+ require 'base64'
3
+ require 'digest'
4
+ class Trocla::Formats::Ssha
5
+ def format(plain_password,options={})
6
+ salt = options['salt'] || Trocla::Util.salt(16)
7
+ "{SSHA}"+Base64.encode64("#{Digest::SHA1.digest("#{plain_password}#{salt}")}#{salt}").chomp
8
+ end
9
+ end
data/trocla.gemspec CHANGED
@@ -4,15 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{trocla}
8
- s.version = "0.0.8"
7
+ s.name = "trocla"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mh"]
12
- s.date = %q{2013-01-14}
13
- s.default_executable = %q{trocla}
14
- s.description = %q{Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival.}
15
- s.email = %q{mh+trocla@immerda.ch}
12
+ s.date = "2013-10-03"
13
+ s.description = "Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival."
14
+ s.email = "mh+trocla@immerda.ch"
16
15
  s.executables = ["trocla"]
17
16
  s.extra_rdoc_files = [
18
17
  "LICENSE.txt",
@@ -39,6 +38,7 @@ Gem::Specification.new do |s|
39
38
  "lib/trocla/formats/plain.rb",
40
39
  "lib/trocla/formats/sha256crypt.rb",
41
40
  "lib/trocla/formats/sha512crypt.rb",
41
+ "lib/trocla/formats/ssha.rb",
42
42
  "lib/trocla/util.rb",
43
43
  "lib/trocla/version.rb",
44
44
  "spec/data/.keep",
@@ -47,11 +47,11 @@ Gem::Specification.new do |s|
47
47
  "spec/trocla_spec.rb",
48
48
  "trocla.gemspec"
49
49
  ]
50
- s.homepage = %q{https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/}
50
+ s.homepage = "https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/"
51
51
  s.licenses = ["GPLv3"]
52
52
  s.require_paths = ["lib"]
53
- s.rubygems_version = %q{1.6.2}
54
- s.summary = %q{Trocla a simple password generator and storage}
53
+ s.rubygems_version = "1.8.25"
54
+ s.summary = "Trocla a simple password generator and storage"
55
55
 
56
56
  if s.respond_to? :specification_version then
57
57
  s.specification_version = 3
metadata CHANGED
@@ -1,168 +1,170 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: trocla
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - mh
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-01-14 00:00:00 +01:00
19
- default_executable: trocla
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
12
+ date: 2013-10-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
23
15
  name: moneta
24
- prerelease: false
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
26
17
  none: false
27
- requirements:
18
+ requirements:
28
19
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 7
31
- segments:
32
- - 0
33
- - 7
34
- - 2
20
+ - !ruby/object:Gem::Version
35
21
  version: 0.7.2
36
- requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
22
  type: :runtime
39
- name: highline
40
23
  prerelease: false
41
- version_requirements: &id002 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 3
47
- segments:
48
- - 0
49
- version: "0"
50
- requirement: *id002
51
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.7.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: highline
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
52
38
  type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
53
47
  name: bcrypt-ruby
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
54
55
  prerelease: false
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
64
- requirement: *id003
65
- - !ruby/object:Gem::Dependency
66
- type: :development
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
67
63
  name: rspec
68
- prerelease: false
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
70
65
  none: false
71
- requirements:
66
+ requirements:
72
67
  - - ~>
73
- - !ruby/object:Gem::Version
74
- hash: 31
75
- segments:
76
- - 2
77
- - 4
78
- - 0
68
+ - !ruby/object:Gem::Version
79
69
  version: 2.4.0
80
- requirement: *id004
81
- - !ruby/object:Gem::Dependency
82
70
  type: :development
83
- name: rdoc
84
71
  prerelease: false
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
86
73
  none: false
87
- requirements:
74
+ requirements:
88
75
  - - ~>
89
- - !ruby/object:Gem::Version
90
- hash: 23
91
- segments:
92
- - 3
93
- - 8
94
- version: "3.8"
95
- requirement: *id005
96
- - !ruby/object:Gem::Dependency
76
+ - !ruby/object:Gem::Version
77
+ version: 2.4.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rdoc
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '3.8'
97
86
  type: :development
98
- name: mocha
99
87
  prerelease: false
100
- version_requirements: &id006 !ruby/object:Gem::Requirement
101
- none: false
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- hash: 3
106
- segments:
107
- - 0
108
- version: "0"
109
- requirement: *id006
110
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '3.8'
94
+ - !ruby/object:Gem::Dependency
95
+ name: mocha
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
111
102
  type: :development
112
- name: bundler
113
103
  prerelease: false
114
- version_requirements: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
115
105
  none: false
116
- requirements:
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: bundler
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
117
115
  - - ~>
118
- - !ruby/object:Gem::Version
119
- hash: 25
120
- segments:
121
- - 1
122
- - 2
123
- - 3
116
+ - !ruby/object:Gem::Version
124
117
  version: 1.2.3
125
- requirement: *id007
126
- - !ruby/object:Gem::Dependency
127
118
  type: :development
128
- name: jeweler
129
119
  prerelease: false
130
- version_requirements: &id008 !ruby/object:Gem::Requirement
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.2.3
126
+ - !ruby/object:Gem::Dependency
127
+ name: jeweler
128
+ requirement: !ruby/object:Gem::Requirement
131
129
  none: false
132
- requirements:
130
+ requirements:
133
131
  - - ~>
134
- - !ruby/object:Gem::Version
135
- hash: 7
136
- segments:
137
- - 1
138
- - 6
139
- - 4
132
+ - !ruby/object:Gem::Version
140
133
  version: 1.6.4
141
- requirement: *id008
142
- - !ruby/object:Gem::Dependency
143
134
  type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 1.6.4
142
+ - !ruby/object:Gem::Dependency
144
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
145
151
  prerelease: false
146
- version_requirements: &id009 !ruby/object:Gem::Requirement
147
- none: false
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- hash: 3
152
- segments:
153
- - 0
154
- version: "0"
155
- requirement: *id009
156
- description: Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival.
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ description: Trocla helps you to generate random passwords and to store them in various
159
+ formats (plain, MD5, bcrypt) for later retrival.
157
160
  email: mh+trocla@immerda.ch
158
- executables:
161
+ executables:
159
162
  - trocla
160
163
  extensions: []
161
-
162
- extra_rdoc_files:
164
+ extra_rdoc_files:
163
165
  - LICENSE.txt
164
166
  - README.md
165
- files:
167
+ files:
166
168
  - .document
167
169
  - .rspec
168
170
  - .travis.yml
@@ -183,6 +185,7 @@ files:
183
185
  - lib/trocla/formats/plain.rb
184
186
  - lib/trocla/formats/sha256crypt.rb
185
187
  - lib/trocla/formats/sha512crypt.rb
188
+ - lib/trocla/formats/ssha.rb
186
189
  - lib/trocla/util.rb
187
190
  - lib/trocla/version.rb
188
191
  - spec/data/.keep
@@ -190,39 +193,32 @@ files:
190
193
  - spec/trocla/util_spec.rb
191
194
  - spec/trocla_spec.rb
192
195
  - trocla.gemspec
193
- has_rdoc: true
194
196
  homepage: https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/
195
- licenses:
197
+ licenses:
196
198
  - GPLv3
197
199
  post_install_message:
198
200
  rdoc_options: []
199
-
200
- require_paths:
201
+ require_paths:
201
202
  - lib
202
- required_ruby_version: !ruby/object:Gem::Requirement
203
+ required_ruby_version: !ruby/object:Gem::Requirement
203
204
  none: false
204
- requirements:
205
- - - ">="
206
- - !ruby/object:Gem::Version
207
- hash: 3
208
- segments:
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ segments:
209
210
  - 0
210
- version: "0"
211
- required_rubygems_version: !ruby/object:Gem::Requirement
211
+ hash: -851903621501958623
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
212
213
  none: false
213
- requirements:
214
- - - ">="
215
- - !ruby/object:Gem::Version
216
- hash: 3
217
- segments:
218
- - 0
219
- version: "0"
214
+ requirements:
215
+ - - ! '>='
216
+ - !ruby/object:Gem::Version
217
+ version: '0'
220
218
  requirements: []
221
-
222
219
  rubyforge_project:
223
- rubygems_version: 1.6.2
220
+ rubygems_version: 1.8.25
224
221
  signing_key:
225
222
  specification_version: 3
226
223
  summary: Trocla a simple password generator and storage
227
224
  test_files: []
228
-