stream-chat-ruby 3.27.0 → 3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a99c43d6a3163fd4978c76884ae662c86b2651ab15f99fa088f2ef9e8f4126a
4
- data.tar.gz: b3243d7e83eb1e03e0ed9e270cfa4d439882a67836e04382c4d169e6594f01e1
3
+ metadata.gz: 48c78a2a0081a76241ab501b91fa58b1cca8ccacd7b462fb28554ad35b951a8d
4
+ data.tar.gz: ba1a3c81f4375ee099810973fba14d6c19ab183cdb84160be54cfd7b19a65cf8
5
5
  SHA512:
6
- metadata.gz: 9f80e08e784f75111e85c56b4cecf159375fc2ffca2eab9d53aa8cd488365a39d9fcef93001351b2ecb0e9d29e900184507fafc067cbfcdab0c92ec331075d86
7
- data.tar.gz: f3f66091808fdfcaa3980fd33338d94a41afe37631e39b9561cad90c955db4ddc8eca273ae44f30e91e8b84b8577f298f06f0f32f9b7a666537f3176d3f008de
6
+ metadata.gz: dd811ac6d24e3f4f1aa111e6f96f71500e0c2cb8518ab5ac91d8db225ae70e3b343cff700dd75172c9d715820e20dc988dadf3069795908718651a5f68ebdb4c
7
+ data.tar.gz: 8de722a10b48d55a3d4c474b9b69b284346a651386b002e0a804142ab0facaa94a7c46ea9cec5b143793b9b9fc8f1bde0c6cef5bf930cf71c46a70ba783a6bac
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.27.1](https://github.com/GetStream/stream-chat-ruby/compare/v3.27.0...v3.27.1) (2026-11-17)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * limit decompressed webhook payloads to 10 MiB ([#230](https://github.com/GetStream/stream-chat-ruby/issues/230)) ([860901a](https://github.com/GetStream/stream-chat-ruby/commit/860901adbcaf0981ce407d915dbbe1e51f2f594a))
11
+
12
+
13
+ ### Other
14
+
15
+ * add deprecation notice to README ([#220](https://github.com/GetStream/stream-chat-ruby/issues/220)) ([7d1117e](https://github.com/GetStream/stream-chat-ruby/commit/7d1117e43ecb7a4ace8cfdcbfbde691500d8212f))
16
+
5
17
  ## [3.27.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.26.2...v3.27.0) (2026-10-29)
6
18
 
7
19
 
data/README.md CHANGED
@@ -1,18 +1,18 @@
1
- > **Note:** [`getstream-ruby`](https://github.com/GetStream/getstream-ruby) is the new full-product SDK for Stream, covering Chat, Video, Moderation, and Feeds with long-term support.
1
+ > [!CAUTION]
2
+ > ## ⚠️ This is a legacy SDK. It is deprecated.
2
3
  >
3
- > **`stream-chat-ruby` is now in maintenance mode.** It will continue to receive critical fixes and requested features, so it is safe to keep using. However, we encourage existing users to migrate when convenient and strongly recommend that new projects start with `getstream-ruby`.
4
+ > 🚫 **Do not start new projects with `stream-chat-ruby`.**
4
5
  >
5
- > Check out the [Migration Guide](https://github.com/GetStream/getstream-ruby/blob/570aaf9b73b27fe01a4abbc1f7c6b639595c304e/docs/migration-from-stream-chat-ruby/README.md) for side-by-side examples covering common use cases.
6
+ > ✅ **Use [`getstream-ruby`](https://github.com/GetStream/getstream-ruby) (gem `getstream-ruby`) instead.** It covers Chat, Video, Moderation and Feeds in one SDK.
7
+ >
8
+ > 🔁 **Already using `stream-chat-ruby`?** Follow the [migration guide](https://github.com/GetStream/getstream-ruby/tree/master/docs/migration-from-stream-chat-ruby) to move your code.
6
9
 
7
- # Official Ruby SDK for [Stream Chat](https://getstream.io/chat/)
10
+ # Legacy Ruby SDK for [Stream Chat](https://getstream.io/chat/)
8
11
 
9
12
  [![build](https://github.com/GetStream/stream-chat-ruby/workflows/build/badge.svg)](https://github.com/GetStream/stream-chat-ruby/actions) [![Gem Version](https://badge.fury.io/rb/stream-chat-ruby.svg)](http://badge.fury.io/rb/stream-chat-ruby)
10
13
 
11
14
  <p align="center">
12
- <img src="./assets/logo.svg" width="50%" height="50%">
13
- </p>
14
- <p align="center">
15
- Official Ruby API client for Stream Chat, a service for building chat applications.
15
+ Legacy Ruby API client for Stream Chat, a service for building chat applications.
16
16
  <br />
17
17
  <a href="https://getstream.io/chat/docs/"><strong>Explore the docs »</strong></a>
18
18
  <br />
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module StreamChat
5
- VERSION = '3.27.0'
5
+ VERSION = '3.27.1'
6
6
  end
@@ -27,6 +27,18 @@ module StreamChat
27
27
 
28
28
  GZIP_MAGIC = T.let("\x1f\x8b".b.freeze, String)
29
29
 
30
+ @max_payload_bytes = T.let(10 * 1024 * 1024, Integer)
31
+
32
+ class << self
33
+ extend T::Sig
34
+
35
+ # Caps the decompressed size of a gzip webhook body. gunzip_payload runs
36
+ # before the signature check, so without a cap an unsigned gzip bomb could
37
+ # exhaust memory. Raise it if your events are larger.
38
+ sig { returns(Integer) }
39
+ attr_accessor :max_payload_bytes
40
+ end
41
+
30
42
  # Coerces the webhook body into a binary `String` regardless of whether
31
43
  # the caller hands us a `String` (HTTP `request.raw_post`) or an array of
32
44
  # bytes (which is what some Ruby SQS clients yield when the message body
@@ -49,16 +61,24 @@ module StreamChat
49
61
  # Magic-byte detection (rather than relying on a header) keeps the same
50
62
  # handler correct when middleware - Rack, Rails - auto-decompresses the
51
63
  # request before your code sees it.
64
+ #
65
+ # Raises `InvalidWebhookError` when the gzip stream is malformed or
66
+ # decompresses to more than `max_payload_bytes`.
52
67
  sig { params(body: T.any(String, T::Array[Integer])).returns(String) }
53
68
  def self.gunzip_payload(body)
54
69
  raw = normalize_body(body)
55
70
  return raw unless raw.start_with?(GZIP_MAGIC)
56
71
 
57
- begin
58
- Zlib::GzipReader.new(StringIO.new(raw)).read.force_encoding(Encoding::ASCII_8BIT)
59
- rescue Zlib::Error
60
- raise InvalidWebhookError, InvalidWebhookError::GZIP_FAILED
61
- end
72
+ limit = max_payload_bytes
73
+ out =
74
+ begin
75
+ Zlib::GzipReader.wrap(StringIO.new(raw)) { |gz| gz.read(limit + 1) } || ''.b
76
+ rescue Zlib::Error
77
+ raise InvalidWebhookError, InvalidWebhookError::GZIP_FAILED
78
+ end
79
+ raise InvalidWebhookError, "#{InvalidWebhookError::GZIP_FAILED}: payload exceeds #{limit} bytes" if out.bytesize > limit
80
+
81
+ out.force_encoding(Encoding::ASCII_8BIT)
62
82
  end
63
83
 
64
84
  # Reverses the SQS firehose envelope: the message `Body` is base64-decoded
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-chat-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.27.0
4
+ version: 3.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - getstream.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-29 00:00:00.000000000 Z
11
+ date: 2026-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.4.20
166
+ rubygems_version: 3.5.3
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: The low level client for serverside calls for Stream Chat.