Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

Ticket Cache


Files

file  ticketcache.c
file  ticketcache.h

Data Structures

struct  TicketEntry

Defines

#define DEFAULT_CASLocalCacheFile   NULL
#define DEFAULT_CASLocalCacheSize   1000
#define DEFAULT_CASLocalCacheTimeout   3600
#define DEFAULT_CASLocalCacheInsecure   0

Functions

void write_lock (int fd)
void read_lock (int fd)
void un_lock (int fd)
const char * cas_read_CASLocalCacheFile (cmd_parms *cmd, void *dummy, const char *word)
const char * cas_read_CASLocalCacheSize (cmd_parms *cmd, void *dummy, const char *word)
const char * cas_read_CASLocalCacheTimeout (cmd_parms *cmd, void *dummy, const char *word)
const char * cas_read_CASLocalCacheInsecure (cmd_parms *cmd, void *dummy, int bool)
int cas_is_cache_initialized ()
void cas_cache_init (server_rec *s)
void cas_cache_put (TicketEntry te)
int cas_cache_get (char *ticket, char *buf, int buflen, char insecure)
void cas_cache_cleanup ()

Variables

char * ticket_cache = NULL
size_t ticket_cache_size = 0
int ticket_cache_fd

Detailed Description

The CAS Ticket Cache works with mod_cas to store local session state that allows us to recover information about prior authentications so that we don't need to redirect the user back to CAS for every HTTP request to the server.

The CAS Ticket Cache is expected to be mmap()'d to a file. It is treated as an array of TicketEntry, preceded by a single int representing the index into the array where the next write is to occur. The array is treated as a circular buffer; new tickets are written either to an unused entry or to the oldest existing entry.


Define Documentation

#define DEFAULT_CASLocalCacheFile   NULL
 

Default cache file (no cache is used when the CASLocalCacheFile directive is not used)

#define DEFAULT_CASLocalCacheInsecure   0
 

By default, Insecure cookies are not permitted

#define DEFAULT_CASLocalCacheSize   1000
 

Default cache size (used when no CASLocalCacheSize directive is found)

#define DEFAULT_CASLocalCacheTimeout   3600
 

Default cache timeout (used when no CASLocalCacheTimeout directive is found)


Function Documentation

void cas_cache_cleanup  ) 
 

Cleanup the ticket cache.

int cas_cache_get char *  ticket,
char *  buf,
int  buflen,
char  insecure
 

Retrieves the NetID for a given ticket, storing it into the buffer provided.

Parameters:
ticket the ticket to get from the cache
buf a buffer store the NetID
buflen the length of the buffer
insecure stores our current CASLocalCacheInsecure status
Returns:
1 if the ticket was found and valid, 0 otherwise.

void cas_cache_init server_rec *  s  ) 
 

initialize the ticket cache.

Parameters:
s the server.

void cas_cache_put TicketEntry  te  ) 
 

Add an entry to the ticket cache.

Parameters:
te the ticket entry to store.
Note:
Values are copied from the TicketEntry, which need not persist after the call terminates.

int cas_is_cache_initialized  ) 
 

Tells if the cache has been initialized or not.

Returns:
1 if the cache has been initialized, 0 otherwise.

const char* cas_read_CASLocalCacheFile cmd_parms *  cmd,
void *  dummy,
const char *  word
 

Command handler for the CASLocalCacheFile directive.

Parameters:
cmd the directive given by the configuration file
dummy not used.
word the parameter of the directive
Returns:
always NULL (success)

const char* cas_read_CASLocalCacheInsecure cmd_parms *  cmd,
void *  dummy,
int  bool
 

Command handler for the CASLocalCacheInsecure directive.

Parameters:
cmd the directive given by the configuration file
dummy not used.
bool TRUE when the directive is set to on, FALSE when set to off
Returns:
always NULL (success).

const char* cas_read_CASLocalCacheSize cmd_parms *  cmd,
void *  dummy,
const char *  word
 

Command handler for the CASLocalCacheSize directive.

Parameters:
cmd the directive given by the configuration file
dummy not used.
word the parameter of the directive
Returns:
NULL on success, an error message otherwise.

const char* cas_read_CASLocalCacheTimeout cmd_parms *  cmd,
void *  dummy,
const char *  word
 

Command handler for the CASLocalCacheTimeout directive.

Parameters:
cmd the directive given by the configuration file
dummy not used.
word the parameter of the directive
Returns:
NULL on success, an error message otherwise.

void read_lock int  fd  )  [static]
 

Prepare for writelock on (or unlock of) entire file.

Parameters:
fd a file descriptor

void un_lock int  fd  )  [static]
 

Prepare for writelock on (or unlock of) entire file.

Parameters:
fd a file descriptor

void write_lock int  fd  )  [static]
 

Prepare for writelock on (or unlock of) entire file.

Parameters:
fd a file descriptor


Variable Documentation

char* ticket_cache = NULL [static]
 

Per-process local pointer to our mmap()'d ticket cache

int ticket_cache_fd [static]
 

File descriptor used to keep the cache opened

size_t ticket_cache_size = 0 [static]
 

size of the ticket cache


Generated on Thu Jun 26 14:33:06 2003 for mod_cas by doxygen1.3