MXS-862: Move backend authentication from MySQLBackend to MySQLBackendAuth

The authentication for backend connections is now done in the
MySQLBackendAuth module. This is also the default authentication module
for backend connections created by MySQLBackend.
This commit is contained in:
Markus Makela
2016-09-28 10:20:39 +03:00
parent 35d9b35609
commit 6d057f8152
9 changed files with 671 additions and 416 deletions

View File

@ -562,12 +562,6 @@ int gw_read_client_event(DCB* dcb)
static int
gw_read_do_authentication(DCB *dcb, GWBUF *read_buffer, int nbytes_read)
{
MySQLProtocol *protocol;
int auth_val;
protocol = (MySQLProtocol *)dcb->protocol;
/* int compress = -1; */
/**
* The first step in the authentication process is to extract the
* relevant information from the buffer supplied and place it
@ -577,18 +571,15 @@ gw_read_do_authentication(DCB *dcb, GWBUF *read_buffer, int nbytes_read)
* data extraction succeeds, then a call is made to the actual
* authenticate function to carry out the user checks.
*/
if (MXS_AUTH_SUCCEEDED == (
auth_val = dcb->authfunc.extract(dcb, read_buffer)))
int auth_val = dcb->authfunc.extract(dcb, read_buffer);
if (MXS_AUTH_SUCCEEDED == auth_val)
{
/*
* Maybe this comment will be useful some day:
compress =
GW_MYSQL_CAPABILITIES_COMPRESS & gw_mysql_get_byte4(
&protocol->client_capabilities);
*/
auth_val = dcb->authfunc.authenticate(dcb);
}
MySQLProtocol *protocol = (MySQLProtocol *)dcb->protocol;
/**
* At this point, if the auth_val return code indicates success
* the user authentication has been successfully completed.