Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
mod_authn_socache.c File Reference
#include "apr_strings.h"
#include "apr_md5.h"
#include "ap_config.h"
#include "ap_provider.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "mod_auth.h"
#include "ap_socache.h"
#include "util_mutex.h"
#include "apr_optional.h"

Go to the source code of this file.

Classes

struct  authn_cache_dircfg
 

Macros

#define MAX_VAL_LEN   256
 

Typedefs

typedef struct authn_cache_dircfg authn_cache_dircfg
 

Functions

static apr_status_t remove_lock (void *data)
 
static apr_status_t destroy_cache (void *data)
 
static int authn_cache_precfg (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptmp)
 
static int authn_cache_post_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptmp, server_rec *s)
 
static void authn_cache_child_init (apr_pool_t *p, server_rec *s)
 
static const charauthn_cache_socache (cmd_parms *cmd, void *CFG, const char *arg)
 
static const charauthn_cache_enable (cmd_parms *cmd, void *CFG)
 
static void * authn_cache_dircfg_create (apr_pool_t *pool, char *s)
 
static void * authn_cache_dircfg_merge (apr_pool_t *pool, void *BASE, void *ADD)
 
static const charauthn_cache_setprovider (cmd_parms *cmd, void *CFG, const char *arg)
 
static const charauthn_cache_timeout (cmd_parms *cmd, void *CFG, const char *arg)
 
static const charconstruct_key (request_rec *r, const char *context, const char *user, const char *realm)
 
static void ap_authn_cache_store (request_rec *r, const char *module, const char *user, const char *realm, const char *data)
 
static authn_status check_password (request_rec *r, const char *user, const char *password)
 
static authn_status get_realm_hash (request_rec *r, const char *user, const char *realm, char **rethash)
 
static void register_hooks (apr_pool_t *p)
 

Variables

static apr_global_mutex_tauthn_cache_mutex = NULL
 
static ap_socache_provider_tsocache_provider = NULL
 
static ap_socache_instance_tsocache_instance = NULL
 
static const char *const authn_cache_id = "authn-socache"
 
static int configured
 
static const char *const directory = "directory"
 
static const command_rec authn_cache_cmds []
 
static const authn_provider authn_cache_provider
 
static int *const aplog_module_index = &( authn_socache_module.module_index)
 

Macro Definition Documentation

◆ MAX_VAL_LEN

#define MAX_VAL_LEN   256

Definition at line 353 of file mod_authn_socache.c.

Typedef Documentation

◆ authn_cache_dircfg

Function Documentation

◆ ap_authn_cache_store()

static void ap_authn_cache_store ( request_rec r,
const char module,
const char user,
const char realm,
const char data 
)
static

Definition at line 293 of file mod_authn_socache.c.

◆ authn_cache_child_init()

static void authn_cache_child_init ( apr_pool_t p,
server_rec s 
)
static

Definition at line 138 of file mod_authn_socache.c.

◆ authn_cache_dircfg_create()

static void * authn_cache_dircfg_create ( apr_pool_t pool,
char s 
)
static

Definition at line 199 of file mod_authn_socache.c.

◆ authn_cache_dircfg_merge()

static void * authn_cache_dircfg_merge ( apr_pool_t pool,
void *  BASE,
void *  ADD 
)
static

Definition at line 209 of file mod_authn_socache.c.

◆ authn_cache_enable()

static const char * authn_cache_enable ( cmd_parms cmd,
void *  CFG 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 191 of file mod_authn_socache.c.

◆ authn_cache_post_config()

static int authn_cache_post_config ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptmp,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 86 of file mod_authn_socache.c.

◆ authn_cache_precfg()

static int authn_cache_precfg ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptmp 
)
static

< Module has handled this stage.

Definition at line 70 of file mod_authn_socache.c.

◆ authn_cache_setprovider()

static const char * authn_cache_setprovider ( cmd_parms cmd,
void *  CFG,
const char arg 
)
static

Definition at line 227 of file mod_authn_socache.c.

◆ authn_cache_socache()

