Saravanakumar Selvaraj created CAMEL-27388:
----------------------------------------------
Summary: camel-alibaba-oss: region, accessKey and secretKey are
marked as required, OSSHeaders lacks six producer headers, and labels do not
match the code
Key: CAMEL-27388
URL: https://issues.apache.org/jira/browse/CAMEL-27388
Project: Camel
Issue Type: Bug
Affects Versions: 4.23.0
Reporter: Saravanakumar Selvaraj
Follow-up to the review of https://github.com/apache/camel/pull/30602 for
CAMEL-23832. That pull request changes description text only.
1. region, accessKey and secretKey have @Metadata(required = true). With
ossClient set or autowired, the code reads none of the three.
OSSEndpoint.initClient returns that client, and only OSSUtils.createClient
reads the three options. Without a set client, createClient takes the AccessKey
pair from serviceKeys when accessKey and secretKey are not set. The catalog
validation reports all three as missing required options for a URI with only
ossClient. It reports the two keys for a URI that sets serviceKeys instead. The
consumer tests of the module set ossClient and none of the three.
2. The producer reads seven names as a header and as an exchange property.
OSSHeaders has a constant for one of them, CamelAlibabaOssBucketName. It has
none for these six:
- CamelAlibabaOssOperation
- CamelAlibabaOssObjectName
- CamelAlibabaOssSourceBucketName
- CamelAlibabaOssSourceObjectName
- CamelAlibabaOssPrefix
- CamelAlibabaOssMaxKeys
Only OSSProperties declares them. So the component JSON, the endpoint DSL and
the generated header table of the doc page lack them. The doc page names them
in a hand-written table. The two source names of copyObject have no option
either.
3. The labels of three options do not match the code, and the Endpoint DSL
follows the labels:
- prefix has the label consumer, but the producer reads it for listObjects. The
Endpoint DSL has prefix only for a consumer endpoint.
- maxKeys has the labels consumer and producer, but only the producer reads it.
The Endpoint DSL has no method for maxKeys, because its generator leaves out an
option that has both labels.
- objectName has no label, but only the producer reads it. The Endpoint DSL has
objectName for a consumer endpoint too.
Both labels are therefore no fix for prefix. It needs no label, as both sides
read it.
4. All nine headers of OSSHeaders have the label consumer. The producer sets
all nine for getObject (OSSUtils.mapOssObject), and it reads
CamelAlibabaOssBucketName. For such a header, camel-alibaba-mns uses the label
common. Only one header of the catalog has both labels.
_Claude Code on behalf of saravanakumar1987_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)