pact-support 1.18.1 → 1.20.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
  SHA256:
3
- metadata.gz: b3fb2c40a2b73c204a645be5480655e98c5c41698b4958ca1acd1a98aeff1c9b
4
- data.tar.gz: 2d1c53df9037d026df359c0aa818d62ba00f3e1f0def19f06b350091f54a4706
3
+ metadata.gz: aa78275d3a1427e18c502011cbda176ace86f52481454ae560a364e3dc32b94a
4
+ data.tar.gz: 0d7b5b2ec8336e32c2b4d5b87940dab547497666e6e50b07e3924165a660ad2f
5
5
  SHA512:
6
- metadata.gz: 006d3697dafed4dca50b3c20f6cd3ade9bfc1d430b2681a489a8878cc86e274c2ede6b3976c4a8276bfcb6cd252d751d158c42ef6236273d97ab88d256aabb99
7
- data.tar.gz: ac8367a3b773c10e927307324d0e5c2fc379c1e727efb2bb69288c0ea0d6548555201bbc6168b52b0dfd55534fa2ba2a25eabeb842c8cadbff3f7a4be5d08f35
6
+ metadata.gz: 00ca57b4165b257361813bbf850a2fe066e75126bf9a3726563acdf17c04ac3555187359b1fd5e887eeb1f7d7a569607370c51bf16239e7c63f0e60305c70756
7
+ data.tar.gz: 70d6322bfd0c0eacf6230416677586032164686deee79f4c3d50a9101306423e09d79d6d1e48ac07528f0fc342b6c02d2ea3ed866a04acfe7d299cd7669bc6bc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ <a name="v1.20.0"></a>
2
+ ### v1.20.0 (2023-10-19)
3
+
4
+ #### Features
5
+
6
+ * handle x509 certs in HTTP Client (#99) ([6a36a48](/../../commit/6a36a48))
7
+
8
+ <a name="v1.19.0"></a>
9
+ ### v1.19.0 (2022-11-15)
10
+
11
+ #### Features
12
+
13
+ * **generators**
14
+ * add generators to a consumer contract request (#97) ([fbce4cb](/../../commit/fbce4cb))
15
+
1
16
  <a name="v1.18.1"></a>
2
17
  ### v1.18.1 (2022-08-17)
3
18
 
@@ -109,6 +109,12 @@ module Pact
109
109
  http.ca_file = ENV['SSL_CERT_FILE'] if ENV['SSL_CERT_FILE'] && ENV['SSL_CERT_FILE'] != ''
110
110
  http.ca_path = ENV['SSL_CERT_DIR'] if ENV['SSL_CERT_DIR'] && ENV['SSL_CERT_DIR'] != ''
111
111
  http.set_debug_output(Pact::Http::AuthorizationHeaderRedactor.new(Pact.configuration.output_stream)) if verbose?(options)
112
+
113
+ if x509_certificate?
114
+ http.cert = OpenSSL::X509::Certificate.new(x509_client_cert_file)
115
+ http.key = OpenSSL::PKey::RSA.new(x509_client_key_file)
116
+ end
117
+
112
118
  if disable_ssl_verification?
113
119
  if verbose?(options)
114
120
  Pact.configuration.output_stream.puts("SSL verification is disabled")
@@ -150,6 +156,19 @@ module Pact
150
156
  options[:verbose] || ENV['VERBOSE'] == 'true'
151
157
  end
152
158
 
159
+ def x509_certificate?
160
+ ENV['X509_CLIENT_CERT_FILE'] && ENV['X509_CLIENT_CERT_FILE'] != '' &&
161
+ ENV['X509_CLIENT_KEY_FILE'] && ENV['X509_CLIENT_KEY_FILE'] != ''
162
+ end
163
+
164
+ def x509_client_cert_file
165
+ File.read(ENV['X509_CLIENT_CERT_FILE'])
166
+ end
167
+
168
+ def x509_client_key_file
169
+ File.read(ENV['X509_CLIENT_KEY_FILE'])
170
+ end
171
+
153
172
  def disable_ssl_verification?
154
173
  ENV['PACT_DISABLE_SSL_VERIFICATION'] == 'true' || ENV['PACT_BROKER_DISABLE_SSL_VERIFICATION'] == 'true'
155
174
  end
@@ -6,7 +6,7 @@ module Pact
6
6
  class Expected < Pact::Request::Base
7
7
 
8
8
  DEFAULT_OPTIONS = {:allow_unexpected_keys => false}.freeze
9
- attr_accessor :options #Temporary hack
9
+ attr_accessor :options, :generators
10
10
 
11
11
  def self.from_hash(hash)
12
12
  sym_hash = symbolize_keys hash
@@ -16,11 +16,13 @@ module Pact
16
16
  headers = sym_hash.fetch(:headers, key_not_found)
17
17
  body = sym_hash.fetch(:body, key_not_found)
18
18
  options = sym_hash.fetch(:options, {})
19
- new(method, path, headers, body, query, options)
19
+ generators = sym_hash.fetch(:generators, {})
20
+ new(method, path, headers, body, query, options, generators)
20
21
  end
21
22
 
22
- def initialize(method, path, headers, body, query, options = {})
23
+ def initialize(method, path, headers, body, query, options = {}, generators = {})
23
24
  super(method, path, headers, body, query)
25
+ @generators = generators
24
26
  @options = options
25
27
  end
26
28
 
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.18.1"
3
+ VERSION = "1.20.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.1
4
+ version: 1.20.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: 2022-08-16 00:00:00.000000000 Z
15
+ date: 2023-10-18 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rainbow
@@ -48,14 +48,14 @@ dependencies:
48
48
  requirements:
49
49
  - - "~>"
50
50
  - !ruby/object:Gem::Version
51
- version: '1.4'
51
+ version: '1.5'
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - "~>"
57
57
  - !ruby/object:Gem::Version
58
- version: '1.4'
58
+ version: '1.5'
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: expgen
61
61
  requirement: !ruby/object:Gem::Requirement
@@ -110,14 +110,14 @@ dependencies:
110
110
  requirements:
111
111
  - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: '3.3'
113
+ version: 3.18.1
114
114
  type: :development
115
115
  prerelease: false
116
116
  version_requirements: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - "~>"
119
119
  - !ruby/object:Gem::Version
120
- version: '3.3'
120
+ version: 3.18.1
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: pry
123
123
  requirement: !ruby/object:Gem::Requirement
@@ -138,28 +138,28 @@ dependencies:
138
138
  requirements:
139
139
  - - "~>"
140
140
  - !ruby/object:Gem::Version
141
- version: 0.11.2
141
+ version: 2.4.0
142
142
  type: :development
143
143
  prerelease: false
144
144
  version_requirements: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - "~>"
147
147
  - !ruby/object:Gem::Version
148
- version: 0.11.2
148
+ version: 2.4.0
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: hashie
151
151
  requirement: !ruby/object:Gem::Requirement
152
152
  requirements:
153
153
  - - "~>"
154
154
  - !ruby/object:Gem::Version
155
- version: '2.0'
155
+ version: '5.0'
156
156
  type: :development
157
157
  prerelease: false
158
158
  version_requirements: !ruby/object:Gem::Requirement
159
159
  requirements:
160
160
  - - "~>"
161
161
  - !ruby/object:Gem::Version
162
- version: '2.0'
162
+ version: '5.0'
163
163
  - !ruby/object:Gem::Dependency
164
164
  name: activesupport
165
165
  requirement: !ruby/object:Gem::Requirement
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0'
321
321
  requirements: []
322
- rubygems_version: 3.3.20
322
+ rubygems_version: 3.4.21
323
323
  signing_key:
324
324
  specification_version: 4
325
325
  summary: Shared code for Pact gems