pact-mock_service 0.11.0 → 0.12.0

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: 08ef2d049830fa21694aaa5f96bee8b93cb0d47c
4
- data.tar.gz: 53f315e4485c56b2c0f0cf8ab851a0a8158c2812
3
+ metadata.gz: d4f8e17d2878239b3f7dad9717666dc8af6c5940
4
+ data.tar.gz: ce1af33556f7215eae1e0e70dd19111fc069ea57
5
5
  SHA512:
6
- metadata.gz: 8b827f6bba1b7ec1943c0b03bac8b4e35662430ae5c324c54b0b24b50fb6baf22f81b1409d1bb91ec368cfb8954b9c387c29db9ddcb28d35de24b6c01629ecc4
7
- data.tar.gz: ae7c46fe3e862ce28b0c8b072a3f976480e7f80a8b22eabaea9bfd6f466325c3719e3e5feb2b1c8753e302eba125634ccf2a1bf1224c520b5eeebd31ea643203
6
+ metadata.gz: 6f1bd7a6f1efc13409f5fd8b357637f245400df1a0821129c0ef5891e9edbbc4e17b0e679a7367a93a1e6537a9ee1a95c3ddfff98097c0623c81a0d6b00aa5d1
7
+ data.tar.gz: cb5a309c5b9905d3c8c1cc36e3b5314e7d6b05308d9d014d0909fd38b10c1ac6903e9b735047ae904aeb18d84da4ae52cc97cf67196d6be002f1a57ec970b70f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@ Do this to generate your change history
2
2
 
3
3
  git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
4
4
 
5
+ ### 0.12.0 (22 Nov 2016)
6
+ * 2fa1a58 - Skip SSL test on Travis for now (Bethany Skurrie, Tue Nov 22 10:26:41 2016 +1100)
7
+ * 22a7d1d - Attempting to cleanup failing test (Bobby Earl, Mon Oct 24 16:00:05 2016 -0400)
8
+ * 43e779f - Added support for sslcert + sslkey to server.rb (Bobby Earl, Mon Oct 24 15:20:33 2016 -0400)
9
+ * d1ab8ff - Added intergration test and updated README.md (Bobby Earl, Fri Oct 21 11:29:00 2016 -0400)
10
+ * ae0a06c - Allow passing in an ssl certificate / key to use instead of having one generated. (Blackbaud-JonathanBell, Fri Oct 21 10:52:53 2016 -0400)
11
+
5
12
  ### 0.11.0 (14 Nov 2016)
6
13
  * 8b32ea9 - Upgrading pact-support version (Beth Skurrie, Mon Nov 14 10:04:22 2016 +1100)
7
14
 
data/README.md CHANGED
@@ -30,10 +30,14 @@ Check out the wiki page [here][install-windows].
30
30
 
31
31
  #### With SSL
32
32
 
33
- If you need to use the mock service with HTTPS, you can use the built-in SSL mode which relies on a self-signed certificate.
33
+ If you need to use the mock service with HTTPS, you can use the built-in SSL mode which relies on and generates a self-signed certificate.
34
34
 
35
35
  $ pact-mock-service --port 1234 --ssl
36
36
 
37
+ If you need to provide your own certificate and key, use the following syntax.
38
+
39
+ $ pact-mock-service --port 1234 --ssl --sslcert PATH_TO_CERT --sslkey PATH_TO_KEY
40
+
37
41
  ### Mac OSX and Linux, without Ruby
38
42
 
39
43
  See the [releases][releases] page for the latest standalone executables.
@@ -87,6 +87,10 @@ module Pact
87
87
 
88
88
  def webrick_opts
89
89
  opts = {Port: port.nil? ? 0 : port, AccessLog: [], Logger: WEBrick::Log::new(nil, 0)}
