Modifying ExternalDBPAEncryptor/DecryptorAdapter to obtain agent instance from shared lib (DLL) - #119
Conversation
|
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? or See also: |
There was a problem hiding this comment.
I made this name change so source files are easier to navigate. Sharing the same name among encryptor and decryptor was confusing.
There was a problem hiding this comment.
this is just formatting, so that the encryptor and decryptor construction are similar in the code (no functional changes)
There was a problem hiding this comment.
We missed this in an earlier PR. Because the code was not being used at the time, there were no compilation errors.
…ance from shared lib (DLL)
…XOR-based encryption
0489c86 to
3e332fc
Compare
| agent_instance_ = LoadAndInitializeAgent( | ||
| column_name, connection_config, app_context, key_id, data_type, compression_type); | ||
|
|
||
| //TODO: what to do if agent was not initialized? |
There was a problem hiding this comment.
Added an Issue to track agent init errors since these are in a couple places. protegrity/DataBatchProtectionService#100
| } | ||
|
|
||
| int32_t ExternalDBPAEncryptorAdapter::CallExternalDBPA( | ||
| int32_t ExternalDBPAEncryptorAdapter::InvokeExternalEncrypt( |
There was a problem hiding this comment.
This is where the "executor" would be hooked? (for my understanding)
There was a problem hiding this comment.
The calls to InvokeExternalEncrypt() and InvokeExternalDecrypt() will definitely be controlled by the "executor". But the overall behavioral reach of the "executor" is TBD. It will really depend on the decision we make on the behavior for init() and how those errors propagate up (e.g. we will likely want to protect against a remote DBPA's init() that takes 10 mins to verify server connections)
Modifying ExternalDBPAEncryptor/DecryptorAdapter to obtain agent instance from shared lib (DLL)
This is the last piece which connects together the base work in Arrow (
dev_phase2), and DLL-based agent loading.Both
ExternalDBPAEncryptorAdapterandExternalDBPADecryptorAdapterhave been modified to abandon the simple, pass-through encryption/decryption, and to make use of the DLL-loaded agent (which must be specific in theconnection_configobject passed in. The modifications include (a) looking for the DLL-file name in the properties, (b) instantiating a new agent from the DLL, and (c) forwarding the encrypt/decrypt operations to the DLL-based agent.Testing
external_dbpa_encryption_tests.cchad to be modified to account for the need of DLL. For these tests, we're making use oflibDBPATestAgent.so, which is built out ofexternal/dbpa_test_agent.*(and used in a few different test scenarios).ctest -L parquet) tests pass.base_app.pycompletes succesfully.Notes
dev-miniAppcodebase: Wiring DBPAgent into ExternalEncryptorImpl/ExternalDecryptor impl #68, however bear in mind that the structure of encryptors/decryptors is/was quite different in the miniAppbase_app.py(it needs to account for DLL-based agent loading)