Skip to content

[backport camel-4.14.x] CAMEL-23579: camel-pdf - align Exchange header constant names with Camel naming convention#23561

Open
oscerd wants to merge 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/23437-to-camel-4.14.x
Open

[backport camel-4.14.x] CAMEL-23579: camel-pdf - align Exchange header constant names with Camel naming convention#23561
oscerd wants to merge 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/23437-to-camel-4.14.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 27, 2026

Backports #23437 to `camel-4.14.x`.

Cherry-pick of merge commit `bdcfe4960` with two adaptations:

  1. The original PR's upgrade-guide entry was added to
    `camel-4x-upgrade-guide-4_21.adoc`, which does not exist on 4.14.x. Per
    the project's backport policy the same content has been added to
    `camel-4x-upgrade-guide-4_14.adoc` in the `== Upgrading from 4.14.7 to
    4.14.8` section instead.
  2. The original commit also converted three `@Metadata` descriptions from
    string concatenation to text blocks. On 4.14.x the existing string-concat
    formatting has been preserved; only the four header string values are
    changed.

Summary

Renames the four Exchange header string values in `PdfHeaderConstants` to
`CamelPdf` so they fall under the default `HeaderFilterStrategy`:

Constant Previous value New value
`PdfHeaderConstants.PROTECTION_POLICY_HEADER_NAME` `protection-policy` `CamelPdfProtectionPolicy`
`PdfHeaderConstants.PDF_DOCUMENT_HEADER_NAME` `pdf-document` `CamelPdfDocument`
`PdfHeaderConstants.DECRYPTION_MATERIAL_HEADER_NAME` `decryption-material` `CamelPdfDecryptionMaterial`
`PdfHeaderConstants.FILES_TO_MERGE_HEADER_NAME` `files-to-merge` `CamelPdfFilesToMerge`

These headers carry security-sensitive PDFBox objects (`PDDocument`,
`DecryptionMaterial`, `ProtectionPolicy`); aligning with the `Camel`
namespace lets the default header filter strip them at transport boundaries.

Test plan

  • `mvn test` in `components/camel-pdf` on 4.14.x — passes
  • String-concat formatting of pre-existing `@Metadata` descriptions
    preserved (avoids touching unrelated code on the maintenance branch)
  • Upgrade-guide entry added in `camel-4x-upgrade-guide-4_14.adoc`

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

…mel naming convention (apache#23437)

Renames the Exchange header string values in PdfHeaderConstants from non-Camel
prefixed values (protection-policy, pdf-document, decryption-material,
files-to-merge) to CamelPdf<Name>, following the convention used across the
rest of the Camel component catalog and matching the pattern established in
CAMEL-23526 (camel-cxf), CAMEL-23522 (camel-mail), CAMEL-23461
(camel-aws-bedrock), CAMEL-23532 (camel-vertx-websocket /
camel-atmosphere-websocket / camel-iggy), and CAMEL-23576 (camel-jira).

The Java field names (PROTECTION_POLICY_HEADER_NAME, PDF_DOCUMENT_HEADER_NAME,
DECRYPTION_MATERIAL_HEADER_NAME, FILES_TO_MERGE_HEADER_NAME) are unchanged
so routes referencing the constants symbolically continue to work; routes
using the literal string values must be updated (documented in the 4.21
upgrade guide).

The generated Endpoint DSL header accessors on PdfHeaderNameBuilder have
been renamed accordingly:
- protectionPolicy() -> pdfProtectionPolicy()
- decryptionMaterial() -> pdfDecryptionMaterial()
- filesToMerge() -> pdfFilesToMerge()
- pdfDocument() unchanged in name but returns "CamelPdfDocument"

All existing tests use symbolic constant references and continue to pass
without changes.

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd force-pushed the backport/23437-to-camel-4.14.x branch from a24f7a7 to a6f3367 Compare May 28, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant