cert_munger 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc7848d1decd68591525ba643fd8be3bb5979a86
4
- data.tar.gz: b8a591e0183a08976a6ffde4f4875101ec60f3d7
3
+ metadata.gz: e52e7430a05f18506ea7ecc99a192b0ec0f94e2a
4
+ data.tar.gz: 67981272e2623b4dec18f49e6bd9fb6194a6a753
5
5
  SHA512:
6
- metadata.gz: ba26f682f4dade354b79f8be9595e3564d981fcf7058e2eea70201f6947393f6dc221210784a72625cfc6ffee44d7a3104c3fdc4dece4ff4b1420f292f2083fd
7
- data.tar.gz: 6766db9c810b9c6da996b4efb58a914f5ee20c123d91832fcafd5fdd77b266b8159d15b019f515d4c94583ee6657387daa00caae6a1c104b844214bc83f5a8f4
6
+ metadata.gz: 7865f3c7e2cae6714851be14b6ae9375206accafb2f685d0c5c31b8e9092a8cbd440bb3a0a8efee694cb92b65ff2641649e1246360cd44a1e984e05a314cf602
7
+ data.tar.gz: ad411501f764f93162277b5a4e7de23eb38728bce3f101e088e9387b0058cf0063582d8ff0636491e16d7e480b93cf1686c0933cdc7b05a67eeaf10016d1a663
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -0,0 +1,8 @@
1
+ languages:
2
+ Ruby: true
3
+ engines:
4
+ rubocop:
5
+ enabled: true
6
+ exclude_paths:
7
+ - "test/*"
8
+ - "spec/*"
@@ -1,10 +1,12 @@
1
1
  language: ruby
2
2
  cache: bundler
3
+ sudo: false
3
4
 
4
5
  rvm:
5
- - ruby-head
6
+ - 2.4.1
7
+ - 2.3.3
6
8
  - 2.2.3
7
- - 2.1.6
9
+ - 2.1.9
8
10
  - 2.0.0
9
11
  - 1.9.3
10
12
 
@@ -19,15 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.required_ruby_version = '>= 1.9.3'
22
- spec.add_dependency 'logging', '~> 1.8'
22
+ spec.add_dependency 'logging', '~> 2.1'
23
23
 
24
24
  spec.add_development_dependency 'awesome_print', '~> 1.2'
25
25
  spec.add_development_dependency 'bundler', '~> 1.6'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter'
27
+ spec.add_development_dependency 'simplecov'
27
28
  spec.add_development_dependency 'rack', '~> 1.5'
28
29
  spec.add_development_dependency 'rack-test', '~> 0.6'
29
30
  spec.add_development_dependency 'rake', '~> 10.0'
30
- spec.add_development_dependency 'rubocop', '~> 0.27'
31
+ spec.add_development_dependency 'rubocop', '=0.41.1'
31
32
  spec.add_development_dependency 'rspec', '~> 3.1'
32
33
  spec.add_development_dependency 'yard', '~> 0.8'
33
34
 
@@ -1,21 +1,21 @@
1
1
  -----BEGIN CERTIFICATE-----
2
2
  MIIDhTCCAm2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMRYwFAYDVQQDDA1zdGV2
3
3
  ZW4uaGFkZG94MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
4
- FgNjb20wHhcNMTQxMTE4MDIxMzIwWhcNMTUxMTE4MDIxMzIwWjBEMRYwFAYDVQQD
4
+ FgNjb20wHhcNMTcwNDA1MTQ0MDQ5WhcNMTgwNDA1MTQ0MDQ5WjBEMRYwFAYDVQQD
5
5
  DA1zdGV2ZW4uaGFkZG94MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJ
6
- k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDanmKr
7
- vJDcVGMeDbDouLfKvU5ugOcHTXP04QDYSshaMTeuWSm4OXakxk2rxnR7Laq86R+8
8
- h1NbHMdiZdwlHcpZm9/YD6qjbQhnLNGsezMrNpfZwfy9VnUQY4e0OCAca9vQXKTL
9
- qC4fiuRD6sQQpyXkiIno0KlJOA4sKtH8vFucPGmhO0FUdlQY5FarDvCvZrtteO6L
10
- 6/GQFjupFBd9X6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CPulZvzn/xN2
18
- KG7SexyfUEXyJRMMigA/mE8h6bYfgKKUmLQVs1uRaXmOI7dKUF6HZJpda51zJH3v
19
- 42qdwEXvvkODZAD6KAIXPdmbMfBgPbcd+B/4eUA0PyKo+4dgL1NuqX4MPWToevIZ
20
- O8EKLF2X7NmC6FY1bOsSj/J8r1SOkx0rxgF+geRvY1P+hfNjDfxTsjU=
15
+ bC5jb20wDQYJKoZIhvcNAQEFBQADggEBANSDl5eTldDIUJKHMB8q7IK8fBt1DGEo
16
+ Y0dyf78b0BVujt945UGKRiPWb9vMeuiTaohtIjqfoI4lvBHe2cEkTIcroB25f+VY
17
+ iPep5M8ormpsruWCekrKlwHpmvtCj8EC7od3JiJIKJaiBRGaRz70D/DOs9sXyUdG
18
+ lrvCjJTLuLtj0HI7/cs+0OFdVA9P7YBH/6GgYIJWgCA9ppAotJrCYGPISYiFNCkc
19
+ NwdGc+LFuu/Xv5FBDYMFyfLSPhncqwXHSzF4OKSqEckawuqN+5eA/C0MsGDplVF4
20
+ eksh9s9/x2f0t0J05xQBWzmmSR6dJRi21G6VUquyVOWHggfRqs3UAZg=
21
21
  -----END CERTIFICATE-----