90
+ opts.merge!({
91
+ :SSLCertificate => OpenSSL::X509::Certificate.new(File.open(options[:sslcert]).read) }) if options[:sslcert]
92
+ opts.merge!({
93
+ :SSLPrivateKey => OpenSSL::PKey::RSA.new(File.open(options[:sslkey]).read) }) if options[:sslkey]
90
94
  opts.merge!(ssl_opts) if options[:ssl]
91
95
  opts
92
96
  end
@@ -15,6 +15,8 @@ module Pact
15
15
  method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
16
16
  method_option :log, aliases: "-l", desc: "File to which to log output"
17
17
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
18
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
19
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
18
20
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
19
21
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written"
20
22
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
@@ -33,6 +35,8 @@ module Pact
33
35
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written"
34
36
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
35
37
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
38
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
39
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
36
40
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
37
41
 
38
42
  def control
@@ -45,6 +49,8 @@ module Pact
45
49
  method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
46
50
  method_option :log, aliases: "-l", desc: "File to which to log output"
47
51
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
52
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
53
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
48
54
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
49
55
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written"
50
56
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
@@ -71,6 +77,8 @@ module Pact
71
77
  method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
72
78
  method_option :log, aliases: "-l", desc: "File to which to log output"
73
79
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
80
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
81
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
74
82
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
75
83
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written"
76
84
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
@@ -88,6 +96,8 @@ module Pact
88
96
  method_option :port, aliases: "-p", desc: "Port on which to run the service", default: '1234'
89
97
  method_option :log_dir, aliases: "-l", desc: "File to which to log output", default: "log"
90
98
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
99
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
100
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
91
101
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
92
102
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written", default: "."
93
103
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
@@ -111,6 +121,8 @@ module Pact
111
121
  method_option :port, aliases: "-p", desc: "Port on which to run the service", default: '1234'
112
122
  method_option :log_dir, aliases: "-l", desc: "File to which to log output", default: "log"
113
123
  method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS", type: :boolean, default: false
124
+ method_option :sslcert, desc: "Specify the path to the SSL cert to use when running the service over HTTPS"
125
+ method_option :sslkey, desc: "Specify the path to the SSL key to use when running the service over HTTPS"
114
126
  method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
115
127
  method_option :pact_dir, aliases: "-d", desc: "Directory to which the pacts will be written", default: "."
116
128
  method_option :pact_specification_version, aliases: "-i", desc: "The pact specification version to use when writing the pact", default: '1'
@@ -122,6 +134,13 @@ module Pact
122
134
  end
123
135
  end
124
136
 
137
+ desc 'version', "Show the pact-mock-service gem version"
138
+
139
+ def version
140
+ require 'pact/mock_service/version.rb'
141
+ puts Pact::MockService::VERSION
142
+ end
143
+
125
144
  default_task :service
126
145
 
127
146
  no_commands do
@@ -70,6 +70,10 @@ module Pact
70
70
  :Host => host,
71
71
  :AccessLog => []
72
72
  }
73
+ opts.merge!({
74
+ :SSLCertificate => OpenSSL::X509::Certificate.new(File.open(options[:sslcert]).read) }) if options[:sslcert]
75
+ opts.merge!({
76
+ :SSLPrivateKey => OpenSSL::PKey::RSA.new(File.open(options[:sslkey]).read) }) if options[:sslkey]
73
77
  opts.merge!(ssl_opts) if options[:ssl]
74
78
  opts.merge!(options[:webbrick_options]) if options[:webbrick_options]
75
79
  opts
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module MockService
3
- VERSION = "0.11.0"
3
+ VERSION = "0.12.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-mock_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-11-13 00:00:00.000000000 Z
15
+ date: 2016-11-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  version: '0'
332
332
  requirements: []
333
333
  rubyforge_project:
334
- rubygems_version: 2.4.5
334
+ rubygems_version: 2.5.1
335
335
  signing_key:
336
336
  specification_version: 4
337
337
  summary: Provides a mock service for use with Pact