didww-v3 6.2.0 → 6.2.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: cadaea9315bfa69aa413d4cbec93d08d877e538f4423141f95beda30a1242ecb
4
- data.tar.gz: 1600bdbbf304e00e80b970f289ca1bdc18b77b452baec09f08799ce70ce0750f
3
+ metadata.gz: b1101871e7a9f40f264d7d9bfc1f3ab0f51c398fcdcc4a4154b9d8c9f061dfe5
4
+ data.tar.gz: 4a35ff675a731bb3d886dcbab60d0f112cbad2b8d96f1593b54f1f76c9547581
5
5
  SHA512:
6
- metadata.gz: aad1243da599c25fbe2d0411804ccdcee166830ca547bab18df176f2c15fb1cc9165e158ded14a1314d626a79078fa13e07d99b57bb04327c5a5baa244aa006d
7
- data.tar.gz: f1a754028e725b7d24048baa7326f46280c5f84c93939ec1e486f10dd1a9f3e98a5d1574ed79d273250acde87b7f0eb36877275c46e042374608d214017fe24f
6
+ metadata.gz: 49177d8bca07e63922c22b70501adbfd1000703532a55f4e3fae242dd9d61ddac874cfb0bf9182a36ab337b0dc68e08e017fa74553f8e220e2bc6f9a06e13068
7
+ data.tar.gz: da7bda7235b89f0024510a9824ba38ffffeb2fd8ce9de85c33ce319b8d7c3cb1c44f3a5672597496ebcbcb2faf69a9467b228b921ef508537be16467f324a120
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [6.2.1] - 2026-10-07
8
+ ### Changed
9
+ - `DIDWW::Callback::RequestValidator` is keyed with the callback secret enabled in the DIDWW User Panel (**APIs → DIDWW API 3 → Callback Secrets**); its constructor argument is renamed to `callback_secret`. The argument is positional, so existing code keeps working, and the signature algorithm is unchanged.
10
+
7
11
  ## [6.2.0] - 2026-06-14
8
12
  ### Added
9
13
  - `VoiceOutTrunk#rtp_ping` (boolean) — exposes the outbound trunk RTP ping toggle.
data/README.md CHANGED
@@ -442,10 +442,12 @@ See [docs/resource_relationships.md](docs/resource_relationships.md) for a Merma
442
442
 
443
443
  Validate incoming webhook callbacks from DIDWW using HMAC-SHA1 signature verification.
444
444
 
445
+ Initialize the validator with the callback secret that is enabled in the DIDWW User Panel (**APIs → DIDWW API 3 → Callback Secrets**). DIDWW signs every callback with it and sends callbacks only while a callback secret is enabled.
446
+
445
447
  ```ruby
446
448
  require 'didww/callback/request_validator'
447
449
 
448
- validator = DIDWW::Callback::RequestValidator.new("YOUR_API_KEY")
450
+ validator = DIDWW::Callback::RequestValidator.new("YOUR_CALLBACK_SECRET")
449
451
 
450
452
  # In your webhook handler:
451
453
  valid = validator.validate(
@@ -464,7 +466,7 @@ class WebhooksController < ApplicationController
464
466
  skip_before_action :verify_authenticity_token
465
467
 
466
468
  def create
467
- validator = DIDWW::Callback::RequestValidator.new("YOUR_API_KEY")
469
+ validator = DIDWW::Callback::RequestValidator.new("YOUR_CALLBACK_SECRET")
468
470
  signature = request.headers[DIDWW::Callback::RequestValidator::HEADER]
469
471
  params_hash = request.POST
470
472
 
@@ -4,7 +4,7 @@ require 'openssl'
4
4
  module DIDWW
5
5
  module Callback
6
6
  # @example
7
- # validator = DIDWW::Callback::RequestValidator.new(api_key)
7
+ # validator = DIDWW::Callback::RequestValidator.new(callback_secret)
8
8
  # uri = request.original_url
9
9
  # if request.post?
10
10
  # # Collect all parameters passed from DIDWW.
@@ -20,8 +20,9 @@ module DIDWW
20
20
  DIGEST_ALGO = 'SHA1'
21
21
  HEADER = 'X-DIDWW-Signature'
22
22
 
23
- def initialize(api_key)
24
- @api_key = api_key
23
+ # @param callback_secret [String] the callback secret enabled in the DIDWW User Panel.
24
+ def initialize(callback_secret)
25
+ @callback_secret = callback_secret
25
26
  end
26
27
 
27
28
  # @param url [String]
@@ -41,7 +42,7 @@ module DIDWW
41
42
  # @return [String] generated signature in URL safe format.
42
43
  def valid_signature(url, payload)
43
44
  data = normalize_url(url) + normalize_payload(payload)
44
- OpenSSL::HMAC.hexdigest(DIGEST_ALGO, @api_key, data)
45
+ OpenSSL::HMAC.hexdigest(DIGEST_ALGO, @callback_secret, data)
45
46
  end
46
47
 
47
48
  # @param payload [Hash,Array]
data/lib/didww/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module DIDWW
3
- VERSION = '6.2.0'.freeze
3
+ VERSION = '6.2.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didww-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Korobeinikov
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  - !ruby/object:Gem::Version
255
255
  version: '0'
256
256
  requirements: []
257
- rubygems_version: 3.7.1
257
+ rubygems_version: 3.6.9
258
258
  specification_version: 4
259
259
  summary: Ruby client for DIDWW API v3
260
260
  test_files: []