Implement user password interface

provides a minimal implementation of Password.interface

Change-Id: I3041b6425b76f931dbb8d7e4b7d192e98d70aa23
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/mainapp.cpp b/mainapp.cpp
index 1f450ac..04c7825 100644
--- a/mainapp.cpp
+++ b/mainapp.cpp
@@ -13,8 +13,36 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <string>
+#include "user.hpp"
+#include "config.h"
+
+// D-Bus root for user manager
+constexpr auto USER_MANAGER_ROOT = "/xyz/openbmc_project/user";
 
 int main(int argc, char** argv)
 {
+    auto bus = sdbusplus::bus::new_default();
+
+    // This is hard coded "root" user.
+    // TODO: This would need to be changed when the complete
+    //       user management code is written. May be, have manager
+    //       create these user objects.
+    //       Issue: openbmc/openbmc#2299
+    auto objPath = std::string{USER_MANAGER_ROOT} + '/' + "root";
+
+    sdbusplus::server::manager::manager objManager(bus, USER_MANAGER_ROOT);
+    phosphor::user::User user(bus, objPath.c_str());
+
+    // Claim the bus now
+    bus.request_name(USER_MANAGER_BUSNAME);
+
+    // Wait for client request
+    while(true)
+    {
+        // process dbus calls / signals discarding unhandled
+        bus.process_discard();
+        bus.wait();
+    }
     return 0;
 }