Skip to content

Refactor AesEncryptor and AesDecryptor - #73

Merged
sofia-tekdatum merged 4 commits into
dev_phase2from
final_aes_encryptor_refactor
Aug 22, 2025
Merged

Refactor AesEncryptor and AesDecryptor#73
sofia-tekdatum merged 4 commits into
dev_phase2from
final_aes_encryptor_refactor

Conversation

@sofia-tekdatum

Copy link
Copy Markdown
Collaborator

Refactor AesEncryptor and AesDecryptor.

Move their AesCryptoContext to header file and make them inherit from EncryptorInterface and DecryptorInterface respectively.

Next step is to change the top level Encryptor to decouple it from the AesEncryptors altogether.

@github-actions

Copy link
Copy Markdown

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@avalerio-tkd avalerio-tkd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sofia-tekdatum did you want to check on the tests before we continue with the refactor?

I finished this refactor before we had that conversation.

I'm back at the first PR in the chain running full tests, will report there and in subsequent PRs.

@argmarco-tkd argmarco-tkd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactor! A bit hard to read (stupid Github diffs, I know)
Left a few comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "2" over "DBPA" as we had it earlier? (a bit less cryptic)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had added an explicit check in AesCryptoContext for our enum, just so we knew it was getting passed along.

That code was removed in this PR, as it's no longer needed because the refactor is getting read to do the right thing.

That message is the existing CryptoContext error message that I don't want to change. This test will go away soon when we implement External versions anyways.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to help legibility, can we add a comment as to which methods are from which interface?
Same for decryptor

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I added a start/end marker for the Encryptor/Decryptor interface methods.

@argmarco-tkd argmarco-tkd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments - not blockers to merge.

@sofia-tekdatum
sofia-tekdatum force-pushed the refactor_aes_encryptor branch from 1ae10e5 to f89f2a6 Compare August 21, 2025 04:26
…o header file and make them inherit from EncryptorInterface and DecryptorInterface respectively
@sofia-tekdatum
sofia-tekdatum force-pushed the final_aes_encryptor_refactor branch from 4e3997e to 52eec39 Compare August 21, 2025 04:41
@sofia-tekdatum
sofia-tekdatum changed the base branch from refactor_aes_encryptor to dev_phase2 August 21, 2025 04:41
@sofia-tekdatum

Copy link
Copy Markdown
Collaborator Author

@sofia-tekdatum did you want to check on the tests before we continue with the refactor?

I finished this refactor before we had that conversation.

I'm back at the first PR in the chain running full tests, will report there and in subsequent PRs.

@avalerio-tkd after the test investigation, ran the following:

From cpp/build:
./release/parquet-encryption-test
./release/parquet-encryption-key-management-test
./release/arrow-dataset-file-parquet-encryption-test

From python:
python -m pytest pyarrow/tests/parquet/test_encryption.py
python -m pytest pyarrow/tests/parquet/test_external_encryption.py
python -m pytest pyarrow/tests/test_dataset_encryption.py

All passed.

Can you PTAL?

@avalerio-tkd avalerio-tkd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already had a look previously and LGTM.

@sofia-tekdatum thanks 10x for the diligence with the tests. That's reassuring.

@sofia-tekdatum
sofia-tekdatum merged commit 6b8938e into dev_phase2 Aug 22, 2025
15 of 62 checks passed
@sofia-tekdatum
sofia-tekdatum deleted the final_aes_encryptor_refactor branch September 20, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants