Like Bond, You Only Auth Once: move store cookie functionality to msgapi; this means queue & <unnamed agent> can share cookies

This commit is contained in:
alexhudson
2007-07-28 17:59:29 +00:00
parent c6e9f2f575
commit 067f347f44
3 changed files with 197 additions and 149 deletions
+13
View File
@@ -35,6 +35,19 @@ EXPORT BOOL MsgAuthVerifyPassword(const char *user, const char *password);
EXPORT BOOL MsgAuthSetPassword(const char *user, const char *oldpassword, const char *newpassword);
EXPORT BOOL MsgAuthGetUserStore(const char *user, struct sockaddr_in *store);
// Auth / cookie functions
#define MSGAUTH_COOKIE_LEN 32
typedef struct {
char token[MSGAUTH_COOKIE_LEN];
uint64_t expiration;
} MsgAuthCookie;
EXPORT BOOL MsgAuthCreateCookie(const char *username, MsgAuthCookie *cookie, uint64_t timeout);
EXPORT int MsgAuthFindCookie(const char *username, const char *token);
EXPORT BOOL MsgAuthDeleteCookie(const char *username, const char *token);
// Misc. util functions
EXPORT BOOL MsgSetRecoveryFlag(void);