davsclaus opened a new pull request, #24904:
URL: https://github.com/apache/camel/pull/24904

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Splits the single shared `sagaURIs` allowlist in `LRASagaService` into 
separate compensation and completion URI sets, and adds automatic cleanup when 
routes are removed.
   
   **Problem:** The LRA Saga service maintained one flat `Set<String>` for both 
compensation and completion callback URIs. This meant (1) a completion callback 
could invoke a compensation endpoint and vice versa, and (2) URIs from 
dynamically removed routes remained authorized for the entire context lifetime 
(memory leak + stale authorization).
   
   **Changes:**
   - **`CamelSagaStep`** — added `routeId` field so steps can be tracked by the 
route that registered them
   - **`SagaReifier`** — sets `routeId` on the step before calling 
`registerStep()`
   - **`LRASagaService`** — replaced `sagaURIs` with separate 
`compensationURIs` and `completionURIs` sets; added `stepsByRouteId` tracking 
map; registered a `LifecycleStrategySupport` that prunes URIs when routes are 
removed; shared URIs are only pruned when all referencing routes are removed
   - **`LRASagaRoutes`** — split `verifyRequest()` into 
`verifyCompensationRequest()` and `verifyCompletionRequest()` so each callback 
type validates only against its own allowlist
   - **New test** `LRASagaServiceAllowlistTest` — covers URI separation, 
pruning, shared URI retention, and no-op for unknown routes
   
   No interface changes — `CamelSagaService.registerStep(CamelSagaStep)` 
signature is preserved. `InMemorySagaService` is unaffected.
   
   ## Test plan
   
   - [x] `LRASagaServiceAllowlistTest` — 6 tests covering separation, pruning, 
shared URIs, union, and no-op
   - [x] All existing LRA tests pass (`mvn verify` in `components/camel-lra`)
   - [x] `camel-core-reifier` compiles with the new `step.setRouteId()` call
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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