refactor(api)!: wrap BouncyCastle PGP types behind SigningKey/VerificationKeyring (#500)#506
Merged
Merged
Conversation
…ationKeyring (#500) Second slice of the 0.4.0 API freeze. SignatureService exposed BouncyCastle types (PGPSecretKey, PGPPublicKeyRingCollection) and the checked PGPException on its public methods, and PackageAction.packageChart leaked PGPSecretKey too — permanently pinning BouncyCastle as a transitive compile dependency of every consumer. - New opaque jhelm-owned wrappers in core: SigningKey (holds a PGPSecretKey) and VerificationKeyring (holds a PGPPublicKeyRingCollection), both with package-private accessors so only SignatureService unwraps the BC objects. - New unchecked SignatureException (extends JhelmException) wraps the checked IOException/PGPException from keyring loading and signing. - SignatureService: loadSecretKey -> loadSigningKey, loadPublicKeyring -> loadVerificationKeyring, sign(...) takes SigningKey, verify(...) takes VerificationKeyring; none declare checked exceptions. verify still throws the unchecked SignatureVerificationException for signature/digest failures. - PackageAction/VerifyAction updated; the org.bouncycastle imports are gone from the action package. Signing/verification logic is byte-for-byte unchanged. BREAKING CHANGE: SignatureService's signing/verification API now uses SigningKey / VerificationKeyring and throws SignatureException instead of exposing BouncyCastle types and checked exceptions. Verified: jhelm-core verify green (499 tests, format/PMD/Checkstyle); full reactor compiles; no org.bouncycastle imports remain in the action package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5yvjG89AqMHPAGJawSmg9
Contributor
Files
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second slice of #500 (0.4.0 API freeze).
SignatureServiceexposed BouncyCastle types (PGPSecretKey,PGPPublicKeyRingCollection) and the checkedPGPExceptionon its public methods, andPackageAction.packageChartleakedPGPSecretKeytoo — pinning BouncyCastle as a transitive compile dependency of every consumer.What changed
SigningKey(holds aPGPSecretKey) andVerificationKeyring(holds aPGPPublicKeyRingCollection), with package-private accessors so onlySignatureServiceunwraps the BC objects.SignatureException(extends JhelmException) wraps the checkedIOException/PGPExceptionfrom keyring loading and signing.SignatureService:loadSecretKey→loadSigningKey,loadPublicKeyring→loadVerificationKeyring,sign(…)takesSigningKey,verify(…)takesVerificationKeyring; none declare checked exceptions.verifystill throws the uncheckedSignatureVerificationExceptionfor signature/digest failures.PackageAction/VerifyActionupdated; noorg.bouncycastleimports remain in theactionpackage. Signing/verification logic is byte-for-byte unchanged.The signing/verification API now uses
SigningKey/VerificationKeyringand throwsSignatureExceptioninstead of exposing BouncyCastle types and checked exceptions. The CLI is unaffected (it uses the string-keyring-path overloads).Verification
jhelm-coreverify green — 499 tests, format/PMD/Checkstyle cleangrep org.bouncycastlein the action package is emptyPart of #500.
🤖 Generated with Claude Code