Claus Ibsen created CAMEL-27685:
-----------------------------------
Summary: camel-aws2-transcribe: proxy credentials ignored, 2 list
ops cannot page, closes user client
Key: CAMEL-27685
URL: https://issues.apache.org/jira/browse/CAMEL-27685
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-transcribe for
CAMEL-23832 (commit
https://github.com/apache/camel/commit/fd9834d3b5d90eb736eed7d55aa311e99890862d).
These are separate problems of the component; the descriptions commit only
documents the current behavior.
h4. 1. proxyUsername and proxyPassword do nothing
{{Transcribe2Configuration}} has the {{proxyUsername}} and {{proxyPassword}}
options, but nothing reads them. The client is built by
{{AwsClientBuilderUtil.buildClient()}}, which creates the
{{ProxyConfiguration}} only from {{proxyProtocol}}, {{proxyHost}} and
{{proxyPort}}. {{AwsCommonConfiguration}} has no getter for proxy credentials.
A user who sets them gets requests without proxy authentication, so a proxy
that requires authentication rejects them.
Either pass the credentials to the proxy configuration of the HTTP client, or
deprecate the two options.
h4. 2. listTranscriptionJobs and listVocabularies cannot page
In header mode, {{Transcribe2Producer.listTranscriptionJobs()}} and
{{Transcribe2Producer.listVocabularies()}} do not read
{{CamelAwsTranscribeMaxResults}} and {{CamelAwsTranscribeNextToken}}, so only
the first page of the result can be fetched. {{listVocabularies()}} also does
not read {{CamelAwsTranscribeJobNameContains}} ({{nameContains}} of
{{ListVocabulariesRequest}}). The other list operations
({{listVocabularyFilters}}, {{listLanguageModels}},
{{listMedicalVocabularies}}, {{listMedicalTranscriptionJobs}}) read all three.
Read the three headers with {{applyMaxResults()}} and {{applyIfPresent()}} as
the other list operations do.
h4. 3. The component closes a client that the user set
{{Transcribe2Component.doStop()}} closes the {{transcribeClient}} of the
component configuration. That client was given by the user, and may be used
elsewhere. The endpoint does not close such a client
({{Transcribe2Endpoint.doStop()}} closes only the client it built), and no
other component in {{components/camel-aws}} closes a client set on the
component.
Remove the close from {{Transcribe2Component.doStop()}}.
h4. 4. operation is not marked required
There is no operation header, and {{Transcribe2Producer.process()}} throws an
{{IllegalArgumentException}} for every exchange when the {{operation}} option
is not set. The option metadata does not have {{required = true}}, so tooling
does not flag a missing operation.
Add {{@Metadata(required = true)}} to {{operation}}.
h4. 5. The verifier ignores the other credential options
{{Transcribe2ComponentVerifierExtension.verifyParameters()}} always requires
{{accessKey}}, {{secretKey}} and {{region}}, also when
{{useDefaultCredentialsProvider}}, {{useProfileCredentialsProvider}},
{{useSessionCredentials}} or {{transcribeClient}} is used.
{{verifyConnectivity()}} builds a client from the static keys and the region
only, so it ignores the session token, the proxy and the endpoint override.
Validate the same combinations as {{Transcribe2Component.createEndpoint()}},
and build the client with {{Transcribe2ClientFactory}}.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)