Add 'switching_auth_sent' to 'PROXYSQL INTERNAL SESSION'

Improved observability for auth switch performed during authentication.
The new field 'switching_auth_sent' is only updated when an actual auth
switch requested to the client.
v2.x_sha2pass_draft3
Javier Jaramago Fernández 2 years ago
parent 3f2a7aa693
commit ab8af07c19

@ -159,6 +159,8 @@ class MySQL_Data_Stream
int switching_auth_stage;
enum proxysql_auth_plugins switching_auth_type;
// Updated **only** when an 'auth_switch' has been sent to client
enum proxysql_auth_plugins switching_auth_sent;
int auth_in_progress; // if 0 , no authentication is in progress. Any value greater than 0 depends from the implementation
unsigned int tmp_charset;

@ -1207,6 +1207,8 @@ bool MySQL_Protocol::generate_pkt_auth_switch_request(bool send, void **ptr, uns
(*myds)->DSS=STATE_SERVER_HANDSHAKE;
(*myds)->sess->status=CONNECTING_CLIENT;
}
(*myds)->switching_auth_sent = (*myds)->switching_auth_type;
if (len) { *len=size; }
if (ptr) { *ptr=(void *)_ptr; }
#ifdef DEBUG

@ -1163,6 +1163,7 @@ void MySQL_Session::generate_proxysql_internal_session_json(json &j) {
}
}
j["client"]["DSS"] = client_myds->DSS;
j["client"]["switching_auth_sent"] = client_myds->switching_auth_sent;
j["client"]["switching_auth_type"] = client_myds->switching_auth_type;
j["client"]["prot"]["sent_auth_plugin_id"] = client_myds->myprot.sent_auth_plugin_id;
j["client"]["prot"]["auth_plugin_id"] = client_myds->myprot.auth_plugin_id;

@ -306,6 +306,7 @@ MySQL_Data_Stream::MySQL_Data_Stream() {
encrypted=false;
switching_auth_stage = 0;
switching_auth_type = AUTH_UNKNOWN_PLUGIN;
switching_auth_sent = AUTH_UNKNOWN_PLUGIN;
auth_in_progress = 0;
x509_subject_alt_name=NULL;
ssl=NULL;

Loading…
Cancel
Save