Claus Ibsen created CAMEL-27636:
-----------------------------------
Summary: camel-aws2-step-functions: list ops read one page only,
required operation/label, labels
Key: CAMEL-27636
URL: https://issues.apache.org/jira/browse/CAMEL-27636
Project: Camel
Issue Type: Bug
Components: camel-aws2
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while improving the option descriptions of camel-aws2-step-functions for
CAMEL-23832 (PR https://github.com/apache/camel/pull/30976).
These are separate problems of the component; the descriptions PR only
documents the current behavior.
h4. 1. The list operations and getExecutionHistory return only the first page
{{StepFunctions2Producer.listStateMachines()}}, {{listActivities()}},
{{listExecutions()}} and {{getExecutionHistory()}} build the request from
headers, but no header sets {{nextToken}}. Step Functions returns at most 100
results per call by default, and at most 1000 with the max results headers.
When there are more, the user gets only the first page, and can read the next
pages only with {{pojoRequest=true}} and a request object that holds the
{{nextToken}} of the previous response.
Proposed change: add a {{CamelAwsStepFunctionsNextToken}} header that the
producer passes to these four requests. Optionally, also set the {{nextToken}}
of the response as a header.
h4. 2. The {{operation}} option is marked as required, but the header can
replace it
{{StepFunctions2Configuration.operation}} has {{@Metadata(required = true)}}.
{{StepFunctions2Producer.determineOperation()}} first reads the
{{CamelAwsStepFunctionsOperation}} header, and fails only when neither the
header nor the option is set. Tooling that validates endpoint URIs against the
catalog reports an error for an endpoint that sets the operation only in the
header.
Proposed change: remove {{required = true}} from {{operation}}, as the producer
already fails with a clear message when neither the header nor the option is
set.
h4. 3. The {{label}} path parameter is required, but no code reads it
{{StepFunctions2Configuration.label}} is the required {{@UriPath}} of
{{aws2-step-functions:label}}. No code calls {{getLabel()}}: the producer takes
the state machine, activity or execution ARN from headers. The user must invent
a value that has no effect.
Proposed change: keep it as a logical name for the endpoint, but consider
making it optional, or document that it is only a name.
h4. 4. Inconsistent label of the credentials options
{{useDefaultCredentialsProvider}} and {{useProfileCredentialsProvider}} in
{{StepFunctions2Configuration}} have no {{label}}, so the docs and the catalog
list them with the producer options. {{useSessionCredentials}}, {{accessKey}},
{{secretKey}} and {{sessionToken}} have {{label = "security"}}.
Proposed change: add {{label = "security"}} to
{{useDefaultCredentialsProvider}} and {{useProfileCredentialsProvider}}.
{{profileCredentialsName}} also has no label and could get the same one.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)