Mercurial > dovecot > core-2.2
annotate src/auth/auth-request-handler.h @ 22614:cf66220d281e
doveadm proxy: Don't crash if remote doesn't support log proxying
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sat, 14 Oct 2017 12:54:18 +0300 |
parents | 1b966650aef9 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
4906
diff
changeset
|
1 #ifndef AUTH_REQUEST_HANDLER_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
4906
diff
changeset
|
2 #define AUTH_REQUEST_HANDLER_H |
3074 | 3 |
3077
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
4 struct auth_request; |
19925
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
5 struct auth_client_connection; |
3308
3f090bcaffcc
Allow multiple master connections for a single listener.
Timo Sirainen <tss@iki.fi>
parents:
3166
diff
changeset
|
6 struct auth_master_connection; |
7388
08d31d752893
Use auth-stream API to build all TAB-delimited strings to make sure strings
Timo Sirainen <tss@iki.fi>
parents:
7088
diff
changeset
|
7 struct auth_stream_reply; |
3077
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
8 |
11497
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
9 enum auth_client_result { |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
10 AUTH_CLIENT_RESULT_CONTINUE = 1, |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
11 AUTH_CLIENT_RESULT_SUCCESS, |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
12 AUTH_CLIENT_RESULT_FAILURE |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
13 }; |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
14 |
7388
08d31d752893
Use auth-stream API to build all TAB-delimited strings to make sure strings
Timo Sirainen <tss@iki.fi>
parents:
7088
diff
changeset
|
15 typedef void |
19925
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
16 auth_client_request_callback_t(const char *reply, struct auth_client_connection *conn); |
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
17 typedef void |
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
18 auth_master_request_callback_t(const char *reply, struct auth_master_connection *conn); |
3074 | 19 |
20 struct auth_request_handler * | |
19925
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
21 auth_request_handler_create(bool token_auth, auth_client_request_callback_t *callback, |
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
22 struct auth_client_connection *conn, |
1b966650aef9
auth: Code cleanup - avoid using void *context
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
15682
diff
changeset
|
23 auth_master_request_callback_t *master_callback); |
14921
d3db2ba15d00
Removed CONTEXT_TYPE_SAFETY macro and reimplemented its functionality better.
Timo Sirainen <tss@iki.fi>
parents:
13722
diff
changeset
|
24 |
12212
bc782780d0fe
auth: Don't assert-crash if a request still succeeds after its client connection is gone.
Timo Sirainen <tss@iki.fi>
parents:
11498
diff
changeset
|
25 void auth_request_handler_destroy(struct auth_request_handler **handler); |
11498
190a5278e58b
auth: Changed how auth deinitilization works.
Timo Sirainen <tss@iki.fi>
parents:
11497
diff
changeset
|
26 void auth_request_handler_unref(struct auth_request_handler **handler); |
190a5278e58b
auth: Changed how auth deinitilization works.
Timo Sirainen <tss@iki.fi>
parents:
11497
diff
changeset
|
27 void auth_request_handler_abort_requests(struct auth_request_handler *handler); |
11441
3ef582c3fb72
auth: Aborting pending async requests on deinit caused crashes.
Timo Sirainen <tss@iki.fi>
parents:
11354
diff
changeset
|
28 |
3077
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
29 void auth_request_handler_set(struct auth_request_handler *handler, |
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
30 unsigned int connect_uid, |
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
31 unsigned int client_pid); |
eb46a5dee02d
Changed the way multiple auth processes are handled. It no longer uses a pid
Timo Sirainen <tss@iki.fi>
parents:
3074
diff
changeset
|
32 |
10903
6e639833c3fc
auth: Initial support for per-protocol auth settings.
Timo Sirainen <tss@iki.fi>
parents:
10894
diff
changeset
|
33 bool auth_request_handler_auth_begin(struct auth_request_handler *handler, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3518
diff
changeset
|
34 const char *args); |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3518
diff
changeset
|
35 bool auth_request_handler_auth_continue(struct auth_request_handler *handler, |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3518
diff
changeset
|
36 const char *args); |
11497
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
37 void auth_request_handler_reply(struct auth_request *request, |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
38 enum auth_client_result result, |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
39 const void *reply, size_t reply_size); |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
40 void auth_request_handler_reply_continue(struct auth_request *request, |
94f78f415811
auth: Removed unnecessary auth_request callback and context uses.
Timo Sirainen <tss@iki.fi>
parents:
11456
diff
changeset
|
41 const void *reply, size_t reply_size); |
13722
2ecd0e90402a
auth: Log a warning if auth client disconnects while it still has pending requests.
Timo Sirainen <tss@iki.fi>
parents:
12212
diff
changeset
|
42 unsigned int |
2ecd0e90402a
auth: Log a warning if auth client disconnects while it still has pending requests.
Timo Sirainen <tss@iki.fi>
parents:
12212
diff
changeset
|
43 auth_request_handler_get_request_count(struct auth_request_handler *handler); |
11285
1a3c9bd45b11
auth: Separate auth and login connections. Non-login requests are freed immediately after auth finished.
Timo Sirainen <tss@iki.fi>
parents:
10903
diff
changeset
|
44 bool auth_request_handler_master_request(struct auth_request_handler *handler, |
3308
3f090bcaffcc
Allow multiple master connections for a single listener.
Timo Sirainen <tss@iki.fi>
parents:
3166
diff
changeset
|
45 struct auth_master_connection *master, |
15049
aa6027a0a78e
Added support to perform token-based service process authentication.
Stephan Bosch <stephan@rename-it.nl>
parents:
14921
diff
changeset
|
46 unsigned int id, unsigned int client_id, |
aa6027a0a78e
Added support to perform token-based service process authentication.
Stephan Bosch <stephan@rename-it.nl>
parents:
14921
diff
changeset
|
47 const char *const *params); |
11354
f70433791464
login: Tell auth process to free aborted auth requests.
Timo Sirainen <tss@iki.fi>
parents:
11285
diff
changeset
|
48 void auth_request_handler_cancel_request(struct auth_request_handler *handler, |
f70433791464
login: Tell auth process to free aborted auth requests.
Timo Sirainen <tss@iki.fi>
parents:
11285
diff
changeset
|
49 unsigned int client_id); |
3074 | 50 |
7088
958500009336
Make sure failed auth requests stay in failure buffer for at least a second.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
51 void auth_request_handler_flush_failures(bool flush_all); |
3074 | 52 |
3166
e6a487d80288
Restructuring of auth code. Balancer auth processes were a bad idea. Usually
Timo Sirainen <tss@iki.fi>
parents:
3077
diff
changeset
|
53 void auth_request_handler_init(void); |
e6a487d80288
Restructuring of auth code. Balancer auth processes were a bad idea. Usually
Timo Sirainen <tss@iki.fi>
parents:
3077
diff
changeset
|
54 void auth_request_handler_deinit(void); |
3074 | 55 |
56 #endif |