oscerd commented on PR #27716:
URL: https://github.com/apache/camel/pull/27716#issuecomment-6128863690

   Thanks for the review. All points are addressed in 4ce572071151:
   
   1. **Restoring the previous behaviour.** New option 
`webhookSecretTokenEnabled`, default `true`. With `false`, the webhook is 
registered without `secret_token` (the one-argument `setWebhook`, as before) 
and webhook requests are not verified; the endpoint logs a WARN at startup. The 
option is marked `security = "insecure:dev"` with `insecureValue = "false"`, so 
the security policy reports it like the other options that turn a check off 
(`failOpen` in camel-opa and camel-openfga). The upgrade notes end with "To 
restore the previous behaviour, set `webhookSecretTokenEnabled=false`".
   
   2. **`WebhookRoutePolicy`.** Right: the registration made with the previous 
version has no secret token. The notes no longer say that nothing changes 
there. They now separate registration at startup (nothing to do: each upgraded 
instance registers with the token, and the instances not upgraded yet ignore 
the header) from registration through the `WebhookRoutePolicy` or outside 
Camel, and give the safe order: register again first, with the new version or 
with `secret_token`, then upgrade the instances that receive the updates.
   
   Smaller:
   
   - **Default path.** In the upgrade notes and on the component page: adding 
an option to the URI, such as `webhookSecretToken` or 
`webhookSecretTokenEnabled`, changes the default path, and `webhookPath` keeps 
the registered one when the webhook is not registered by Camel at startup.
   - **Request URI in messages.** `sendSyncRequest` now describes a request by 
its HTTP method and the method of the Bot API (`Could not GET setWebhook: 401 
...`), in the exception messages and in the TRACE log. The producer's 
`TelegramAsyncHandler` printed the same URI (`<uri> responded: 400...`), so it 
gets the same change (`POST sendMessage responded: 400...`). 
`TelegramServiceRestBotAPIAdapterErrorTest` covers both.
   - **camel-spring-boot and camel-quarkus.** Opened as drafts, to be marked 
ready once this is merged and a snapshot has the new option:
     - apache/camel-spring-boot#2029: `TelegramWebhookCallTest` sets 
`webhookSecretToken` and sends the header. It passes locally against a 
camel-telegram snapshot built from this branch.
     - apache/camel-quarkus#9317 (`camel-main`): the route sets 
`webhook-secret-token` and `TelegramTest#testWebhookEndpoint` sends the header. 
The WireMock mapping of `setWebhook` also needed the `secret_token` parameter: 
it matches the whole query, so without it the registration at startup gets no 
match and the webhook route fails to start.
   
   `camel-telegram`: 105 tests green; full reactor `-DskipTests -DskipITs` 
green, with `SecurityUtils` regenerated for the new insecure option.
   
   _Claude Code on behalf of oscerd_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to