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 +4 -4
- data/README.md +28 -0
- data/lib/vonage/http.rb +3 -3
- data/lib/vonage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 882867135989a3281df945f45ee52c5f8ccd01f60878e0987570f43d5802b384
|
4
|
+
data.tar.gz: 805db1a403bdbe6ceae3adb90b7e1cf8afdc25215b947e5a41a010b5050e4836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/vonage/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|