Skip to content

camel-crypto: certificateName is a Certificate reference, not a PrivateKey - #29539

Merged
Croway merged 2 commits into
apache:mainfrom
Dhairya-007:fix/crypto-certificate-name-doc
Nov 10, 2026
Merged

Croway merged 2 commits into
apache:mainfrom
Dhairya-007:fix/crypto-certificate-name-doc

Conversation

@Dhairya-007

Copy link
Copy Markdown
Contributor

DigitalSignatureConfiguration has three registry-reference options and documents two of them identically:

Option Description What the setter looks up
publicKeyName Sets the reference name for a publicKey that can be found in the registry. PublicKey
privateKeyName Sets the reference name for a PrivateKey that can be found in the registry. PrivateKey
certificateName Sets the reference name for a PrivateKey that can be found in the registry. Certificate
public void setCertificateName(String certificateName) {
    if (context != null && certificateName != null) {
        Certificate certificate = context.getRegistry().lookupByNameAndType(certificateName, Certificate.class);

The javadoc is the text the generator reads (no description on the @UriParam), so it is corrected there, and the copies in crypto.json (component and camel-catalog, kept byte-identical) and DigitalSignatureEndpointBuilderFactory are updated to match. privateKeyName's description, which is correct, is untouched.

Doc-only change.

…teKey

The setter javadoc of certificateName, which the catalog and the
endpoint DSL copy, said "Sets the reference name for a PrivateKey that
can be found in the registry", the same text as privateKeyName. The
setter looks the name up as a java.security.cert.Certificate, so say so.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the fix is right. setCertificateName looks up a Certificate (DigitalSignatureConfiguration.java:291), and the javadoc is where the generator takes the description from. The component and camel-catalog crypto.json entries and DigitalSignatureEndpointBuilderFactory are updated consistently.

One generated file is missing. certificateName is also a component option, so dsl/camel-componentdsl/.../CryptoComponentBuilderFactory.java still says "Sets the reference name for a PrivateKey that can be found in the registry." (around line 93). The regen will change it to "Certificate" and CI will fail on uncommitted changes. Please regenerate it and commit it as well.

Heads-up: #29550 changes the keystore line right below this one in both crypto.json files, so whichever merges second will need a rebase and regen.

Reviewed with Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

certificateName is a component option as well as an endpoint option, so
CryptoComponentBuilderFactory carries the same javadoc and still said
PrivateKey. privateKeyName, two options below, keeps its wording.
@Dhairya-007

Copy link
Copy Markdown
Contributor Author

Thanks — added in e561dd8. CryptoComponentBuilderFactory.certificateName now reads "Sets the reference name for a Certificate that can be found in the registry.", wrapped at the same point as the endpoint DSL (77 chars, under the generator's 80). privateKeyName two options below keeps the PrivateKey wording.

I checked the other generated crypto files: DigitalSignatureComponentConfigurer, DigitalSignatureEndpointConfigurer and DigitalSignatureEndpointUriFactory only carry the option name, and crypto-component.adoc builds its tables from the JSON, so nothing else changes.

On the overlap with #29550: understood. That PR now touches the keystore/keyStoreParameters lines in both crypto.json files from the Java source instead of editing the generated copies, so whichever lands second I will rebase and regenerate.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Generated files are up to date

An earlier CI run reported uncommitted generated changes; the latest run no longer does.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, CryptoComponentBuilderFactory now says "Certificate" for certificateName and matches the generator output exactly (compared with the regen patch from the first CI run). As noted before, this PR and #29550 both change crypto.json, so whichever merges second needs a rebase and regen. Please also mention the component DSL change in the PR description.

Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-crypto
  • dsl/camel-componentdsl
  • dsl/camel-endpointdsl

🔬 Scalpel shadow comparison — Scalpel: 10 of 722 tested, 24 compile-only — current: 10 all tested

Maveniverse Scalpel detected 10 affected modules (current approach: 10).

Skip-tests mode would test 10 modules (4 direct + 9 downstream), skip tests for 24 (generated code, meta-modules)

Modules Scalpel would test (10)
  • camel-crypto ← components/camel-crypto/src/generated/resources/META-INF/org/apache/camel/component/crypto/crypto.json, components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-jbang-run ← downstream of org.apache.camel:camel-catalog
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-pqc ← downstream of org.apache.camel:camel-crypto
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (24)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (37 modules, 6m 57s total)

Total reactor time: 6m 57s

Module Duration Status
Camel :: JBang :: MCP 59.2s SUCCESS
Camel :: PQC 54.0s SUCCESS
Camel :: YAML DSL :: Validator 30.6s SUCCESS
Camel :: Component DSL 26.1s SUCCESS
Camel :: JBang :: Plugin :: Validate 25.2s SUCCESS
Camel :: Catalog :: Camel Catalog 24.7s SUCCESS
Camel :: YAML DSL 23.4s SUCCESS
Camel :: JBang :: Run 22.5s SUCCESS
Camel :: Kamelet Main 19.5s SUCCESS
Camel :: Crypto 19.1s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 18.1s SUCCESS
Camel :: Docs 15.8s SUCCESS
Camel :: JBang :: Plugin :: Testing 13.4s SUCCESS
Camel :: YAML DSL :: Deserializers 8.5s SUCCESS
Camel :: Catalog :: Camel Route Parser 7.8s SUCCESS
Camel :: Assembly 7.4s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 7.1s SUCCESS
Camel :: JBang :: Plugin :: Generate 5.7s SUCCESS
Camel :: All Components Sync point 5.5s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 5.0s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.3s SUCCESS
Camel :: Catalog :: Maven 3.0s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 2.5s SUCCESS
Camel :: JBang :: Plugin :: MCP 2.1s SUCCESS
Camel :: Coverage 1.4s SUCCESS
Camel :: Catalog :: Dummy Component 1.1s SUCCESS
Camel :: Catalog :: Console 1.0s SUCCESS
Camel :: JBang :: Integration tests 0.9s SUCCESS
Camel :: JBang :: Plugin :: Edit 0.8s SUCCESS
Camel :: JBang :: Main 0.8s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS
Camel :: Endpoint DSL :: Support 0.7s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: Launcher n/a

Top 20 slowest modules:

  • Camel :: JBang :: MCP (59.2s)
  • Camel :: PQC (54.0s)
  • Camel :: YAML DSL :: Validator (30.6s)
  • Camel :: Component DSL (26.1s)
  • Camel :: JBang :: Plugin :: Validate (25.2s)
  • Camel :: Catalog :: Camel Catalog (24.7s)
  • Camel :: YAML DSL (23.4s)
  • Camel :: JBang :: Run (22.5s)
  • Camel :: Kamelet Main (19.5s)
  • Camel :: Crypto (19.1s)
  • Camel :: JBang :: Plugin :: Kubernetes (18.1s)
  • Camel :: Docs (15.8s)
  • Camel :: JBang :: Plugin :: Testing (13.4s)
  • Camel :: YAML DSL :: Deserializers (8.5s)
  • Camel :: Catalog :: Camel Route Parser (7.8s)
  • Camel :: Assembly (7.4s)
  • Camel :: Catalog :: Camel Report Maven Plugin (7.1s)
  • Camel :: JBang :: Plugin :: Generate (5.7s)
  • Camel :: All Components Sync point (5.5s)
  • Camel :: YAML DSL :: Validator Maven Plugin (5.0s)

⚙️ View full build and test results

@Croway
Croway merged commit a18c095 into apache:main Nov 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants