Skip to content

Commit d1e004c

Browse files
authored
[CHA-2961] Webhook handling spec — regenerate SDK + dual-API (#62)
* feat(webhook): regenerate with CHA-2961 helpers + dual-API on StreamSDKClient Regenerated Webhook.java + WebhookTest.java from chat/'s feature/cha-2961-webhook-handling-spec branch. New surface in io.getstream.Webhook: - UnknownEvent class (forward-compat for unknown event types) - gunzipPayload, decodeSqsPayload, decodeSnsPayload primitives - parseEvent (returns typed event or UnknownEvent) - verifyAndParseWebhook HTTP composite - parseSqsPayload, parseSnsPayload queue composites (no signature) - InvalidWebhookException (unified exception per spec rev 2026-05-11) Hand-added instance methods on StreamSDKClient (dual API): - verifySignature(body, signature) — uses client's stored secret - verifyAndParseWebhook(body, signature) — uses client's stored secret generate.sh now also runs chat-manager's generate-webhook-fixtures subcommand to populate src/test/resources/fixtures/webhooks/. Refs CHA-2961. * chore: re-regenerate against updated chat/ templates (parseSqs/parseSns rename) * feat(webhook): add parseSqs/parseSns instance methods on StreamSDKClient * chore: regenerate webhook helpers with base64 fallback for plain-JSON SQS * chore: regenerate with P7 chat/ template fixes; rename InvalidWebhookException → WebhookException in StreamSDKClient Exception class was split per spec §5.2 in chat/ 13097a0765 into a WebhookException base + InvalidSignatureException / MalformedWebhookException subclasses. The instance methods on StreamSDKClient declare 'throws' clauses that referenced the old unified class name; updated to the new base class so both subclasses propagate cleanly. * chore: regenerate with unified InvalidWebhookError; rename Webhook.WebhookException → Webhook.InvalidWebhookError in StreamSDKClient * chore: regenerate with P9 chat/ template fixes (WebhookHelpers wire, fixtures-present guard, WebhookException deprecation alias) * chore: regenerate after chat/ restructure (build/chat-manager path)
1 parent 10d97b4 commit d1e004c

193 files changed

Lines changed: 1993 additions & 27 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
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.
44

5+
## [Unreleased]
6+
7+
### Added
8+
9+
- Webhook handling spec helpers (CHA-2961): `UnknownEvent` class for forward-compat;
10+
`gunzipPayload`, `decodeSqsPayload`, `decodeSnsPayload` primitives;
11+
`verifyAndParseWebhook` HTTP composite; `parseSqs` / `parseSns`
12+
queue composites (no HMAC signature on the payload — queue transports rely on
13+
AWS IAM for authentication). Transparent gzip via magic-byte detection.
14+
- New instance methods on `StreamSDKClient`: `verifySignature(body, signature)`
15+
and `verifyAndParseWebhook(body, signature)` — drop the api_secret parameter
16+
in favor of the client's stored secret. Dual API: static `Webhook.*` methods
17+
remain available.
18+
- New instance methods on `StreamSDKClient`: `parseSqs(String)`, `parseSns(String)`
19+
(no signature; AWS IAM).
20+
- New exception class: `Webhook.InvalidWebhookException` (unified — covers both
21+
signature mismatch and malformed payloads).
22+
- Conformance fixture suite under `src/test/resources/fixtures/webhooks/`.
23+
24+
### Changed
25+
26+
- No breaking changes. All existing webhook helpers preserved.
27+
28+
[Spec](https://www.notion.so/stream-wiki/Server-Side-SDK-Webhook-Handling-Spec-34b6a5d7f9f681e78003c443f227493c)
29+
530
## [7.2.0](https://github.com/GetStream/stream-sdk-java/compare/7.1.0...7.2.0) (2026-04-30)
631

732
## [7.1.0](https://github.com/GetStream/stream-sdk-java/compare/7.0.0...7.1.0) (2026-04-10)

generate.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ fi
1111
set -ex
1212

1313
# cd in API repo, generate new spec and then generate code from it
14-
( cd $SOURCE_PATH ; make openapi ; go run ./cmd/chat-manager openapi generate-client --language java --spec ./releases/v2/serverside-api.yaml --output ../stream-sdk-java )
14+
( cd $SOURCE_PATH ; make openapi ; ./build/chat-manager openapi generate-client --language java --spec ./releases/v2/serverside-api.yaml --output ../stream-sdk-java )
15+
16+
# Generate webhook conformance fixtures (CHA-2961). The test template reads them from
17+
# src/test/resources/fixtures/webhooks/ and gracefully skips if the dir is missing.
18+
( cd $SOURCE_PATH ; ./build/chat-manager openapi generate-webhook-fixtures --output ../stream-sdk-java/src/test/resources/fixtures/webhooks )
1519

1620
perl -i -0pe 's/ \@JsonProperty\("Role"\)\n private String role;\n//g' src/main/java/io/getstream/models/CallParticipant.java
1721

0 commit comments

Comments
 (0)