2. Server - littleredshack/socketbi GitHub Wiki
Authentication
Code: sessions.js
Provided by username and password in 'auth' message from client.
Server checks against authentication database.
If authenticated, the server calculates an encrypted session key and returns that to the client in an 'auth' message.
Client side library receives the key and stores it in the browser session storage. Subsequent messages to the server include the session key.
Authorisation
TODO: Users, Roles and Permissions (Read/Write)
TODO: Controlled per datasource
Datasource Connections
Code: connections.js
Datasource definitions are stored in a config file/database in json format. New datasources can be added without having to restart the server. Server will need to provide a plugin architecture for people to be able to code and add in new datasource types.
The server can establish connections to multiple datasources. A datasource is of a particular datasource type e.g. MySQL, Flat File, MongoDB, etc.
A client can request a list of datasources. The list of datasource names and optional descriptions of each datasource is returned by the server. Details (host, port, etc) of the connection are never returned via the API.
Server can use connection pooling if supported by the nodejs connector e.g MySQL.