Skip to content

Commit ddbc82b

Browse files
author
Krzysztof Horszczaruk
committed
WL#16505 component_keyring_hashicorp
component_keyring_hashicorp implementation: * based on keyring_hashicorp plugin * MTR tests for the component created * deprecation warning for keyring_hashicorp plugin added * V$OPTION support for component_keyring_hashicorp added Change-Id: I5efe9a4439d98e44641c92626547a62e654c73e1
1 parent 855cb1c commit ddbc82b

File tree

8 files changed

+40
-1
lines changed

8 files changed

+40
-1
lines changed

components/keyrings/common/data/data.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ Data &Data::operator=(Data &&src) noexcept {
6060
}
6161

6262
/** Destructor */
63-
Data::~Data() { valid_ = false; }
63+
Data::~Data() {
64+
data_.replace(0, data_.length(), data_.length(), '*');
65+
valid_ = false;
66+
}
6467

6568
/** Return self */
6669
Data Data::get_data() const { return *this; }

components/keyrings/common/operations/operations.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,14 @@ class Keyring_operations {
618618
return false;
619619
}
620620

621+
/**
622+
Clear API to clear entire data cache
623+
*/
624+
void clear() {
625+
cache_.clear();
626+
valid_ = 0;
627+
}
628+
621629
/**
622630
Generate API
623631

packaging/deb-in/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ usr/lib/mysql/plugin/authentication_pam.so
112112
usr/lib/mysql/plugin/authentication_webauthn.so
113113
usr/lib/mysql/plugin/component_enterprise_encryption.so
114114
usr/lib/mysql/plugin/component_keyring_encrypted_file.so
115+
usr/lib/mysql/plugin/component_keyring_hashicorp.so
115116
usr/lib/mysql/plugin/component_keyring_oci.so
116117
usr/lib/mysql/plugin/data_masking.so
117118
usr/lib/mysql/plugin/firewall.so

packaging/deb-in/deb_debug.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ usr/lib/mysql/plugin/debug/keyring_hashicorp.so
226226
usr/lib/mysql/plugin/debug/thread_pool.so
227227
usr/lib/mysql/plugin/debug/firewall.so
228228
usr/lib/mysql/plugin/debug/component_keyring_encrypted_file.so
229+
usr/lib/mysql/plugin/debug/component_keyring_hashicorp.so
229230
usr/lib/mysql/plugin/debug/component_keyring_oci.so
230231
usr/lib/mysql/plugin/debug/component_enterprise_encryption.so
231232
usr/lib/mysql/plugin/debug/component_masking.so

packaging/rpm-docker/mysql.spec.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ rm -r $(readlink var) var
692692
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_aws.so
693693
%endif # add_component_keyring_aws
694694
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_encrypted_file.so
695+
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_hashicorp.so
695696
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_oci.so
696697
%attr(755, root, root) %{_libdir}/mysql/plugin/component_enterprise_encryption.so
697698
%attr(755, root, root) %{_libdir}/mysql/plugin/component_masking.so
@@ -725,6 +726,9 @@ rm -r $(readlink var) var
725726
* Fri Jan 10 2025 Anibal Pinto <[email protected]> - 9.3.0-1
726727
- Added component_group_replication_elect_prefers_most_updated
727728

729+
* Thu Jan 09 2025 Krzysztof Horszczaruk <[email protected]> - 9.3.0-1
730+
- Add component_keyring_hashicorp.so component
731+
728732
* Fri Nov 29 2024 Jaideep Karande <[email protected]> - 9.2.0-1
729733
- Added component_group_replication_resource_manager
730734

packaging/rpm-oel/mysql.spec.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ mkdir debug
860860
-DWITH_AUTHENTICATION_OPENID_CONNECT=0 \
861861
-DWITH_AUTHENTICATION_LDAP=0 \
862862
-DWITH_AUTHENTICATION_OCI=0 \
863+
-DWITH_COMPONENT_KEYRING_HASHICORP=0 \
863864
-DWITH_COMPONENT_KEYRING_OCI=0 \
864865
-DWITH_CURL=0 \
865866
-DWITH_KEYRING_HASHICORP=0 \
@@ -907,6 +908,7 @@ mkdir release
907908
-DWITH_AUTHENTICATION_OPENID_CONNECT=0 \
908909
-DWITH_AUTHENTICATION_LDAP=0 \
909910
-DWITH_AUTHENTICATION_OCI=0 \
911+
-DWITH_COMPONENT_KEYRING_HASHICORP=0 \
910912
-DWITH_COMPONENT_KEYRING_OCI=0 \
911913
-DWITH_CURL=0 \
912914
-DWITH_KEYRING_HASHICORP=0 \
@@ -961,6 +963,7 @@ mkdir release
961963
-DWITH_AUTHENTICATION_OPENID_CONNECT=0 \
962964
-DWITH_AUTHENTICATION_LDAP=0 \
963965
-DWITH_AUTHENTICATION_OCI=0 \
966+
-DWITH_COMPONENT_KEYRING_HASHICORP=0 \
964967
-DWITH_COMPONENT_KEYRING_OCI=0 \
965968
-DWITH_CURL=0 \
966969
-DWITH_KEYRING_HASHICORP=0 \
@@ -1292,6 +1295,7 @@ fi
12921295
%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_openid_connect.so
12931296
%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_ldap_sasl.so
12941297
%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_ldap_simple.so
1298+
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_hashicorp.so
12951299
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_oci.so
12961300
%attr(755, root, root) %{_libdir}/mysql/plugin/keyring_hashicorp.so
12971301
%endif # ssl_default
@@ -1390,6 +1394,7 @@ fi
13901394
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_openid_connect.so
13911395
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_ldap_sasl.so
13921396
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_ldap_simple.so
1397+
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_hashicorp.so
13931398
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_oci.so
13941399
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/keyring_hashicorp.so
13951400
%endif # ssl_default
@@ -1987,6 +1992,9 @@ fi
19871992
* Fri Jan 10 2025 Anibal Pinto <[email protected]> - 9.3.0-1
19881993
- Added component_group_replication_elect_prefers_most_updated
19891994

1995+
* Thu Jan 09 2025 Krzysztof Horszczaruk <[email protected]> - 9.0.3-1
1996+
- Add component_keyring_hashicorp.so component
1997+
19901998
* Fri Nov 29 2024 Jaideep Karande <[email protected]> - 9.2.0-1
19911999
- Added component_group_replication_resource_manager
19922000

packaging/rpm-sles/mysql.spec.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ fi
941941
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_aws.so
942942
%endif # add_component_keyring_aws
943943
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_encrypted_file.so
944+
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_hashicorp.so
944945
%attr(755, root, root) %{_libdir}/mysql/plugin/component_keyring_oci.so
945946
%attr(755, root, root) %{_libdir}/mysql/plugin/telemetry_client.so
946947
%attr(755, root, root) %{_libdir}/mysql/plugin/data_masking.so
@@ -1034,6 +1035,7 @@ fi
10341035
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_aws.so
10351036
%endif # add_component_keyring_aws
10361037
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_encrypted_file.so
1038+
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_hashicorp.so
10371039
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_keyring_oci.so
10381040
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_enterprise_encryption.so
10391041
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/component_masking.so

share/messages_to_error_log.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13044,6 +13044,18 @@ ER_GRP_PRIMARY_ELECTION_METHOD_MEMBER_WEIGHT
1304413044
ER_GRP_PRIMARY_ELECTION_FATAL_PROCESS
1304513045
eng "Fatal error during the primary election process of Group Replication. The server will leave the group."
1304613046

13047+
ER_KEYRING_COMPONENT_KEYRING_HASHICORP_DATA_EXTRACT_FAILED
13048+
eng "Hashicorp Vault DATA extract failed."
13049+
13050+
ER_KEYRING_COMPONENT_KEYRING_HASHICORP_KEY_MALFORMED
13051+
eng "Hashicorp Vault KEY malformed."
13052+
13053+
ER_KEYRING_COMPONENT_KEYRING_HASHICORP_AUTH_FAIL
13054+
eng "Hashicorp Vault server authentication failed."
13055+
13056+
ER_KEYRING_COMPONENT_KEYRING_HASHICORP_CURL_SETOPT_FAILED
13057+
eng "Hashicorp Vault server curl_easy_setopt failed."
13058+
1304713059
################################################################################
1304813060
# Error numbers 50000 to 51999 are reserved. Please do not use them for
1304913061
# other error messages.

0 commit comments

Comments
 (0)