luigidemasi opened a new issue, #82:
URL: https://github.com/apache/camel-kit/issues/82

   > Imported from 
[luigidemasi/camel-kit#179](https://github.com/luigidemasi/camel-kit/issues/179),
 opened by [luigidemasi](https://github.com/luigidemasi) on 2026-08-20.
   > Closed by 
[luigidemasi/camel-kit#180](https://github.com/luigidemasi/camel-kit/pull/180), 
merged on 2026-08-20.
   
   ---
   
   ## Description
   
   `ShipExpressionPolicy` implements a closed, private re-definition of the 
Simple language: an approved-lookup allowlist (only `body`, `routeId`, 
`exchangeId`, `messageTimestamp`, and single-level 
`header.`/`exchangeProperty.`/`variable.` keys), a comparison-only predicate 
grammar with exactly one ASCII space around operators and at most one 
logical-operator kind, a custom number grammar, `=~` redefined as 
case-insensitive equality instead of regex matching, and a Unicode 16.0 
format-character table frozen into the source.
   
   As a result, perfectly valid Simple that Camel accepts is silently rejected 
during catalog-usage extraction and payload validation — for example 
`${bodyAs(String)}`, `${date:now:yyyyMMdd}`, `${body} =~ 'a.*b'` (real regex), 
predicates without the exact single-space layout, and any function-style 
lookup. The sandboxed `camel-main` startup in the VALIDATE stage is already the 
authority on what Camel actually accepts, so the closed grammar only produces 
false rejections; it also duplicates concepts that exist elsewhere in the 
subsystem (`ShipTreePolicy` classifies unsafe display characters with live 
`Character.getType`, while this class carries its own frozen table).
   
   ## Expected behavior
   
   The expression gate checks only what Ship must enforce before handing text 
to the worker and the validation payload: bounded size, clean encoding (no 
control or format characters, no lone surrogates), and no indirect expansion 
(`$simple{`, `$init{`, `{{ }}` property placeholders). Simple syntax itself is 
left to the real `camel-main` startup in the sandboxed VALIDATE stage.
   
   ## Scope
   
   - Replace the closed grammar in `ShipExpressionPolicy` with the bounded-text 
gate; classify format characters with live `Character.getType` (consistent with 
`ShipTreePolicy`); keep the class JDK-only (it is embedded in the validation 
payload archive).
   - Keep the `isSafeSimpleTemplate`/`isSafeSimplePredicate` entry points used 
by `CatalogExpressionInventory`; drop the test-only selector helpers.
   - Rewrite the policy tests accordingly.


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