MINIFICPP-2749 Add EncryptContentPGP and DecryptContentPGP#2208
Open
martinzink wants to merge 1 commit into
Open
MINIFICPP-2749 Add EncryptContentPGP and DecryptContentPGP#2208martinzink wants to merge 1 commit into
martinzink wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Rust minifi_pgp MiNiFi extension that provides OpenPGP content encryption/decryption processors plus supporting controller services, along with unit/integration tests and test fixtures. This integrates with the existing minifi_native Rust API layer and the behave-based test harness used in this repo.
Changes:
- Introduce
EncryptContentPGPandDecryptContentPGPprocessors, including properties, relationships, and output attributes. - Add
PGPPublicKeyServiceandPGPPrivateKeyServicecontroller services (key loading + lookup) and comprehensive unit tests. - Add test keys/messages and behave integration scenarios; generalize Rust behave build Dockerfiles to export
libminifi_*.soartifacts.
Reviewed changes
Copilot reviewed 45 out of 52 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| minifi_rust/minifi_rs_behave/alpine.dockerfile | Exports any libminifi_*.so from the build stage to support multiple Rust extension library names. |
| minifi_rust/minifi_rs_behave/debian.dockerfile | Same as above for Debian-based build flavor. |
| minifi_rust/extensions/minifi_pgp/.cargo/config.toml | Adds macOS linker flags to support building the extension as a dynamic library. |
| minifi_rust/extensions/minifi_pgp/.gitignore | Ignores build/test outputs for the extension and its integration test venvs. |
| minifi_rust/extensions/minifi_pgp/Cargo.toml | Declares the new minifi_pgp cdylib crate and its dependencies. |
| minifi_rust/extensions/minifi_pgp/features/encrypt_decrypt.feature | Adds behave scenarios validating extension registration and encrypt/decrypt behavior in a MiNiFi container. |
| minifi_rust/extensions/minifi_pgp/features/environment.py | Builds a MiNiFi container image with the compiled minifi_pgp extension library injected. |
| minifi_rust/extensions/minifi_pgp/features/steps/steps.py | Adds behave step implementations for configuring PGP services/processors and asserting outputs. |
| minifi_rust/extensions/minifi_pgp/minifi_pgp.md | Adds user-facing documentation for processors/services (properties, relationships, output attributes). |
| minifi_rust/extensions/minifi_pgp/src/controller_services/key_lookup.rs | Implements key-id/user-id matching logic (including unit tests). |
| minifi_rust/extensions/minifi_pgp/src/controller_services/mod.rs | Wires controller-service modules into the crate. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/private_key_service.rs | Implements PGPPrivateKeyService (load secret keys, provide TheRing) + unit test module hook. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/private_key_service/controller_service_definition.rs | Declares controller-service metadata for PGPPrivateKeyService. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/private_key_service/properties.rs | Defines PGPPrivateKeyService properties (key file/content/passphrase). |
| minifi_rust/extensions/minifi_pgp/src/controller_services/private_key_service/tests.rs | Unit tests for private-key loading and lookup behavior. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/public_key_service.rs | Implements PGPPublicKeyService (load public keys, lookup) + unit test module hook. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/public_key_service/controller_service_definition.rs | Declares controller-service metadata for PGPPublicKeyService. |
| minifi_rust/extensions/minifi_pgp/src/controller_services/public_key_service/properties.rs | Defines PGPPublicKeyService properties (keyring file/content). |
| minifi_rust/extensions/minifi_pgp/src/controller_services/public_key_service/tests.rs | Unit tests for public-key loading and lookup behavior. |
| minifi_rust/extensions/minifi_pgp/src/lib.rs | Registers processors and controller services in the MiNiFi extension entrypoint. |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content.rs | Implements DecryptContentPGP processor logic (decrypt, optional decompress, emit attributes). |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/output_attributes.rs | Declares decryption output attributes (literal data filename/modified). |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/processor_definition.rs | Declares processor metadata for DecryptContentPGP. |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/properties.rs | Declares decryption properties (strategy, password, private key service). |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/relationships.rs | Declares DecryptContentPGP relationships (success/failure). |
| minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/tests.rs | Unit tests for decryption across password/private-key paths and failure modes. |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content.rs | Implements EncryptContentPGP processor logic (public-key and/or password encryption; ASCII/binary). |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content/output_attributes.rs | Declares encryption output attribute (pgp.file.encoding). |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content/processor_definition.rs | Declares processor metadata for EncryptContentPGP. |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content/properties.rs | Declares encryption properties (encoding, password, public key search/service). |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content/relationships.rs | Declares EncryptContentPGP relationships (success/failure). |
| minifi_rust/extensions/minifi_pgp/src/processors/encrypt_content/tests.rs | Unit tests covering encryption via password and public-key service. |
| minifi_rust/extensions/minifi_pgp/src/processors/mod.rs | Wires processor modules into the crate. |
| minifi_rust/extensions/minifi_pgp/src/test_utils/mod.rs | Test helpers for locating key/message fixtures from tests. |
| minifi_rust/extensions/minifi_pgp/test_keys/README.txt | Documents test identities/passphrases used by fixtures. |
| minifi_rust/extensions/minifi_pgp/test_keys/alice.asc | Adds test public key (Alice). |
| minifi_rust/extensions/minifi_pgp/test_keys/alice_private.asc | Adds test private key (Alice). |
| minifi_rust/extensions/minifi_pgp/test_keys/bob_private.asc | Adds test private key (Bob). |
| minifi_rust/extensions/minifi_pgp/test_keys/keyring.asc | Adds test public keyring (Alice + Bob). |
| minifi_rust/extensions/minifi_pgp/test_keys/secret_keyring.asc | Adds test secret keyring (Alice + Bob). |
| minifi_rust/extensions/minifi_pgp/test_keys/truncated.asc | Adds intentionally truncated/corrupt public key fixture for negative tests. |
| minifi_rust/extensions/minifi_pgp/test_keys/truncated_private.asc | Adds intentionally truncated/corrupt private key fixture for negative tests. |
| minifi_rust/extensions/minifi_pgp/test_messages/foo_for_alice.asc | Adds encrypted message fixture targeting Alice (ASCII armored). |
| minifi_rust/extensions/minifi_pgp/test_messages/password_encrypted_foo.asc | Adds password-encrypted message fixture (ASCII armored). |
| minifi_rust/extensions/minifi_pgp/test_messages/password_encrypted_foo.gpg | Adds password-encrypted message fixture (binary). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fb5a265 to
e34ead0
Compare
e34ead0 to
cd1d2df
Compare
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.
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.