File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / src / http_auth.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Nov 2 10:35:00 2016 UTC (7 years, 8 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_41p8, HEAD
lighttpd 1.4.41

    1: #ifndef _HTTP_AUTH_H_
    2: #define _HTTP_AUTH_H_
    3: #include "first.h"
    4: 
    5: #include "server.h"
    6: #include "plugin.h"
    7: 
    8: #if defined(HAVE_LDAP_H) && defined(HAVE_LBER_H) && defined(HAVE_LIBLDAP) && defined(HAVE_LIBLBER)
    9: # define USE_LDAP
   10: # include <ldap.h>
   11: #endif
   12: #include <mysql/mysql.h>
   13: 
   14: typedef enum {
   15: 	AUTH_BACKEND_UNSET,
   16: 	AUTH_BACKEND_PLAIN,
   17: 	AUTH_BACKEND_LDAP,
   18: 	AUTH_BACKEND_HTPASSWD,
   19: 	AUTH_BACKEND_HTDIGEST,
   20: 	AUTH_BACKEND_MYSQL
   21: } auth_backend_t;
   22: 
   23: typedef struct {
   24: 	/* auth */
   25: 	array  *auth_require;
   26: 
   27: 	buffer *auth_plain_groupfile;
   28: 	buffer *auth_plain_userfile;
   29: 
   30: 	buffer *auth_htdigest_userfile;
   31: 	buffer *auth_htpasswd_userfile;
   32: 
   33: 	buffer *auth_backend_conf;
   34: 
   35: 	buffer *auth_ldap_hostname;
   36: 	buffer *auth_ldap_basedn;
   37: 	buffer *auth_ldap_binddn;
   38: 	buffer *auth_ldap_bindpw;
   39: 	buffer *auth_ldap_filter;
   40: 	buffer *auth_ldap_cafile;
   41: 	unsigned short auth_ldap_starttls;
   42: 	unsigned short auth_ldap_allow_empty_pw;
   43: 
   44: 	unsigned short auth_debug;
   45: 
   46: 	/* generated */
   47: 	auth_backend_t auth_backend;
   48: 
   49: #ifdef USE_LDAP
   50: 	LDAP *ldap;
   51: 
   52: 	buffer *ldap_filter_pre;
   53: 	buffer *ldap_filter_post;
   54: #endif
   55: 
   56: 	MYSQL  *mysql_conn;
   57: 	buffer *auth_mysql_host;
   58: 	buffer *auth_mysql_user;
   59: 	buffer *auth_mysql_pass;
   60: 	buffer *auth_mysql_db;
   61: 	buffer *auth_mysql_port;
   62: 	buffer *auth_mysql_socket;
   63: 	buffer *auth_mysql_users_table;
   64: 	buffer *auth_mysql_col_user;
   65: 	buffer *auth_mysql_col_pass;
   66: 	buffer *auth_mysql_col_realm;
   67: 	buffer *auth_mysql_domains_table;
   68: 	buffer *auth_mysql_col_domain;
   69: 	buffer *auth_mysql_domains_table_col_domain_id;
   70: 	buffer *auth_mysql_users_table_col_domain_id;
   71: 
   72: } mod_auth_plugin_config;
   73: 
   74: typedef struct {
   75: 	PLUGIN_DATA;
   76: 	buffer *tmp_buf;
   77: 
   78: 	buffer *auth_user;
   79: 
   80: #ifdef USE_LDAP
   81: 	buffer *ldap_filter;
   82: #endif
   83: 
   84: 	mod_auth_plugin_config **config_storage;
   85: 
   86: 	mod_auth_plugin_config conf, *anon_conf; /* this is only used as long as no handler_ctx is setup */
   87: } mod_auth_plugin_data;
   88: 
   89: int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, const char *realm_str);
   90: int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, const char *realm_str);
   91: int http_auth_digest_generate_nonce(server *srv, mod_auth_plugin_data *p, buffer *fn, char (*hh)[33]);
   92: int http_auth_match_rules(server *srv, array *req, const char *username, const char *group, const char *host);
   93: 
   94: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>