MXS-2574: Add PATCH for /users/inet endpoint

The alteration of user passwords is now done inside MaxScale. This
prevents the possibility of a user locking themselves out.
This commit is contained in:
Markus Mäkelä
2019-06-24 14:44:11 +03:00
parent 77671a2393
commit aac0ecc373
9 changed files with 115 additions and 13 deletions

View File

@ -327,6 +327,13 @@ bool users_find(USERS* users, const char* user)
return u->get(user);
}
bool users_change_password(USERS* users, const char* user, const char* password)
{
Users* u = reinterpret_cast<Users*>(users);
UserInfo info;
return u->get(user, &info) && u->remove(user) && u->add(user, password, info.permissions);
}
bool users_auth(USERS* users, const char* user, const char* password)
{
Users* u = reinterpret_cast<Users*>(users);