davsclaus opened a new pull request, #3259: URL: https://github.com/apache/camel-kamelets/pull/3259
Fixes #3189. With `getObject: true`, `aws-s3-event-based-source`, `ceph-event-based-source` and `google-storage-event-based-source` read the file of each event. They put its name into the endpoint address of that call, so a name with `&`, `+` or `=` was cut or changed. For `reports/a&b=c.txt`, the address got the key `reports/a` and an unknown option `b`, and the call failed. For `dir/my file+x=1.txt`, the `+` became a space, and the file was not found. ### What changed - **The object name goes in the header of the component:** `CamelAwsS3Key` for the S3 sources and `CamelGoogleCloudStorageObjectName` for Google Cloud Storage. Both components use this header as it is, on main, 4.22.x and 4.18.x. The Kamelet removes the header after the call, so the output has the same headers as before. - **The other headers of the component are removed before the call** (`CamelAwsS3*`, `CamelGoogleCloudStorage*`). The call takes only the name of the event, and not, for example, an operation header that came with the message. - **The S3 sources call a bucket only when its name is a valid bucket name** (lowercase letters, digits, `.` and `-`, 3 to 63 characters). The bucket stays in the endpoint address, so each bucket keeps its own client, as before. A bucket name can never have `&`, `?` or `=`. An event with any other bucket name is passed on as parsed JSON, like the events the Kamelet does not read. - **`google-storage-event-based-source` uses a fixed endpoint.** It reads only the bucket of `bucketNameOrArn`, so the endpoint does not depend on the message. It now starts with the route, not on the first event. ### Tests - New Citrus tests `aws-s3-event-based-source-get-object` and `ceph-event-based-source-get-object`, in `aws/s3`. They upload `dir/my file+x=1.txt` and `reports/a&b=c.txt` and send the events. They pass with this change and fail without it. The other `aws/s3` tests pass too. `AwsIT#awsS3`: 6 of 6. - `google-storage-event-based-source` was run against the Floci GCP emulator (Pub/Sub and Cloud Storage) with the same two names. Both are read, and the current template fails on `reports/a&b=c.txt`. No Citrus test: Citrus has no Google Cloud container. - `./mvnw clean install` from the root passes, run twice: Kamelet validation, catalog tests and generated files. ### Backports `aws-s3-event-based-source` and `google-storage-event-based-source` have the same step on 4.22.x and 4.18.x. `ceph-event-based-source` is not on those branches. I will open the backports after this PR is merged. _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]
