aboutsummaryrefslogtreecommitdiff
path: root/src/include/libpq/auth.h
blob: 6a4160e65df0b8c911370ee9a4fb7e3ae142b92a (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*-------------------------------------------------------------------------
 *
 * auth.h--
 *	  Definitions for network authentication routines
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
 * $Id: auth.h,v 1.7 1997/09/08 21:52:28 momjian Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef AUTH_H
#define AUTH_H

#include <libpq/pqcomm.h>

/*----------------------------------------------------------------
 * Common routines and definitions
 *----------------------------------------------------------------
 */

/* what we call "no authentication system" */
#define UNAUTHNAME				"unauth"

/* what a frontend uses by default */
#if !defined(KRB4) && !defined(KRB5)
#define DEFAULT_CLIENT_AUTHSVC	UNAUTHNAME
#else							/* KRB4 || KRB5 */
#define DEFAULT_CLIENT_AUTHSVC	"kerberos"
#endif							/* KRB4 || KRB5 */

extern int	fe_sendauth(MsgType msgtype, Port *port, char *hostname);
extern void fe_setauthsvc(char *name);
extern MsgType fe_getauthsvc();
extern char *fe_getauthname(void);
extern int	be_recvauth(MsgType msgtype, Port *port, char *username, StartupInfo *sp);
extern void be_setauthsvc(char *name);

/* the value that matches any dbName value when doing
   host based authentication*/
#define ALL_DBNAME		"*"

#define PG_KRB4_VERSION "PGVER4.1"		/* at most KRB_SENDAUTH_VLEN chars */
#define PG_KRB5_VERSION "PGVER5.1"

#endif							/* AUTH_H */