pact-provider-proxy 2.1.0 → 2.2.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: b73783cf0db620e4c71da1a8988c01f75a210c36
4
- data.tar.gz: 969d8e18def3a40f24fe172326142ac5c1dc26ad
3
+ metadata.gz: 0fff4c4e689274a735a1c2790a49b418508a477f
4
+ data.tar.gz: 62a90848138e3bdcd67d0328f20581615a7aad01
5
5
  SHA512:
6
- metadata.gz: de4baaca1aba26841d77c0d1b13ecc1318f2d44aebf874cb6dd036e22b0e814666be1e2deacc8b1231587de05eae991f9d563b7a60fccb588a4139eaa3faa9c7
7
- data.tar.gz: 321e95b935ce5aece188971496d66fa9e95289f275c3d193acb60d2b0b450a71a7886bc18b3fe7bceec62cab610806c7527efab12677e85ec1409cf533f314f9
6
+ metadata.gz: 7745ed6e4c846342d9569601dd7ae087d4e1c9622cf70d330aed46ac274caa85c11e060574315ff60742278e779d47f15e1364fb9926e57be5aa6ff8186e1ded
7
+ data.tar.gz: 98daf31e5a6f7239d447c4a74c8ceb018acc4dc0189a407c1b940a2137351454927bb77fa53c0f8c6f8a4e2e6016c6f08567db57b9e73e430ae7e4c3d70c4937
@@ -1,5 +1,8 @@
1
1
  git log --pretty=format:' * %h - %s (%an, %ad)'
2
2
 
3
+ ### 2.2.0 (3 Aug 2017)
4
+ * 8a872c2 - feat(ssl verify none): Turn off SSL verification so that servers can run using self signed certificates. (Beth Skurrie, Thu Aug 3 14:04:26 2017 +1000)
5
+
3
6
  ### 2.1.0 (21 April 2015)
4
7
 
5
8
  * c94657c - Pass through PACT_DESCRIPTION, PACT_PROVIDER_STATE and BACKTRACE env vars to pact verify command (Beth Skurrie, Tue Apr 21 14:31:47 2015 +1000)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Pact::Provider::Proxy
2
2
 
3
+ [![Build Status](https://travis-ci.org/pact-foundation/pact-provider-proxy.svg?branch=master)](https://travis-ci.org/pact-foundation/pact-provider-proxy)
4
+
3
5
  Allows pact verification against a running provider at a configurable base URL (normal pact verification is run against a code base using Rack::Test::Methods - no process is actually spawned).
4
6
 
5
7
  This allows testing against providers where you have access to a running instance of a provider, but you do not have access to its code base, or where the provider is not a ruby application.
@@ -1,7 +1,7 @@
1
1
  module Pact
2
2
  module Provider
3
3
  module Proxy
4
- VERSION = "2.1.0"
4
+ VERSION = "2.2.0"
5
5
  end
6
6
  end
7
7
  end
@@ -5,6 +5,16 @@ Pact::ProxyVerificationTask.new :monolith do | task |
5
5
  task.provider_base_url 'http://localhost:9292'
6
6
  end
7
7
 
8
+ Pact::ProxyVerificationTask.new :monolith_ssl do | task |
9
+ task.pact_url './spec/support/pact.json', :pact_helper => './spec/support/custom_pact_helper'
10
+ task.provider_base_url 'https://localhost:9393'
11
+ end
12
+
13
+ desc 'Shutdown SSL monolith server after pact:verify'
14
+ task 'pact:verify:monolith_ssl' do | foo, bar |
15
+ Process.kill('INT', @@ssl_server_pid) if @@ssl_server_pid
16
+ end
17
+
8
18
  Pact::ProxyVerificationTask.new :monolith_no_pact_helper do | task |
9
19
  task.pact_url './spec/support/pact-with-no-provider-states.json'
10
20
  task.provider_base_url 'http://localhost:9292'
@@ -14,16 +24,26 @@ namespace :pact do
14
24
  namespace :test do
15
25
  task :spawn_test_monolith do
16
26
  require 'pact/mock_service/app_manager'
17
- app = lambda { | env |
18
- if env['PATH_INFO'] == '/some-path' && env['QUERY_STRING'] == 'foo=bar'
19
- [200, {}, ["Monolith!"]]
20
- else
21
- [500, {}, []]
22
- end
23
- }
27
+ app = lambda { | env | [200, {}, ["Monolith!"]] }
24
28
  Pact::MockService::AppManager.instance.register app, 9292
25
29
  Pact::MockService::AppManager.instance.spawn_all
26
30
  end
31
+
32
+ task :spawn_test_monolith_ssl do
33
+ @@ssl_server_pid = fork do
34
+ trap 'INT' do @server.shutdown end
35
+ require 'rack'
36
+ require 'rack/handler/webrick'
37
+ require 'webrick/https'
38
+
39
+ app = lambda { | env | [200, {}, ["Monolith!"]] }
40
+ webrick_opts = {:Port => 9393, :SSLEnable => true, :SSLCertName => [%w[CN localhost]]}
41
+ Rack::Handler::WEBrick.run(app, webrick_opts) do |server|
42
+ @server = server
43
+ end
44
+ end
45
+ sleep 2
46
+ end
27
47
  end
28
48
  end
29
49
 
@@ -44,12 +64,11 @@ task 'create_custom_pact_helper' do
44
64
  end
45
65
 
46
66
  task 'pact:verify:monolith' => ['pact:test:spawn_test_monolith', 'delete_pact_helper', 'create_custom_pact_helper']
67
+ task 'pact:verify:monolith_ssl' => ['pact:test:spawn_test_monolith_ssl', 'delete_pact_helper', 'create_custom_pact_helper']
47
68
  task 'pact:verify:monolith_no_pact_helper' => ['pact:test:spawn_test_monolith', 'delete_pact_helper', 'create_pact_helper_that_should_not_be_loaded']
48
69
 
49
70
  require 'rspec/core/rake_task'
50
71
 
51
72
  RSpec::Core::RakeTask.new(:spec)
52
73
 
53
- task :default => [:spec, 'pact:verify:monolith_no_pact_helper','pact:verify:monolith']
54
-
55
-
74
+ task :default => [:spec, 'pact:verify:monolith_no_pact_helper','pact:verify:monolith', 'pact:verify:monolith_ssl']
@@ -72,6 +72,7 @@ module Rack
72
72
  target_response = HttpStreamingResponse.new(target_request, uri.host, uri.port)
73
73
 
74
74
  target_response.use_ssl = "https" == uri.scheme
75
+ target_response.verify_mode = OpenSSL::SSL::VERIFY_NONE
75
76
 
76
77
  # Let rack set the transfer-encoding header
77
78
  response_headers = target_response.headers
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-provider-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pact
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.2.2
170
+ rubygems_version: 2.4.5.2
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Allows verification of a pact against a running provider