MXS-862: Add create/destroy and remove plugin_name entry points

The create and destroy entry points allow authenticators to store data in
the DCB. This data is not shared by other DCBs related to the same
session.

The plugin_name entry point wasn't really useful as the plugins would
still need to send a AuthSwitchRequest packet if they wanted to change the
authentication mechanism.
This commit is contained in:
Markus Makela
2016-10-04 12:06:52 +03:00
parent 829d5a7453
commit dfeb5c46c9
15 changed files with 155 additions and 89 deletions

View File

@ -848,8 +848,12 @@ mxs_auth_state_t gw_send_backend_auth(DCB *dcb)
uint32_t capabilities = create_capabilities(conn, (local_session.db && strlen(local_session.db)), false);
gw_mysql_set_byte4(client_capabilities, capabilities);
const char* auth_plugin_name = dcb->authfunc.plugin_name ?
dcb->authfunc.plugin_name : DEFAULT_MYSQL_AUTH_PLUGIN;
/**
* Use the default authentication plugin name. If the server is using a
* different authentication mechanism, it will send an AuthSwitchRequest
* packet.
*/
const char* auth_plugin_name = DEFAULT_MYSQL_AUTH_PLUGIN;
long bytes = response_length(conn, local_session.user, local_session.client_sha1,
local_session.db, auth_plugin_name);
@ -909,7 +913,7 @@ mxs_auth_state_t gw_send_backend_auth(DCB *dcb)
}
// if the db is not NULL append it
if (local_session.db && strlen(local_session.db))
if (local_session.db[0])
{
memcpy(payload, local_session.db, strlen(local_session.db));
payload += strlen(local_session.db);