MySQL 8.3.0
Source Code Documentation
daemon_proxy_keyring.cc File Reference

Classes

struct  my_h_keyring_reader_object_keyring_proxy
 
struct  my_h_keyring_keys_metadata_iterator_keyring_proxy
 
class  keyring_proxy::Callback
 Class that stores callback function reference as well as the result of the callback function call (invoke method). More...
 
class  keyring_proxy::Keyring_proxy_imp
 A class that implements proxy keyring component services and calls keyring plugin APIs underneath. More...
 

Namespaces

namespace  keyring_proxy
 

Typedefs

using keyring_generator_t = mysql_service_keyring_generator_t
 
using keyring_keys_metadata_iterator_t = mysql_service_keyring_keys_metadata_iterator_t
 
using keyring_component_status_t = mysql_service_keyring_component_status_t
 
using keyring_reader_t = mysql_service_keyring_reader_with_status_t
 
using keyring_writer_t = mysql_service_keyring_writer_t
 

Enumerations

enum  proxy_keyring_services_enum {
  GENERATOR = 0 , KEYS_METADATA_ITERATOR , COMPONENT_STATUS , READER_WITH_STATUS ,
  WRITER
}
 

Functions

static bool keyring_proxy::key_plugin_cb_fn (THD *, plugin_ref plugin, void *arg)
 Callback function that is called on the plugin. More...
 
static bool keyring_proxy::iterate_plugins (std::function< bool(st_mysql_keyring *keyring)> fn)
 Iterate over plugins of the MYSQL_KEYRING_PLUGIN type and call the function specified by the argument. More...
 
static const std::string keyring_proxy::oom_error ("Failed to allocate required memory")
 
static int daemon_keyring_proxy_plugin_init (void *)
 Initializes the plugin. More...
 
static int daemon_keyring_proxy_plugin_deinit (void *)
 De-initializes the plugin. More...
 
 mysql_declare_plugin (daemon_keyring_proxy)
 Plugin Descriptor. More...
 

Variables

const size_t KEYRING_PROXY_MAX_ID_LENGTH = 1024 + 1
 
const mysql_service_keyring_generator_t imp_daemon_keyring_proxy_keyring_generator
 ======================================================================= More...
 
const mysql_service_keyring_keys_metadata_iterator_t imp_daemon_keyring_proxy_keyring_keys_metadata_iterator
 
const mysql_service_keyring_component_status_t imp_daemon_keyring_proxy_keyring_component_status
 
const mysql_service_keyring_reader_with_status_t imp_daemon_keyring_proxy_keyring_reader_with_status
 
const mysql_service_keyring_writer_t imp_daemon_keyring_proxy_keyring_writer
 
struct st_mysql_daemon daemon_keyring_proxy_plugin
 ======================================================================= More...
 
static const char * proxy_keyring_service_names []
 
static my_h_service proxy_keyring_service_handles []
 
 mysql_declare_plugin_end
 

Typedef Documentation

◆ keyring_component_status_t

◆ keyring_generator_t

◆ keyring_keys_metadata_iterator_t

◆ keyring_reader_t

◆ keyring_writer_t

Enumeration Type Documentation

◆ proxy_keyring_services_enum

Enumerator
GENERATOR 
KEYS_METADATA_ITERATOR 
COMPONENT_STATUS 
READER_WITH_STATUS 
WRITER 

Function Documentation

◆ daemon_keyring_proxy_plugin_deinit()

static int daemon_keyring_proxy_plugin_deinit ( void *  )
static

De-initializes the plugin.

Unregisters services.

◆ daemon_keyring_proxy_plugin_init()

static int daemon_keyring_proxy_plugin_init ( void *  )
static

Initializes the plugin.

Registers the proxy keyring services.

◆ mysql_declare_plugin()

mysql_declare_plugin ( daemon_keyring_proxy  )

Plugin Descriptor.

Variable Documentation

◆ daemon_keyring_proxy_plugin

struct st_mysql_daemon daemon_keyring_proxy_plugin
Initial value:
= {
#define MYSQL_DAEMON_INTERFACE_VERSION
Definition: plugin.h:671

=======================================================================

Plugin related stuff

◆ imp_daemon_keyring_proxy_keyring_component_status

const mysql_service_keyring_component_status_t imp_daemon_keyring_proxy_keyring_component_status
Initial value:
= {
static mysql_service_status_t keyring_status() noexcept
Keyring status.
Definition: daemon_proxy_keyring.cc:634

◆ imp_daemon_keyring_proxy_keyring_generator

const mysql_service_keyring_generator_t imp_daemon_keyring_proxy_keyring_generator
Initial value:
= {
static mysql_service_status_t generate(const char *data_id, const char *auth_id, const char *data_type, size_t data_size) noexcept
Generate data and store in keyring.
Definition: daemon_proxy_keyring.cc:187

=======================================================================

Component declaration related stuff This component provides implementation of following component services

◆ imp_daemon_keyring_proxy_keyring_keys_metadata_iterator

const mysql_service_keyring_keys_metadata_iterator_t imp_daemon_keyring_proxy_keyring_keys_metadata_iterator
Initial value:
= {
static mysql_service_status_t next(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Definition: daemon_proxy_keyring.cc:329
static mysql_service_status_t is_valid(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Validity of iterator.
Definition: daemon_proxy_keyring.cc:307
static mysql_service_status_t deinit(my_h_keyring_keys_metadata_iterator forward_iterator) noexcept
Iterator deinitialization.
Definition: daemon_proxy_keyring.cc:279
static mysql_service_status_t get(my_h_keyring_keys_metadata_iterator forward_iterator, char *data_id, size_t data_id_length, char *auth_id, size_t auth_id_length) noexcept
Fetch metadata for current key pointed by iterator and move the iterator forward.
Definition: daemon_proxy_keyring.cc:401
static mysql_service_status_t get_length(my_h_keyring_keys_metadata_iterator forward_iterator, size_t *data_id_length, size_t *auth_id_length) noexcept
Fetch metadata for current key pointed by iterator and move the iterator forward.
Definition: daemon_proxy_keyring.cc:365
static mysql_service_status_t init(my_h_keyring_keys_metadata_iterator *forward_iterator) noexcept
Forward iterator initialization.
Definition: daemon_proxy_keyring.cc:211

◆ imp_daemon_keyring_proxy_keyring_reader_with_status

const mysql_service_keyring_reader_with_status_t imp_daemon_keyring_proxy_keyring_reader_with_status
Initial value:
= {
static mysql_service_status_t reader_deinit(my_h_keyring_reader_object reader_object) noexcept
Deinitialize reader.
Definition: daemon_proxy_keyring.cc:486
static mysql_service_status_t fetch(my_h_keyring_reader_object reader_object, unsigned char *data_buffer, size_t data_buffer_length, size_t *data_size, char *data_type, size_t data_type_buffer_length, size_t *data_type_size) noexcept
Fetches data from keyring.
Definition: daemon_proxy_keyring.cc:557
static mysql_service_status_t fetch_length(my_h_keyring_reader_object reader_object, size_t *data_size, size_t *data_type_size) noexcept
Fetch length of the data.
Definition: daemon_proxy_keyring.cc:521
static mysql_service_status_t reader_init(const char *data_id, const char *auth_id, my_h_keyring_reader_object *reader_object) noexcept
Initialize reader.
Definition: daemon_proxy_keyring.cc:438

◆ imp_daemon_keyring_proxy_keyring_writer

const mysql_service_keyring_writer_t imp_daemon_keyring_proxy_keyring_writer
Initial value:
= {
static mysql_service_status_t remove(const char *data_id, const char *auth_id) noexcept
Remove data from keyring.
Definition: daemon_proxy_keyring.cc:618
static mysql_service_status_t store(const char *data_id, const char *auth_id, const unsigned char *data, size_t data_size, const char *data_type) noexcept
Store data in keyring.
Definition: daemon_proxy_keyring.cc:594

◆ KEYRING_PROXY_MAX_ID_LENGTH

const size_t KEYRING_PROXY_MAX_ID_LENGTH = 1024 + 1

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ proxy_keyring_service_handles

my_h_service proxy_keyring_service_handles[]
static
Initial value:
= {
reinterpret_cast<my_h_service>(const_cast<keyring_generator_t *>(
&SERVICE_IMPLEMENTATION(daemon_keyring_proxy, keyring_generator))),
reinterpret_cast<my_h_service>(
daemon_keyring_proxy, keyring_keys_metadata_iterator))),
reinterpret_cast<my_h_service>(
daemon_keyring_proxy, keyring_component_status))),
reinterpret_cast<my_h_service>(
daemon_keyring_proxy, keyring_reader_with_status))),
reinterpret_cast<my_h_service>(const_cast<keyring_writer_t *>(
&SERVICE_IMPLEMENTATION(daemon_keyring_proxy, keyring_writer))),
}
struct my_h_service_imp * my_h_service
A handle type for acquired Service.
Definition: registry.h:32
#define SERVICE_IMPLEMENTATION(component, service)
Reference to the name of the service implementation variable.
Definition: service_implementation.h:50
Keyring component status provides a way to check whether keyring is active or not.
Definition: keyring_metadata_query.h:46
Key generator service provides a way to generate random data and store it in keyring backend.
Definition: keyring_generator.h:64
Keyring keys metadata iterator service provides APIs to create and use iterator to access metadata as...
Definition: keyring_keys_metadata_iterator.h:75
Keyring reader with status service provides APIs to fetch sensitive data from keyring backend.
Definition: keyring_reader_with_status.h:127
Keyring writer service provides APIs to add/remove sensitive data to/from keyring backend.
Definition: keyring_writer.h:69

◆ proxy_keyring_service_names

const char* proxy_keyring_service_names[]
static
Initial value:
= {
"keyring_generator.daemon_keyring_proxy",
"keyring_keys_metadata_iterator.daemon_keyring_proxy",
"keyring_component_status.daemon_keyring_proxy",
"keyring_reader_with_status.daemon_keyring_proxy",
"keyring_writer.daemon_keyring_proxy"}