Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
AuthenticatedUser.h File Reference
#include <HttpServer.h>
#include <BaServerLib.h>
#include <DoubleList.h>
#include <SplayTree.h>
Include dependency graph for AuthenticatedUser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AuthorizerIntf
 An abstract class, which you must implement, provides a method of authorizing an authenticated user. More...
 
struct  UserIntf
 User database interface used by the authentication classes. More...
 
struct  AuthenticatedUser
 Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser. More...
 
struct  AuthenticatorIntf
 Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator. More...
 
struct  LoginRespIntf
 The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticator, BasicAuthenticator, and FormAuthenticator. More...
 
struct  AuthInfo
 An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is used as a container object for sending information to the registered user callback methods. More...
 
struct  LoginTrackerIntf
 The interface between the LoginTracker and the application code. More...
 
struct  LoginTrackerNode
 A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to login to the server. More...
 
struct  LoginTracker
 The LoginTracker class is an optional security enhancement that can be installed in an instance of one of the authenticator classes. More...
 

Macros

#define AuthorizerIntf_constructor(o, authorize)   (o)->authorizeFP=authorize
 Install the callback used by AuthorizerIntf. More...
 
#define AuthorizerIntf_authorize(o, user, method, path)    (o)->authorizeFP(o, user, method, path)
 Returns TRUE if user is authorized. More...
 
#define UserIntf_constructor(o, getPwd)   (o)->getPwdFp = getPwd
 Install the callback used by UserIntf. More...
 
#define UserIntf_getPwd(o, username)   (o)->getPwdFp(o, username)
 Invoke UserIntf_GetPwd synchronously. More...
 
#define AuthenticatedUser_getName(o)
 Access the authenticated name. More...
 
#define AuthenticatedUser_getSession(o)    HttpSessionAttribute_getSession((HttpSessionAttribute*)o)
 Get the containing session. More...
 
#define AuthenticatedUser_getPassword(o)
 Access the stored credential representation. More...
 
#define AuthenticatorIntf_authenticate(o, relPath, cmd)    (o)->authenticateCB(o, relPath, cmd)
 Authenticate the user. More...
 
#define LoginRespIntf_constructor(o, service)   (o)->serviceFp=service
 Install the callback used by LoginRespIntf. More...
 
#define AuthInfo_constructor(o, trackerMA, cmdMA, typeMA)
 Initialize an authentication record with zeroed optional fields. More...
 
#define LoginTrackerIntf_constructor(o, validateMA, loginMA, loginFailedMA, terminateNodeMA)
 Install required tracker callbacks; no callback may be NULL. More...
 
#define LoginTrackerIntf_validate(o, request, node)    (o)->validate(o, request, node)
 Invoke the corresponding LoginTrackerIntf callback synchronously. More...
 
#define LoginTrackerIntf_login(o, request, user)    (o)->login(o, request, user)
 Invoke the corresponding LoginTrackerIntf callback synchronously. More...
 
#define LoginTrackerIntf_loginFailed(o, node, loginName)    (o)->loginFailed(o, node, loginName)
 Invoke the corresponding LoginTrackerIntf callback synchronously. More...
 
#define LoginTrackerIntf_terminateNode(o, node)    (o)->terminateNode(o, node)
 Invoke the corresponding LoginTrackerIntf callback synchronously. More...
 
#define LoginTrackerNode_getCounter(o)   (o)->loginCounter
 Query the address failure/denial counter. More...
 
#define LoginTrackerNode_getAuxCounter(o)   (o)->auxCounter
 Query the application auxiliary counter. More...
 
#define LoginTrackerNode_setAuxCounter(o, count)   (o)->auxCounter=count
 Set the application auxiliary counter. More...
 
#define LoginTrackerNode_getAddr(o)   (&(o)->addr)
 Access the cached peer IP address. More...
 
#define LoginTrackerNode_setUserData(o, data)   (o)->userData=data
 Associate application data with the node. More...
 
#define LoginTrackerNode_getUserData(o)   (o)->userData
 Query application data. More...
 
#define LoginTrackerNode_getTime(o)   (o)->t
 Query the latest recorded failed or denied attempt. More...
 

Typedefs

typedef BaBool(* AuthorizerIntf_Authorize) (struct AuthorizerIntf *intf, struct AuthenticatedUser *user, HttpMethod httpMethod, const char *path)
 Prototype for the Authorize callback method. More...
 
typedef struct AuthorizerIntf AuthorizerIntf
 An abstract class, which you must implement, provides a method of authorizing an authenticated user. More...
 
typedef void(* UserIntf_GetPwd) (struct UserIntf *intf, struct AuthInfo *info)
 User database callback used by authenticators. More...
 
