00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00025 #ifndef APACHE_MOD_AUTH_H
00026 #define APACHE_MOD_AUTH_H
00027
00028 #include "apr_pools.h"
00029 #include "apr_hash.h"
00030
00031 #include "httpd.h"
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #define AUTHN_PROVIDER_GROUP "authn"
00038 #define AUTHN_DEFAULT_PROVIDER "file"
00039
00040 #define AUTHZ_GROUP_NOTE "authz_group_note"
00041 #define AUTHN_PROVIDER_NAME_NOTE "authn_provider_name"
00042
00043 #define AUTHN_PREFIX "AUTHENTICATE_"
00044
00045 typedef enum {
00046 AUTH_DENIED,
00047 AUTH_GRANTED,
00048 AUTH_USER_FOUND,
00049 AUTH_USER_NOT_FOUND,
00050 AUTH_GENERAL_ERROR
00051 } authn_status;
00052
00053 typedef struct {
00054
00055
00056
00057 authn_status (*check_password)(request_rec *r, const char *user,
00058 const char *password);
00059
00060
00061
00062
00063 authn_status (*get_realm_hash)(request_rec *r, const char *user,
00064 const char *realm, char **rethash);
00065 } authn_provider;
00066
00067
00068 typedef struct authn_provider_list authn_provider_list;
00069
00070 struct authn_provider_list {
00071 const char *provider_name;
00072 const authn_provider *provider;
00073 authn_provider_list *next;
00074 };
00075
00076 typedef struct {
00077
00078 apr_hash_t * (*get_user_groups)(request_rec *r, const char *user);
00079 } authz_provider;
00080
00081 #ifdef __cplusplus
00082 }
00083 #endif
00084
00085 #endif