@@ -0,0 +1 @@
1
+ 4ca1cb691b0021b81d3ed527792a63e783834173867067c6233c6fae1ac88b5bcee35792ff888b636e42237234630cc9c5c1a6e5dc950772180dab2b1004afdd
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'digest/sha2'
4
+ built_gem_path = "pkg/cert_munger-#{ENV['VERSION']}.gem"
5
+ checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
6
+ checksum_path = "checksum/cert_munger-#{ENV['VERSION']}.gem.sha512"
7
+ File.open(checksum_path, 'w' ) {|f| f.write(checksum) }
@@ -48,11 +48,11 @@ module CertMunger
48
48
  # @return [String] reformatted and (hopefully) parseable certificate string
49
49
  def build_cert(raw_cert)
50
50
  tmp_cert = ['-----BEGIN CERTIFICATE-----']
51
- if raw_cert.lines.count == 1
52
- cert_contents = one_line_contents(raw_cert)
53
- else
54
- cert_contents = multi_line_contents(raw_cert)
55
- end
51
+ cert_contents = if raw_cert.lines.count == 1
52
+ one_line_contents(raw_cert)
53
+ else
54
+ multi_line_contents(raw_cert)
55
+ end
56
56
  tmp_cert << cert_contents.flatten # put mixed space lines as own elements
57
57
  tmp_cert << '-----END CERTIFICATE-----'
58
58
  tmp_cert.join("\n").rstrip
@@ -64,11 +64,11 @@ module CertMunger
64
64
  # @return [String] reformatted certificate body
65
65
  def one_line_contents(raw_cert)
66
66
  # Detect if we have newlines, if not, split on spaces
67
- if raw_cert.include?('\n')
68
- cert_contents = raw_cert.split('\n')
69
- else
70
- cert_contents = parse_space_delimited_cert(raw_cert)
71
- end
67
+ cert_contents = if raw_cert.include?('\n')
68
+ raw_cert.split('\n')
69
+ else
70
+ parse_space_delimited_cert(raw_cert)
71
+ end
72
72
  cert_contents.pop # Remove -----BEGIN CERTIFICATE-----
73
73
  cert_contents.shift # Remove -----END CERTIFICATE-----
74
74
 
@@ -1,3 +1,3 @@
1
1
  module CertMunger
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -59,5 +59,10 @@ describe CertMunger do
59
59
  new_cert = subject.class.send(:to_cert, one_line_cert)
60
60
  expect(new_cert.to_s).to eq(certificate.to_s)
61
61
  end
62
+
63
+ it "should parse a certificate with all content in one line, space delimited" do
64
+ new_cert = subject.class.send(:to_cert, one_line_spaces_cert)
65
+ expect(new_cert.to_s).to eq(certificate.to_s)
66
+ end
62
67
  end
63
68
  end
@@ -1,5 +1,5 @@
1
- require "codeclimate-test-reporter"
2
- CodeClimate::TestReporter.start
1
+ require "simplecov"
2
+ SimpleCov.start
3
3
 
4
4
  require_relative '../lib/cert_munger'
5
5
  require 'awesome_print'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cert_munger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Haddox
@@ -12,25 +12,25 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDhTCCAm2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMRYwFAYDVQQDDA1zdGV2
14
14
  ZW4uaGFkZG94MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
15
- FgNjb20wHhcNMTQxMTE4MDIxMzIwWhcNMTUxMTE4MDIxMzIwWjBEMRYwFAYDVQQD
15
+ FgNjb20wHhcNMTcwNDA1MTQ0MDQ5WhcNMTgwNDA1MTQ0MDQ5WjBEMRYwFAYDVQQD
16
16
  DA1zdGV2ZW4uaGFkZG94MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJ
17
- k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDanmKr
18
- vJDcVGMeDbDouLfKvU5ugOcHTXP04QDYSshaMTeuWSm4OXakxk2rxnR7Laq86R+8
19
- h1NbHMdiZdwlHcpZm9/YD6qjbQhnLNGsezMrNpfZwfy9VnUQY4e0OCAca9vQXKTL
20
- qC4fiuRD6sQQpyXkiIno0KlJOA4sKtH8vFucPGmhO0FUdlQY5FarDvCvZrtteO6L
21
- 6/GQFjupFBd9X6zt1XBs28IC+YUw33SN0UJ5JHB45ig0BmeWMXdd4SKWe4ve/2UY
22
- asgs2miI3HP0wCPs0EF64/8LbuEUyMjHDr3a7+7KIRxYn2H/yUH5Ndqz6yL5G0sf
23
- jUsC32JuE7VlJwFNAgMBAAGjgYEwfzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAd
24
- BgNVHQ4EFgQUC8HywyOMPJFCsH7uGW+CeKcZ8+8wIgYDVR0RBBswGYEXc3RldmVu
17
+ k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDV2Ycu
18
+ HeFU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+VY
28
+ iPep5M8ormpsruWCekrKlwHpmvtCj8EC7od3JiJIKJaiBRGaRz70D/DOs9sXyUdG
29
+ lrvCjJTLuLtj0HI7/cs+0OFdVA9P7YBH/6GgYIJWgCA9ppAotJrCYGPISYiFNCkc
30
+ NwdGc+LFuu/Xv5FBDYMFyfLSPhncqwXHSzF4OKSqEckawuqN+5eA/C0MsGDplVF4
31
+ eksh9s9/x2f0t0J05xQBWzmmSR6dJRi21G6VUquyVOWHggfRqs3UAZg=
32
32
  -----END CERTIFICATE-----
33
- date: 2015-10-07 00:00:00.000000000 Z
33
+ date: 2017-04-05 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: logging
@@ -38,14 +38,14 @@ dependencies:
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.8'
41
+ version: '2.1'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.8'
48
+ version: '2.1'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: awesome_print
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +88,20 @@ dependencies:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
+ - !ruby/object:Gem::Dependency
92
+ name: simplecov
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
91
105
  - !ruby/object:Gem::Dependency
92
106
  name: rack
93
107
  requirement: !ruby/object:Gem::Requirement
@@ -134,16 +148,16 @@ dependencies:
134
148
  name: rubocop
135
149
  requirement: !ruby/object:Gem::Requirement
136
150
  requirements:
137
- - - "~>"
151
+ - - '='
138
152
  - !ruby/object:Gem::Version
139
- version: '0.27'
153
+ version: 0.41.1
140
154
  type: :development
141
155
  prerelease: false
142
156
  version_requirements: !ruby/object:Gem::Requirement
143
157
  requirements:
144
- - - "~>"
158
+ - - '='
145
159
  - !ruby/object:Gem::Version
146
- version: '0.27'
160
+ version: 0.41.1
147
161
  - !ruby/object:Gem::Dependency
148
162
  name: rspec
149
163
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +194,7 @@ executables: []
180
194
  extensions: []
181
195
  extra_rdoc_files: []
182
196
  files:
197
+ - ".codeclimate.yml"
183
198
  - ".gitignore"
184
199
  - ".rubocop.yml"
185
200
  - ".travis.yml"
@@ -190,6 +205,8 @@ files:
190
205
  - Rakefile
191
206
  - cert_munger.gemspec
192
207
  - certs/stevenhaddox.pem
208
+ - checksum/cert_munger-0.2.1.gem.sha512
209
+ - checksum_generator.rb
193
210
  - lib/cert_munger.rb
194
211
  - lib/cert_munger/formatter.rb
195
212
  - lib/cert_munger/string.rb
@@ -224,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
241
  version: '0'
225
242
  requirements: []
226
243
  rubyforge_project:
227
- rubygems_version: 2.4.5.1
244
+ rubygems_version: 2.5.2
228
245
  signing_key:
229
246
  specification_version: 4
230
247
  summary: Reformat commonly malformatted X509 strings.
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- YM�(���0�� Ŝ� ����Xm�BHiS�`F�֙P#P)� �s���t$Ϩʏ�0p
2
- K��b�`��`�ђ��>��HDX',5q��B�3��0a�#]B����R�����xZJ�Ռb?G�����~Z��؅U����o)�!����z��s�y�,�oxς��r{͋u,Ċm�gܤ����ե#�hkw]���J�J�rhy0�78�2�܆1�w�Q�$y��F�$��$�tq~��ԋ]��l�.�
1
+ �����v�0�
2
+ )Y��uh �sFf�+�ë�M�ߔ�K�=R