/* * HttpAuth * * Copyright (C) 2004 Stefan Walter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. */ #include "usuals.h" #include "httpauthd.h" #include "defaults.h" #include "hash.h" #include "bd.h" #include #include /* ------------------------------------------------------------------------------- * Structures */ /* Forward declarations for callbacks */ static int validate_digest(ha_request_t* rq, const char* user, digest_context_t* dg, char ***groups); static int validate_basic(ha_request_t* rq, const char* user, const char* password, char ***groups); /* The defaults for the context */ static const bd_context_t dummy_defaults = BD_CALLBACKS(validate_digest, validate_basic, NULL); /* ------------------------------------------------------------------------------- * Internal Functions */ static int validate_digest(ha_request_t* rq, const char* user, digest_context_t* dg, char ***groups) { return HA_OK; } static int validate_basic(ha_request_t* rq, const char* user, const char* password, char ***groups) { return HA_OK; } /* ------------------------------------------------------------------------------- * Handler Functions */ int dummy_config(ha_context_t* context, const char* name, const char* value) { return HA_FALSE; } int dummy_init(ha_context_t* context) { int r; if((r = bd_init(context)) != HA_OK) return r; ha_messagex(NULL, LOG_INFO, "initialized dummy handler"); return HA_OK; } /* ------------------------------------------------------------------------------- * Handler Definition */ ha_handler_t dummy_handler = { "DUMMY", /* The type */ dummy_init, /* Initialization function */ bd_destroy, /* Uninitialization routine */ dummy_config, /* Config routine */ bd_process, /* Processing routine */ &dummy_defaults, /* A default context */ sizeof(bd_context_t) /* Size of the context */ };