PBS-39 feature: Add binlog encryption config and keyring support (part 1) - #162
Merged
percona-ysorokin merged 1 commit intoJul 30, 2026
Merged
Conversation
percona-ysorokin
force-pushed
the
encryption_main_config
branch
from
July 30, 2026 00:53
0c40511 to
af8ff4b
Compare
…t 1) https://perconadev.atlassian.net/browse/PBS-39 'binsrv::storage_config' extended with new optional field 'encryption' of class 'binsrv::encryption_config' that if present indicates that binlog data files in the storage should be encrypted and holds encryption configuration parameters (currently only 'format' and 'keyring_uri'). Added config validation functions for 'binsrv::encryption_config' and 'binsrv::storage_config'. Added new abstract class 'binsrv::basic_keyring' that provides basic interface for working with encryption keys (currently only 'get_key()' method). Added new model classes (based on 'util::nv_tuple') for representing individual encryption keys and their collections: 'binsrv::keyring_record' and 'binsrv::keyring_record_collection'. Added concrete implementation of the 'binsrv::basic_keyring' interface called 'binsrv::file_keyring' that uses 'binsrv::keyring_record_collection' underneath. Added new factory class 'binsrv::keyring_factory' that helps with constructing concrete implementation of the 'binsrv::basic_keyring' interface based on the provided URI (the value taken from the '<storage.encryption.keyring_uri>' configuration parameter). Main application extended with analyzing optional encryption configuration section, printing its primary parameters to the log file, creating an instance of concrete 'binsrv::basic_keyring' interface using 'binsrv::keyring_factory' class, and printing loaded keyring statistics (number of keys and key/algorithm pairs). Introduced 'utils::hex_value' class that holds a byte blob that can be serialized to / from a hex string. This class is supposed to be used in configuration files to store binary data. Similarly to 'native_file_operations_helpers.hpp' introduced new 'file_operations_helpers.hpp' header file in the 'util' namespace which provides simple functions for reading / writing file content (using 'std::ifstream' / 'std::ofstream') into 'std::string'. 'binsrv::filesystem_storage_backend', 'binsrv::main_config', and `binsrv::keyring_record_collection` refactored to use these helper functions. Sample configuration file ('main_config.json') extended with the '<storage.encryption>' section. Added a sample file representing file keyring data in JSON format ('file_keyring_data.json'). Updated 'README.md' file with new configuration section description.
percona-ysorokin
force-pushed
the
encryption_main_config
branch
from
July 30, 2026 01:31
af8ff4b to
4c8a2c1
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.
https://perconadev.atlassian.net/browse/PBS-39
'binsrv::storage_config' extended with new optional field 'encryption' of class 'binsrv::encryption_config' that if present indicates that binlog data files in the storage should be encrypted and holds encryption configuration parameters (currently only 'format' and 'keyring_uri').
Added config validation functions for 'binsrv::encryption_config' and 'binsrv::storage_config'.
Added new abstract class 'binsrv::basic_keyring' that provides basic interface for working with encryption keys (currently only 'get_key()' method).
Added new model classes (based on 'util::nv_tuple') for representing individual encryption keys and their collections: 'binsrv::keyring_record' and 'binsrv::keyring_record_collection'.
Added concrete implementation of the 'binsrv::basic_keyring' interface called 'binsrv::file_keyring' that uses 'binsrv::keyring_record_collection' underneath.
Added new factory class 'binsrv::keyring_factory' that helps with constructing concrete implementation of the 'binsrv::basic_keyring' interface based on the provided URI (the value taken from the '<storage.encryption.keyring_uri>' configuration parameter).
Main application extended with analyzing optional encryption configuration section, printing its primary parameters to the log file, creating an instance of concrete 'binsrv::basic_keyring' interface using 'binsrv::keyring_factory' class, and printing loaded keyring statistics (number of keys and key/algorithm pairs).
Introduced 'utils::hex_value' class that holds a byte blob that can be serialized to / from a hex string. This class is supposed to be used in configuration files to store binary data.
Similarly to 'native_file_operations_helpers.hpp' introduced new 'file_operations_helpers.hpp' header file in the 'util' namespace which provides simple functions for reading / writing file content (using 'std::ifstream' / 'std::ofstream') into 'std::string'. 'binsrv::filesystem_storage_backend', 'binsrv::main_config', and
binsrv::keyring_record_collectionrefactored to use these helper functions.Sample configuration file ('main_config.json') extended with the '<storage.encryption>' section.
Added a sample file representing file keyring data in JSON format ('file_keyring_data.json').
Updated 'README.md' file with new configuration section description.