ADORSYS-GIS / ADORSYS-GIS/keycloak-ops
[Task]: Enhance Webhook response status code handling
- 主要言語
- 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 はまだ評価されていません。