Serialization: Adding Serialization for MFA
This commit will add the persistency of Dbus properties related to MFA.
The configuration file will be stored under
/var/lib/usr_mgr.conf.
Change-Id: Ib7fdc467c7cb094d328ae670df3bb4352e4a7b91
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>
diff --git a/user_mgr.hpp b/user_mgr.hpp
index 624b2ba..b69cb87 100644
--- a/user_mgr.hpp
+++ b/user_mgr.hpp
@@ -14,6 +14,7 @@
// limitations under the License.
*/
#pragma once
+#include "json_serializer.hpp"
#include "users.hpp"
#include <boost/process/child.hpp>
@@ -278,6 +279,11 @@
bool skipSignal) override;
bool secretKeyRequired(std::string userName) override;
static std::vector<std::string> readAllGroupsOnSystem();
+ void load();
+ JsonSerializer& getSerializer()
+ {
+ return serializer;
+ }
protected:
/** @brief get pam argument value
@@ -441,6 +447,8 @@
/** @brief object path */
const std::string path;
+ /** @brief serializer for mfa */
+ JsonSerializer serializer;
/** @brief privilege manager container */
const std::vector<std::string> privMgr = {"priv-admin", "priv-operator",
"priv-user"};
@@ -449,8 +457,8 @@
std::vector<std::string> groupsMgr;
/** @brief map container to hold users object */
- using UserName = std::string;
- std::unordered_map<UserName, std::unique_ptr<phosphor::user::Users>>
+
+ std::unordered_map<std::string, std::unique_ptr<phosphor::user::Users>>
usersList;
/** @brief get users in group