Saravanakumar Selvaraj created CAMEL-27035:
----------------------------------------------
Summary: camel-alibaba-kms: a Map or POJO in the plaintext header
is encrypted as its toString(), and an invalid numberOfBytes header fails every
operation
Key: CAMEL-27035
URL: https://issues.apache.org/jira/browse/CAMEL-27035
Project: Camel
Issue Type: Bug
Reporter: Saravanakumar Selvaraj
Follow-up to the review of https://github.com/apache/camel/pull/30139.
1. A Map or a POJO in the CamelAlibabaKmsPlaintext header or exchange property
is encrypted as its toString(), because OpenApiClientSupport.resolveString
reads the value as a String. The same value as the message body fails with an
InvalidPayloadException since CAMEL-26258, and the 4.24 upgrade guide says that
a toString() is no longer encrypted.
2. An empty or non-numeric String in the CamelAlibabaKmsNumberOfBytes header or
exchange property fails every exchange with a TypeConversionException, also for
encrypt and decrypt, which do not use the value.
OpenApiClientSupport.resolveInteger lets only null through, and
KMSUtils.createClientConfigurations resolves all six names for each exchange.
3. region has @Metadata(required = true), but the code needs region or
endpoint, and neither when kmsClient is set or autowired.
4. KMSHeaders has no constant for CamelAlibabaKmsOperation, which the producer
reads like the other input headers. Only KMSProperties declares it, so the
header is missing from the header list of the component JSON, the endpoint DSL
and the doc page. https://github.com/apache/camel/pull/30048 closed the same
gap for camel-alibaba-mns.
5. KMSProperties has @Metadata with texts of its own on its seven header names,
but the build reads only the headers class KMSHeaders. So these texts are not
used.
_Claude Code on behalf of saravanakumar1987_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)