MySQL 26.10.0
Source Code Documentation
mrs_component_runtime_services.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2026, 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 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 MRS_COMPONENT_RUNTIME_SERVICES_H
27#define MRS_COMPONENT_RUNTIME_SERVICES_H
28
29#include <cstdint>
30#include <memory>
31#include <optional>
32#include <string>
33
35
36namespace mrs_component {
37
38/**
39 Adapts embedded MRS runtime operations to Server component services.
40*/
42 public:
43 ComponentEmbeddedRuntimeServices(std::string local_address,
44 std::string metadata_user,
45 std::string data_user,
46 std::string jwt_secret);
48
49 std::unique_ptr<collector::MysqlCacheManager> create_mysql_cache_manager(
50 const mrs::Configuration &configuration) override;
51
52 std::optional<std::string> authenticate_mysql_user(
53 const std::string &user,
55
56 std::shared_ptr<collector::MysqlFixedPoolManager>
57 create_mysql_user_session_pool(uint32_t passthrough_pool_size,
58 const std::string &auth_id) override;
59
60 const std::string &jwt_secret() const override { return jwt_secret_; }
61
62 private:
63 std::string local_address_;
64 std::string metadata_auth_id_;
65 std::string data_auth_id_;
66 std::string jwt_secret_;
67};
68
69} // namespace mrs_component
70
71#endif // MRS_COMPONENT_RUNTIME_SERVICES_H
Definition: configuration.h:49
Component-mode overrides for selected MRS runtime services.
Definition: embedded_runtime_services.h:53
Adapts embedded MRS runtime operations to Server component services.
Definition: mrs_component_runtime_services.h:41
const std::string & jwt_secret() const override
Definition: mrs_component_runtime_services.h:60
ComponentEmbeddedRuntimeServices(std::string local_address, std::string metadata_user, std::string data_user, std::string jwt_secret)
Definition: mrs_component_runtime_services.cc:42
std::optional< std::string > authenticate_mysql_user(const std::string &user, const mysql_harness::SecureString &password) override
Validate HTTP-supplied MySQL credentials through the server authentication path and return the authen...
Definition: mrs_component_runtime_services.cc:64
std::string metadata_auth_id_
Definition: mrs_component_runtime_services.h:64
std::string local_address_
Definition: mrs_component_runtime_services.h:63
std::string jwt_secret_
Definition: mrs_component_runtime_services.h:66
std::string data_auth_id_
Definition: mrs_component_runtime_services.h:65
std::shared_ptr< collector::MysqlFixedPoolManager > create_mysql_user_session_pool(uint32_t passthrough_pool_size, const std::string &auth_id) override
Definition: mrs_component_runtime_services.cc:121
std::unique_ptr< collector::MysqlCacheManager > create_mysql_cache_manager(const mrs::Configuration &configuration) override
Definition: mrs_component_runtime_services.cc:57
~ComponentEmbeddedRuntimeServices() override
Definition: mrs_component_runtime_services.cc:50
Null-terminated string which is securely wiped on destruction.
Definition: secure_string.h:59
static char * password
Definition: mysql_secure_installation.cc:58
char * user
Definition: mysqladmin.cc:67
Definition: mrs_component.cc:137
required string configuration
Definition: replication_asynchronous_connection_failover.proto:49