7#include <bsoncxx/json.hpp>
8#include <bsoncxx/types.hpp>
9#include <mongocxx/client.hpp>
10#include <mongocxx/stdx.hpp>
11#include <mongocxx/uri.hpp>
12#include <mongocxx/instance.hpp>
13#include <bsoncxx/builder/stream/helpers.hpp>
14#include <bsoncxx/builder/stream/document.hpp>
15#include <bsoncxx/builder/stream/array.hpp>
22using bsoncxx::builder::stream::close_array;
23using bsoncxx::builder::stream::close_document;
24using bsoncxx::builder::stream::document;
25using bsoncxx::builder::stream::finalize;
26using bsoncxx::builder::stream::open_array;
27using bsoncxx::builder::stream::open_document;
28using bsoncxx::document::value;
29using bsoncxx::document::view;
30using bsoncxx::document::element;
35 bool authenticateUser(std::string username, std::string password, std::string databaseUrl, mongocxx::client& adminClient);
37 bool registerUser(std::string username, std::string password, mongocxx::client& adminClient, std::string oldSettingsCollectionName =
"");
45 std::vector<User>
getAllUsers(mongocxx::client& adminClient);
48 bool removeUser(
User& userToBeDeleted, mongocxx::client& adminClient);
54 bool changeUserPassword(std::string username, std::string newPassword, mongocxx::client& adminClient);
56 bool updateUsername(std::string oldUsername, std::string newUsername, mongocxx::client& adminClient);
63 bool doesUserExist(
const std::string &userName, mongocxx::client& adminClient);
66 void removeTmpUser(std::string userName, mongocxx::client& adminClient);
std::map< int, std::string > users
Definition UserAPI.cpp:10
JSON document.
Definition JSON.h:276
Definition MongoUserFunctions.h:34
User getUserDataThroughId(std::string userId, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:225
bool authenticateUser(std::string username, std::string password, std::string databaseUrl, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:31
void createTmpUser(std::string userName, std::string userPWD, User &_loggedInUser, mongocxx::client &adminClient, ot::JsonDocument &json)
Definition MongoUserFunctions.cpp:516
size_t getAllUserCount(mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:271
std::vector< User > getAllUsers(mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:245
bool registerUser(std::string username, std::string password, mongocxx::client &adminClient, std::string oldSettingsCollectionName="")
Definition MongoUserFunctions.cpp:67
bool updateUsername(std::string oldUsername, std::string newUsername, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:454
bool removeUser(User &userToBeDeleted, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:281
std::string userToJson(User &user)
Definition MongoUserFunctions.cpp:493
bool updateUserUsernameByName(std::string oldUsername, std::string newUsername, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:380
bool updateUserUsernameById(std::string userId, std::string newUsername, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:341
bool changeUserPassword(std::string username, std::string newPassword, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:419
bool doesUserExist(const std::string &userName, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:324
std::string generateUserSettingsCollectionName(mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:166
std::string hashPassword(const std::string &password)
Definition MongoUserFunctions.cpp:154
User getUserDataThroughUsername(const std::string &username, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:204
void removeTmpUser(std::string userName, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:547
std::string usersToJson(std::vector< User > &users)
Definition MongoUserFunctions.cpp:502