blob: f7e3dd641d90d5beb6deb7ea08b5b531a56f01bb [file] [log] [blame]
Krzysztof Piotr Oledzki96105042010-01-29 17:50:44 +01001/*
2 * User authentication & authorization.
3 *
4 * Copyright 2010 Krzysztof Piotr Oledzki <ole@ans.pl>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#ifndef _TYPES_AUTH_H
14#define _TYPES_AUTH_H
15
16#include <common/config.h>
17#include <common/mini-clist.h>
18
19#include <types/auth.h>
20
21#define MAX_AUTH_GROUPS (unsigned int)(sizeof(int)*8)
22
23#define AU_O_INSECURE 0x00000001 /* insecure, unencrypted password */
24
25enum {
26 PR_REQ_ACL_ACT_UNKNOWN = 0,
27 PR_REQ_ACL_ACT_ALLOW,
28 PR_REQ_ACL_ACT_DENY,
29 PR_REQ_ACL_ACT_HTTP_AUTH,
30
31 PR_REQ_ACL_ACT_MAX
32};
33
34
35struct req_acl_rule {
36 struct list list;
37 struct acl_cond *cond; /* acl condition to meet */
38 unsigned int action;
Willy Tarreaub4c06b72010-02-02 11:28:20 +010039 struct {
40 char *realm;
41 } http_auth;
Krzysztof Piotr Oledzki96105042010-01-29 17:50:44 +010042};
43
44struct auth_users {
45 struct auth_users *next;
46 unsigned int flags;
47 char *user, *pass;
48 union {
49 char *groups;
50 unsigned int group_mask;
Willy Tarreaub4c06b72010-02-02 11:28:20 +010051 } u;
Krzysztof Piotr Oledzki96105042010-01-29 17:50:44 +010052};
53
54struct userlist {
55 struct userlist *next;
56 char *name;
57 struct auth_users *users;
58 int grpcnt;
59 char *groups[MAX_AUTH_GROUPS];
60 char **groupusers;
61};
62
63#endif /* _TYPES_AUTH_H */
64
65/*
66 * Local variables:
67 * c-indent-level: 8
68 * c-basic-offset: 8
69 * End:
70 */
71