allthingssecurity opened a new pull request, #28132: URL: https://github.com/apache/camel/pull/28132
# Description [CAMEL-25770](https://issues.apache.org/jira/browse/CAMEL-25770) The google-storage consumer lists the whole bucket at every poll and downloads every listed object when it creates the exchanges. An object that no longer exists (CAMEL-25519), or whose name is rejected as a local path, is skipped; any other failure of a download was rethrown and failed the poll. As every poll lists the whole bucket again, one object whose download always fails (access denied for that object, an object encrypted with a customer-supplied key, a disabled Cloud KMS key version) stopped the consumer from consuming any object, until someone removed the object. This change does what camel-aws2-s3 does since CAMEL-25558 (and what CAMEL-25760 does for camel-alibaba-oss and camel-huaweicloud-obs): - a failed download of one listed object is collected, the object is skipped for this poll and reported to the consumer's exception handler with its name, and the other listed objects are consumed; - the poll still fails (with the first failure) when none of the listed objects could be got, as for expired credentials, so the error handling and the backoff of the scheduled consumer apply; - a failure of the listing, and a failure with `objectName` set, still fail the poll as before. The behaviour change (a skipped object is reported at every poll that lists it) is in the 4.24 upgrade guide. Tests: - New `ConsumerObjectThatCannotBeGotTest` (2 tests) with the module's in-process `LocalStorageHelper` storage, which can now refuse the reads of an object with 403. Without the fix `objectThatCannotBeGotDoesNotBlockTheOtherObjects` (a.txt, refused b.txt, c.txt) receives no object at all. `pollFailsWhenNoListedObjectCanBeGot` passes with and without the fix; it is there because the fix must not swallow that case. - camel-google-storage unit tests: 63 run, 0 failures (formatter and import sort run in the same build). - Not run: against Cloud Storage. How it was found: variant analysis of the camel-aws2-s3 fix CAMEL-25558 across the object-store consumers (a Semgrep rule for a batch consumer that gets every listed item in one try block and rethrows the first failure). camel-minio, camel-azure-storage-blob and camel-azure-storage-datalake have the same defect and are fixed in separate PRs. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested camel-google-storage, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 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]
