8 #include <netinet/in.h> 12 #define RTTPD_VERSION "8.0.3" 14 #define RTTPD_MAJOR_VERSION 8 15 #define RTTPD_MINOR_VERSION 0 16 #define RTTPD_PATCH_VERSION 3 21 #define AUTH_EXPORT extern __declspec(dllimport) 34 #define MAX_OBNAME 4096 38 #define MAX_USERNAME 255 40 typedef struct _string_pair_type string_pair_t;
56 typedef struct _checkwriteinfo checkwriteinfo_t;
127 AUTH_INVALID_USER = -3,
128 AUTH_INVALID_PASS = -4,
129 AUTH_INVALID_ADDR = -5,
130 AUTH_ACCT_EXPIRED = -6,
131 AUTH_USER_LC_EXCEEDED = -7,
132 AUTH_SITE_LC_EXCEEDED = -8,
153 typedef struct _auth_map_type auth_map_t;
155 struct _auth_map_type
171 typedef enum _http_method http_method_t;
180 int (*auth_new_user)(
session_t *session,
char *user,
char *pass);
270 int (*auth_map_object)(
session_t *session,
char *requested_name,
char *name,
char *mapped,
int *len);
317 int (*auth_http_request)(
char *user,
char *pass, http_method_t method,
char *path);
350 int (*auth_check_permission_update)(
session_t *session,
object_t *obj,
char *key,
int auth_map_size, auth_map_t *keyvalues);
355 int (*auth_check_write_extended)(
session_t *session,
object_t *obj,
char *requested_name,
int field_count, string_pair_t * fields,
char *contrib_id);
380 void (*auth_global_permission_update)(
object_t *obj,
char *key,
int auth_map_size, auth_map_t *keyvalues, auth_perm_operation_t operation);
411 struct _string_pair_type
459 AUTH_EXPORT
int auth_new_subscription(
char *prefix,
char *subject,
void *user_context,
void (*loaded)(
void *,
int,
char *),
void (*failed)(
void *,
int,
char *),
void (*status)(
void *,
int,
char *,
int));
475 #define SESSION_ID_LEN_MIN 6 479 #define SESSION_ID_LEN_DEFAULT 22 483 #define SESSION_ID_LEN_MAX 256 511 struct sockaddr_storage addr;
520 typedef struct _fieldset fieldset_t;
549 THREADS_AUTH_LOGIN = 600,
550 THREADS_AUTH_MAPPED = 601,
551 THREADS_AUTH_CHECKWRITE = 602,
589 struct _checkwriteinfo
599 AUTH_EXPORT
char *object_get_value_byname(
object_t *obj,
char *fieldname,
char *buf,
int len);
AUTH_EXPORT int auth_eject_username_by_app_id(char *name, int num, char *app_id)
Wrapper for auth_eject_username_by_app_id that takes the user name instead of a _user pointer...
Definition: auth.c:2200
char * authorization
Definition: rttpd.h:517
Describes the callback functions that should be implemented by an auth module.
Definition: rttpd.h:178
AUTH_EXPORT int auth_verify_signature_username(char *expected_username, char *token)
Verify that the supplied token is for the expected username.
Definition: auth.c:6528
The user object.
Definition: rttpd.h:402
char * addrname
Definition: rttpd.h:512
char * tobo_username
Definition: rttpd.h:408
AUTH_EXPORT void auth_invalidate_sessions(user_t *user, int num, int flags)
Invalidate all sessions for a user.
Definition: auth.c:2452
struct _session_request_retry session_request_retry_t
Structure used to hold request retry information when things are overloaded.
Definition: rttpd.h:487
AUTH_EXPORT object_t * infoob_new_object(const char *name)
Creates a new system object.
Definition: infoob.c:184
#define MAX_OBNAME
Definition: rttpd.h:34
void(* eventcallback_t)(void *data, short event, short code)
Definition of the callback function for delayed events.
Definition: rttpd.h:66
_auth_perm_operation
Operations for the __authfuncs::auth_global_permission_update() function.
Definition: rttpd.h:144
int uid
Definition: rttpd.h:505
_object_type
Definition of RTTP object types.
Definition: rttpd.h:71
AUTH_EXPORT void auth_listener_throttle(char *session_id, char *object_name, char *command)
Throttle an individual subscription on a user's session.
Definition: auth.c:2624
AUTH_EXPORT int auth_eject_username_sessions(char *name, int num)
Wrapper for auth_eject_sessions that takes the user name instead of a _user pointer.
Definition: auth.c:2100
short msg
Definition: rttpd.h:571
AUTH_EXPORT void infoob_add_str(object_t *obj, int field, const char *value)
Adds a value to a system object.
Definition: infoob.c:264
AUTH_EXPORT void auth_subscribe(int subscriptionId)
Subscribes to subject.
Definition: auth.c:6687
time_t s_loggedin
Definition: rttpd.h:509
AUTH_EXPORT void auth_unsubscribe_free_data(int subscriptionId, void *free_context, void(*free_data_cb)(void *, void *))
Unsubscribes to subject and frees the user context on the thread handling auth updates.
Definition: auth.c:6755
AUTH_EXPORT char * auth_get_tobouser(const char *username)
Get the TOBO user setting.
Definition: auth.c:6248
char * cookie
Definition: rttpd.h:516
AUTH_EXPORT int signature_check(char *key_id, char *token)
Provides a mechanism for validating a KeyMaster-generated encrypted single-use token.
Definition: auth.c:1540
AUTH_EXPORT int auth_eject_all_sessions_by_app_id(const char *app_id)
Eject all logged in sessions that are using the specified application id.
Definition: auth.c:2353
AUTH_EXPORT char * object_get_value(object_t *obj, int32_t fieldnum, char *buf, int len)
The function returns the value of a specified field in an object.
Definition: object.c:4133
AUTH_EXPORT void auth_reset_tobouser(const char *username)
Remove the tobouser for the user specified by the session.
Definition: auth.c:6274
AUTH_EXPORT void auth_invalidate_all_sessions(int flags)
Invalidate all sessions for all users in the system.
Definition: auth.c:2547
void * auth
Definition: rttpd.h:407
char * nodename
Definition: rttpd.h:625
char * password
Definition: rttpd.h:405
AUTH_EXPORT void infoob_add_data(object_t *obj, const int *fields, const char **values, int count)
Adds an array of values to a system object.
Definition: infoob.c:311
AUTH_EXPORT void infoob_add_int_generic(object_t *obj, const char *fieldname, int value)
Adds a numerical value to a system object.
Definition: infoob.c:360
AUTH_EXPORT int auth_new_subscription(char *prefix, char *subject, void *user_context, void(*loaded)(void *, int, char *), void(*failed)(void *, int, char *), void(*status)(void *, int, char *, int))
Creates a subscription for use with auth_subscribe and auth_unsubscribe.
Definition: auth.c:6666
AUTH_EXPORT void auth_invalidate_sessions_by_name(char *name, int num, int flags)
Invalidate all sessions for a username.
Definition: auth.c:2488
AUTH_EXPORT void infoob_add_data_generic(object_t *obj, const char **fieldnames, const char **values, int count)
Adds an array of values to a system object.
Definition: infoob.c:383
AUTH_EXPORT int infoob_add_field(const char *name, int flags)
Creates a new field for updating system objects.
Definition: infoob.c:160
char * name
Definition: rttpd.h:542
unsigned short sessions
Definition: rttpd.h:626
time_t s_connected
Definition: rttpd.h:508
user_t * user
Definition: rttpd.h:506
AUTH_EXPORT int auth_create_object(char *name, object_type_t type)
Create an object within the Liberator.
Definition: auth.c:6382
int ref
Definition: rttpd.h:406
object_type_t type
Definition: rttpd.h:543
The RTTP Session Object.
Definition: rttpd.h:502
char * application_id
Definition: rttpd.h:514
unsigned long s_updates
Definition: rttpd.h:510
unsigned short max_sessions
Definition: rttpd.h:627
short msg
Definition: rttpd.h:584
AUTH_EXPORT int auth_eject_sessions_by_app_id(user_t *user, int num, char *app_id)
Eject sessions with matching application id.
Definition: auth.c:2244
Callback that is called when an object changes initial state.
Definition: rttpd.h:540
AUTH_EXPORT int auth_get_login_count(char *username)
Get the number of current logins for a username.
Definition: auth.c:6554
AUTH_EXPORT void auth_invalidate_object(char *name, int flags)
Invalidate an object.
Definition: auth.c:2520
_auth_result
Return codes for the authentication functions.
Definition: rttpd.h:119
void * auth
Definition: rttpd.h:507
AUTH_EXPORT int auth_get_user_session_count_by_name(char *object_name)
Return the number of active sessions.
Definition: auth.c:6327
AUTH_EXPORT size_t auth_get_extra_data(char *token, char *buffer, size_t max_len)
Gets the extra data from the token. The extra data is expected to be the 4th part of the ~ separated ...
Definition: auth.c:6589
AUTH_EXPORT void auth_delete_object(char *name)
Delete an object within the Liberator.
Definition: auth.c:6410
AUTH_EXPORT void auth_unsubscribe(int subscriptionId)
Unsubscribes to subject.
Definition: auth.c:6730
char * username
Definition: rttpd.h:404
AUTH_EXPORT void auth_set_tobouser(const char *username, const char *tobouser)
Set the tobo user for the specified user.
Definition: auth.c:6218
char * machine_id
Definition: rttpd.h:515
The map information object.
Definition: rttpd.h:581
AUTH_EXPORT char * auth_get_token_parameter(const char *keymaster_token, const char *parameter_to_query)
Return a value for the given field within a keymaster token.
Definition: auth.c:6184
The RTTP node object.
Definition: rttpd.h:623
AUTH_EXPORT void infoob_add_int(object_t *obj, int field, int value)
Adds a numerical value to a system object.
Definition: infoob.c:287
AUTH_EXPORT int auth_eject_sessions(user_t *user, int num)
Eject sessions.
Definition: auth.c:2143
AUTH_EXPORT int auth_eject_username_by_machine_id(char *name, int num, char *machine_id)
Wrapper for auth_eject_sessions_by_machine_id that takes the user name instead of a _user pointer...
Definition: auth.c:2338
char * auth_filename_expand(char *format, char *buf, size_t buflen)
Expand a filename pattern into a fully qualified filename.
Definition: auth.c:6368
AUTH_EXPORT void infoob_add_str_generic(object_t *obj, const char *fieldname, const char *value)
Adds a value to a system object.
Definition: infoob.c:338
AUTH_EXPORT int auth_eject_sessions_by_machine_id(user_t *user, int num, char *machine_id)
Eject sessions based on the username by machine id.
Definition: auth.c:2393
Structure passed between invalidation routines.
Definition: rttpd.h:568
char type
Definition: rttpd.h:513
#define SESSION_ID_LEN_MAX
Definition: rttpd.h:483
void * auth
Definition: rttpd.h:544
AUTH_EXPORT void auth_session_throttle(char *session_id, char *command)
Throttle a users' session.
Definition: auth.c:2576