~ubuntu-branches/ubuntu/trusty/haproxy/trusty-updates

« back to all changes in this revision

Viewing changes to include/types/auth.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2010-04-15 20:00:34 UTC
  • mfrom: (1.2.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20100415200034-mtlky4sy39tk0dfi
Tags: upstream-1.4.4
ImportĀ upstreamĀ versionĀ 1.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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
 
 
25
enum {
 
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
 
 
35
struct req_acl_rule {
 
36
        struct list list;
 
37
        struct acl_cond *cond;                  /* acl condition to meet */
 
38
        unsigned int action;
 
39
        struct {
 
40
                char *realm;
 
41
        } http_auth;
 
42
};
 
43
 
 
44
struct 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;
 
51
        } u;
 
52
};
 
53
 
 
54
struct 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