ADORSYS-GIS / ADORSYS-GIS/keycloak-ops

[Task]: Enhance Webhook response status code handling

オープン
#33 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Smarty
スター
0
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

### Analysis
The current `HttpWebhookHandler` catches all exceptions from the HTTP client, logs them, and stops processing. It does not inspect the HTTP response status code. Therefore, if the receiver returns a `500 Internal Server Error`, the provider treats it as a success because no network-level exception was thrown.

### Necessity
**Critical.** This is a bug. A non-2xx response indicates a failure on the receiver's end, and the system should treat it as a delivery failure. Ignoring it makes the webhook system unreliable.

### Proposed changes
- Inspect the HTTP response's status code after the request is sent.
- If the status code is **not** a success (i.e., outside the `200-299` range), throw a `RuntimeException`.

### Backward Compatibility & Safety
- This is a corrective change that improves synchronisation
- When enabled, the provider becomes more reliable. When disabled (the default), it maintains the old behavior, preventing any disruption to existing production systems.

#### code reference:
check [here](https://github.com/vymalo/keycloak-webhook/blob/main/keycloak-webhook-provider-http/src/main/kotlin/HttpWebhookHandler.kt)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。