Local admins are the ones accessing MaxScale on the same host over a Unix domain socket, and who are strongly identified), and optional remote admins are the ones accessing MaxScale potentially over a tcp socket (potentially over the network), and who are weakly identified. These are completely separate and a different set of functions will be needed for managing them. This initial change merely renames the functions.
63 lines
1.6 KiB
C
63 lines
1.6 KiB
C
#ifndef _ADMINUSERS_H
|
|
#define _ADMINUSERS_H
|
|
/*
|
|
* Copyright (c) 2016 MariaDB Corporation Ab
|
|
*
|
|
* Use of this software is governed by the Business Source License included
|
|
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
|
*
|
|
* Change Date: 2019-01-01
|
|
*
|
|
* On the date above, in accordance with the Business Source License, use
|
|
* of this software will be governed by version 2 or later of the General
|
|
* Public License.
|
|
*/
|
|
|
|
/**
|
|
* @file adminusers.h - Administration users support routines
|
|
*
|
|
* @verbatim
|
|
* Revision History
|
|
*
|
|
* Date Who Description
|
|
* 18/07/13 Mark Riddoch Initial implementation
|
|
*
|
|
* @endverbatim
|
|
*/
|
|
#include <dcb.h>
|
|
|
|
#define ADMIN_SALT "$1$MXS"
|
|
|
|
/* Max length of fields in for admin users */
|
|
#define ADMIN_USER_MAXLEN 128
|
|
#define ADMIN_PASSWORD_MAXLEN 128
|
|
|
|
/** Default user for the administrative interface */
|
|
#define DEFAULT_ADMIN_USER "@DEFAULT_ADMIN_USER@"
|
|
|
|
/*
|
|
* MySQL session specific data
|
|
*
|
|
*/
|
|
typedef struct admin_session
|
|
{
|
|
#if defined(SS_DEBUG)
|
|
skygw_chk_t adminses_chk_top;
|
|
#endif
|
|
char user[ADMIN_USER_MAXLEN + 1]; /*< username */
|
|
bool validated; /* Was user validated? */
|
|
#if defined(SS_DEBUG)
|
|
skygw_chk_t adminses_chk_tail;
|
|
#endif
|
|
} ADMIN_session;
|
|
|
|
extern const char *admin_local_add_user(const char *uname);
|
|
extern const char *admin_local_remove_user(const char *uname);
|
|
extern bool admin_local_search_user(const char *uname);
|
|
|
|
extern bool admin_remote_verify(const char *uname, const char *password);
|
|
|
|
extern void dcb_PrintAdminUsers(DCB *dcb);
|
|
|
|
#endif
|