adamreeve commented on code in PR #40329:
URL: https://github.com/apache/arrow/pull/40329#discussion_r1525823189
##########
cpp/src/parquet/encryption/crypto_factory.cc:
##########
@@ -172,8 +201,8 @@ std::shared_ptr<FileDecryptionProperties>
CryptoFactory::GetFileDecryptionProper
const KmsConnectionConfig& kms_connection_config,
const DecryptionConfiguration& decryption_config, const std::string&
file_path,
const std::shared_ptr<::arrow::fs::FileSystem>& file_system) {
- auto key_retriever = std::make_shared<FileKeyUnwrapper>(
- &key_toolkit_, kms_connection_config,
decryption_config.cache_lifetime_seconds,
+ auto key_retriever = std::make_shared<CryptoFactoryFileKeyRetriever>(
Review Comment:
Yes, users can work around this by holding a reference to the CryptoFactory.
But I think it would be good to improve the API here so that users didn't have
to worry about this, especially for users of managed languages/runtimes like C#
and Python where they don't expect usage errors to lead to segfaults or
undefined behaviour.
It's fair to say this isn't exactly a bug, but I'd say that if this
behaviour isn't changed then at the very least the Python API documentation for
`CryptoFactory.file_decryption_properties` should be updated to warn users
about the possibility of undefined behaviour if they don't keep their
CryptoFactory alive as long as the decryption properties may be in use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]