MySQL 8.0.39
Source Code Documentation
components.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2021, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef COMPONENTS_INCLUDED
27#define COMPONENTS_INCLUDED
28
29#include <mysql/components/minimal_chassis.h> /* Minimal chassis */
35
36#include "client/logger.h" /* Log */
37#include "options.h" /* Mysql_connection */
38namespace components {
43 SERVICE_TYPE_NO_CONST(keyring_keys_metadata_iterator);
45 SERVICE_TYPE_NO_CONST(keyring_reader_with_status);
47
51 SERVICE_TYPE(keyring_keys_metadata_iterator);
52using const_keyring_load_t = SERVICE_TYPE(keyring_load);
54 SERVICE_TYPE(keyring_reader_with_status);
55using const_keyring_writer_t = SERVICE_TYPE(keyring_writer);
56
59
61 public:
62 Keyring_component_load(const std::string component_name,
63 const std::string type);
64
66
67 bool ok() { return ok_; }
68
69 private:
71 std::string component_path_;
72 std::string type_;
73 bool ok_;
74};
75
77 public:
78 Keyring_services(const std::string implementation_name,
79 const std::string instance_path);
80
81 virtual ~Keyring_services();
82
83 bool ok() { return ok_; }
84
85 protected:
89 bool ok_;
90};
91
93 public:
94 Source_keyring_services(const std::string implementation_name,
95 const std::string instance_path);
96
98
101 }
104 }
105
106 private:
110};
111
113 public:
114 Destination_keyring_services(const std::string implementation_name,
115 const std::string instance_path);
116
118
120
121 private:
123};
124
125class Keyring_migrate final {
126 public:
128 Destination_keyring_services &dst, bool online_migration);
129
130 bool migrate_keys();
131
133
134 bool lock_source_keyring();
136 bool ok() { return ok_; }
137
138 private:
143 bool ok_{false};
144 const size_t maximum_size_{16384};
145};
146
147} // namespace components
148
149#endif // !COMPONENTS_INCLUDED
Definition: components.h:112
Destination_keyring_services(const std::string implementation_name, const std::string instance_path)
Definition: components.cc:159
my_service< const_keyring_writer_t > keyring_writer_service_
Definition: components.h:122
const_keyring_writer_t * writer()
Definition: components.h:119
~Destination_keyring_services()
Definition: components.cc:175
Definition: components.h:60
bool ok_
Definition: components.h:73
std::string component_path_
Definition: components.h:71
Keyring_component_load(const std::string component_name, const std::string type)
Definition: components.cc:59
std::string type_
Definition: components.h:72
dynamic_loader_type_t * dynamic_loader_
Definition: components.h:70
bool ok()
Definition: components.h:67
~Keyring_component_load()
Definition: components.cc:81
Definition: components.h:125
bool ok()
Definition: components.h:136
options::Mysql_connection mysql_connection_
Definition: components.h:142
bool ok_
Definition: components.h:143
const size_t maximum_size_
Definition: components.h:144
bool lock_source_keyring()
Definition: components.cc:200
my_h_keyring_keys_metadata_iterator iterator_
Definition: components.h:141
Keyring_migrate(Source_keyring_services &src, Destination_keyring_services &dst, bool online_migration)
Definition: components.cc:182
Source_keyring_services & src_
Definition: components.h:139
bool migrate_keys()
Definition: components.cc:214
~Keyring_migrate()
Definition: components.cc:372
Destination_keyring_services & dst_
Definition: components.h:140
bool unlock_source_keyring()
Definition: components.cc:207
Definition: components.h:76
bool ok()
Definition: components.h:83
my_service< const_keyring_load_t > keyring_load_service_
Definition: components.h:88
std::string implementation_name_
Definition: components.h:87
virtual ~Keyring_services()
Definition: components.cc:123
registry_type_t * registry_
Definition: components.h:86
bool ok_
Definition: components.h:89
Keyring_services(const std::string implementation_name, const std::string instance_path)
Definition: components.cc:96
Definition: components.h:92
const_keyring_reader_with_status_t * reader()
Definition: components.h:102
const_keyring_keys_metadata_iterator_t * metadata_iterator()
Definition: components.h:99
Source_keyring_services(const std::string implementation_name, const std::string instance_path)
Definition: components.cc:131
my_service< const_keyring_reader_with_status_t > keyring_reader_service_
Definition: components.h:109
~Source_keyring_services()
Definition: components.cc:151
my_service< const_keyring_keys_metadata_iterator_t > keyring_keys_metadata_service_
Definition: components.h:108
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
Definition: options.h:93
struct my_h_keyring_keys_metadata_iterator_imp * my_h_keyring_keys_metadata_iterator
Definition: keyring_keys_metadata_iterator.h:29
Definition: components.cc:41
void deinit_components_subsystem()
Definition: components.cc:53
void init_components_subsystem()
Definition: components.cc:46
required string type
Definition: replication_group_member_actions.proto:34
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:71
Service for managing the list of loaded Components.
Definition: dynamic_loader.h:41
Keyring keys metadata iterator service provides APIs to create and use iterator to access metadata as...
Definition: keyring_keys_metadata_iterator.h:76
Keyring load service provides way to initialize or reiniitalize keyring component.
Definition: keyring_load.h:52
Keyring reader with status service provides APIs to fetch sensitive data from keyring backend.
Definition: keyring_reader_with_status.h:128
Keyring writer service provides APIs to add/remove sensitive data to/from keyring backend.
Definition: keyring_writer.h:70
Service for acquiring and releasing references to all registered Service Implementations.
Definition: registry.h:48