You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/06/10 12:47:18 UTC

[PR] CAMEL-23726: Use JSON instead of Java serialization for key metadata in AWS and HashiCorp Vault lifecycle managers [camel]

oscerd opened a new pull request, #23912:
URL: https://github.com/apache/camel/pull/23912

   ## Summary
   
   Aligns all three `KeyLifecycleManager` implementations in `camel-pqc` on the same JSON
   representation for key metadata, and removes the use of Java serialization for stored metadata
   in the AWS and HashiCorp Vault managers.
   
   `FileBasedKeyLifecycleManager` already stores `KeyMetadata` as JSON (since CAMEL-23200), but
   `AwsSecretsManagerKeyLifecycleManager` and `HashicorpVaultKeyLifecycleManager` still persisted it
   as a Base64-encoded, Java-serialized value. This makes them consistent and avoids relying on Java
   serialization for persisted state, while keeping full backward compatibility.
   
   ## Changes
   
   - Add `KeyMetadataCodec`, a shared helper that serializes `KeyMetadata` to/from JSON and provides
     allow-list `ObjectInputFilter`s used when reading legacy values.
   - `AwsSecretsManagerKeyLifecycleManager` / `HashicorpVaultKeyLifecycleManager`: store metadata as
     JSON; transparently read metadata written by previous versions (the legacy `ObjectInputStream`
     read is constrained to the expected types) and migrate it to JSON on the next update.
   - `FileBasedKeyLifecycleManager`: constrain the legacy-migration `ObjectInputStream` reads
     (`KeyPair`, `KeyMetadata`) to the expected types, and make the metadata format detection
     binary-safe — the previous `Files.readString` could fail on a legacy binary metadata file and
     prevent migration.
   - Docs: `camel-4x-upgrade-guide-4_21.adoc` note (format change + downgrade caveat).
   
   ## Backward compatibility
   
   Metadata written by previous versions is read transparently and migrated to JSON on the next
   update. Downgrading after new JSON metadata has been written is not supported (older versions
   cannot read it) — documented in the upgrade guide.
   
   ## Testing
   
   - New `KeyMetadataCodecTest`: JSON round-trip, format detection, and legacy-format read.
   - New `FileBasedKeyLifecycleManager` migration tests exercising the legacy `KeyPair` and
     `KeyMetadata` paths with a real Bouncy Castle PQC key pair.
   - 45 `camel-pqc` key-lifecycle unit tests pass; code formatted (`formatter:format` + `impsort:sort`).
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-23726
   
   ---
   _Claude Code on behalf of Andrea Cosentino_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23726: Use JSON instead of Java serialization for key metadata in AWS and HashiCorp Vault lifecycle managers [camel]

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #23912:
URL: https://github.com/apache/camel/pull/23912


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23726: Use JSON instead of Java serialization for key metadata in AWS and HashiCorp Vault lifecycle managers [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23912:
URL: https://github.com/apache/camel/pull/23912#issuecomment-4670416838

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23726: Use JSON instead of Java serialization for key metadata in AWS and HashiCorp Vault lifecycle managers [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23912:
URL: https://github.com/apache/camel/pull/23912#issuecomment-4670896125

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-pqc`
   - `docs`
   
   <details><summary>All tested modules (8 modules)</summary>
   
   - Camel :: JBang :: 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
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/27278598105)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org