summaryrefslogtreecommitdiffstats
path: root/database/eurephiadb_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'database/eurephiadb_driver.h')
-rw-r--r--database/eurephiadb_driver.h79
1 files changed, 78 insertions, 1 deletions
diff --git a/database/eurephiadb_driver.h b/database/eurephiadb_driver.h
index c6785f3..b7154ea 100644
--- a/database/eurephiadb_driver.h
+++ b/database/eurephiadb_driver.h
@@ -1,6 +1,6 @@
/* eurephiadb_driver.h -- API provided by the database driver
*
- * GPLv2 only - Copyright (C) 2008 - 2012
+ * GPLv2 only - Copyright (C) 2008 - 2013
* David Sommerseth <dazo@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or
@@ -54,6 +54,27 @@
#define USERINFO_blacklist 0x10 /**< flag for extracting information from blacklist log */
/**
+ * Defines supported authentication methods or account restrictions
+ */
+typedef enum { eAM_UNDEF, /**< Unknown/undefined/unsupported method */
+ eAM_BLACKLISTED, /**< Account has been blacklisted, no auth allowed */
+ eAM_INACTIVE, /**< Account is not active, no auth allowed */
+ eAM_INTERNDB, /**< Use the eurephia database for password authentication */
+ eAM_PLUGIN /**< Use an auth plug-in for password authentication */
+} eDBauthMethod;
+
+/**
+ * Result structure from eDBauth_GetAuthMethod()
+ */
+typedef struct __eDBauthMethodResult {
+ eDBauthMethod method; /**< Authentication method */
+ char *username; /**< Username to use with external methods */
+ unsigned int authplugid; /**< Authentication plug-in ID for external methods */
+ int uicid; /**< User account/certificate link ID */
+} eDBauthMethodResult;
+
+
+/**
* Mandatory function. Retrieves driver version information
*
* @return Returns string (const char *) containing driver version information.
@@ -114,6 +135,21 @@ int EUREPHIA_DRIVERAPI_FUNC(eDBauth_TLS)(eurephiaCTX *ctx, const char *org, cons
const char *digest, const unsigned int depth);
/**
+ * Retrieves authentication method for a specific user name and certificate ID
+ *
+ * @version API version level 1
+ * @param ctx eurephiaCTX
+ * @param certid certificate ID to the user being authenticated
+ * @param username username to be authenticated
+ *
+ * @return Returns a pointer to a eDBauthMethodResult struct which defines how
+ * to authenticate this user. On system failure, NULL is returned.
+ */
+eDBauthMethodResult * EUREPHIA_DRIVERAPI_FUNC(eDBauth_GetAuthMethod)(eurephiaCTX *ctx,
+ const int certid,
+ const char *username);
+
+/**
* Authenticates a client against the database, with users certificate ID, username and password.
*
* @version API version level 1
@@ -318,6 +354,17 @@ int EUREPHIA_DRIVERAPI_FUNC(eDBget_accessprofile) (eurephiaCTX *ctx, const int u
*/
eurephiaVALUES * EUREPHIA_DRIVERAPI_FUNC(eDBget_blacklisted_ip)(eurephiaCTX *ctx);
+/**
+ * Retrieve a list of additional configured eurephia plug-ins of a certain plug-in type
+ *
+ * @version API version level 4
+ * @param ctx eurephiaCTX
+ * @param plgtype Plug-in category type (string value, null terminated)
+ *
+ * @return Returns an eurephiaVALUES chain with all plug-ins configured, otherwise NULL is returned
+ */
+eurephiaVALUES * EUREPHIA_DRIVERAPI_FUNC(eDBget_plugins)(eurephiaCTX *ctx, const char *plgtype);
+
/* The following functions is also declared in eurephia_session_values.c - for local internal usage. */
/**
* Retrieve a unique session key based on a session seed.
@@ -697,6 +744,36 @@ xmlDoc * EUREPHIA_DRIVERAPI_FUNC(eDBadminFirewallProfiles)(eurephiaCTX *ctx, xml
/**
+ * Query or modify the eurephia plug-ins setup.
+ *
+ * @version API version level 4
+ * @param ctx eurephiaCTX
+ * @param xmlqry XML document with the operation and information.
+ *
+ * The XML format skeleton
+ * @code
+ * <eurephia format="1">
+ * <plugins mode="{search|register|unregister|modify}"
+ * [plugin-id="{ID}"] [plugin-dso="{FILENAME}]">
+ * <fieldMapping table="plugins">
+ * <{field name}>{value}</{field name}>
+ * </fieldMapping>
+ * </plugins>
+ * </eurephia>
+ * @endcode
+ * It can be several field name tags to narrow the search even more.
+ * For the register and unregister mode, either the plugin or plugin-id field name tag
+ * must be present. For modify mode one of the plugin-id or plugin-dso attributes
+ * must be present.
+ *
+ * @return Returns a valid XML document with the result on success, otherwise either
+ * NULL or an XML error document is returned.
+ * @see eurephiaXML_CreateDoc(), eurephiaXML_getRoot()
+ */
+xmlDoc * EUREPHIA_DRIVERAPI_FUNC(eDBadminPlugins)(eurephiaCTX *ctx, xmlDoc *xmlqry);
+
+
+/**
* Retrieve the eurephia lastlog
*
* @version API version level 2