12 Commits

Author SHA1 Message Date
Markus Makela
891ce2d0e7 MXS-862: Move client information extraction to client protocol
The client protocol module now extracts the information that is relevant
for all modules. Currently this information consists of the client
capabilities, character set, username and default database.
2016-10-18 14:23:43 +03:00
Markus Makela
c0ad2936a4 MXS-862: Implement loadusers entry point
The GSSAPI client side authenticator now loads a list of users that are,
for the time being, logged at info level. The next step is to store this
information in the listener's user hashtable.
2016-10-18 14:23:43 +03:00
Markus Makela
571919264f MXS-862: Make packet sequence handling automatic
Made the packet sequence number handling automatic so that it always uses
the correct one.

All functions now have documentation in them. Cleaned up code and added
comments to GSSAPI code.
2016-10-14 18:25:38 +03:00
Johan Wikman
3a18b64bdd mysql_client_server_protocol.h moved.
Moved to include/maxscale/protocol/mysql.h
2016-10-13 22:59:39 +03:00
Markus Makela
840575d1dc MXS-862: Add FindGSSAPI.cmake and missing includes
Added FindGSSAPI.cmake which allows the modules to be built only if the
libraries are found.

The log manager header was not included by the GSSAPI modules.
2016-10-13 16:30:56 +03:00
Johan Wikman
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00
Markus Makela
4a4c65577c MXS-862: Add initialize entry point to GSSAPIAuth
The GSSAPIAuth module now creates an instance and stores the configured
service principal name there.
2016-10-13 15:58:21 +03:00
Markus Makela
9d8c5cd410 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.
2016-10-13 15:58:18 +03:00
Markus Makela
a2a8562c39 MXS-862: Implement GSSAPI backend authentication
The GSSAPI backend authentication is based on tokens.  The server first
sends the service principal name which is used for token generation. The
client then retrieves a token from the GSSAPI server which it sends to the
backend server. If the server can verify the authenticity of the token,
authentication is successful.

This module can be used with both GSSAPIAuth and MySQLAuth modules.
2016-10-13 15:51:54 +03:00
Markus Makela
5d96faedd8 MXS-862: Move sending of OK packet to mysql_client
Moving the sending of the final OK packet of the authentication process to
the client protocol plugin makes the authentication plugins simpler.

By reading the client's sequence and incrementing that by one, the client
protocol module will always send the correct sequence byte in the final OK
packet.
2016-10-13 15:51:53 +03:00
Markus Makela
cb7c112764 MXS-862: Create common MySQL library
The MySQLCommon library contains functions used by both the protocol and
authenticator modules. The contents of the modutil.c file could also be
moved to this file if the functions in that file are only used by modules
and not the core.
2016-10-13 15:51:52 +03:00
Markus Makela
d87f15b7f6 MXS-862: Add client side GSSAPI authenticator
Initial implementation of the client side GSSAPI authenticator. The
current version successfully authenticates clients using the same style as
the MariaDB GSSAPI plugin does. Currently, it is not possible to acutally
use the plugin as the backend server would require the matchig GSSAPI
plugin.

Also added skeleton code for the backend GSSAPI authenticator. It only
implements the required entry points and sends the client auth packet to
the backend.
2016-10-13 15:51:51 +03:00