vonage 7.27.0 → 7.27.1

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: 1ef29adae44fffb9754118333b6a82cac7172cb536eb2b4ec31644694c6388ef
4
- data.tar.gz: 43496b6bcf0db687cdef8bdd4506db140fea685f48a306abc1aac4325f8300f5
3
+ metadata.gz: 882867135989a3281df945f45ee52c5f8ccd01f60878e0987570f43d5802b384
4
+ data.tar.gz: 805db1a403bdbe6ceae3adb90b7e1cf8afdc25215b947e5a41a010b5050e4836
5
5
  SHA512:
6
- metadata.gz: 055f8c7f7e0bcdc9eb8c59f0110b6bbfb850a1d725468f0e23d1e5bf736b5acdf3a9dfdbf0e17e0f4e5b54fabe6415173c2d8f39106b73ca336389f4f8483baa
7
- data.tar.gz: 72ad26a1bf8696cd465ea2f89f7ab190803a29ee13dcb3680238504b9c81c6264dc444e2e12c0e078a19dd2042ea8fe31e8988e32162413325fa7be5a56444d4
6
+ metadata.gz: 14edb2c22f6e54e58bd17a26290944ec5d963706436b3b41d1f5598f094e57a7fdd09fa6ece3d4885a575c567eddaeb16bf8ebf2bd52a5fdd107a4404e7d20ce
7
+ data.tar.gz: 284099e63365b6e08bbcb6ec3a03213ba9f812963841470b83e35b8f03e040611f75bdba1d6c35d5e4982604dcc1e9803e96fc5a290ed5677474537837687a38
data/README.md CHANGED
@@ -14,6 +14,7 @@ need a Vonage account. Sign up [for free at vonage.com][signup].
14
14
  * [Logging](#logging)
15
15
  * [Exceptions](#exceptions)
16
16
  * [Overriding the default hosts](#overriding-the-default-hosts)
17
+ * [HTTP Client Configuration](#http-client-configuration)
17
18
  * [JWT authentication](#jwt-authentication)
18
19
  * [Webhook signatures](#webhook-signatures)
19
20
  * [Pagination](#pagination)
@@ -179,6 +180,33 @@ client = Vonage::Client.new(
179
180
 
180
181
  By default the hosts are set to `api.nexmo.com` and `rest.nexmo.com`, respectively.
181
182
 
183
+ ### HTTP Client Configuration
184
+
185
+ It is possible to set configuration options on the HTTP client. This can be don in a couple of ways.
186
+
187
+ 1. Using an `:http` key during `Vonage::Client` instantiation, for example:
188
+ ```ruby
189
+ client = Vonage::Client.new(
190
+ api_key: 'YOUR-API-KEY',
191
+ api_secret: 'YOUR-API-SECRET',
192
+ http: {
193
+ max_retries: 1
194
+ }
195
+ )
196
+ ```
197
+
198
+ 2. By using the `http=` setter on the `Vonage::Config` object, for example:
199
+ ```ruby
200
+ client = Vonage::Client.new(
201
+ api_key: 'YOUR-API-KEY',
202
+ api_secret: 'YOUR-API-SECRET'
203
+ )
204
+
205
+ client.config.http = { max_retries: 1 }
206
+ ```
207
+
208
+ The Vonage Ruby SDK uses the [`Net::HTTP::Persistent` library](https://github.com/drbrain/net-http-persistent) as an HTTP client. For available configuration options see [the documentation for that library](https://www.rubydoc.info/gems/net-http-persistent/3.0.0/Net/HTTP/Persistent).
209
+
182
210
  ### Webhook signatures
183
211
 
184
212
  Certain Vonage APIs provide signed [webhooks](https://developer.vonage.com/en/getting-started/concepts/webhooks) as a means of verifying the origin of the webhooks. The exact signing mechanism varies depending on the API.
data/lib/vonage/http.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # typed: strict
2
2
  # frozen_string_literal: true
3
- require 'net/http'
3
+ require 'net/http/persistent'
4
4
 
5
5
  module Vonage
6
6
  module HTTP
@@ -21,7 +21,7 @@ module Vonage
21
21
  end
22
22
  end
23
23
 
24
- sig { params(http: Net::HTTP).returns(T::Hash[Symbol, T.untyped]) }
24
+ sig { params(http: Net::HTTP::Persistent).returns(T::Hash[Symbol, T.untyped]) }
25
25
  def set(http)
26
26
  @hash.each do |name, value|
27
27
  http.public_send(defined_options.fetch(name), value)
@@ -34,7 +34,7 @@ module Vonage
34
34
  def defined_options
35
35
  @defined_options = T.let(@defined_options, T.nilable(T::Hash[Symbol, T.untyped]))
36
36
 
37
- @defined_options ||= Net::HTTP.instance_methods.grep(/\w=\z/).each_with_object({}) do |name, hash|
37
+ @defined_options ||= Net::HTTP::Persistent.instance_methods.grep(/\w=\z/).each_with_object({}) do |name, hash|
38
38
  hash[name.to_s.chomp('=').to_sym] = name
39
39
  end
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.27.0'
4
+ VERSION = '7.27.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vonage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.27.0
4
+ version: 7.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-28 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vonage-jwt
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  - !ruby/object:Gem::Version
294
294
  version: '0'
295
295
  requirements: []
296
- rubygems_version: 3.5.11
296
+ rubygems_version: 3.5.16
297
297
  signing_key:
298
298
  specification_version: 4
299
299
  summary: This is the Ruby Server SDK for Vonage APIs. To use it you'll need a Vonage