Skip to content

CAMEL-22538: Camel-PQC - Add Azure Key Vault Lifecycle Manager#24953

Merged
oscerd merged 2 commits into
apache:mainfrom
oscerd:feature/CAMEL-22538-azure-kv-lifecycle
Jul 21, 2026
Merged

CAMEL-22538: Camel-PQC - Add Azure Key Vault Lifecycle Manager#24953
oscerd merged 2 commits into
apache:mainfrom
oscerd:feature/CAMEL-22538-azure-kv-lifecycle

Conversation

@oscerd

@oscerd oscerd commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

CAMEL-22538 (sub-task of CAMEL-22512): camel-pqc has key lifecycle managers for in-memory, file, HashiCorp Vault and AWS Secrets Manager backends — this adds the missing Azure Key Vault implementation.

Changes

  • New AzureKeyVaultKeyLifecycleManager, mirroring the AWS Secrets Manager implementation: private key (PKCS#8), public key (X.509/SubjectPublicKeyInfo) and metadata are stored as three distinct Key Vault secrets, enabling different access policies / Azure RBAC for private vs public material. PQC keys are stored as Key Vault secrets because Key Vault key objects do not support post-quantum key material.
  • Metadata is stored as JSON via KeyMetadataCodec — no Java serialization anywhere (consistent with the CAMEL-23726 hardening; no legacy-deserialization path since this is a new store).
  • Azure secret names only allow [0-9a-zA-Z-], so secrets are named {keyPrefix}-{keyId}-{type} (default prefix pqc-keys), with explicit validation of key ids/prefix (fail fast instead of silent mangling).
  • Crypto helpers reuse the shared KeyAlgorithmSupport/KeyFormatConverter instead of duplicating them.
  • Three constructors: injected SecretClient (recommended), client-secret credential, and Default Azure Credential chain (managed identity).
  • pom: azure-sdk-bom import + azure-security-keyvault-secrets/azure-identity as optional deps (same pattern as the optional AWS/spring-vault deps); mockito-core (test).
  • Docs: full section in pqc-key-lifecycle.adoc (security notes, naming, soft-delete behavior, three usage examples) + updated comparison table and component-page mention.

Testing

  • 9 new unit tests against a mocked SecretClient simulating the vault store (store/round-trip through a fresh manager instance, listing, deletion, rotation/deprecation, expire/revoke, missing-key handling, invalid-name rejection) — all pass. Note: the AWS/Hashicorp managers currently have no unit tests, so this also raises the bar slightly.
  • mvn clean install in components/camel-pqc: BUILD SUCCESS.
  • Full reactor mvn clean install -DskipTests from root: success, no stale generated files.

No backport: new feature, main/4.22.0 only.

Claude Code on behalf of Andrea Cosentino (@oscerd).

🤖 Generated with Claude Code

Add AzureKeyVaultKeyLifecycleManager storing PQC keys in Azure Key Vault as
secrets (Key Vault key objects do not support post-quantum key material).
Private key (PKCS#8), public key (X.509) and metadata (JSON via
KeyMetadataCodec, no Java serialization) are stored as three distinct
secrets so different access policies can apply. Azure secret names only
allow alphanumerics and dashes, so secrets are named
{keyPrefix}-{keyId}-{type} with validation of key ids and prefix.
Constructors support an injected SecretClient, client secret credentials,
and the Default Azure Credential chain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the enhancement New feature or request label Jul 20, 2026
@oscerd
oscerd requested review from davsclaus and gnodet July 20, 2026 13:28

@gnodet gnodet 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.

Well-structured Azure Key Vault implementation — consistent with the AWS Secrets Manager backend and a natural addition to the PQC key lifecycle manager lineup.

What works well:

  • Clean separation of private key, public key, and metadata into distinct Key Vault secrets, enabling fine-grained Azure RBAC / access policies.
  • Industry-standard key formats (PKCS#8 / X.509) with Base64 JSON envelopes — consistent with the AWS implementation.
  • Input validation via validateName enforces Azure Key Vault naming constraints upfront (fail-fast over silent mangling).
  • Three constructor options (injected SecretClient, client-secret credential, Default Azure Credential) cover the common deployment scenarios.
  • JSON metadata via KeyMetadataCodec — no Java serialization, consistent with CAMEL-23726 hardening.
  • Good test coverage: 9 tests against a mocked SecretClient covering the full lifecycle (generate, round-trip through a fresh manager, list, delete, rotate/deprecate, expire, revoke, missing key, invalid name).
  • Thorough documentation with security notes, naming conventions, soft-delete behavior, three usage examples, and updated comparison table.
  • Azure SDK deps properly marked <optional>true</optional>.

Minor observations (non-blocking):

  • updateKeyMetadata calls getKey() + storeKey(), re-writing all three secrets when only metadata changed. Not incorrect — it's consistent with the AWS pattern — but could be optimized to update only the metadata secret if vault write costs matter.
  • metadata.setDescription("Generated on " + new Date()) uses locale-dependent Date.toString() — consider Instant.now().toString() for ISO-8601 consistency, but this matches the existing implementations.

LGTM ✅

Claude Code on behalf of gnodet — AI-generated review

@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.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-pqc

🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all tested

Maveniverse Scalpel detected 38 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • 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

Skip-tests mode would test 9 modules (1 direct + 8 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-pqc
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • 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 (38 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: PQC
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

…tern

AsciiDoc read {keyPrefix}/{keyId} as attribute references, which the strict
documentation-validation build rejects. Escape them so the naming pattern
renders literally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd self-assigned this Jul 21, 2026
@oscerd oscerd added this to the 4.22.0 milestone Jul 21, 2026
@oscerd
oscerd merged commit 2c57c0c into apache:main Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components docs enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants