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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +8 -8
- data/lib/stream-chat/version.rb +1 -1
- data/lib/stream-chat/webhook.rb +25 -5
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48c78a2a0081a76241ab501b91fa58b1cca8ccacd7b462fb28554ad35b951a8d
|
|
4
|
+
data.tar.gz: ba1a3c81f4375ee099810973fba14d6c19ab183cdb84160be54cfd7b19a65cf8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
>
|
|
1
|
+
> [!CAUTION]
|
|
2
|
+
> ## ⚠️ This is a legacy SDK. It is deprecated.
|
|
2
3
|
>
|
|
3
|
-
>
|
|
4
|
+
> 🚫 **Do not start new projects with `stream-chat-ruby`.**
|
|
4
5
|
>
|
|
5
|
-
>
|
|
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
|
-
#
|
|
10
|
+
# Legacy Ruby SDK for [Stream Chat](https://getstream.io/chat/)
|
|
8
11
|
|
|
9
12
|
[](https://github.com/GetStream/stream-chat-ruby/actions) [](http://badge.fury.io/rb/stream-chat-ruby)
|
|
10
13
|
|
|
11
14
|
<p align="center">
|
|
12
|
-
|
|
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 />
|
data/lib/stream-chat/version.rb
CHANGED
data/lib/stream-chat/webhook.rb
CHANGED
|
@@ -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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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.
|
|
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-
|
|
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.
|
|
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.
|