oscerd opened a new issue, #2952:
URL: https://github.com/apache/camel-kamelets/issues/2952
The FTP, FTPS, SFTP and Azure Storage Files sink Kamelets copy an inbound
`file` (or `ce-file`) header straight into `CamelFileName` without constraining
its shape:
- `kamelets/ftp-sink.kamelet.yaml`
- `kamelets/ftps-sink.kamelet.yaml`
- `kamelets/sftp-sink.kamelet.yaml`
- `kamelets/azure-storage-files-sink.kamelet.yaml`
All four share the same copy block:
```yaml
- choice:
when:
- simple: "${header[file]}"
steps:
- setHeader:
name: CamelFileName
simple: "${header[file]}"
- simple: "${header[ce-file]}"
steps:
- setHeader:
name: CamelFileName
simple: "${header[ce-file]}"
```
Two things are worth fixing:
1. **The value is written verbatim.** A header carrying path separators or
`..` segments resolves relative to the configured `directoryName` instead of
staying inside it. The templates should reduce the header to a single path
segment (or reject separators) before setting `CamelFileName`.
2. **The input is undeclared.** Neither `file` nor `ce-file` appears in
`spec.definition` or in the generated documentation page, so operators have no
way to discover that these headers are honoured. Whatever shape the templates
settle on should be documented alongside the fix.
Related: #929 (a Kamelet should define which headers are supported as input
and output).
_Claude Code on behalf of Andrea Cosentino_
--
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]