24#ifndef KEYRING_KEYS_METADATA_SERVICE_IMPL_TEMPLATE_INCLUDED
25#define KEYRING_KEYS_METADATA_SERVICE_IMPL_TEMPLATE_INCLUDED
33#include <mysqld_error.h>
60template <
typename Backend,
typename Data_extension = Data>
68 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
75 ER_NOTE_KEYRING_COMPONENT_KEYS_METADATA_ITERATOR_INIT_FAILED);
81 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"init",
82 "keyring_keys_metadata_iterator");
99template <
typename Backend,
typename Data_extension = Data>
107 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
113 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"deinit",
114 "keyring_keys_metadata_iterator");
131template <
typename Backend,
typename Data_extension = Data>
139 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
142 return keyring_operations.
is_valid(it);
144 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"is_valid",
145 "keyring_keys_metadata_iterator");
162template <
typename Backend,
typename Data_extension = Data>
170 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
173 if (keyring_operations.
next(it)) {
178 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"next",
179 "keyring_keys_metadata_iterator");
198template <
typename Backend,
typename Data_extension = Data>
201 size_t *auth_id_length,
207 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
216 ER_NOTE_KEYRING_COMPONENT_KEYS_METADATA_ITERATOR_FETCH_FAILED);
220 *data_id_length = metadata.
key_id().length();
221 *auth_id_length = metadata.
owner_id().length();
224 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"get_length",
225 "keyring_keys_metadata_iterator");
245template <
typename Backend,
typename Data_extension = Data>
248 size_t data_id_length,
char *auth_id,
size_t auth_id_length,
254 ER_NOTE_KEYRING_COMPONENT_NOT_INITIALIZED);
263 ER_NOTE_KEYRING_COMPONENT_KEYS_METADATA_ITERATOR_FETCH_FAILED);
267 if (metadata.
key_id().length() >= data_id_length) {
272 if (metadata.
owner_id().length() >= auth_id_length) {
277 memcpy(data_id, metadata.
key_id().c_str(), metadata.
key_id().length());
278 data_id[metadata.
key_id().length()] =
'\0';
280 auth_id[metadata.
owner_id().length()] =
'\0';
283 LogComponentErr(
ERROR_LEVEL, ER_KEYRING_COMPONENT_EXCEPTION,
"get",
284 "keyring_keys_metadata_iterator");
Sensitive data storage.
Definition: data.h:39
Definition: iterator.h:32
Keyring operations A class to perform operations on keyring.
Definition: operations.h:482
bool next(std::unique_ptr< iterator::Iterator< Data_extension > > &it)
Move iterator forward.
Definition: operations.h:720
bool get_iterator_data(std::unique_ptr< iterator::Iterator< Data_extension > > &it, meta::Metadata &metadata, Data_extension &data)
Get data from iterator.
Definition: operations.h:736
bool init_forward_iterator(std::unique_ptr< iterator::Iterator< Data_extension > > &it, bool cached)
Iterator creation.
Definition: operations.h:680
void deinit_forward_iterator(std::unique_ptr< iterator::Iterator< Data_extension > > &it)
Iterator destruction.
Definition: operations.h:693
bool is_valid(std::unique_ptr< iterator::Iterator< Data_extension > > &it)
Check iterator validity.
Definition: operations.h:707
bool get_iterator_metadata(std::unique_ptr< iterator::Iterator< Data_extension > > &it, meta::Metadata &metadata, Data_extension &data)
Get metadata from iterator.
Definition: operations.h:762
Definition: service_requirements.h:35
bool keyring_initialized()
Keyring component status.
Definition: component_callbacks.cc:28
@ ERROR_LEVEL
Definition: my_loglevel.h:43
@ INFORMATION_LEVEL
Definition: my_loglevel.h:45
Definition: keyring_encryption_service_impl_template.h:56
bool deinit_keys_metadata_iterator_template(std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Iterator deinitialization.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:100
bool keys_metadata_get_template(std::unique_ptr< Iterator< Data_extension > > &it, char *data_id, size_t data_id_length, char *auth_id, size_t auth_id_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Fetch metadata for current key pointed by iterator.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:246
bool keys_metadata_iterator_is_valid(std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Check validity of the iterator.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:132
bool init_keys_metadata_iterator_template(std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Forward iterator initialization.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:61
bool keys_metadata_iterator_next(std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Move iterator forward.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:163
bool keys_metadata_get_length_template(std::unique_ptr< Iterator< Data_extension > > &it, size_t *data_id_length, size_t *auth_id_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
Fetch length of metadata for current key pointed by iterator.
Definition: keyring_keys_metadata_iterator_service_impl_template.h:199
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2440