MXS-1220: Add creation and deletion of admin users

Admin users can now be created via the REST API. This allows remote
management of the administrative interface itself.
This commit is contained in:
Markus Mäkelä
2017-05-20 08:18:25 +03:00
parent ead9059eeb
commit 1067fd352c
8 changed files with 234 additions and 13 deletions

View File

@ -18,6 +18,7 @@
#include <maxscale/cdefs.h>
#include <maxscale/adminusers.h>
#include <maxscale/monitor.h>
#include <maxscale/server.h>
#include <maxscale/service.h>
@ -264,4 +265,23 @@ bool runtime_alter_logs_from_json(json_t* json);
*/
json_t* runtime_get_json_error();
/**
* @brief Create a new user account
*
* @param json JSON defining the user
*
* @return True if the user was successfully created
*/
bool runtime_create_user_from_json(json_t* json);
/**
* @brief Remove admin user
*
* @param id Username of the network user
* @param type USER_TYPE_INET for network user and USER_TYPE_UNIX for enabled accounts
*
* @return True if user was successfully removed
*/
bool runtime_remove_user(const char* id, enum user_type type);
MXS_END_DECLS