taskrambler  0.1.8
Web server and task management solution.
application.h
Go to the documentation of this file.
1 /**
2  * \file
3  *
4  * \author Georg Hopp
5  *
6  * \copyright
7  * Copyright © 2012 Georg Hopp
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef __APPLICATION_H__
24 #define __APPLICATION_H__
25 
26 #include <sys/types.h>
27 
28 #include "class.h"
29 
30 #include "session.h"
31 #include "hash.h"
32 #include "auth.h"
33 #include "auth/credential.h"
34 #include "storage/storage.h"
35 #include "session.h"
36 #include "user.h"
37 #include "uuid.h"
38 
39 
40 struct randval {
41  time_t timestamp;
42  int value;
43 };
44 
45 CLASS(Application) {
46  Hash * active_sessions;
47  time_t session_time_ofs;
48 
49  Auth auth;
50 
51  struct randval * val;
52 
53  Storage users;
54  Storage passwords;
55  Storage roles;
56 
57  Uuid user_namespace;
58 
59  Hash roles_user_index;
60  Hash roles_resource_index;
61 
62  const char * version;
63  const char * loc;
64 };
65 
66 int applicationLogin(Application, Credential, Session);
67 void applicationLogout(Application, Session);
68 Uuid applicationCreateUser(Application, Credential, User);
69 Uuid applicationUpdateUser(Application, User);
70 User applicationGetUser(Application, Uuid);
71 int applicationUpdatePassword(Application, Credential, User);
72 
73 Session applicationSessionStart(Application);
74 Session applicationSessionGet(Application, const char *);
75 void applicationSessionStop(Application, Session);
76 void applicationSessionCleanup(Application, time_t);
77 
78 #endif // __HTTP_HEADER_H__
79 
80 // vim: set ts=4 sw=4:
Session applicationSessionGet(Application, const char *)
Definition: session_get.c:36
time_t timestamp
Definition: application.h:41
CLASS(Application)
Definition: application.h:45
int applicationUpdatePassword(Application, Credential, User)
void applicationLogout(Application, Session)
Definition: logout.c:33
int value
Definition: application.h:42
Uuid applicationUpdateUser(Application, User)
Definition: update_user.c:43
void applicationSessionCleanup(Application, time_t)
void applicationSessionStop(Application, Session)
Definition: session_stop.c:35
Session applicationSessionStart(Application)
Definition: session_start.c:36
Uuid applicationCreateUser(Application, Credential, User)
Definition: create_user.c:43
int applicationLogin(Application, Credential, Session)
Definition: login.c:42
User applicationGetUser(Application, Uuid)
Definition: get_user.c:41