MySQL 9.0.0
Source Code Documentation
classic_change_user_sender.cc File Reference
#include "classic_change_user_sender.h"
#include <optional>
#include "classic_auth.h"
#include "classic_auth_caching_sha2.h"
#include "classic_auth_cleartext.h"
#include "classic_auth_forwarder.h"
#include "classic_auth_native.h"
#include "classic_auth_sha256_password.h"
#include "classic_connect.h"
#include "classic_connection_base.h"
#include "classic_frame.h"
#include "hexify.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/stdx/expected.h"
#include "mysql/harness/tls_error.h"
#include "mysqld_error.h"
#include "tracer.h"

Functions

static std::vector< std::pair< std::string, std::string > > client_ssl_connection_attributes (const SSL *ssl)
 router specific connection attributes. More...
 
template<class T >
std::vector< T > vector_splice (std::vector< T > v, const std::vector< T > &other)
 splice two vectors together. More...
 
static stdx::expected< void, std::error_code > classic_proto_verify_connection_attributes (const std::string &attrs)
 verify connection attributes are sane. More...
 
static stdx::expected< size_t, std::error_code > classic_proto_append_attribute (std::string &attrs_buf, const std::string &key, const std::string &value)
 
static auto strip_trailing_null (std::string_view s)
 remove trailing \0 in a string_view. More...
 
static stdx::expected< std::string, std::error_code > classic_proto_decode_and_add_connection_attributes (std::string attrs, const std::vector< std::pair< std::string, std::string > > &extra_attributes)
 merge connection attributes. More...
 
static std::optional< std::string > scramble_them_all (std::string_view auth_method, std::string_view nonce, std::string_view pwd)
 
static classic_protocol::message::client::ChangeUser change_user_for_reuse (Channel &src_channel, ClientSideClassicProtocolState &src_protocol, ServerSideClassicProtocolState &dst_protocol, std::vector< std::pair< std::string, std::string > > initial_connection_attributes)
 

Function Documentation

◆ change_user_for_reuse()

static classic_protocol::message::client::ChangeUser change_user_for_reuse ( Channel src_channel,
ClientSideClassicProtocolState src_protocol,
ServerSideClassicProtocolState dst_protocol,
std::vector< std::pair< std::string, std::string > >  initial_connection_attributes 
)
static

◆ classic_proto_append_attribute()

static stdx::expected< size_t, std::error_code > classic_proto_append_attribute ( std::string &  attrs_buf,
const std::string &  key,
const std::string &  value 
)
static

◆ classic_proto_decode_and_add_connection_attributes()

static stdx::expected< std::string, std::error_code > classic_proto_decode_and_add_connection_attributes ( std::string  attrs,
const std::vector< std::pair< std::string, std::string > > &  extra_attributes 
)
static

merge connection attributes.

  • verifies the connection attributes
  • appends new attributes.
  • sets attributes back to the client-greeting-msg
Returns
bytes appended on success, std::error_code on error.

◆ classic_proto_verify_connection_attributes()

static stdx::expected< void, std::error_code > classic_proto_verify_connection_attributes ( const std::string &  attrs)
static

verify connection attributes are sane.

connection attributes are a key-value-key-value-...

  • decodes as var-string
  • each key must have a value

◆ client_ssl_connection_attributes()

static std::vector< std::pair< std::string, std::string > > client_ssl_connection_attributes ( const SSL *  ssl)
static

router specific connection attributes.

Parameters
[in]sslpointer to a SSL struct of the client connection. May be nullptr.

◆ scramble_them_all()

static std::optional< std::string > scramble_them_all ( std::string_view  auth_method,
std::string_view  nonce,
std::string_view  pwd 
)
static

◆ strip_trailing_null()

static auto strip_trailing_null ( std::string_view  s)
static

remove trailing \0 in a string_view.

returns the original string-view, if there is no trailing NUL-char.

◆ vector_splice()

template<class T >
std::vector< T > vector_splice ( std::vector< T >  v,
const std::vector< T > &  other 
)

splice two vectors together.

appends all elements of other to the vector v.