MXS-862: Add authenticator options and instances

Authenticators now have a similar mechanism to the `router_options`
parameter which enables configurable authentication.

The authenticators also have a new initialize entry point which is similar
to the createInstance entry point of the filters and routers. The value of
`authenticator_options` is passed as a parameter to this function. The
return vaulue of the `initialize` entry point is passed to the `create`
entry point.
This commit is contained in:
Markus Makela
2016-10-11 22:44:43 +03:00
parent a2a8562c39
commit 9d8c5cd410
27 changed files with 236 additions and 62 deletions

View File

@ -52,7 +52,7 @@ typedef struct mysql_backend_auth
* @brief Allocate a new mysql_backend_auth object
* @return Allocated object or NULL if memory allocation failed
*/
void* auth_backend_create()
void* auth_backend_create(void *instance)
{
mysql_backend_auth_t* mba = MXS_MALLOC(sizeof(*mba));
@ -148,14 +148,6 @@ static bool auth_backend_ssl(DCB *dcb)
return dcb->server->server_ssl != NULL;
}
/**
* @brief Dummy function for the loadusers entry point
*/
static int auth_backend_load_users(SERV_LISTENER *port)
{
return MXS_AUTH_LOADUSERS_OK;
}
/* @see function load_module in load_utils.c for explanation of the following
* lint directives.
*/
@ -176,6 +168,7 @@ static char *version_str = "V1.0.0";
*/
static GWAUTHENTICATOR MyObject =
{
NULL, /* No initialize entry point */
auth_backend_create, /* Create authenticator */
auth_backend_extract, /* Extract data into structure */
auth_backend_ssl, /* Check if client supports SSL */