From 86e45cfbd0655193e363be6daadbfd5434566a03 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 12 Aug 2004 00:50:29 +0000 Subject: - Added postgresql database support - Lots of changes to properly abstract bd handlers - Handle multiple passwords and ha1s properly. --- daemon/bd.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'daemon/bd.h') 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 */ -- cgit v1.2.3