MXS-862: Add SQLite based authentication checks

The authentication checks make sure that a user has all the required
grants to access the database. This prevents the creation of unnecessary
backend connections reducing the overall load on the database.

Doing preliminary authentication in MaxScale enables the creation of more
informative error messages.
This commit is contained in:
Markus Makela
2016-10-21 22:59:01 +03:00
parent 4c286b85e6
commit 7e822aed4d
5 changed files with 257 additions and 46 deletions

View File

@ -15,31 +15,6 @@
#include <maxscale/alloc.h>
#include <maxscale/log_manager.h>
void* gssapi_auth_alloc(void *instance)
{
gssapi_auth_t* rval = MXS_MALLOC(sizeof(gssapi_auth_t));
if (rval)
{
rval->state = GSSAPI_AUTH_INIT;
rval->principal_name = NULL;
rval->principal_name_len = 0;
rval->sequence = 0;
}
return rval;
}
void gssapi_auth_free(void *data)
{
if (data)
{
gssapi_auth_t *auth = (gssapi_auth_t*)data;
MXS_FREE(auth->principal_name);
MXS_FREE(auth);
}
}
/**
* @brief Report GSSAPI errors
*