Skip to content

MINIFICPP-2749 Add EncryptContentPGP and DecryptContentPGP#2208

Open
martinzink wants to merge 1 commit into
apache:minifi_rustfrom
martinzink:minifi_rust_pgp
Open

MINIFICPP-2749 Add EncryptContentPGP and DecryptContentPGP#2208
martinzink wants to merge 1 commit into
apache:minifi_rustfrom
martinzink:minifi_rust_pgp

Conversation

@martinzink

Copy link
Copy Markdown
Member

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

Copilot AI 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.

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 EncryptContentPGP and DecryptContentPGP processors, including properties, relationships, and output attributes.
  • Add PGPPublicKeyService and PGPPrivateKeyService controller services (key loading + lookup) and comprehensive unit tests.
  • Add test keys/messages and behave integration scenarios; generalize Rust behave build Dockerfiles to export libminifi_*.so artifacts.

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.

Comment thread minifi_rust/extensions/minifi_pgp/features/encrypt_decrypt.feature Outdated
Comment thread minifi_rust/extensions/minifi_pgp/src/processors/decrypt_content/tests.rs Outdated
@martinzink martinzink force-pushed the minifi_rust_pgp branch 2 times, most recently from fb5a265 to e34ead0 Compare July 7, 2026 08:48
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.

2 participants