48 Commits

Author SHA1 Message Date
Massimiliano Pinto
aa006a9406 gw_mysql_do_authentication puts user, db, and client_sha1 in the (MYSQL_session *) session->data of client DCB.
gw_mysql_connect can now access this session->data for transparent authentication
2013-06-14 18:27:43 +02:00
Massimiliano Pinto
936ccfeda3 Merged 2013-06-14 18:13:23 +02:00
Massimiliano Pinto
1239420be1 create_backend_connection added.
This routine calls the gw_mysql_connect passing the MySQL_session data available
2013-06-14 18:05:29 +02:00
Mark Riddoch
34372fbc5d Addition of connect function to dcb functions and added dcb_connect routine 2013-06-14 17:55:31 +02:00
Massimiliano Pinto
ebbe4bf035 Fixed a space at the beginning of comment 2013-06-14 17:50:13 +02:00
Massimiliano Pinto
e8d6289ca2 Added void *data for generic session data
Added MySQL_session for specifc mysql data in session: user, sha1_cleient_passowrd, database_name
2013-06-14 17:46:44 +02:00
Massimiliano Pinto
6071f89b4f Commit, again bzr merge 2013-06-14 17:36:31 +02:00
Massimiliano Pinto
438ba42f0a Commit these files, fixing bzr merge message 2013-06-14 17:35:14 +02:00
Mark Riddoch
cf6b18a4fe A slight rejig of the server/service setup for the backend databases. Also including the protocol
module names.
2013-06-14 17:05:00 +02:00
Mark Riddoch
2260bf7587 Addition of Read Connection Balancer for Query Routing 2013-06-14 16:26:22 +02:00
Massimiliano Pinto
6690320542 Commiting these files 2013-06-14 14:27:43 +02:00
Mark Riddoch
3b86c93adf Addition of global Makefile
First example external module, testroute, has been added. This serves more as an example than a real router
Updated module loading to used fixed GetModuleObject route and addition of ModuleInit routine
2013-06-14 11:51:54 +02:00
Massimiliano Pinto
748230a7bb Merge commit 2013-06-13 18:44:29 +02:00
Massimiliano Pinto
a5e1441cb8 Some fprintf removed.
Fixed an if statement without brackets
2013-06-13 18:38:03 +02:00
Mark Riddoch
61cf0c6187 Addition of interface for loading external modules as shared library objects 2013-06-13 18:30:15 +02:00
Massimiliano Pinto
269bef8280 Authentication FAILED triggers client and backend connection close.
mysqlslap tests show some memory is nod deallocated, probably some gwbuffer incorrect use or the error handling is not triggering any consume action on buffers.
2013-06-13 18:09:14 +02:00
Massimiliano Pinto
a89c2bc1c0 Added gw_mysql_do_authentication() for checking authentication.
I uses the mysql protocol 4.1 authentication method.

The actual implementation requires the password is excatly equal to the username.

The client sends user: "user" and the password must be "user"

The gateway converts "user" in SHA1(SHA1("user") and then using the algorithm check all the data.

if the clients sends anything else than "user" the password algorithm check will fail.

IN the next release we must load into memory the content of mysql.user table, with fields user and password in memory.

The gateway will then find the HEX(SHA1(SHA1(real_password))) fro tahta table and check the incoming data.

Please note that real_password is not stored in any place: not in mysql db nor in the gateway.
2013-06-13 14:34:37 +02:00
Massimiliano Pinto
732ff1732f Added username detection ofr authentication 2013-06-13 10:32:42 +02:00
Massimiliano Pinto
bf36f01c33 Initial work on client flags(comprtess, client connect with db), next is authentication check 2013-06-13 10:13:43 +02:00
Massimiliano Pinto
e31957f2d1 Initial work on local authentication 2013-06-13 10:12:50 +02:00
Massimiliano Pinto
84ec7ffd51 Some fprintf has been removed 2013-06-13 00:31:35 +02:00
Massimiliano Pinto
368ce2d8b7 New funcion for reading and store data in gwbuff, and its use in reading from client 2013-06-12 23:58:41 +02:00
Massimiliano Pinto
2a9e0b06ef New version 2013-06-12 22:23:09 +02:00
Mark Riddoch
a9bcc3841a Converted mysql_send_ok and MySQLSendHandshake to use the new buffer management
Also added the -p option to set listener port. This is a short term measure for testing only
until we have the proper configuration in place.
2013-06-12 17:13:04 +01:00
Massimiliano Pinto
82b70e3877 New version, state2string updated 2013-06-12 17:18:22 +02:00
Massimiliano Pinto
2cf646d948 in utils.c see line 88 for modifications 2013-06-12 15:15:09 +02:00
Mark Riddoch
08549ad5ae Addition of some basic statistics on the DCB 2013-06-12 13:08:33 +01:00
Mark Riddoch
c7f533abaf Split the backend read function as an example, this still needs to be reorganised into protocols
Addition of DCB diagnostics, and free routine
2013-06-12 12:57:09 +01:00
Mark Riddoch
329a70eccd Addition of example buffer handling 2013-06-12 10:01:02 +01:00
Massimiliano Pinto
a70974d8a1 EPOLLER | EPOLLHUP moved at the begininning of the loop 2013-06-12 09:54:27 +02:00
Mark Riddoch
037055d33e Added clean rule 2013-06-12 08:07:50 +01:00
Massimiliano Pinto
d46e256b9a added int parameter to close function 2013-06-11 17:08:30 +02:00
Mark Riddoch
2a82ba152f Updated GWPROTOCOL structure with new entry points and some documentation 2013-06-11 16:04:49 +01:00
Mark Riddoch
e820e36aa3 Updated structure and added makefile 2013-06-11 14:58:21 +01:00
Massimiliano Pinto
bbe339ac78 Test 2013-06-11 15:57:10 +02:00
Timofey Turenko
b768069a1d repotest 2013-06-11 16:52:39 +03:00
Massimiliano Pinto
0352705b67 New files and new versions 2013-06-11 13:02:26 +02:00
Massimiliano Pinto
0c8fdaed01 New versions 2013-06-11 12:28:37 +02:00
Massimiliano Pinto
b6411bf40a New version, with client socket closed detection 2013-06-10 19:48:17 +02:00
Massimiliano Pinto
ac08cb4368 New version for gw_mysql_close() 2013-06-10 15:11:03 +02:00
Massimiliano Pinto
3413f29e5a New version with DCB_STATE_DISCONNECTED state 2013-06-10 13:46:59 +02:00
Massimiliano Pinto
0c2d273a83 New version and new file 2013-06-10 11:02:13 +02:00
Massimiliano Pinto
dc4cf3ab17 New files 2013-06-10 10:22:53 +02:00
Massimiliano Pinto
2f7d3a1335 New version 2013-06-10 09:29:23 +02:00
Massimiliano Pinto
912e73f8ee Gateway utils 2013-06-10 09:21:02 +02:00
Massimiliano Pinto
d82a719ada New version: added ifdef GW_EVENT_DEBUG 2013-06-10 09:17:50 +02:00
Massimiliano Pinto
ddeaead2d1 New version 2013-06-10 09:03:13 +02:00
Massimiliano Pinto
ac01de7782 First commit, test bazaar 2013-06-07 19:51:05 +02:00