typedef struct UserIntf UserIntf
 User database interface used by the authentication classes. More...
 
typedef struct AuthenticatedUser AuthenticatedUser
 Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser. More...
 
typedef AuthenticatedUser *(* AuthenticatorIntf_Authenticate) (struct AuthenticatorIntf *super, const char *relPath, HttpCommand *cmd)
 The authenticator callback method for the abstract class AuthenticatorIntf. More...
 
typedef struct AuthenticatorIntf AuthenticatorIntf
 Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator. More...
 
typedef void(* LoginRespIntf_Service) (struct LoginRespIntf *intf, struct AuthInfo *info)
 This callback function is called if the user failed to authenticate with one of DigestAuthenticator, BasicAuthenticator, or FormAuthenticator. More...
 
typedef struct LoginRespIntf LoginRespIntf
 The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticator, BasicAuthenticator, and FormAuthenticator. More...
 
typedef struct AuthInfo AuthInfo
 An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is used as a container object for sending information to the registered user callback methods. More...
 
typedef BaBool(* LoginTrackerIntf_Validate) (struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
 Prototype for the validate callback method. More...
 
typedef void(* LoginTrackerIntf_Login) (struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
 Prototype for the Login tracker method. More...
 
typedef void(* LoginTrackerIntf_LoginFailed) (struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
 Prototype for the LoginFailed callback method. More...
 
typedef void(* LoginTrackerIntf_TerminateNode) (struct LoginTrackerIntf *o, struct LoginTrackerNode *node)
 Prototype for the TerminateNode callback method. More...
 
typedef struct LoginTrackerIntf LoginTrackerIntf
 The interface between the LoginTracker and the application code. More...
 
typedef struct LoginTrackerNode LoginTrackerNode
 A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to login to the server. More...
 
typedef struct LoginTracker LoginTracker
 The LoginTracker class is an optional security enhancement that can be installed in an instance of one of the authenticator classes. More...
 

Enumerations

enum  AuthenticatedUserType
 The authenticator types. More...
 
enum  AuthInfoCT { AuthInfoCT_Password =5 , AuthInfoCT_HA1 , AuthInfoCT_Valid , AuthInfoCT_Invalid }
 AuthInfo Credential Type can optionally be used by the UserIntf_GetPwd callback function. More...
 

Functions

BA_API AuthenticatedUserAuthenticatedUser_get1 (HttpRequest *request)
 Find the authenticated user without creating a session. More...
 
BA_API AuthenticatedUserAuthenticatedUser_get2 (HttpSession *session)
 Find the authenticated-user session attribute. More...
 
BA_API void AuthenticatedUser_logout (AuthenticatedUser *o, BaBool all)
 Log out and terminate the associated session or sessions. More...
 
BA_API AuthenticatedUserType AuthenticatedUser_getType (AuthenticatedUser *o)
 Identify the authenticator that created this user. More...
 
BA_API AuthenticatedUserAuthenticatedUser_getAnonymous (void)
 Access the shared anonymous user. More...
 
BA_API void AuthenticatorIntf_constructor (AuthenticatorIntf *o, AuthenticatorIntf_Authenticate authenticate)
 Install the callback used by AuthenticatorIntf. More...
 
BA_API void LoginTracker_constructor (LoginTracker *o, U32 noOfLoginTrackerNodes, LoginTrackerIntf *intf, AllocatorIntf *allocator)
 Allocate a fixed cache of address records. More...
 
BA_API void LoginTracker_destructor (LoginTracker *o)
 Release a tracker after detaching all users. More...
 
BA_API void LoginTracker_clearCache (LoginTracker *o)
 Remove all active cached addresses. More...
 
BA_API LoginTrackerNodeLoginTracker_getFirstNode (LoginTracker *o)
 Start iteration over active cached addresses in insertion order. More...
 
BA_API LoginTrackerNodeLoginTracker_getNextNode (LoginTracker *o, LoginTrackerNode *n)
 Advance through active cached addresses. More...
 
BA_API LoginTrackerNodeLoginTracker_find (LoginTracker *o, HttpRequest *req)
 C form of LoginTracker::find. More...
 
BA_API void LoginTracker_loginFailed (LoginTracker *o, AuthInfo *info)
 Record a failed login, inserting or recycling an address node as needed. More...
 
BA_API BaBool LoginTracker_validate (LoginTracker *o, AuthInfo *info)
 Check whether a cached peer may attempt authentication. More...
 
BA_API void LoginTracker_login (LoginTracker *o, AuthInfo *info)
 Notify successful authentication and remove any cached peer entry. More...