summaryrefslogtreecommitdiffstats
path: root/src/lib-master/master-login-auth.h
blob: d08732b86d1076d9a6ed5b46e36f0defe438e032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef MASTER_LOGIN_AUTH_H
#define MASTER_LOGIN_AUTH_H

struct master_auth_request;

typedef void
master_login_auth_request_callback_t(const char *const *auth_args,
				     const char *errormsg, void *context);

struct master_login_auth *
master_login_auth_init(const char *auth_socket_path, bool request_auth_token);
void master_login_auth_deinit(struct master_login_auth **auth);
void master_login_auth_disconnect(struct master_login_auth *auth);

/* Set timeout for requests. */
void master_login_auth_set_timeout(struct master_login_auth *auth,
				   unsigned int msecs);

/* req has been sent by login process. this function finishes authentication
   by performing verifying from auth that req is valid and doing the userdb
   lookup. */
void master_login_auth_request(struct master_login_auth *auth,
			       const struct master_auth_request *req,
			       master_login_auth_request_callback_t *callback,
			       void *context);
unsigned int master_login_auth_request_count(struct master_login_auth *auth);

#endif