summaryrefslogtreecommitdiff
path: root/daemon/bd.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-08-12 00:50:29 +0000
committerStef Walter <stef@memberwebs.com>2004-08-12 00:50:29 +0000
commit86e45cfbd0655193e363be6daadbfd5434566a03 (patch)
tree5391fdcbfd6b3e360d425f0bd4b260d073901a21 /daemon/bd.h
parentc44a74e52a8b227857f28289a91d126b7edc959c (diff)
- Added postgresql database support
- Lots of changes to properly abstract bd handlers - Handle multiple passwords and ha1s properly.
Diffstat (limited to 'daemon/bd.h')
-rw-r--r--daemon/bd.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/daemon/bd.h b/daemon/bd.h
index 272e09a..a59b1e1 100644
--- a/daemon/bd.h
+++ b/daemon/bd.h
@@ -3,6 +3,8 @@
#define BD_H
#include "hash.h"
+#include "digest.h"
+#include "httpauthd.h"
/* ----------------------------------------------------------------------------------
* Callbacks
@@ -17,8 +19,8 @@
* HA_OK: completed successfully
* HA_FAILED: error retrieving hash (should have logged error)
*/
-typedef int (*bd_complete_digest)(ha_request_t* rq,
- const char* user, unsigned char* ha1);
+typedef int (*bd_validate_digest)(ha_request_t* rq,
+ const char* user, digest_context_t* dg);
/*
* A callback for validating a given user's password.
@@ -31,6 +33,12 @@ typedef int (*bd_complete_digest)(ha_request_t* rq,
typedef int (*bd_validate_basic)(ha_request_t* rq,
const char* user, const char* password);
+/*
+ * Escapes a value for sending to 'server'
+ */
+typedef void (*bd_escape_value)(const ha_request_t* rq, ha_buffer_t* buf,
+ const char* value);
+
/* ----------------------------------------------------------------------------------
* Base Context
*/
@@ -38,12 +46,13 @@ typedef struct bd_context
{
hsh_t* cache; /* Some cached records or basic */
- bd_complete_digest f_complete_digest;
+ bd_validate_digest f_validate_digest;
bd_validate_basic f_validate_basic;
+ bd_escape_value f_escape_value;
}
bd_context_t;
-#define BD_CALLBACKS(a, b) { NULL, (a), (b) }
+#define BD_CALLBACKS(a, b, c) { NULL, (a), (b), (c) }
#define BD_DEFAULTS { NULL, NULL, NULL }
/* ----------------------------------------------------------------------------------
@@ -68,4 +77,10 @@ void bd_destroy(ha_context_t* context);
*/
int bd_process(ha_request_t* rq);
+/* ----------------------------------------------------------------------------------
+ * Other helper functionts
+ */
+
+const char* bd_substitute(const ha_request_t* rq, const char* user, const char* str);
+
#endif /* BD_H */