From 8da942bbd9c7f75d865137822552e9c2f7640325 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sun, 3 Mar 2013 01:06:00 +0100 Subject: sqlite: Implemented needed functions to enable authentication plug-ins This adds the needed functions the eurephia framework requires to retrieve a list of all configured plug-ins - eDBget_plugins(). And it includes eDBauth_GetAuthMethod() which is used to lookup what kind of authentication method a specific user account/certificate combination should use. If the authentication backend requires a different username for this, that can also be configured in this user account/certification setup. Signed-off-by: David Sommerseth --- database/sqlite/sql-schema.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'database/sqlite/sql-schema.sql') diff --git a/database/sqlite/sql-schema.sql b/database/sqlite/sql-schema.sql index 6d2befb..2e21605 100644 --- a/database/sqlite/sql-schema.sql +++ b/database/sqlite/sql-schema.sql @@ -1,7 +1,7 @@ -- -- eurephia database schema for SQLite3 -- --- GPLv2 only - Copyright (C) 2008 - 2012 +-- GPLv2 only - Copyright (C) 2008 - 2013 -- David Sommerseth -- -- This program is free software; you can redistribute it and/or @@ -19,6 +19,16 @@ -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- +-- eurephia_plugins - Defines loadable eurephia plug-ins +-- This table is parsed upon start-up of OpenVPN/eurephia +CREATE TABLE eurephia_plugins ( + plgname varchar(32) NOT NULL, -- short name of the plug-in module + plgtype varchar(16) NOT NULL, -- plug-in type (auth, firewall, etc) + plgdsofile text NOT NULL, -- full path to the plug-in DSO file + plgenabled boolean NOT NULL, -- Enable/disable the plug-in + plgid integer PRIMARY KEY AUTOINCREMENT +); +CREATE INDEX eurephia_plugins_name_type ON eurephia_plugins (plgname, plgtype); -- openvpn_certificates - contains mainly X.509 information from SSL certificates CREATE TABLE openvpn_certificates ( @@ -49,6 +59,8 @@ CREATE TABLE openvpn_usercerts ( uid integer NOT NULL, -- Must be found in openvpn_users certid integer NOT NULL, -- Must be found in openvpn_certificates accessprofile integer , -- If not null, it must be found in openvpn_accesses + authplugin integer , -- optional, must match eurephia_plugins.plgid if used + authusername text , -- optional, alternative username through plug-ins registered timestamp DEFAULT CURRENT_TIMESTAMP, uicid integer PRIMARY KEY AUTOINCREMENT -- Unique ID ); -- cgit From e121092323ad2b3e0966da4f12b1636458715efb Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 4 Mar 2013 11:57:32 +0100 Subject: sqlite: Modified eDBget_plugins() to support the new interface for plug-in init This is needed to provide config data to a configured plug-in when it is loaded and initialised. Signed-off-by: David Sommerseth --- database/sqlite/sql-schema.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'database/sqlite/sql-schema.sql') diff --git a/database/sqlite/sql-schema.sql b/database/sqlite/sql-schema.sql index 2e21605..899c95b 100644 --- a/database/sqlite/sql-schema.sql +++ b/database/sqlite/sql-schema.sql @@ -25,6 +25,7 @@ CREATE TABLE eurephia_plugins ( plgname varchar(32) NOT NULL, -- short name of the plug-in module plgtype varchar(16) NOT NULL, -- plug-in type (auth, firewall, etc) plgdsofile text NOT NULL, -- full path to the plug-in DSO file + plgconfig text , -- Optional config data for the plug-in plgenabled boolean NOT NULL, -- Enable/disable the plug-in plgid integer PRIMARY KEY AUTOINCREMENT ); -- cgit