basecradle 0.17.2 → 0.17.3

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: 9f95fcda9f2157a91e2278019f201e714dc57a048f1f7e0b819bc2b39e968dfe
4
- data.tar.gz: a98cad0a7c156461386a585a794051ea6a4c26efd1f315779d46c85b5119049b
3
+ metadata.gz: 3678e2e214d103af05b907532dd29db2adf6ab1b952194224bbb72421a44f379
4
+ data.tar.gz: 42fa863ec1f9b122d3c9199323fda9a94060ea54f5b1810afcb966bd8ee83285
5
5
  SHA512:
6
- metadata.gz: bf93d1e87f3931c3924b5446d090d38307b1d54cfaaa4edb0365b96cc8b7af4111c908638e707c44f1bbed7499055de064324168141339428f895a89def52728
7
- data.tar.gz: df8cda75e927c9caa6d67066ec5ff4dcdb216981908f649fd8cdc8682006c1f7056c48d6e309a517b8aaf46c1540794f3d686da811ea958cb024e6e9550aadea
6
+ metadata.gz: 04c4f0257547edab6f5304807288ee043873af0473d6c1bd31d2ba4e8e734ea2cbd74f7cfe1c4b8f811ba18f878a4534f402c83e8fa559cb64ff11706aafb769
7
+ data.tar.gz: b7b71f2f8fdb4527785fc17cdc023a618419b62c4c22699173df8c33034208b9c25c70319cf76bfd3ad3fcd1ce5386160d5cfe14d4508b6e928b383fc329df76
data/CHANGELOG.md CHANGED
@@ -9,6 +9,32 @@ section**. The newest heading is always the version `lib/basecradle/version.rb`
9
9
  a release writes its entry and its version in the same PR — and `test/changelog_test.rb`
10
10
  fails CI if the two ever disagree.
11
11
 
12
+ ## [0.17.3] - 2026-11-26
13
+
14
+ A patch release that corrects what the SDK says about a platform change of 2026-11-26
15
+ ([#334](https://github.com/basecradle/basecradle-ruby/issues/334)). No code path changes:
16
+ no verb is added or removed, and no signature changes.
17
+
18
+ ### Fixed
19
+
20
+ - **An endpoint's `verifier` has five schemes, not four.** The platform now verifies
21
+ `twilio`, for the webhooks Twilio sends (an incoming text message, a recording or
22
+ transcription callback, a status callback). It reads Twilio's own `X-Twilio-Signature`,
23
+ fixed, so `signature_header` is ignored as it is under `github` and `slack`, and a move
24
+ from `shared_secret_header` to `twilio` that names no header resets it to `X-Signature`.
25
+ The secret is a shared key made at Twilio for signing webhooks (Twilio's own
26
+ recommendation) or the account's Auth Token. Twilio signs the URL it was given, so give
27
+ it the endpoint's `ingest_url` exactly as the endpoint reports it. Twilio also reads the
28
+ reply to a delivery, so a `twilio` endpoint answers each delivery it stores with
29
+ `200 OK` and an empty TwiML document in place of the empty `201`; that is the
30
+ endpoint's answer to the sender, and nothing this SDK returns changes. The empty answer
31
+ ends a voice call, so an `ingest_url` is never a number's voice URL, and an endpoint
32
+ holds one secret, so a change between a shared key and the Auth Token is made here in
33
+ the same minute as at Twilio; the README says both.
34
+ `configure_verification` already passed the verifier through as a string, so `twilio`
35
+ works with this SDK as it is; only the docs listed four. The README,
36
+ `WebhookVerification` and `configure_verification` now list all five.
37
+
12
38
  ## [0.17.2] - 2026-11-26
13
39
 
14
40
  A patch release that corrects what the SDK says about two platform changes of 2026-11-25
@@ -39,6 +65,7 @@ no verb is added or removed, and no signature changes.
39
65
  `slack`. It is required in the same call that moves an endpoint to
40
66
  `shared_secret_header`, or from it back to `hmac_sha256_hex`; a call that passes only
41
67
  `verifier:` there raises `BaseCradle::ValidationError`.
68
+ *Corrected in 0.17.3: since 2026-11-26 it has five, adding `twilio`.*
42
69
 
43
70
  ## [0.17.1] - 2026-11-21
44
71
 
@@ -150,7 +177,8 @@ you upgrade your own Ruby, to 3.3.14, 3.4.13 or 4.0.10.
150
177
  `hmac_sha256_hex` only. A `github` endpoint always reads `X-Hub-Signature-256`.
151
178
  *Corrected in 0.17.2: since 2026-11-25 the platform has four schemes, adding
152
179
  `shared_secret_header` and `slack`, and `signature_header:` also names the header a
153
- `shared_secret_header` endpoint reads the secret from.*
180
+ `shared_secret_header` endpoint reads the secret from. Corrected again in 0.17.3:
181
+ since 2026-11-26 it has five, adding `twilio`.*
154
182
  - **`clear_verification`** sends `clear_credential: true`, which removes the secret and
155
183
  turns verification off.
156
184
  - Both update the endpoint in place and return it, like `rotate`, so the new state
@@ -1077,6 +1105,7 @@ the Python SDK's behavior in idiomatic Ruby. Zero runtime dependencies.
1077
1105
  - **Quality bars** — a README-as-tested-doc harness (every example runs against a mocked
1078
1106
  API) and a spec drift-guard (CI fails if the live API grows beyond the SDK).
1079
1107
 
1108
+ [0.17.3]: https://github.com/basecradle/basecradle-ruby/releases/tag/v0.17.3
1080
1109
  [0.17.2]: https://github.com/basecradle/basecradle-ruby/releases/tag/v0.17.2
1081
1110
  [0.17.1]: https://github.com/basecradle/basecradle-ruby/releases/tag/v0.17.1
1082
1111
  [0.17.0]: https://github.com/basecradle/basecradle-ruby/releases/tag/v0.17.0
data/README.md CHANGED
@@ -226,7 +226,7 @@ and the SDK invents none. `BaseCradle.uuid_of(endpoint)` reads it too, and is wh
226
226
  **Signature verification is configured with two verbs.**
227
227
  `endpoint.configure_verification(verifier:, credential:, signature_header:)` sends only
228
228
  the keywords you pass, so anything left out stays as it is; passing none raises
229
- `ArgumentError` before any request. `verifier:` is the scheme, one of four today:
229
+ `ArgumentError` before any request. `verifier:` is the scheme, one of five today:
230
230
 
231
231
  | `verifier:` | For | The header it reads |
232
232
  |---|---|---|
@@ -234,6 +234,18 @@ the keywords you pass, so anything left out stays as it is; passing none raises
234
234
  | `"github"` | a GitHub webhook, pointed straight at the `ingest_url` | `X-Hub-Signature-256`, fixed |
235
235
  | `"shared_secret_header"` | a sender that cannot sign | the `signature_header:` you set; carries the secret itself |
236
236
  | `"slack"` | a Slack app's Events API | `X-Slack-Signature`, fixed; the endpoint answers Slack's `url_verification` handshake itself, and the handshake creates no event |
237
+ | `"twilio"` | the webhooks Twilio sends (an incoming text message, a recording or transcription callback, a status callback) | `X-Twilio-Signature`, fixed; Twilio signs the URL it was given, so give it the `ingest_url` exactly as the endpoint reports it |
238
+
239
+ Under `twilio` the secret is a shared key made at Twilio for signing webhooks (Twilio's own
240
+ recommendation) or the account's Auth Token. Twilio reads the reply to a delivery, so a
241
+ `twilio` endpoint answers each delivery it stores with `200 OK` and an empty TwiML document
242
+ in place of the empty `201`. That is the endpoint's answer to the sender; nothing this SDK
243
+ returns changes. The empty answer also ends a voice call, so never make the `ingest_url` a
244
+ number's voice URL: answer the call with TwiML of your own that records a message, and point
245
+ the recording's callbacks here. An endpoint holds one secret, a delivery signed with the
246
+ other is refused with `401`, and Twilio does not resend it by default, so when you switch
247
+ between a shared key and the Auth Token, or replace a shared key, change the secret here in
248
+ the same minute you change it at Twilio.
237
249
 
238
250
  The verifier is passed through as given, so a scheme the platform adds later needs no SDK
239
251
  release; one it does not know raises `BaseCradle::ValidationError`. Use a signing scheme
@@ -245,12 +257,12 @@ stays, and `verification.enabled` cannot tell you a rotation was skipped, so mak
245
257
  secret read from the environment is not empty before passing it. It is **write-only**: the
246
258
  API never returns it, and the SDK keeps no copy and never puts it in an `inspect` or an
247
259
  error message. `signature_header:` names the header that is read: the signature's under
248
- `hmac_sha256_hex`, the secret's under `shared_secret_header`; a `github` or `slack`
249
- endpoint ignores it. **Pass it in the same call that moves an endpoint to
260
+ `hmac_sha256_hex`, the secret's under `shared_secret_header`; a `github`, `slack` or
261
+ `twilio` endpoint ignores it. **Pass it in the same call that moves an endpoint to
250
262
  `shared_secret_header`, or from it back to `hmac_sha256_hex`** — a header named for one
251
263
  scheme is never carried over to the other, so a call that passes only `verifier:` raises
252
- `BaseCradle::ValidationError`. A move from `shared_secret_header` to `github` or `slack`
253
- that names no header resets it to `X-Signature`. `endpoint.clear_verification` removes the secret and turns verification
264
+ `BaseCradle::ValidationError`. A move from `shared_secret_header` to `github`, `slack` or
265
+ `twilio` that names no header resets it to `X-Signature`. `endpoint.clear_verification` removes the secret and turns verification
254
266
  off. Both return the endpoint, updated in place; read the result at
255
267
  `endpoint.content.verification`. How senders sign is in the API docs:
256
268
  [Verifying Inbound Deliveries](https://basecradle.com/docs/api#verifying-inbound-deliveries-optional).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BaseCradle
4
- VERSION = "0.17.2"
4
+ VERSION = "0.17.3"
5
5
  end
@@ -19,10 +19,11 @@ module BaseCradle
19
19
  attribute :enabled
20
20
  # The header deliveries are checked against: the signature's under "hmac_sha256_hex",
21
21
  # the secret's under "shared_secret_header". A "github" endpoint reports its fixed
22
- # X-Hub-Signature-256 here; a "slack" endpoint always reads X-Slack-Signature.
22
+ # X-Hub-Signature-256 here; a "slack" endpoint always reads X-Slack-Signature, and a
23
+ # "twilio" endpoint X-Twilio-Signature.
23
24
  attribute :signature_header
24
- # "hmac_sha256_hex", "github", "shared_secret_header" or "slack" today — an open set;
25
- # read it as a string.
25
+ # "hmac_sha256_hex", "github", "shared_secret_header", "slack" or "twilio" today — an
26
+ # open set; read it as a string.
26
27
  attribute :verifier
27
28
  end
28
29
 
@@ -76,31 +77,43 @@ module BaseCradle
76
77
  # stays as it is; pass at least one, or this raises ArgumentError before any request
77
78
  # is made.
78
79
  #
79
- # - +verifier+ is the scheme, one of four today: "hmac_sha256_hex" (the default; any
80
- # sender you control signs the body), "github" (a GitHub webhook), "slack" (a Slack
81
- # app's Events API; the endpoint answers Slack's url_verification handshake itself,
82
- # and the handshake creates no event) or "shared_secret_header" (a sender that
83
- # cannot sign sends the secret itself in a header). It is passed through as given,
84
- # so a scheme the platform adds later works here unchanged; one it does not know
85
- # raises ValidationError.
80
+ # - +verifier+ is the scheme, one of five today: "hmac_sha256_hex" (the default; any
81
+ # sender you control signs the body), "github" (a GitHub webhook),
82
+ # "shared_secret_header" (a sender that cannot sign sends the secret itself in a
83
+ # header), "slack" (a Slack app's Events API; the endpoint answers Slack's
84
+ # url_verification handshake itself, and the handshake creates no event) or "twilio"
85
+ # (the webhooks Twilio sends: an incoming text message, a recording or transcription
86
+ # callback, a status callback). It is passed through as given, so a scheme the
87
+ # platform adds later works here unchanged; one it does not know raises
88
+ # ValidationError. Twilio signs the URL it was given, so give it +content.ingest_url+
89
+ # exactly as the endpoint reports it. Twilio also reads the reply, so a "twilio"
90
+ # endpoint answers each delivery it stores with 200 OK and an empty TwiML document
91
+ # in place of the empty 201: the answer to the sender, which changes nothing this
92
+ # method returns. That empty answer ends a voice call, so the ingest_url is never a
93
+ # number's voice URL; point a recording's callbacks at it instead.
86
94
  # - +credential+ is the signing secret, sent as +verification_credential+: setting it
87
95
  # turns verification on. Under "shared_secret_header" nothing is signed: it is the
88
- # header's exact value, compared as sent, so include any prefix the sender adds. A
89
- # blank one is sent as given and the API treats it as no change: the current
90
- # secret, if any, stays, and +content.verification.enabled+
91
- # cannot tell that skipped rotation from a real one, so make sure a secret read from
92
- # the environment is not empty before passing it. It is sent as its bytes, which
93
- # must be UTF-8 (a BINARY string read from a file is fine); a credential that is not
94
- # a String, or whose bytes are not UTF-8, raises ArgumentError before any request,
95
- # and the error never shows it. It is write-only: the API never returns it, and this
96
- # SDK keeps no copy and never puts it in an inspect or an error message.
96
+ # header's exact value, compared as sent, so include any prefix the sender adds.
97
+ # Under "twilio" it is a shared key made at Twilio for signing webhooks (Twilio's own
98
+ # recommendation) or the account's Auth Token. An endpoint holds one secret, a
99
+ # delivery signed with the other is refused with 401, and Twilio does not resend it
100
+ # by default: when you switch between the two, or replace a shared key, change it
101
+ # here in the same minute you change it at Twilio. A blank credential is sent as
102
+ # given and the API treats it as no change: the current secret, if any, stays, and
103
+ # +content.verification.enabled+ cannot tell that skipped rotation from a real one,
104
+ # so make sure a secret read from the environment is not empty before passing it. It
105
+ # is sent as its bytes, which must be UTF-8 (a BINARY string read from a file is
106
+ # fine); a credential that is not a String, or whose bytes are not UTF-8, raises
107
+ # ArgumentError before any request, and the error never shows it. It is write-only:
108
+ # the API never returns it, and this SDK keeps no copy and never puts it in an
109
+ # inspect or an error message.
97
110
  # - +signature_header+ is the header that is read: the signature's under
98
- # "hmac_sha256_hex", the secret's under "shared_secret_header". A "github" or
99
- # "slack" endpoint ignores it. Pass it in the same call that moves an endpoint to
100
- # "shared_secret_header", or from it back to "hmac_sha256_hex": a header named for
101
- # one is never carried over to the other, so passing only +verifier+ there raises
102
- # ValidationError. A move from "shared_secret_header" to "github" or "slack" that
103
- # names no header resets it to X-Signature.
111
+ # "hmac_sha256_hex", the secret's under "shared_secret_header". A "github", "slack"
112
+ # or "twilio" endpoint ignores it. Pass it in the same call that moves an endpoint
113
+ # to "shared_secret_header", or from it back to "hmac_sha256_hex": a header named
114
+ # for one is never carried over to the other, so passing only +verifier+ there
115
+ # raises ValidationError. A move from "shared_secret_header" to "github", "slack" or
116
+ # "twilio" that names no header resets it to X-Signature.
104
117
  #
105
118
  # Any viewer of the endpoint's timeline may configure it, locked timeline or not.
106
119
  # Returns this endpoint, which adopts the one the API returns, so
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basecradle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.17.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drawk Kwast