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

   Fixes #3388
   
   ## Problem
   
   Most action Kamelets remove the component headers of the incoming message 
before their component step (#3240), and the PGP actions remove 
`CamelPGPDataFormat*`. `crypto-encrypt-action` and `crypto-decrypt-action` did 
not: a `CamelCrypto*` header on the incoming message (for example 
`CamelCryptoInitVector`) is read by the `crypto` data format before its own 
settings, so it changed how the data format ran instead of the Kamelet's 
`algorithm`, `mode` and `key` options. With `mode: CBC`, such a header replaced 
the new random initialization vector that the Kamelet describes for each 
message.
   
   ## Change
   
   - `kamelets/crypto-encrypt-action.kamelet.yaml`, 
`kamelets/crypto-decrypt-action.kamelet.yaml`:
     - the first step is `removeHeaders` with the pattern `CamelCrypto*`, 
before the `choice` on `mode`. Other headers are kept as before.
     - `mode` accepts only `CBC` (`enum: ["CBC"]`), the mode the description 
documents; the template always uses `PKCS5Padding` and an initialization vector 
put in front of the data.
     - "Good to know" says that the algorithm, the mode and the key come only 
from the options, and that the `CamelCrypto*` headers of the incoming message 
are removed first.
   - Regenerated by `./mvnw clean install`: the copies under 
`library/camel-kamelets/src/main/resources/kamelets/` and `kamelets-index.json`.
   
   No upgrade note: `mode` is new on main (#3247) and not in a release yet.
   
   ## Tests
   
   - 
`CryptoKameletsTest.cbcGivesDifferentBytesForTheSameTextWithCryptoHeadersOnTheMessage`
 (AES and DESede): the same text sent twice with a `CamelCryptoInitVector` 
header and `mode=CBC` gives different bytes, and both decrypt back to the text. 
Without the template change it fails (the two results are equal).
   - `KameletsRemoveHeadersTest`: rows for both Kamelets in 
`remove-headers/kamelets.csv`, checking that the first step is the 
`removeHeaders`.
   - `./mvnw clean install` passes (catalog module: 141 tests, Maven plugin: 19 
tests).
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 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