Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
AuthenticatedUser.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: AuthenticatedUser.h 6657 2026-10-28 18:19:39Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2006 - 2026
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 */
40#ifndef __AuthenticatedUser_h
41#define __AuthenticatedUser_h
42
43#include <HttpServer.h>
44#include <BaServerLib.h>
45#include <DoubleList.h>
46#include <SplayTree.h>
47
48#ifndef __DOXYGEN__
50struct UserIntf;
51struct AuthorizerIntf;
53struct LoginRespIntf;
54struct LoginTracker;
55struct LoginTrackerIntf;
56struct LoginTrackerNode;
57struct AuthInfo;
58#endif
59
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64extern BA_API const char BasicAuthUser_derivedType[];
65extern BA_API const char DigestAuthUser_derivedType[];
66extern BA_API const char FormAuthUser_derivedType[];
67#ifdef __cplusplus
68}
69#endif
70
71
84typedef enum {
85 AuthenticatedUserType_Unknown,
86 AuthenticatedUserType_Digest,
87 AuthenticatedUserType_Basic,
88 AuthenticatedUserType_Form
90
91
106 struct AuthorizerIntf* intf,
107 struct AuthenticatedUser* user,
108 HttpMethod httpMethod,
109 const char* path);
110
114typedef struct AuthorizerIntf
115{
116#ifdef __cplusplus
118
123
131 bool authorize(struct AuthenticatedUser* user,
132 HttpMethod method,
133 const char* path);
134#endif
135 AuthorizerIntf_Authorize authorizeFP;
137
142#define AuthorizerIntf_constructor(o, authorize) (o)->authorizeFP=authorize
146#define AuthorizerIntf_authorize(o, user, method, path) \
147 (o)->authorizeFP(o, user, method, path)
148
149#ifdef __cplusplus
150inline
151AuthorizerIntf::AuthorizerIntf(AuthorizerIntf_Authorize authorize) {
153inline bool
155 HttpMethod method,
156 const char* path) {
157 return AuthorizerIntf_authorize(this,user,method,path) ? true : false; }
158#endif
159
160
189typedef void (*UserIntf_GetPwd)(struct UserIntf* intf,struct AuthInfo* info);
190
195typedef struct UserIntf
196{
197#ifdef __cplusplus
198
199 UserIntf() {}
200
205
206#endif
207 UserIntf_GetPwd getPwdFp;
209
210#ifdef __cplusplus
211extern "C" {
212#endif
213
218#define UserIntf_constructor(o, getPwd) (o)->getPwdFp = getPwd
219
224#define UserIntf_getPwd(o, username) (o)->getPwdFp(o, username)
225#ifdef __cplusplus
226}
227inline UserIntf::UserIntf(
228 UserIntf_GetPwd getPwd) {
229 UserIntf_constructor(this, getPwd);
230}
231#endif
232
233
234#ifndef __DOXYGEN__
235typedef struct AuthUserList
236{
237#ifdef __cplusplus
238#endif
239 SplayTreeNode super; /* inherits from SplayTreeNode */
240 DoubleList list; /* List of AuthenticatedUser objects */
241 struct UserIntf* userDb;
242 HttpServer* server;
243 char* username;
244 char* password;
245 int listLen; /* Number of objects in 'list' */
246} AuthUserList;
247#endif
248
249BA_API int AuthUserList_createOrCheck(struct AuthInfo* info,
250 UserIntf* userDb,
251 void** ptr,
252 size_t size);
253
254
255typedef DoubleListEnumerator AuthUserListEnumerator;
256#define AuthUserListEnumerator_constructor(e, o) \
257 DoubleListEnumerator_constructor(e, &(o)->list)
258BA_API struct AuthenticatedUser*
259AuthUserListEnumerator_getElement(DoubleListEnumerator* o);
260BA_API struct AuthenticatedUser*
261AuthUserListEnumerator_nextElement(DoubleListEnumerator* o);
262void AuthUserList_termIfEmpty(AuthUserList* o);
263
264
265
272typedef struct AuthenticatedUser
273{
274#ifdef __cplusplus
275
282 static AuthenticatedUser* get(HttpRequest* request);
283
284
290 static AuthenticatedUser* get(HttpSession* session);
291
297
303 const char* getPassword();
304
309 const char* getName();
310
323 void logout(bool all=false);
324
330
336#endif
337 HttpSessionAttribute superClass; /*as if inherited */
338 DoubleLink dlink; /* In AuthUserList */
339 AuthUserList* authUserList;
340 const char* derivedType; /* Used for dynamic cast */
342
343#ifdef __cplusplus
344extern "C" {
345#endif
346
347BA_API void
348AuthenticatedUser_constructor(AuthenticatedUser* o,
349 const char* derivedType,
350 AuthUserList* list,
352BA_API void AuthenticatedUser_destructor(AuthenticatedUser* o);
362#define AuthenticatedUser_getName(o) \
363 ((o) && (o)->authUserList && (o)->authUserList->username ? \
364 (o)->authUserList->username : 0)
365#define AuthenticatedUser_getDerivedType(o) (o)->derivedType
369#define AuthenticatedUser_getSession(o) \
370 HttpSessionAttribute_getSession((HttpSessionAttribute*)o)
374#define AuthenticatedUser_getPassword(o) \
375 ((o) && (o)->authUserList && (o)->authUserList->password ? \
376 (o)->authUserList->password : 0)
388#ifdef __cplusplus
389}
391 return AuthenticatedUser_get1(request); }
393 return AuthenticatedUser_get2(session); }
394inline const char* AuthenticatedUser::getName() {
395 return AuthenticatedUser_getName(this); }
397 return AuthenticatedUser_getSession(this); }
398inline const char* AuthenticatedUser::getPassword() {
399 return AuthenticatedUser_getPassword(this); }
400inline void AuthenticatedUser::logout(bool all) {
401 AuthenticatedUser_logout(this, all ? TRUE : FALSE); }
403 return AuthenticatedUser_getType(this); }
406#endif
407
416typedef AuthenticatedUser* (*AuthenticatorIntf_Authenticate)(
417 struct AuthenticatorIntf* super,
418 const char* relPath,
419 HttpCommand* cmd);
420
421
425typedef struct AuthenticatorIntf
426{
427#ifdef __cplusplus
428 /*Only to be used as default constructor when sub-classing with C code*/
430
435
442 AuthenticatedUser* authenticate(const char* relPath, HttpCommand* cmd);
443#endif
444 AuthenticatorIntf_Authenticate authenticateCB;
446
447#ifdef __cplusplus
448extern "C" {
449#endif
450
454#define AuthenticatorIntf_authenticate(o, relPath, cmd) \
455 (o)->authenticateCB(o, relPath, cmd)
456
463 AuthenticatorIntf_Authenticate authenticate);
464#ifdef __cplusplus
465}
466inline AuthenticatorIntf::AuthenticatorIntf(
467 AuthenticatorIntf_Authenticate authenticate) {
469}
471 const char* relPath, HttpCommand* cmd) {
472 return AuthenticatorIntf_authenticate(this, relPath, cmd);
473}
474#endif
475
476
493typedef void (*LoginRespIntf_Service)(struct LoginRespIntf* intf,
494 struct AuthInfo* info);
495
504typedef struct LoginRespIntf
505{
506#ifdef __cplusplus
507 LoginRespIntf() {}
512#endif
513 LoginRespIntf_Service serviceFp;
515
520#define LoginRespIntf_constructor(o, service) (o)->serviceFp=service
521#ifdef __cplusplus
522inline LoginRespIntf::LoginRespIntf(LoginRespIntf_Service service) {
523 LoginRespIntf_constructor(this, service); }
524#endif
525
526
530typedef enum {
541
547
548
553typedef struct AuthInfo
554{
557
560
562 const char* username;
563
565 const char* upwd;
566
569
572
575
577 void* userObj;
578
579 AuthUserList* authUserList;
580
590
591 U32 seed;
592 U32 seedKey;
593
596
599
602
605
609
617#define AuthInfo_constructor(o, trackerMA, cmdMA, typeMA) do {\
618 memset(o, 0, sizeof(AuthInfo));\
619 (o)->tracker=trackerMA;\
620 (o)->cmd=cmdMA;\
621 (o)->type=typeMA;\
622 (o)->maxUsers=3;\
623 (o)->ct=AuthInfoCT_Password;\
624 (o)->password[0]=0;\
625} while(0)
626
642 struct LoginTrackerIntf* o,
643 AuthInfo* info,
644 struct LoginTrackerNode* node);
645
646
656 struct LoginTrackerIntf* o,
657 AuthInfo* info,
658 struct LoginTrackerNode* node);
659
678 struct LoginTrackerIntf* o,
679 AuthInfo* info,
680 struct LoginTrackerNode* node);
681
694 struct LoginTrackerIntf* o,
695 struct LoginTrackerNode* node);
696
697
702typedef struct LoginTrackerIntf
703{
704#ifdef __cplusplus
714 LoginTrackerIntf_TerminateNode terminateNode);
715#endif
719 LoginTrackerIntf_TerminateNode terminateNode;
721
729#define LoginTrackerIntf_constructor(\
730 o, validateMA, loginMA, loginFailedMA, terminateNodeMA) do {\
731 (o)->validate=validateMA;\
732 (o)->login=loginMA;\
733 (o)->loginFailed=loginFailedMA;\
734 (o)->terminateNode=terminateNodeMA;\
735} while(0)
742#define LoginTrackerIntf_validate(o, request, node) \
743 (o)->validate(o, request, node)
749#define LoginTrackerIntf_login(o, request, user) \
750 (o)->login(o, request, user)
756#define LoginTrackerIntf_loginFailed(o, node, loginName) \
757 (o)->loginFailed(o, node, loginName)
762#define LoginTrackerIntf_terminateNode(o, node) \
763 (o)->terminateNode(o, node)
764
765#ifdef __cplusplus
770 LoginTrackerIntf_TerminateNode terminateNode) {
771 LoginTrackerIntf_constructor(this,validate,login,loginFailed,terminateNode);
772}
773#endif
774
775
780typedef struct LoginTrackerNode
781{
782#ifdef __cplusplus
786 U32 getCounter();
787
792
796 void setAuxCounter(U32 count);
797
801 HttpSockaddr* getAddr();
802
806 void setUserData(void* data);
807
811 void* getUserData();
812
816 BaTime getTime();
817#endif
818 SplayTreeNode super;
819 DoubleLink dlink;
820 HttpSockaddr addr;
821 void* userData;
822 BaTime t;
823 U32 loginCounter;
824 U32 auxCounter;
826
830#define LoginTrackerNode_getCounter(o) (o)->loginCounter
834#define LoginTrackerNode_getAuxCounter(o) (o)->auxCounter
838#define LoginTrackerNode_setAuxCounter(o, count) (o)->auxCounter=count
842#define LoginTrackerNode_getAddr(o) (&(o)->addr)
846#define LoginTrackerNode_setUserData(o, data) (o)->userData=data
850#define LoginTrackerNode_getUserData(o) (o)->userData
854#define LoginTrackerNode_getTime(o) (o)->t
855
856#ifdef __cplusplus
858 return LoginTrackerNode_getCounter(this);
859}
862}
863
866}
867
868inline HttpSockaddr* LoginTrackerNode::getAddr() {
869 return LoginTrackerNode_getAddr(this);
870}
871inline void LoginTrackerNode::setUserData(void* data) {
873}
875 return LoginTrackerNode_getUserData(this);
876}
878 return LoginTrackerNode_getTime(this);
879}
880#endif
881
891typedef struct LoginTracker
892{
893#ifdef __cplusplus
906 LoginTracker(U32 noOfLoginTrackerNodes,
907 LoginTrackerIntf* intf,
909
914 void clearCache();
915
921
927
933#endif
934 SplayTree tree;
935 DoubleList dInUseList;
936 DoubleList dFreeList;
937 LoginTrackerIntf* loginTrackerIntf;
938 U32 cursor;
939 U32 noOfLoginTrackerNodes;
940 LoginTrackerNode* nodes;
942
943
944#ifdef __cplusplus
945extern "C" {
946#endif
951 U32 noOfLoginTrackerNodes,
952 LoginTrackerIntf* intf,
953 AllocatorIntf* allocator);
984 LoginTracker* o, AuthInfo* info);
1000#ifdef __cplusplus
1001}
1002inline LoginTracker::LoginTracker(U32 noOfLoginTrackerNodes,
1003 LoginTrackerIntf* intf,
1004 AllocatorIntf* allocator) {
1005 LoginTracker_constructor(this, noOfLoginTrackerNodes, intf, allocator);
1006}
1009}
1011 return LoginTracker_getFirstNode(this);
1012}
1014 return LoginTracker_getNextNode(this,n);
1015}
1017 return LoginTracker_find(this,request);
1018}
1019#endif
1020
1021 /* end of Authentication */
1023
1024/* Internal func */
1025void calculateHA1Hex(
1026 const char* realm, const char* uname, const char* pwd, U8 hexbuf[33]);
1027
1028#endif
#define UserIntf_constructor(o, getPwd)
Install the callback used by UserIntf.
Definition: AuthenticatedUser.h:218
struct UserIntf UserIntf
User database interface used by the authentication classes.
AuthInfoCT
AuthInfo Credential Type can optionally be used by the UserIntf_GetPwd callback function.
Definition: AuthenticatedUser.h:530
LoginTrackerNode * find(HttpRequest *request)
Find a cached address using the current connection's peer IP.
Definition: AuthenticatedUser.h:1016
BA_API void LoginTracker_loginFailed(LoginTracker *o, AuthInfo *info)
Record a failed login, inserting or recycling an address node as needed.
#define LoginTrackerIntf_constructor(o, validateMA, loginMA, loginFailedMA, terminateNodeMA)
Install required tracker callbacks; no callback may be NULL.
Definition: AuthenticatedUser.h:729
HttpSession * getSession()
Get the containing session.
Definition: AuthenticatedUser.h:396
static AuthenticatedUser * getAnonymous()
Access the shared anonymous user.
Definition: AuthenticatedUser.h:404
bool authorize(struct AuthenticatedUser *user, HttpMethod method, const char *path)
Returns TRUE if user is authorized.
Definition: AuthenticatedUser.h:154
BA_API void AuthenticatedUser_logout(AuthenticatedUser *o, BaBool all)
Log out and terminate the associated session or sessions.
#define LoginTrackerNode_getAddr(o)
Access the cached peer IP address.
Definition: AuthenticatedUser.h:842
const char * getPassword()
Access the stored credential representation.
Definition: AuthenticatedUser.h:398
AuthenticatedUser *(* AuthenticatorIntf_Authenticate)(struct AuthenticatorIntf *super, const char *relPath, HttpCommand *cmd)
The authenticator callback method for the abstract class AuthenticatorIntf.
Definition: AuthenticatedUser.h:416
U32 getCounter()
Query the address failure/denial counter.
Definition: AuthenticatedUser.h:857
LoginTrackerIntf(LoginTrackerIntf_Validate validate, LoginTrackerIntf_Login login, LoginTrackerIntf_LoginFailed loginFailed, LoginTrackerIntf_TerminateNode terminateNode)
Install four required callbacks; none may be NULL.
Definition: AuthenticatedUser.h:766
BA_API LoginTrackerNode * LoginTracker_getNextNode(LoginTracker *o, LoginTrackerNode *n)
Advance through active cached addresses.
void(* LoginTrackerIntf_Login)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the Login tracker method.
Definition: AuthenticatedUser.h:655
BaTime getTime()
Query the latest recorded failed or denied attempt.
Definition: AuthenticatedUser.h:877
BA_API AuthenticatedUser * AuthenticatedUser_get2(HttpSession *session)
Find the authenticated-user session attribute.
#define LoginTrackerNode_getUserData(o)
Query application data.
Definition: AuthenticatedUser.h:850
struct AuthorizerIntf AuthorizerIntf
An abstract class, which you must implement, provides a method of authorizing an authenticated user.
LoginTrackerNode * getNextNode(LoginTrackerNode *n)
Advance through active cached addresses.
Definition: AuthenticatedUser.h:1013
#define AuthenticatorIntf_authenticate(o, relPath, cmd)
Authenticate the user.
Definition: AuthenticatedUser.h:454
void * getUserData()
Query application data.
Definition: AuthenticatedUser.h:874
AuthenticatedUserType getType()
Identify the authenticator that created this user.
Definition: AuthenticatedUser.h:402
struct AuthenticatorIntf AuthenticatorIntf
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator...
BaBool(* LoginTrackerIntf_Validate)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the validate callback method.
Definition: AuthenticatedUser.h:641
AuthenticatedUser * authenticate(const char *relPath, HttpCommand *cmd)
Authenticate the user.
Definition: AuthenticatedUser.h:470
struct LoginTrackerNode LoginTrackerNode
A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to ...
BA_API BaBool LoginTracker_validate(LoginTracker *o, AuthInfo *info)
Check whether a cached peer may attempt authentication.
BA_API void LoginTracker_login(LoginTracker *o, AuthInfo *info)
Notify successful authentication and remove any cached peer entry.
BA_API AuthenticatedUser * AuthenticatedUser_get1(HttpRequest *request)
Find the authenticated user without creating a session.
const char * getName()
Access the authenticated name.
Definition: AuthenticatedUser.h:394
#define LoginRespIntf_constructor(o, service)
Install the callback used by LoginRespIntf.
Definition: AuthenticatedUser.h:520
BA_API void LoginTracker_destructor(LoginTracker *o)
Release a tracker after detaching all users.
LoginTrackerNode * getFirstNode()
Start iteration over active cached addresses in insertion order.
Definition: AuthenticatedUser.h:1010
#define AuthenticatedUser_getSession(o)
Get the containing session.
Definition: AuthenticatedUser.h:369
#define LoginTrackerNode_getAuxCounter(o)
Query the application auxiliary counter.
Definition: AuthenticatedUser.h:834
AuthenticatedUserType
The authenticator types.
Definition: AuthenticatedUser.h:84
struct LoginRespIntf LoginRespIntf
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
#define LoginTrackerNode_getCounter(o)
Query the address failure/denial counter.
Definition: AuthenticatedUser.h:830
void logout(bool all=false)
Log out and terminate the associated session or sessions.
Definition: AuthenticatedUser.h:400
struct LoginTrackerIntf LoginTrackerIntf
The interface between the LoginTracker and the application code.
void(* LoginRespIntf_Service)(struct LoginRespIntf *intf, struct AuthInfo *info)
This callback function is called if the user failed to authenticate with one of DigestAuthenticator,...
Definition: AuthenticatedUser.h:493
void(* UserIntf_GetPwd)(struct UserIntf *intf, struct AuthInfo *info)
User database callback used by authenticators.
Definition: AuthenticatedUser.h:189
static AuthenticatedUser * get(HttpRequest *request)
Find the authenticated user without creating a session.
Definition: AuthenticatedUser.h:390
#define AuthorizerIntf_constructor(o, authorize)
Install the callback used by AuthorizerIntf.
Definition: AuthenticatedUser.h:142
void setUserData(void *data)
Associate application data with the node.
Definition: AuthenticatedUser.h:871
void clearCache()
Remove all active cached addresses.
Definition: AuthenticatedUser.h:1007
struct LoginTracker LoginTracker
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
BA_API LoginTrackerNode * LoginTracker_getFirstNode(LoginTracker *o)
Start iteration over active cached addresses in insertion order.
void(* LoginTrackerIntf_LoginFailed)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the LoginFailed callback method.
Definition: AuthenticatedUser.h:677
BA_API AuthenticatedUser * AuthenticatedUser_getAnonymous(void)
Access the shared anonymous user.
#define LoginTrackerNode_getTime(o)
Query the latest recorded failed or denied attempt.
Definition: AuthenticatedUser.h:854
U32 getAuxCounter()
Query the application auxiliary counter.
Definition: AuthenticatedUser.h:860
struct AuthInfo AuthInfo
An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is use...
BA_API AuthenticatedUserType AuthenticatedUser_getType(AuthenticatedUser *o)
Identify the authenticator that created this user.
HttpSockaddr * getAddr()
Access the cached peer IP address.
Definition: AuthenticatedUser.h:868
BaBool(* AuthorizerIntf_Authorize)(struct AuthorizerIntf *intf, struct AuthenticatedUser *user, HttpMethod httpMethod, const char *path)
Prototype for the Authorize callback method.
Definition: AuthenticatedUser.h:105
#define AuthenticatedUser_getPassword(o)
Access the stored credential representation.
Definition: AuthenticatedUser.h:374
struct AuthenticatedUser AuthenticatedUser
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
#define AuthorizerIntf_authorize(o, user, method, path)
Returns TRUE if user is authorized.
Definition: AuthenticatedUser.h:146
BA_API void LoginTracker_clearCache(LoginTracker *o)
Remove all active cached addresses.
void(* LoginTrackerIntf_TerminateNode)(struct LoginTrackerIntf *o, struct LoginTrackerNode *node)
Prototype for the TerminateNode callback method.
Definition: AuthenticatedUser.h:693
#define AuthenticatedUser_getName(o)
Access the authenticated name.
Definition: AuthenticatedUser.h:362
void setAuxCounter(U32 count)
Set the application auxiliary counter.
Definition: AuthenticatedUser.h:864
#define LoginTrackerNode_setUserData(o, data)
Associate application data with the node.
Definition: AuthenticatedUser.h:846
#define LoginTrackerNode_setAuxCounter(o, count)
Set the application auxiliary counter.
Definition: AuthenticatedUser.h:838
BA_API void AuthenticatorIntf_constructor(AuthenticatorIntf *o, AuthenticatorIntf_Authenticate authenticate)
Install the callback used by AuthenticatorIntf.
BA_API LoginTrackerNode * LoginTracker_find(LoginTracker *o, HttpRequest *req)
C form of LoginTracker::find.
BA_API void LoginTracker_constructor(LoginTracker *o, U32 noOfLoginTrackerNodes, LoginTrackerIntf *intf, AllocatorIntf *allocator)
Allocate a fixed cache of address records.
LoginTracker(U32 noOfLoginTrackerNodes, LoginTrackerIntf *intf, AllocatorIntf *allocator=AllocatorIntf::getDefault())
Allocate a fixed cache of address records.
Definition: AuthenticatedUser.h:1002
@ AuthInfoCT_Invalid
Set when getpwd callback failed comparing AuthInfo::upwd with stored password.
Definition: AuthenticatedUser.h:545
@ AuthInfoCT_Valid
Set when getpwd callback successfully compared AuthInfo::upwd with stored password.
Definition: AuthenticatedUser.h:540
@ AuthInfoCT_HA1
The password is returned as a HA1 hash, which is: MD5(username ":" realm ":" password)
Definition: AuthenticatedUser.h:536
@ AuthInfoCT_Password
The default.
Definition: AuthenticatedUser.h:532
void(* HttpSessionAttribute_Destructor)(struct HttpSessionAttribute *o)
HttpSessionAttribute termination callback function.
Definition: HttpServer.h:2248
HttpMethod
HTTP method types.
Definition: HttpServer.h:941
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:00 UTC,...
Definition: GenPrimT.h:106
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:96
uint8_t U8
Unsigned 8-bit integer.
Definition: GenPrimT.h:92
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:121
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
static AllocatorIntf * getDefault(void)
Obtain the shared allocator backed by baMalloc, baRealloc and baFree.
Definition: AllocatorIntf.h:200
An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is use...
Definition: AuthenticatedUser.h:554
const char * username
Borrowed NUL-terminated input user name, or NULL when no login was supplied.
Definition: AuthenticatedUser.h:562
const char * upwd
Borrowed supplied password when available for Basic/Form; NULL when unavailable, including Digest.
Definition: AuthenticatedUser.h:565
AuthInfoCT ct
Credential interpretation selected by UserIntf_GetPwd.
Definition: AuthenticatedUser.h:574
BaBool recycle
Initially FALSE.
Definition: AuthenticatedUser.h:604
int maxUsers
Maximum concurrent logins for the user; initially 3.
Definition: AuthenticatedUser.h:595
struct LoginTracker * tracker
Borrowed optional tracker; NULL when tracking is disabled.
Definition: AuthenticatedUser.h:556
U8 password[100]
Output credential storage, initially empty.
Definition: AuthenticatedUser.h:607
BaTime maxInactiveInterval
This variable specifies the time, in seconds, between client requests before the user is automaticall...
Definition: AuthenticatedUser.h:589
HttpCommand * cmd
Borrowed command for normal authentication.
Definition: AuthenticatedUser.h:559
AuthenticatedUser * user
Borrowed authenticated user when available, otherwise NULL.
Definition: AuthenticatedUser.h:568
int loginAttempts
Tracker-derived login counter difference when access is denied; initially zero.
Definition: AuthenticatedUser.h:598
BaBool denied
Initially FALSE; set TRUE when the tracker validation callback denies a cached address.
Definition: AuthenticatedUser.h:601
void * userObj
Application pointer shared between callbacks in this authentication flow; initially NULL.
Definition: AuthenticatedUser.h:577
AuthenticatedUserType type
Input authentication mechanism; Unknown is permitted for direct database lookup.
Definition: AuthenticatedUser.h:571
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:273
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator...
Definition: AuthenticatedUser.h:426
An abstract class, which you must implement, provides a method of authorizing an authenticated user.
Definition: AuthenticatedUser.h:115
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:2179
The HttpServer creates an HttpRequest object when the HttpServer parses a client request.
Definition: HttpServer.h:981
Route and process HTTP requests using a borrowed dispatcher.
Definition: HttpServer.h:3463
The interface to an HttpSession attribute.
Definition: HttpServer.h:2279
Provides a way to identify a user across more than one page request or visit to a web site,...
Definition: HttpServer.h:2338
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:505
The interface between the LoginTracker and the application code.
Definition: AuthenticatedUser.h:703
A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to ...
Definition: AuthenticatedUser.h:781
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:892
Intrusive tree node.
Definition: SplayTree.h:52
Self-adjusting tree of caller-owned nodes, with unique keys.
Definition: SplayTree.h:109
User database interface used by the authentication classes.
Definition: AuthenticatedUser.h:196