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