static const char * authn_cache_socache ( cmd_parms cmd,
void *  CFG,
const char arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 153 of file mod_authn_socache.c.

◆ authn_cache_timeout()

static const char * authn_cache_timeout ( cmd_parms cmd,
void *  CFG,
const char arg 
)
static

Definition at line 239 of file mod_authn_socache.c.

◆ check_password()

static authn_status check_password ( request_rec r,
const char user,
const char password 
)
static

Definition at line 354 of file mod_authn_socache.c.

◆ construct_key()

static const char * construct_key ( request_rec r,
const char context,
const char user,
const char realm 
)
static

Definition at line 266 of file mod_authn_socache.c.

◆ destroy_cache()

static apr_status_t destroy_cache ( void *  data)
static

Definition at line 61 of file mod_authn_socache.c.

◆ get_realm_hash()

static authn_status get_realm_hash ( request_rec r,
const char user,
const char realm,
char **  rethash 
)
static

Definition at line 409 of file mod_authn_socache.c.

◆ register_hooks()

static void register_hooks ( apr_pool_t p)
static

< Run access control hooks only on internal requests with configurations distinct from that of initial request

Definition at line 455 of file mod_authn_socache.c.

◆ remove_lock()

static apr_status_t remove_lock ( void *  data)
static

Definition at line 52 of file mod_authn_socache.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( authn_socache_module.module_index)
static

Definition at line 466 of file mod_authn_socache.c.

◆ authn_cache_cmds

const command_rec authn_cache_cmds[]
static
Initial value:
=
{
{ "AuthnCacheSOCache" , authn_cache_socache , NULL , 128 , TAKE1, "socache provider for authn cache" },
{ "AuthnCacheEnable" , authn_cache_enable , NULL , 128 , RAW_ARGS, "enable socache configuration in htaccess even if not enabled anywhere else" },
{ "AuthnCacheProvideFor" , authn_cache_setprovider , NULL , 8 , ITERATE, "Determine what authn providers to cache for" },
{ "AuthnCacheTimeout" , authn_cache_timeout , NULL , 8 , TAKE1, "Timeout (secs) for cached credentials" },
{ "AuthnCacheContext" , ap_set_string_slot , (void*)((long) (((char *) (&((( authn_cache_dircfg * )NULL)-> context ))) - ((char *) NULL))) , 64 , TAKE1, "Context for authn cache" },
{NULL}
}
const char * ap_set_string_slot(cmd_parms *cmd, void *struct_ptr, const char *arg)
Definition config.c:1469
@ RAW_ARGS
Definition http_config.h:50
@ TAKE1
Definition http_config.h:51
@ ITERATE
Definition http_config.h:53
apr_md5_ctx_t * context
Definition util_md5.h:58
static const char * authn_cache_timeout(cmd_parms *cmd, void *CFG, const char *arg)
static const char * authn_cache_enable(cmd_parms *cmd, void *CFG)
static const char * authn_cache_setprovider(cmd_parms *cmd, void *CFG, const char *arg)
static const char * authn_cache_socache(cmd_parms *cmd, void *CFG, const char *arg)
return NULL
Definition mod_so.c:359

Definition at line 248 of file mod_authn_socache.c.

◆ authn_cache_id

const char* const authn_cache_id = "authn-socache"
static

Definition at line 49 of file mod_authn_socache.c.

◆ authn_cache_mutex

apr_global_mutex_t* authn_cache_mutex = NULL
static

Definition at line 46 of file mod_authn_socache.c.

◆ authn_cache_provider

const authn_provider authn_cache_provider
static
Initial value:
=
{
}
static authn_status get_realm_hash(request_rec *r, const char *user, const char *realm, char **rethash)
static authn_status check_password(request_rec *r, const char *user, const char *password)

Definition at line 449 of file mod_authn_socache.c.

◆ configured

int configured
static

Definition at line 50 of file mod_authn_socache.c.

◆ directory

const char* const directory = "directory"
static

Definition at line 198 of file mod_authn_socache.c.

◆ socache_instance

ap_socache_instance_t* socache_instance = NULL
static

Definition at line 48 of file mod_authn_socache.c.

◆ socache_provider

ap_socache_provider_t* socache_provider = NULL
static

Definition at line 47 of file mod_authn_socache.c.