summaryrefslogtreecommitdiffstats
path: root/src/auth/db-lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth/db-lua.h')
-rw-r--r--src/auth/db-lua.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/auth/db-lua.h b/src/auth/db-lua.h
new file mode 100644
index 0000000..ebb697a
--- /dev/null
+++ b/src/auth/db-lua.h
@@ -0,0 +1,33 @@
+#ifndef DB_LUA_H
+#define DB_LUA_H 1
+
+#include "dlua-script.h"
+
+#define DB_LUA_CACHE_KEY "%u"
+
+#define AUTH_LUA_PASSWORD_VERIFY "auth_password_verify"
+
+struct dlua_script;
+
+int auth_lua_script_init(struct dlua_script *script, const char **error_r);
+
+int auth_lua_call_password_verify(struct dlua_script *script,
+ struct auth_request *req, const char *password,
+ const char **error_r);
+
+enum passdb_result
+auth_lua_call_passdb_lookup(struct dlua_script *script,
+ struct auth_request *req, const char **scheme_r,
+ const char **password_r, const char **error_r);
+
+enum userdb_result
+auth_lua_call_userdb_lookup(struct dlua_script *script,
+ struct auth_request *req, const char **error_r);
+
+struct userdb_iterate_context *
+auth_lua_call_userdb_iterate_init(struct dlua_script *script, struct auth_request *req,
+ userdb_iter_callback_t *callback, void *context);
+void auth_lua_userdb_iterate_next(struct userdb_iterate_context *ctx);
+int auth_lua_userdb_iterate_deinit(struct userdb_iterate_context *ctx);
+
+#endif