]> granicus.if.org Git - postgresql/blob - src/include/libpq/hba.h
Allow LDAP authentication to operate in search+bind mode, meaning it
[postgresql] / src / include / libpq / hba.h
1 /*-------------------------------------------------------------------------
2  *
3  * hba.h
4  *        Interface to hba.c
5  *
6  *
7  * $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.60 2009/12/12 21:35:21 mha Exp $
8  *
9  *-------------------------------------------------------------------------
10  */
11 #ifndef HBA_H
12 #define HBA_H
13
14 #include "nodes/pg_list.h"
15 #include "libpq/pqcomm.h"
16
17
18 typedef enum UserAuth
19 {
20         uaReject,
21         uaKrb5,
22         uaTrust,
23         uaIdent,
24         uaPassword,
25         uaMD5,
26         uaGSS,
27         uaSSPI,
28         uaPAM,
29         uaLDAP,
30         uaCert
31 } UserAuth;
32
33 typedef enum IPCompareMethod
34 {
35         ipCmpMask,
36         ipCmpSameHost,
37         ipCmpSameNet
38 } IPCompareMethod;
39
40 typedef enum ConnType
41 {
42         ctLocal,
43         ctHost,
44         ctHostSSL,
45         ctHostNoSSL
46 } ConnType;
47
48 typedef struct
49 {
50         int                     linenumber;
51         ConnType        conntype;
52         char       *database;
53         char       *role;
54         struct sockaddr_storage addr;
55         struct sockaddr_storage mask;
56         IPCompareMethod ip_cmp_method;
57         UserAuth        auth_method;
58
59         char       *usermap;
60         char       *pamservice;
61         bool            ldaptls;
62         char       *ldapserver;
63         int                     ldapport;
64         char       *ldapbinddn;
65         char       *ldapbindpasswd;
66         char       *ldapsearchattribute;
67         char       *ldapbasedn;
68         char       *ldapprefix;
69         char       *ldapsuffix;
70         bool            clientcert;
71         char       *krb_server_hostname;
72         char       *krb_realm;
73         bool            include_realm;
74 } HbaLine;
75
76 /* kluge to avoid including libpq/libpq-be.h here */
77 typedef struct Port hbaPort;
78
79 extern bool load_hba(void);
80 extern void load_ident(void);
81 extern int      hba_getauthmethod(hbaPort *port);
82 extern int check_usermap(const char *usermap_name,
83                           const char *pg_role, const char *auth_user,
84                           bool case_sensitive);
85 extern bool pg_isblank(const char c);
86
87 #endif   /* HBA_H */