puppet_webhook 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/bin/puppet_webhook +12 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a033807d653ea6ca0e2e168285cedaa3a88b6e7e
4
- data.tar.gz: a61cef2d602fe46e73628917ac1f55b6339c2211
3
+ metadata.gz: 8ed278f549c585151ba3bbb7b57e3e04ad14790d
4
+ data.tar.gz: a6d0eb7a04bb324c23b21b56badb309214206d45
5
5
  SHA512:
6
- metadata.gz: ae8031b56b893d520f9264b98007609a3b18121c8ee74d795836e9d83979b5904c920dacb9d78ea3fcc1949fb7cca4dec9e3c6e991a97a03e07fa728464ee520
7
- data.tar.gz: d3d0924a67612ab7231f31eca989d06981208b5a66ee7feeb7f2cc2756c46bb884a45d7aa12731c0e80c88731ee8cfac6ecdbfd13b7df63789c3a030a3673ffc
6
+ metadata.gz: 37d39b4ee20fd892843b639300114f908f4ab3187c5cc79b19c6f5a192dca6fa74aa32fe315ccc250d8510ac78d00a0430ccf7d2aeb2eaa1eb13e0537d367812
7
+ data.tar.gz: 26dd12e232e6ef9879163cafd67183f6f6b7fb1f8337a17b980ea9abc451a3c8b73240d070e79487c9f3f4cc11a5be8bdafeae9ea93dbf27cf7d02cc34ea7e69
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  Each new release typically also includes the latest modulesync defaults.
5
5
  These should not affect the functionality of the module.
6
6
 
7
+ ## [v1.6.1](https://github.com/voxpupuli/puppet_webhook/tree/v1.6.1) (2019-01-15)
8
+ [Full Changelog](https://github.com/voxpupuli/puppet_webhook/compare/v1.6.1...v1.6.1)
9
+
10
+ **Fixed bugs:**
11
+
12
+ - Ensure that the ssl cert/key content is sent to WEBrick, not the path [\#84](https://github.com/voxpupuli/puppet_webhook/pull/84) ([dhollinger](https://github.com/dhollinger))
13
+
7
14
  ## [v1.6.1](https://github.com/voxpupuli/puppet_webhook/tree/v1.6.1) (2018-12-23)
8
15
  [Full Changelog](https://github.com/voxpupuli/puppet_webhook/compare/v1.6.0...v1.6.1)
9
16
 
data/bin/puppet_webhook CHANGED
@@ -48,11 +48,11 @@ optparse = OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
48
48
  end
49
49
 
50
50
  opts.on('--ssl-cert FILE', 'Specify the SSL cert to use. Pair with --ssl-key.') do |arg|
51
- ssl_opts[:ssl_cert] = OpenSSL::X509::Certificate.new(File.open(arg).read)
51
+ ssl_opts[:ssl_cert] = arg
52
52
  end
53
53
 
54
54
  opts.on('--ssl-key FILE', 'Specify the SSL key to use. Pair with --ssl-cert.') do |arg|
55
- ssl_opts[:ssl_key] = OpenSSL::PKey::RSA.new(File.open(arg))
55
+ ssl_opts[:ssl_key] = arg
56
56
  end
57
57
 
58
58
  opts.on('-c FILE', '--configfile FILE', 'Specifies a configuration file to use.') do |arg|
@@ -84,7 +84,13 @@ if @server_config
84
84
  ssl_opts[:enable_ssl] = settings.enable_ssl if settings.respond_to? :enable_ssl=
85
85
  ssl_opts[:ssl_verify] = settings.ssl_verify if settings.respond_to? :ssl_verify=
86
86
  ssl_opts[:ssl_cert] = settings.ssl_cert if settings.respond_to? :ssl_cert=
87
- ssl_opts[:ssl_key] = settings.enable_ssl if settings.respond_to? :ssl_key=
87
+ ssl_opts[:ssl_key] = settings.ssl_key if settings.respond_to? :ssl_key=
88
+ end
89
+
90
+ def ssl_verify(ssl_opts)
91
+ return OpenSSL::SSL::VERIFY_NONE unless ssl_opts[:ssl_verify]
92
+
93
+ OpenSSL::SSL::VERIFY_PEER
88
94
  end
89
95
 
90
96
  LOGGER = WEBrick::Log.new(options[:logfile], Object.const_get("WEBrick::Log::#{options[:loglevel]}"))
@@ -99,9 +105,9 @@ webrick_opts = {
99
105
 
100
106
  if ssl_opts[:enable_ssl]
101
107
  webrick_opts[:SSLEnable] = ssl_opts[:enable_ssl]
102
- webrick_opts[:SSLVerifyClient] = ssl_opts[:ssl_verify]
103
- webrick_opts[:SSLCertificate] = ssl_opts[:ssl_cert]
104
- webrick_opts[:SSLPrivateKey] = ssl_opts[:ssl_key]
108
+ webrick_opts[:SSLVerifyClient] = ssl_verify(ssl_opts)
109
+ webrick_opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(ssl_opts[:ssl_cert]))
110
+ webrick_opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(File.read(ssl_opts[:ssl_key]))
105
111
  webrick_opts[:SSLCertName] = [['CN', WEBrick::Utils.getservername]]
106
112
  end
107
113
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_webhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-23 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json