MySQL 8.4.2
Source Code Documentation
|
#include <memory>
#include <sstream>
#include "my_dbug.h"
#include "mysql_server_keyring_lockable_imp.h"
#include <include/mysql/components/my_service.h>
#include <include/mysql/components/services/registry.h>
#include <include/mysqld_error.h>
#include <include/rwlock_scoped_lock.h>
#include <include/scope_guard.h>
#include <mysql/components/services/log_builtins.h>
#include "sql/mysqld.h"
#include "sql/set_var.h"
#include "sql/sql_component.h"
#include "sql/sql_plugin.h"
Classes | |
struct | keyring_lockable::my_h_keyring_reader_object_server |
Error messages. More... | |
struct | keyring_lockable::my_h_keyring_keys_metadata_iterator_server |
Wrapper over my_h_keyring_keys_metadata_iterator to associate RWlock. More... | |
Namespaces | |
namespace | keyring_lockable |
namespace | keyring_lockable::keyring_common |
namespace | keyring_lockable::keyring_common::service_definition |
Enumerations | |
enum | lockable_service_enum { AES_ENCRYPTION = 0 , GENERATOR , KEYS_METADATA_ITERATOR , COMPONENT_STATUS , COMPONENT_METADATA_QUERY , READER_WITH_STATUS , LOAD , WRITER } |
Functions | |
static bool | keyring_lockable::keyring_common::service_definition::check_service (const void *service, enum lockable_service_enum name) |
Helper to check service validity. More... | |
void | keyring_lockable_init () |
Initialize lockable keyring component. More... | |
void | keyring_lockable_deinit () |
Deinitialize lockable keyring component. More... | |
void | set_srv_keyring_implementation_as_default () |
Set server's implementation of keyring as default. More... | |
void | release_keyring_handles () |
bool | keyring_status_no_error () |
void keyring_lockable_deinit | ( | ) |
Deinitialize lockable keyring component.
void keyring_lockable_init | ( | ) |
Initialize lockable keyring component.
bool keyring_status_no_error | ( | ) |
void release_keyring_handles | ( | ) |
void set_srv_keyring_implementation_as_default | ( | ) |
Set server's implementation of keyring as default.
server component provides implementation of all keyring related services to provide concurrency control.
In turn it uses either one of the following as actual implementation(in order of priority): A> A keyring component loaded through manifest file B> Proxy keyring component over keyring plugin
There are two places where this function is called.
At the time of server startup, server_component's services are registered when minimal chassis is initialized. However, without actual keyring implementation, they are not really of any use.
After minimal chassis initialization, server read manifest file. If file is present and contains keyring component details, the component is loaded and services are registered.
At this point we have 2 implementations of each keyring services: One provided by server and another provided by keyring component.
One component is loaded set_srv_keyring_implementation_as_default() is called. At this stage function will:
After this point, keyring functionality can be used.
If manifest file is not provided or does not contain details of keyring plugin, call to set_srv_keyring_implementation_as_default() will still be made and set server's implementation as default.
However, no internal handles are set. Thus, keyring functionality can not be used still.
Startup sequence will then process –early-plugin-load if provided.
Afterwards, daemon_proxy_keyring_implementation plugin is loaded which registers a subset of keyring component services. These services will use keyring plugin if installed.
At this point set_srv_keyring_implementation_as_default() is called once again. If internal handles were not set with the first call, they are set now and will use daemon_proxy_keyring_implementation.
This means, if keyring plugin is available (either through –early-plugin-load OR loaded later through INSTALL PLUGIN), it will be used.
|
static |
const mysql_service_keyring_aes_t* srv_keyring_aes = nullptr |
Server handle for keyring AES encryption service.
const mysql_service_keyring_component_metadata_query_t* srv_keyring_component_metadata_query = nullptr |
Server handle for keyring component metadata service.
const mysql_service_keyring_component_status_t* srv_keyring_component_status = nullptr |
Server handle for keyring status service.
const mysql_service_keyring_generator_t* srv_keyring_generator = nullptr |
Server handle for keyring generator service.
const mysql_service_keyring_keys_metadata_iterator_t* srv_keyring_keys_metadata_iterator = nullptr |
Server handle for keyring keys metadata service.
const mysql_service_keyring_load_t* srv_keyring_load = nullptr |
Server handle for keyring load service.
const mysql_service_keyring_reader_with_status_t* srv_keyring_reader = nullptr |
Server handle for keyring reader service.
const mysql_service_keyring_writer_t* srv_keyring_writer = nullptr |
Server handle for keyring writer service.