vonage 7.19.0 → 7.21.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: 748a3a579f5c7c4a263b7b840234b0489e7b895e63d43d939f01bdc177616a53
4
- data.tar.gz: 6e2b5d3d0a8135aff72a1314c33a833c1a77384f7a6047e6147c013e29e6ea45
3
+ metadata.gz: 8839127b442d9de3ee98bfc35f38bf76c967389bcf02136a28c8232f497f94bb
4
+ data.tar.gz: c52b8d863d3326153f6678a9234457eb945b155f6fdfa2b782e45abbc4c5d16b
5
5
  SHA512:
6
- metadata.gz: 913f6f7f81f667513740f61849db751dfdd9dc60ca6366c81b6e621564e53719f3503a5085ed38f7c48570dd55a33a26b5037af136387aa2226ed7c8a4542b2c
7
- data.tar.gz: 636e92166449f951489340b2cb00a00c7f72225fd2239f4ba9faba6919e72bd17ba24454f8a2be9ed2be8c6f76382045490a2d24b13e09bb1323dbb5dbadcb81
6
+ metadata.gz: bf2d3ae171d5278f8c8d9c68129e3ba70b1edce0d16fb414bf0ecae7995c27620fbaca284f40c121dc128e6388f1485fa4bfa069f52e38b029d2f76397a73b0e
7
+ data.tar.gz: 49897746fc8dc49fd67b01e3366215cc6298a59f771c1544b0004d2dcdac07c5d4b2263f383ac6c17e9d9bf7ca483bb4922bcc4ebdcdb0167a4823ac4387f627
@@ -2,6 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'net/http'
5
+ require 'net/http/persistent'
5
6
  require 'net/http/post/multipart'
6
7
  require 'json'
7
8
 
@@ -12,8 +13,7 @@ module Vonage
12
13
 
13
14
  @host = set_host
14
15
 
15
- @http = Net::HTTP.new(@host, Net::HTTP.https_default_port, p_addr = nil)
16
- @http.use_ssl = true
16
+ @http = Net::HTTP::Persistent.new
17
17
 
18
18
  @config.http.set(@http) unless @config.http.nil?
19
19
  end
@@ -94,7 +94,8 @@ module Vonage
94
94
  def make_request!(request, &block)
95
95
  logger.log_request_info(request)
96
96
 
97
- response = @http.request(request, &block)
97
+ uri = URI("https://" + @host + request.path)
98
+ response = @http.request(uri, request, &block)
98
99
 
99
100
  logger.log_response_info(response, @host)
100
101
 
@@ -143,7 +144,7 @@ module Vonage
143
144
 
144
145
  uri = override_uri ? URI(override_uri) : URI('https://' + @host + path)
145
146
 
146
- http = override_uri ? Net::HTTP.new(uri.host, Net::HTTP.https_default_port, p_addr = nil) : @http
147
+ http = Net::HTTP.new(uri.host, Net::HTTP.https_default_port, p_addr = nil)
147
148
  http.use_ssl = true
148
149
  http.set_debug_output($stdout)
149
150
 
@@ -32,7 +32,7 @@ module Vonage
32
32
 
33
33
  signature = params.delete('sig')
34
34
 
35
- ::JWT::Algos::Hmac::SecurityUtils.secure_compare(signature, digest(params, signature_secret, signature_method))
35
+ ::JWT::JWA::Hmac::SecurityUtils.secure_compare(signature, digest(params, signature_secret, signature_method))
36
36
  end
37
37
 
38
38
  private
@@ -6,7 +6,7 @@ module Vonage
6
6
  class Verify2::Channels::SMS
7
7
  APP_HASH_LENGTH = 11
8
8
 
9
- attr_reader :channel, :to, :app_hash
9
+ attr_reader :channel, :to, :from, :entity_id, :content_id, :app_hash
10
10
 
11
11
  def initialize(to:, app_hash: nil)
12
12
  self.channel = 'sms'
@@ -19,6 +19,20 @@ module Vonage
19
19
  @to = to
20
20
  end
21
21
 
22
+ def from=(from)
23
+ @from = from
24
+ end
25
+
26
+ def entity_id=(entity_id)
27
+ raise ArgumentError, "Invalid 'entity_id' value #{entity_id}. Length must be between 1 and 20 characters." unless entity_id.length.between?(1, 20)
28
+ @entity_id = entity_id
29
+ end
30
+
31
+ def content_id=(content_id)
32
+ raise ArgumentError, "Invalid 'content_id' value #{content_id}. Length must be between 1 and 20 characters ." unless content_id.length.between?(1, 20)
33
+ @content_id = content_id
34
+ end
35
+
22
36
  def app_hash=(app_hash)
23
37
  raise ArgumentError, "Invalid 'app_hash' value #{app_hash}. Length must be #{APP_HASH_LENGTH}" unless app_hash.length == APP_HASH_LENGTH
24
38
  @app_hash = app_hash
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.19.0'
4
+ VERSION = '7.21.0'
5
5
  end
data/vonage.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency('zeitwerk', '~> 2', '>= 2.2')
17
17
  s.add_dependency('sorbet-runtime', '~> 0.5')
18
18
  s.add_dependency('multipart-post', '~> 2.0')
19
+ s.add_dependency('net-http-persistent', '~> 4.0', '>= 4.0.2')
19
20
  s.add_runtime_dependency('rexml')
20
21
  s.add_runtime_dependency('phonelib')
21
22
  s.require_path = 'lib'
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.19.0
4
+ version: 7.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-11 00:00:00.000000000 Z
11
+ date: 2024-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vonage-jwt
@@ -72,6 +72,26 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '2.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: net-http-persistent
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '4.0'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 4.0.2
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '4.0'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 4.0.2
75
95
  - !ruby/object:Gem::Dependency
76
96
  name: rexml
77
97
  requirement: !ruby/object:Gem::Requirement
@@ -254,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
274
  - !ruby/object:Gem::Version
255
275
  version: '0'
256
276
  requirements: []
257
- rubygems_version: 3.4.10
277
+ rubygems_version: 3.5.3
258
278
  signing_key:
259
279
  specification_version: 4
260
280
  summary: This is the Ruby Server SDK for Vonage APIs. To use it you'll need a Vonage