shashank created CAMEL-25773:
--------------------------------
Summary: camel-aws-secrets-manager - the CloudTrail refresh task
reads lastTime for every lookup page, so a shutdown during a check sends the
next page without a start time
Key: CAMEL-25773
URL: https://issues.apache.org/jira/browse/CAMEL-25773
Project: Camel
Issue Type: Improvement
Components: camel-aws2
Reporter: shashank
Assignee: shashank
Follow-up to the review of CAMEL-25729 (apache/camel#28036, merged), two points
raised by gnodet-bot on the PR.
{{CloudTrailReloadTriggerTask}} reads the volatile field {{lastTime}} for every
{{LookupEvents}} request. {{doShutdown}} sets {{lastTime}} to null, so a
shutdown while a check reads its pages sends the next page without a start time
(the whole event history of the last 90 days), and the two lookups of one check
({{PutSecretValue}} and {{UpdateSecret}}) can use different start times.
The event loop also checks the event source and the event name of every event.
The lookups are filtered by event name, so both checks are always true; they
suggest the results could hold other events.
*Change*: the check reads {{lastTime}} once and passes it to both lookups, so
every page of both lookups uses the same start time. The always-true checks are
removed from the CloudTrail path; the SQS notification path, whose messages are
not filtered, keeps them. Otherwise the behaviour is unchanged.
*Tests*: new
{{CloudTrailReloadTriggerTaskLookupTest.everyPageOfBothLookupsOfOneCheckUsesTheSameStartTime}}:
the fake {{LookupEvents}} clears {{lastTime}} while the first page is read, as
{{doShutdown}} does, and the test checks that the three requests of the check
(two pages of {{PutSecretValue}}, one of {{UpdateSecret}}) use the start time
of the check. It fails without the change: {{expected: <2026-10-17T10:00:00Z>
but was: <null>}} (the second page is sent without a start time).
camel-aws-secrets-manager unit tests: 11 run, 0 failures.
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)