telnyx 5.71.0 → 5.72.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: 55892760f556bee9521d8c638235b5dce702cea3c1766f230318952e9db8f8ab
4
- data.tar.gz: bfa439dd1d25de410cd87030b3a86f119b068e922ed4f74821c6028fc9beb3bf
3
+ metadata.gz: d4b500a4bc4109025ba78f82c49404d3013e7503c76f1d9c8634b3acafbab842
4
+ data.tar.gz: 10cf9319219e298027dc388a87825bd3edd259ffdeead4f22296ed2a69c6a0e2
5
5
  SHA512:
6
- metadata.gz: ed548d98590649ba4b7e628a4f2955f1a40c6ba9e78b6268d396a7ed400e6e6870c39951bdb70fdd21f0ab10187767a752b59fba7e493539c37fd26d996a438b
7
- data.tar.gz: d8ae515be892c263d2a85a0ee1b60531aca724fe39973e5b148c32bfa6cb5c58ce37a7bf3ae5d92d41f146c4cdc5bd887970cf9df3dd246ce8d17a9b89c20da9
6
+ metadata.gz: b9f7f8f34ba648a1ec8309a25a958b2cfccb5e8f4f78753110353ba7795b5d82191d2939ce8bc7890f91b174875349ca89d7161cf11bc8171311c75c282e0724
7
+ data.tar.gz: 1ce14a74710071dabcf31b1c5046172211879613dfe534cadf77783cf66e696bf557a15ade2928eaf5de7f3aa6637c93d4b83b22c0f78bb738c2d36f842559c3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.72.0 (2026-04-11)
4
+
5
+ Full Changelog: [v5.71.0...v5.72.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.71.0...v5.72.0)
6
+
7
+ ### Features
8
+
9
+ * **lib:** make ED25519 the default webhook verification ([c281219](https://github.com/team-telnyx/telnyx-ruby/commit/c2812192677e731ddf6b6702590f7e55d2f3ef68))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **lib:** move ED25519 auto-require to lib.rb entry point to survive codegen ([7f38f2c](https://github.com/team-telnyx/telnyx-ruby/commit/7f38f2cf33fb3c8391ce7d8f86c88513d7edc907))
15
+ * **lib:** update webhook tests for ED25519 default unwrap ([30ac4c7](https://github.com/team-telnyx/telnyx-ruby/commit/30ac4c7d1fc66732ba5dc55824d3876b4dd120f0))
16
+
3
17
  ## 5.71.0 (2026-04-11)
4
18
 
5
19
  Full Changelog: [v5.70.0...v5.71.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.70.0...v5.71.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "telnyx", "~> 5.71.0"
27
+ gem "telnyx", "~> 5.72.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -150,7 +150,20 @@ module Telnyx
150
150
  # The raw 32-byte key needs to be wrapped in X.509 SubjectPublicKeyInfo format
151
151
  # ED25519 OID: 1.3.101.112 = 06 03 2b 65 70
152
152
  # X.509 SPKI header for ED25519: 30 2a 30 05 06 03 2b 65 70 03 21 00
153
- ed25519_spki_header = [0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00].pack("C*")
153
+ ed25519_spki_header = [
154
+ 0x30,
155
+ 0x2a,
156
+ 0x30,
157
+ 0x05,
158
+ 0x06,
159
+ 0x03,
160
+ 0x2b,
161
+ 0x65,
162
+ 0x70,
163
+ 0x03,
164
+ 0x21,
165
+ 0x00
166
+ ].pack("C*")
154
167
  der_key = ed25519_spki_header + public_key_bytes
155
168
 
156
169
  begin
@@ -3,48 +3,61 @@
3
3
  require_relative "webhook_verification"
4
4
  require_relative "webhook_verification_error"
5
5
 
6
- module Telnyx
7
- module Resources
8
- # Extends the generated Webhooks class with ED25519 signature verification.
9
- #
10
- # This reopens the Webhooks class to include the WebhookVerification module,
11
- # which adds ED25519 signature verification matching Python, Node, Go, and Java SDKs.
12
- #
13
- # Usage:
14
- #
15
- # require "telnyx"
16
- # require "telnyx/lib/webhooks_ed25519"
17
- #
18
- # client = Telnyx::Client.new(
19
- # api_key: ENV["TELNYX_API_KEY"],
20
- # public_key: ENV["TELNYX_PUBLIC_KEY"] # Base64 from Mission Control
21
- # )
22
- #
23
- # # Verify signature only (raises WebhookVerificationError on failure)
24
- # client.webhooks.verify!(payload, headers)
25
- #
26
- # # Verify and parse (ED25519 verification, then parse)
27
- # event = client.webhooks.unwrap(payload, headers: headers)
28
- #
29
- class Webhooks
30
- include Telnyx::Lib::WebhookVerification
31
-
32
- # Override unwrap to use ED25519 verification instead of StandardWebhooks.
6
+ # Only apply the ED25519 override if the generated Webhooks class exists.
7
+ # This file is loaded after lib/telnyx/resources/webhooks.rb in the gem
8
+ # load order (see lib/telnyx.rb), so the class should always be defined.
9
+ if defined?(Telnyx::Resources::Webhooks)
10
+ module Telnyx
11
+ module Resources
12
+ # Extends the generated Webhooks class with ED25519 signature verification.
13
+ #
14
+ # This reopens the Webhooks class to include the WebhookVerification module,
15
+ # which adds ED25519 signature verification matching Python, Node, Go, and Java SDKs.
16
+ #
17
+ # Usage:
18
+ #
19
+ # require "telnyx"
20
+ # # ED25519 verification is now loaded by default — no extra require needed
33
21
  #
34
- # @param payload [String] The raw webhook payload as a string
35
- # @param headers [Hash{String=>String}] The raw HTTP headers
36
- # @param key [String, nil] Optional public key override (base64-encoded ED25519)
22
+ # client = Telnyx::Client.new(
23
+ # api_key: ENV["TELNYX_API_KEY"],
24
+ # public_key: ENV["TELNYX_PUBLIC_KEY"] # Base64 from Mission Control
25
+ # )
37
26
  #
38
- # @return [Telnyx::Models::UnwrapWebhookEvent]
39
- # @raise [Telnyx::Errors::WebhookVerificationError] If verification fails
40
- def unwrap(payload, headers:, key: nil)
41
- # Use ED25519 verification
42
- do_verify_signature(payload, headers, key || @client.public_key)
27
+ # # Verify signature only (raises WebhookVerificationError on failure)
28
+ # client.webhooks.verify!(payload, headers)
29
+ #
30
+ # # Verify and parse (ED25519 verification, then parse)
31
+ # event = client.webhooks.unwrap(payload, headers: headers)
32
+ #
33
+ class Webhooks
34
+ include Telnyx::Lib::WebhookVerification
35
+
36
+ # Override unwrap to use ED25519 verification instead of StandardWebhooks.
37
+ #
38
+ # @param payload [String] The raw webhook payload as a string
39
+ # @param headers [Hash{String=>String}] The raw HTTP headers
40
+ # @param key [String, nil] Optional public key override (base64-encoded ED25519)
41
+ #
42
+ # @return [Telnyx::Models::UnwrapWebhookEvent]
43
+ # @raise [Telnyx::Errors::WebhookVerificationError] If verification fails
44
+ def unwrap(payload, headers:, key: nil)
45
+ # Use ED25519 verification
46
+ do_verify_signature(payload, headers, key || @client.public_key)
43
47
 
44
- # Parse the payload
45
- parsed = JSON.parse(payload, symbolize_names: true)
46
- Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
48
+ # Parse the payload
49
+ parsed = JSON.parse(payload, symbolize_names: true)
50
+ Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
51
+ end
47
52
  end
48
53
  end
49
54
  end
55
+ else
56
+ # If the generated Webhooks class isn't loaded yet, the ED25519 override
57
+ # can't be applied. This shouldn't happen in normal gem usage since
58
+ # lib/telnyx.rb loads resources before lib/. If you see this warning,
59
+ # ensure lib/telnyx.rb requires lib/telnyx/lib after the resources.
60
+ warn "[telnyx] ED25519 webhook verification not loaded: " \
61
+ "Telnyx::Resources::Webhooks is not defined. " \
62
+ "Check that lib/telnyx.rb loads resources before lib/telnyx/lib."
50
63
  end
data/lib/telnyx/lib.rb ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Custom lib entry point — preserved across Stainless codegen.
4
+ #
5
+ # This file requires all custom modules in lib/telnyx/lib/.
6
+ # It is loaded from lib/telnyx.rb (the gem entry point).
7
+ #
8
+ # If Stainless regenerates lib/telnyx.rb, the require_relative line
9
+ # pointing to this file must be re-added. All other custom code
10
+ # lives here and in lib/telnyx/lib/ — safe from codegen.
11
+ #
12
+ # Add new custom modules below:
13
+
14
+ require_relative "lib/webhooks_ed25519"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "5.71.0"
4
+ VERSION = "5.72.0"
5
5
  end
data/lib/telnyx.rb CHANGED
@@ -2703,3 +2703,7 @@ require_relative "telnyx/resources/wireless_blocklists"
2703
2703
  require_relative "telnyx/resources/wireless_blocklist_values"
2704
2704
  require_relative "telnyx/resources/x402"
2705
2705
  require_relative "telnyx/resources/x402/credit_account"
2706
+
2707
+ # Custom lib entry point — preserved across codegen.
2708
+ # If this line is lost after a Stainless codegen run, it must be re-added.
2709
+ require_relative "telnyx/lib"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telnyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.71.0
4
+ version: 5.72.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telnyx
@@ -93,6 +93,7 @@ files:
93
93
  - lib/telnyx/internal/type/union.rb
94
94
  - lib/telnyx/internal/type/unknown.rb
95
95
  - lib/telnyx/internal/util.rb
96
+ - lib/telnyx/lib.rb
96
97
  - lib/telnyx/lib/webhook_verification.rb
97
98
  - lib/telnyx/lib/webhook_verification_error.rb
98
99
  - lib/telnyx/lib/webhooks_ed25519.rb