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

@ -42,12 +42,14 @@ struct servlistener;
* @verbatim
* The operations that can be performed on the descriptor
*
* create Create a data structure unique to this DCB, stored in dcb->authenticator_data
* extract Extract the data from a buffer and place in a structure
* shared at the session level, stored in dcb->data
* connectssl Determine whether the connection can support SSL
* authenticate Carry out the authentication
* free Free extracted data
* destroy Destroy the unique DCB data
* loadusers Load or update authenticator user data
* plugin_name The protocol specific name of the authentication plugin.
* @endverbatim
*
* This forms the "module object" for authenticator modules within the gateway.
@ -56,12 +58,13 @@ struct servlistener;
*/
typedef struct gw_authenticator
{
void *(*create)();
int (*extract)(struct dcb *, GWBUF *);
bool (*connectssl)(struct dcb *);
int (*authenticate)(struct dcb *);
void (*free)(struct dcb *);
void (*destroy)(void *);
int (*loadusers)(struct servlistener *);
const char* plugin_name;
} GWAUTHENTICATOR;
/** Return values for extract and authenticate entry points */