serverspec 2.35.0 → 2.36.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3689402c5d03f438cdb273aa1300f49604319e6
|
4
|
+
data.tar.gz: 8cc6ee4a4bb5fda653cfeccfed3e53c4f5459470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b56de0b976a48f57563fca617bc74e5ec0176458ee36cb4c7d02f26f0382b404965e0bfcd8935e3efc26907b89a0ef65782971599f6530e30e4d270b21a006
|
7
|
+
data.tar.gz: b7aaafc17b9ea01c96907cc0cc3a0e0015bdf096822e8ddf170d8af7b94e828546445a3d6e60f5568efeb2a9f013742b2fdaad4bd5bfea1ccfc65a29efd5965f
|
data/lib/serverspec/setup.rb
CHANGED
@@ -60,6 +60,15 @@ module Serverspec::Type
|
|
60
60
|
( diff/(60*60*24) )
|
61
61
|
end
|
62
62
|
|
63
|
+
def subject_alt_names
|
64
|
+
text = run_openssl_command_with('-text -noout').stdout
|
65
|
+
# X509v3 Subject Alternative Name:
|
66
|
+
# DNS:*.example.com, DNS:www.example.net, IP:192.0.2.10
|
67
|
+
if text =~ /^ *X509v3 Subject Alternative Name: *\n *(.*)$/
|
68
|
+
$1.split(/, +/)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
63
72
|
private
|
64
73
|
def run_openssl_command_with(param_str)
|
65
74
|
@runner.run_command("openssl x509 -in #{name} #{param_str}")
|
data/lib/serverspec/version.rb
CHANGED
@@ -33,6 +33,10 @@ describe x509_certificate('test.pem') do
|
|
33
33
|
it { should_not be_valid }
|
34
34
|
end
|
35
35
|
|
36
|
+
describe x509_certificate('test.pem') do
|
37
|
+
let(:stdout) { sample_san }
|
38
|
+
its(:subject_alt_names) { should eq %w[DNS:*.example.com DNS:www.example.net IP:192.0.2.10] }
|
39
|
+
end
|
36
40
|
|
37
41
|
def sample_subj
|
38
42
|
<<'EOS'
|
@@ -60,3 +64,15 @@ notAfter=Jul 1 11:11:00 2010 GMT
|
|
60
64
|
EOS
|
61
65
|
end
|
62
66
|
|
67
|
+
def sample_san
|
68
|
+
<<'EOS'
|
69
|
+
Certificate:
|
70
|
+
Data:
|
71
|
+
Version: 3 (0x2)
|
72
|
+
X509v3 extensions:
|
73
|
+
X509v3 Extended Key Usage:
|
74
|
+
TLS Web Server Authentication, TLS Web Client Authentication
|
75
|
+
X509v3 Subject Alternative Name:
|
76
|
+
DNS:*.example.com, DNS:www.example.net, IP:192.0.2.10
|
77
|
+
EOS
|
78
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|