oscerd opened a new pull request, #26746:
URL: https://github.com/apache/camel/pull/26746
This restricts Simple-language evaluation in the `camel-aws2-s3` producer to
the values configured on the endpoint (`keyName` / `bucketName`). A key or
bucket name supplied through the `CamelAwsS3Key` /
`CamelAwsS3OverrideBucketName` header is now used literally.
## Background
`AWS2S3Utils.determineKey()` / `determineBucketName()` previously evaluated
any value containing a Simple function (`${...}` / `$simple{...}`), including a
value taken from the header. The `CamelAwsS3Key` header carries message content
— for example the name of a consumed object, which the S3 consumer sets on the
exchange — so a header value that happens to contain `${...}` was interpreted
as an expression instead of being used as the literal key. Dynamic keys/buckets
(CAMEL-20971) are a route authoring feature and belong on the endpoint
configuration.
## Change
- `determineKey()` / `determineBucketName()` evaluate Simple only for the
configured `keyName` / `bucketName`; header-supplied values are used literally.
- Added unit tests in `AWS2S3UtilsTest` (header value used literally,
configured expression evaluated, missing value throws).
- Migrated `S3GetObjectDynamicKeyOperationIT` to configure the dynamic key
via the endpoint `keyName`.
- Added a 4.23 upgrade-guide note.
A route that needs a dynamic value on the header should evaluate it in the
route (e.g. `simple(...)`), so the resolved value reaches the producer; a
configured `keyName=RAW(${...})` is unchanged.
JIRA: https://issues.apache.org/jira/browse/CAMEL-24901
_Claude Code on behalf of Andrea Cosentino_
🤖 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]