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

   ## What
   
   Follows the toD MVP (#25315, CAMEL-24298) by extending the optional 
**`allowedSchemes`** allow-list to the remaining 5 dynamic-URI EIPs: 
**`recipientList`, `routingSlip`, `dynamicRouter`, `enrich`, `pollEnrich`**. A 
resolved dynamic recipient whose component scheme is not in the configured list 
is rejected — a defence-in-depth restriction for low-code / Kamelet deployments.
   
   ```java
   
from("direct:start").recipientList(header("dest")).allowedSchemes("http,https");
   ```
   
   ## Enforcement
   
   A shared `ProcessorHelper.checkAllowedSchemes(...)` (+ 
`parseAllowedSchemes(...)`) is called at each processor's recipient-resolution 
point:
   - **RoutingSlip** (and **DynamicRouter**, which extends it), 
**PollEnricher**, and **RecipientListProcessor** — after `prepareRecipient`.
   - **enrich** — `Enricher` delegates to its internal `SendDynamicProcessor`, 
which already enforces `allowedSchemes` (from #25315).
   
   Each of the 5 model definitions gets the `allowedSchemes` attribute + 
getter/setter + fluent builder, wired through its reifier.
   
   ## Behaviour
   
   Default unset = any scheme allowed → **no behavioural change**. Because the 
check throws a `ResolveEndpointFailedException` at the resolution point, a 
disallowed scheme follows each EIP's existing `ignoreInvalidEndpoint` semantics 
— hard-fail by default, and (like any invalid endpoint) skipped-not-sent if the 
route opted into `ignoreInvalidEndpoint`. This is slightly less strict than 
`toD`, which hard-fails regardless — happy to align them if you'd prefer.
   
   ## Tests
   
   `DynamicUriEipAllowedSchemesTest` — a disallowed scheme (`seda:` against an 
`allowedSchemes("mock")` route) is rejected across all five EIPs. Full-reactor 
`mvn clean install -DskipTests` green (model JSON, XML/YAML schemas, DSL 
writers/parsers/deserializers, catalog regenerated). The option is documented 
on each EIP's auto-generated options table (via the `@Metadata` description).
   
   ## Scope
   
   Completes CAMEL-24298: `toD` landed in #25315, `wireTap` inherits it, and 
this covers the 5 sibling EIPs. Main only — additive feature (default 
unrestricted), not a bug fix.
   
   Closes CAMEL-24298.
   
   ---
   _Claude Code on behalf of Andrea Cosentino (@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