Remove middlewares

Middlewares, while kinda cool from an academic standpoint, make our
build times even worse than they already are.  Given that we only really
use 1 real middleware today (token auth) and it needs to move into the
parser mode anyway (for security limiting buffer sizes), we might as well
use this as an opportunity to delete some code.

Some other things that happen:
1. Persistent data now moves out of the crow namespace
2. App is no longer a template
3. All request_routes implementations no longer become templates.  This
should be a decent (unmeasured) win on compile times.

This commit was part of a commit previously called "various cleanups".
This separates ONLY the middleware deletion part of that.

Note, this also deletes about 400 lines of hard to understand code.

Change-Id: I4c19e25491a153a2aa2e4ef46fc797bcb5b3581a
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 8ef1434..0522149 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -19,6 +19,7 @@
 #include <dbus_utility.hpp>
 #include <error_messages.hpp>
 #include <openbmc_dbus_rest.hpp>
+#include <persistent_data.hpp>
 #include <utils/json_utils.hpp>
 
 #include <variant>
@@ -556,7 +557,7 @@
 class AccountService : public Node
 {
   public:
-    AccountService(CrowApp& app) :
+    AccountService(App& app) :
         Node(app, "/redfish/v1/AccountService/"), app(app)
     {
         entityPrivileges = {
@@ -909,9 +910,8 @@
         }
 
         // Make a copy of methods configuration
-        crow::persistent_data::AuthConfigMethods authMethodsConfig =
-            crow::persistent_data::SessionStore::getInstance()
-                .getAuthMethodsConfig();
+        persistent_data::AuthConfigMethods authMethodsConfig =
+            persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
 
         if (basicAuth)
         {
@@ -948,11 +948,10 @@
             return;
         }
 
-        crow::persistent_data::SessionStore::getInstance()
-            .updateAuthMethodsConfig(authMethodsConfig);
+        persistent_data::SessionStore::getInstance().updateAuthMethodsConfig(
+            authMethodsConfig);
         // Save configuration immediately
-        app.template getMiddleware<crow::persistent_data::Middleware>()
-            .writeData();
+        persistent_data::getConfig().writeData();
 
         messages::success(asyncResp->res);
     }
@@ -1126,9 +1125,8 @@
     void doGet(crow::Response& res, const crow::Request& req,
                const std::vector<std::string>& params) override
     {
-        const crow::persistent_data::AuthConfigMethods& authMethodsConfig =
-            crow::persistent_data::SessionStore::getInstance()
-                .getAuthMethodsConfig();
+        const persistent_data::AuthConfigMethods& authMethodsConfig =
+            persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
 
         auto asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue = {
@@ -1315,13 +1313,13 @@
         }
     }
 
-    CrowApp& app;
+    App& app;
 };
 
 class AccountsCollection : public Node
 {
   public:
-    AccountsCollection(CrowApp& app) :
+    AccountsCollection(App& app) :
         Node(app, "/redfish/v1/AccountService/Accounts/")
     {
         entityPrivileges = {
@@ -1510,7 +1508,7 @@
 class ManagerAccount : public Node
 {
   public:
-    ManagerAccount(CrowApp& app) :
+    ManagerAccount(App& app) :
         Node(app, "/redfish/v1/AccountService/Accounts/<str>/", std::string())
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index 0a0effa..b997ad4 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -11,7 +11,7 @@
 class BiosService : public Node
 {
   public:
-    BiosService(CrowApp& app) : Node(app, "/redfish/v1/Systems/system/Bios/")
+    BiosService(App& app) : Node(app, "/redfish/v1/Systems/system/Bios/")
     {
         entityPrivileges = {{boost::beast::http::verb::get, {{"Login"}}}};
     }
@@ -43,7 +43,7 @@
 class BiosReset : public Node
 {
   public:
-    BiosReset(CrowApp& app) :
+    BiosReset(App& app) :
         Node(app, "/redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios/")
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 7a94935..6ade4e5 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -52,8 +52,7 @@
 class CertificateService : public Node
 {
   public:
-    CertificateService(CrowApp& app) :
-        Node(app, "/redfish/v1/CertificateService/")
+    CertificateService(App& app) : Node(app, "/redfish/v1/CertificateService/")
     {
         // TODO: Issue#61 No entries are available for Certificate
         // service at https://www.dmtf.org/standards/redfish
@@ -249,7 +248,7 @@
 class CertificateActionGenerateCSR : public Node
 {
   public:
-    CertificateActionGenerateCSR(CrowApp& app) :
+    CertificateActionGenerateCSR(App& app) :
         Node(app, "/redfish/v1/CertificateService/Actions/"
                   "CertificateService.GenerateCSR/")
     {
@@ -687,7 +686,7 @@
 class CertificateActionsReplaceCertificate : public Node
 {
   public:
-    CertificateActionsReplaceCertificate(CrowApp& app) :
+    CertificateActionsReplaceCertificate(App& app) :
         Node(app, "/redfish/v1/CertificateService/Actions/"
                   "CertificateService.ReplaceCertificate/")
     {
@@ -812,8 +811,7 @@
 class HTTPSCertificate : public Node
 {
   public:
-    template <typename CrowApp>
-    HTTPSCertificate(CrowApp& app) :
+    HTTPSCertificate(App& app) :
         Node(app,
              "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/"
              "<str>/",
@@ -858,8 +856,7 @@
 class HTTPSCertificateCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    HTTPSCertificateCollection(CrowApp& app) :
+    HTTPSCertificateCollection(App& app) :
         Node(app,
              "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/")
     {
@@ -970,8 +967,7 @@
 class CertificateLocations : public Node
 {
   public:
-    template <typename CrowApp>
-    CertificateLocations(CrowApp& app) :
+    CertificateLocations(App& app) :
         Node(app, "/redfish/v1/CertificateService/CertificateLocations/")
     {
         entityPrivileges = {
@@ -1061,8 +1057,7 @@
 class LDAPCertificateCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    LDAPCertificateCollection(CrowApp& app) :
+    LDAPCertificateCollection(App& app) :
         Node(app, "/redfish/v1/AccountService/LDAP/Certificates/")
     {
         entityPrivileges = {
@@ -1165,8 +1160,7 @@
 class LDAPCertificate : public Node
 {
   public:
-    template <typename CrowApp>
-    LDAPCertificate(CrowApp& app) :
+    LDAPCertificate(App& app) :
         Node(app, "/redfish/v1/AccountService/LDAP/Certificates/<str>/",
              std::string())
     {
@@ -1206,8 +1200,7 @@
 class TrustStoreCertificateCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    TrustStoreCertificateCollection(CrowApp& app) :
+    TrustStoreCertificateCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/Truststore/Certificates/")
     {
         entityPrivileges = {
@@ -1311,8 +1304,7 @@
 class TrustStoreCertificate : public Node
 {
   public:
-    template <typename CrowApp>
-    TrustStoreCertificate(CrowApp& app) :
+    TrustStoreCertificate(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/Truststore/Certificates/<str>/",
              std::string())
     {
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 7a7748a..ce0a8c1 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -160,7 +160,7 @@
 class ChassisCollection : public Node
 {
   public:
-    ChassisCollection(CrowApp& app) : Node(app, "/redfish/v1/Chassis/")
+    ChassisCollection(App& app) : Node(app, "/redfish/v1/Chassis/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -227,8 +227,7 @@
 class Chassis : public Node
 {
   public:
-    Chassis(CrowApp& app) :
-        Node(app, "/redfish/v1/Chassis/<str>/", std::string())
+    Chassis(App& app) : Node(app, "/redfish/v1/Chassis/<str>/", std::string())
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -556,7 +555,7 @@
 class ChassisResetAction : public Node
 {
   public:
-    ChassisResetAction(CrowApp& app) :
+    ChassisResetAction(App& app) :
         Node(app, "/redfish/v1/Chassis/<str>/Actions/Chassis.Reset/",
              std::string())
     {
@@ -605,7 +604,7 @@
     /*
      * Default Constructor
      */
-    ChassisResetActionInfo(CrowApp& app) :
+    ChassisResetActionInfo(App& app) :
         Node(app, "/redfish/v1/Chassis/<str>/ResetActionInfo/", std::string())
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/cpudimm.hpp b/redfish-core/lib/cpudimm.hpp
index 0ea5e87..0510f2b 100644
--- a/redfish-core/lib/cpudimm.hpp
+++ b/redfish-core/lib/cpudimm.hpp
@@ -1028,7 +1028,7 @@
     /*
      * Default Constructor
      */
-    ProcessorCollection(CrowApp& app) :
+    ProcessorCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/Processors/")
     {
         entityPrivileges = {
@@ -1066,7 +1066,7 @@
     /*
      * Default Constructor
      */
-    Processor(CrowApp& app) :
+    Processor(App& app) :
         Node(app, "/redfish/v1/Systems/system/Processors/<str>/", std::string())
     {
         entityPrivileges = {
@@ -1114,8 +1114,7 @@
     /*
      * Default Constructor
      */
-    MemoryCollection(CrowApp& app) :
-        Node(app, "/redfish/v1/Systems/system/Memory/")
+    MemoryCollection(App& app) : Node(app, "/redfish/v1/Systems/system/Memory/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -1149,7 +1148,7 @@
     /*
      * Default Constructor
      */
-    Memory(CrowApp& app) :
+    Memory(App& app) :
         Node(app, "/redfish/v1/Systems/system/Memory/<str>/", std::string())
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 21443f4..a47d4b1 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1003,8 +1003,7 @@
 class EthernetCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    EthernetCollection(CrowApp& app) :
+    EthernetCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/")
     {
         entityPrivileges = {
@@ -1076,8 +1075,7 @@
     /*
      * Default Constructor
      */
-    template <typename CrowApp>
-    EthernetInterface(CrowApp& app) :
+    EthernetInterface(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/",
              std::string())
     {
@@ -2066,8 +2064,7 @@
     /*
      * Default Constructor
      */
-    template <typename CrowApp>
-    VlanNetworkInterface(CrowApp& app) :
+    VlanNetworkInterface(App& app) :
         Node(app,
              "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/<str>/",
              std::string(), std::string())
@@ -2309,8 +2306,7 @@
 class VlanNetworkInterfaceCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    VlanNetworkInterfaceCollection(CrowApp& app) :
+    VlanNetworkInterfaceCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/",
              std::string())
     {
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index b532815..26cd80a 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -39,7 +39,7 @@
 class EventService : public Node
 {
   public:
-    EventService(CrowApp& app) : Node(app, "/redfish/v1/EventService/")
+    EventService(App& app) : Node(app, "/redfish/v1/EventService/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -153,7 +153,7 @@
 class SubmitTestEvent : public Node
 {
   public:
-    SubmitTestEvent(CrowApp& app) :
+    SubmitTestEvent(App& app) :
         Node(app,
              "/redfish/v1/EventService/Actions/EventService.SubmitTestEvent/")
     {
@@ -179,7 +179,7 @@
 class EventDestinationCollection : public Node
 {
   public:
-    EventDestinationCollection(CrowApp& app) :
+    EventDestinationCollection(App& app) :
         Node(app, "/redfish/v1/EventService/Subscriptions/")
     {
         entityPrivileges = {
@@ -450,7 +450,7 @@
 class EventServiceSSE : public Node
 {
   public:
-    EventServiceSSE(CrowApp& app) :
+    EventServiceSSE(App& app) :
         Node(app, "/redfish/v1/EventService/Subscriptions/SSE/")
     {
         entityPrivileges = {
@@ -555,7 +555,7 @@
 class EventDestination : public Node
 {
   public:
-    EventDestination(CrowApp& app) :
+    EventDestination(App& app) :
         Node(app, "/redfish/v1/EventService/Subscriptions/<str>/",
              std::string())
     {
diff --git a/redfish-core/lib/hypervisor_ethernet.hpp b/redfish-core/lib/hypervisor_ethernet.hpp
index bcd5afe..f0955b2 100644
--- a/redfish-core/lib/hypervisor_ethernet.hpp
+++ b/redfish-core/lib/hypervisor_ethernet.hpp
@@ -22,8 +22,7 @@
     /*
      * Default Constructor
      */
-    HypervisorSystem(CrowApp& app) :
-        Node(app, "/redfish/v1/Systems/hypervisor/")
+    HypervisorSystem(App& app) : Node(app, "/redfish/v1/Systems/hypervisor/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -78,8 +77,7 @@
 class HypervisorInterfaceCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    HypervisorInterfaceCollection(CrowApp& app) :
+    HypervisorInterfaceCollection(App& app) :
         Node(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/")
     {
         entityPrivileges = {
@@ -473,8 +471,7 @@
     /*
      * Default Constructor
      */
-    template <typename CrowApp>
-    HypervisorInterface(CrowApp& app) :
+    HypervisorInterface(App& app) :
         Node(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/<str>/",
              std::string())
     {
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index aed37b0..a884290 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -930,8 +930,7 @@
 class SystemLogServiceCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    SystemLogServiceCollection(CrowApp& app) :
+    SystemLogServiceCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/")
     {
         entityPrivileges = {
@@ -1011,8 +1010,7 @@
 class EventLogService : public Node
 {
   public:
-    template <typename CrowApp>
-    EventLogService(CrowApp& app) :
+    EventLogService(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/")
     {
         entityPrivileges = {
@@ -1051,7 +1049,7 @@
 class JournalEventLogClear : public Node
 {
   public:
-    JournalEventLogClear(CrowApp& app) :
+    JournalEventLogClear(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
                   "LogService.ClearLog/")
     {
@@ -1199,8 +1197,7 @@
 class JournalEventLogEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    JournalEventLogEntryCollection(CrowApp& app) :
+    JournalEventLogEntryCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Entries/")
     {
         entityPrivileges = {
@@ -1301,7 +1298,7 @@
 class JournalEventLogEntry : public Node
 {
   public:
-    JournalEventLogEntry(CrowApp& app) :
+    JournalEventLogEntry(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/EventLog/Entries/<str>/",
              std::string())
@@ -1378,8 +1375,7 @@
 class DBusEventLogEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    DBusEventLogEntryCollection(CrowApp& app) :
+    DBusEventLogEntryCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Entries/")
     {
         entityPrivileges = {
@@ -1519,7 +1515,7 @@
 class DBusEventLogEntry : public Node
 {
   public:
-    DBusEventLogEntry(CrowApp& app) :
+    DBusEventLogEntry(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/EventLog/Entries/<str>/",
              std::string())
@@ -1675,8 +1671,7 @@
 class BMCLogServiceCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    BMCLogServiceCollection(CrowApp& app) :
+    BMCLogServiceCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/")
     {
         entityPrivileges = {
@@ -1723,8 +1718,7 @@
 class BMCJournalLogService : public Node
 {
   public:
-    template <typename CrowApp>
-    BMCJournalLogService(CrowApp& app) :
+    BMCJournalLogService(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Journal/")
     {
         entityPrivileges = {
@@ -1804,8 +1798,7 @@
 class BMCJournalLogEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    BMCJournalLogEntryCollection(CrowApp& app) :
+    BMCJournalLogEntryCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/")
     {
         entityPrivileges = {
@@ -1908,7 +1901,7 @@
 class BMCJournalLogEntry : public Node
 {
   public:
-    BMCJournalLogEntry(CrowApp& app) :
+    BMCJournalLogEntry(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/<str>/",
              std::string())
     {
@@ -1995,8 +1988,7 @@
 class BMCDumpService : public Node
 {
   public:
-    template <typename CrowApp>
-    BMCDumpService(CrowApp& app) :
+    BMCDumpService(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/")
     {
         entityPrivileges = {
@@ -2039,8 +2031,7 @@
 class BMCDumpEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    BMCDumpEntryCollection(CrowApp& app) :
+    BMCDumpEntryCollection(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/")
     {
         entityPrivileges = {
@@ -2076,7 +2067,7 @@
 class BMCDumpEntry : public Node
 {
   public:
-    BMCDumpEntry(CrowApp& app) :
+    BMCDumpEntry(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/",
              std::string())
     {
@@ -2118,7 +2109,7 @@
 class BMCDumpCreate : public Node
 {
   public:
-    BMCDumpCreate(CrowApp& app) :
+    BMCDumpCreate(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/"
                   "Actions/Oem/"
                   "OemLogService.CollectDiagnosticData/")
@@ -2143,7 +2134,7 @@
 class BMCDumpEntryDownload : public Node
 {
   public:
-    BMCDumpEntryDownload(CrowApp& app) :
+    BMCDumpEntryDownload(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/attachment/<str>/",
              std::string())
     {
@@ -2173,7 +2164,7 @@
 class BMCDumpClear : public Node
 {
   public:
-    BMCDumpClear(CrowApp& app) :
+    BMCDumpClear(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/"
                   "Actions/"
                   "LogService.ClearLog/")
@@ -2198,8 +2189,7 @@
 class SystemDumpService : public Node
 {
   public:
-    template <typename CrowApp>
-    SystemDumpService(CrowApp& app) :
+    SystemDumpService(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Dump/")
     {
         entityPrivileges = {
@@ -2243,8 +2233,7 @@
 class SystemDumpEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    SystemDumpEntryCollection(CrowApp& app) :
+    SystemDumpEntryCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Dump/Entries/")
     {
         entityPrivileges = {
@@ -2280,7 +2269,7 @@
 class SystemDumpEntry : public Node
 {
   public:
-    SystemDumpEntry(CrowApp& app) :
+    SystemDumpEntry(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Dump/Entries/<str>/",
              std::string())
     {
@@ -2322,7 +2311,7 @@
 class SystemDumpCreate : public Node
 {
   public:
-    SystemDumpCreate(CrowApp& app) :
+    SystemDumpCreate(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Dump/"
                   "Actions/Oem/"
                   "OemLogService.CollectDiagnosticData/")
@@ -2347,7 +2336,7 @@
 class SystemDumpEntryDownload : public Node
 {
   public:
-    SystemDumpEntryDownload(CrowApp& app) :
+    SystemDumpEntryDownload(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Dump/attachment/<str>/",
              std::string())
@@ -2378,7 +2367,7 @@
 class SystemDumpClear : public Node
 {
   public:
-    SystemDumpClear(CrowApp& app) :
+    SystemDumpClear(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Dump/"
                   "Actions/"
                   "LogService.ClearLog/")
@@ -2403,8 +2392,7 @@
 class CrashdumpService : public Node
 {
   public:
-    template <typename CrowApp>
-    CrashdumpService(CrowApp& app) :
+    CrashdumpService(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Crashdump/")
     {
         // Note: Deviated from redfish privilege registry for GET & HEAD
@@ -2463,7 +2451,7 @@
 class CrashdumpClear : public Node
 {
   public:
-    CrashdumpClear(CrowApp& app) :
+    CrashdumpClear(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/"
                   "LogService.ClearLog/")
     {
@@ -2556,8 +2544,7 @@
 class CrashdumpEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    CrashdumpEntryCollection(CrowApp& app) :
+    CrashdumpEntryCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/")
     {
         // Note: Deviated from redfish privilege registry for GET & HEAD
@@ -2642,7 +2629,7 @@
 class CrashdumpEntry : public Node
 {
   public:
-    CrashdumpEntry(CrowApp& app) :
+    CrashdumpEntry(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/<str>/",
              std::string())
@@ -2676,7 +2663,7 @@
 class CrashdumpFile : public Node
 {
   public:
-    CrashdumpFile(CrowApp& app) :
+    CrashdumpFile(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/<str>/"
              "<str>/",
@@ -2779,7 +2766,7 @@
 class OnDemandCrashdump : public Node
 {
   public:
-    OnDemandCrashdump(CrowApp& app) :
+    OnDemandCrashdump(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
              "Crashdump.OnDemand/")
@@ -2851,7 +2838,7 @@
 class TelemetryCrashdump : public Node
 {
   public:
-    TelemetryCrashdump(CrowApp& app) :
+    TelemetryCrashdump(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
              "Crashdump.Telemetry/")
@@ -2923,7 +2910,7 @@
 class SendRawPECI : public Node
 {
   public:
-    SendRawPECI(CrowApp& app) :
+    SendRawPECI(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
              "Crashdump.SendRawPeci/")
@@ -3020,7 +3007,7 @@
 class DBusLogServiceActionsClear : public Node
 {
   public:
-    DBusLogServiceActionsClear(CrowApp& app) :
+    DBusLogServiceActionsClear(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
                   "LogService.ClearLog/")
     {
@@ -3075,7 +3062,7 @@
 class PostCodesLogService : public Node
 {
   public:
-    PostCodesLogService(CrowApp& app) :
+    PostCodesLogService(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/PostCodes/")
     {
         entityPrivileges = {
@@ -3113,7 +3100,7 @@
 class PostCodesClear : public Node
 {
   public:
-    PostCodesClear(CrowApp& app) :
+    PostCodesClear(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/PostCodes/Actions/"
                   "LogService.ClearLog/")
     {
@@ -3392,8 +3379,7 @@
 class PostCodesEntryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    PostCodesEntryCollection(CrowApp& app) :
+    PostCodesEntryCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/")
     {
         entityPrivileges = {
@@ -3441,7 +3427,7 @@
 class PostCodesEntry : public Node
 {
   public:
-    PostCodesEntry(CrowApp& app) :
+    PostCodesEntry(App& app) :
         Node(app,
              "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/<str>/",
              std::string())
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index b65f89d..552c264 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -73,7 +73,7 @@
 class ManagerResetAction : public Node
 {
   public:
-    ManagerResetAction(CrowApp& app) :
+    ManagerResetAction(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/Actions/Manager.Reset/")
     {
         entityPrivileges = {
@@ -119,7 +119,7 @@
 class ManagerResetToDefaultsAction : public Node
 {
   public:
-    ManagerResetToDefaultsAction(CrowApp& app) :
+    ManagerResetToDefaultsAction(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults/")
     {
         entityPrivileges = {
@@ -194,7 +194,7 @@
     /*
      * Default Constructor
      */
-    ManagerResetActionInfo(CrowApp& app) :
+    ManagerResetActionInfo(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/ResetActionInfo/")
     {
         entityPrivileges = {
@@ -1659,10 +1659,10 @@
 class Manager : public Node
 {
   public:
-    Manager(CrowApp& app) : Node(app, "/redfish/v1/Managers/bmc/")
+    Manager(App& app) : Node(app, "/redfish/v1/Managers/bmc/")
     {
-        uuid = app.template getMiddleware<crow::persistent_data::Middleware>()
-                   .systemUuid;
+
+        uuid = persistent_data::getConfig().systemUuid;
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
             {boost::beast::http::verb::head, {{"Login"}}},
@@ -2076,7 +2076,7 @@
 class ManagerCollection : public Node
 {
   public:
-    ManagerCollection(CrowApp& app) : Node(app, "/redfish/v1/Managers/")
+    ManagerCollection(App& app) : Node(app, "/redfish/v1/Managers/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index 57e0ad2..63aa5f3 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -28,8 +28,7 @@
 class MessageRegistryFileCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    MessageRegistryFileCollection(CrowApp& app) :
+    MessageRegistryFileCollection(App& app) :
         Node(app, "/redfish/v1/Registries/")
     {
         entityPrivileges = {
@@ -71,8 +70,7 @@
 class MessageRegistryFile : public Node
 {
   public:
-    template <typename CrowApp>
-    MessageRegistryFile(CrowApp& app) :
+    MessageRegistryFile(App& app) :
         Node(app, "/redfish/v1/Registries/<str>/", std::string())
     {
         entityPrivileges = {
@@ -157,8 +155,7 @@
 class MessageRegistry : public Node
 {
   public:
-    template <typename CrowApp>
-    MessageRegistry(CrowApp& app) :
+    MessageRegistry(App& app) :
         Node(app, "/redfish/v1/Registries/<str>/<str>/", std::string(),
              std::string())
     {
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index b32fde1..3e48efb 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -130,7 +130,7 @@
 class NetworkProtocol : public Node
 {
   public:
-    NetworkProtocol(CrowApp& app) :
+    NetworkProtocol(App& app) :
         Node(app, "/redfish/v1/Managers/bmc/NetworkProtocol/")
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index ac2a2f9..e2f3591 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -72,8 +72,7 @@
 class SystemPCIeDeviceCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    SystemPCIeDeviceCollection(CrowApp& app) :
+    SystemPCIeDeviceCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/PCIeDevices/")
     {
         entityPrivileges = {
@@ -107,7 +106,7 @@
 class SystemPCIeDevice : public Node
 {
   public:
-    SystemPCIeDevice(CrowApp& app) :
+    SystemPCIeDevice(App& app) :
         Node(app, "/redfish/v1/Systems/system/PCIeDevices/<str>/",
              std::string())
     {
@@ -192,8 +191,7 @@
 class SystemPCIeFunctionCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    SystemPCIeFunctionCollection(CrowApp& app) :
+    SystemPCIeFunctionCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/",
              std::string())
     {
@@ -287,7 +285,7 @@
 class SystemPCIeFunction : public Node
 {
   public:
-    SystemPCIeFunction(CrowApp& app) :
+    SystemPCIeFunction(App& app) :
         Node(
             app,
             "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>/",
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 59492c3..544c42b 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -25,7 +25,7 @@
 class Power : public Node
 {
   public:
-    Power(CrowApp& app) :
+    Power(App& app) :
         Node((app), "/redfish/v1/Chassis/<str>/Power/", std::string())
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 8080e6f..e54492d 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -17,7 +17,7 @@
 
 #include "error_messages.hpp"
 #include "node.hpp"
-#include "persistent_data_middleware.hpp"
+#include "persistent_data.hpp"
 
 namespace redfish
 {
@@ -27,7 +27,7 @@
 class Sessions : public Node
 {
   public:
-    Sessions(CrowApp& app) :
+    Sessions(App& app) :
         Node(app, "/redfish/v1/SessionService/Sessions/<str>/", std::string())
     {
         entityPrivileges = {
@@ -46,7 +46,7 @@
     {
         // Note that control also reaches here via doPost and doDelete.
         auto session =
-            crow::persistent_data::SessionStore::getInstance().getSessionByUid(
+            persistent_data::SessionStore::getInstance().getSessionByUid(
                 params[0]);
 
         if (session == nullptr)
@@ -88,7 +88,7 @@
         }
 
         auto session =
-            crow::persistent_data::SessionStore::getInstance().getSessionByUid(
+            persistent_data::SessionStore::getInstance().getSessionByUid(
                 params[0]);
 
         if (session == nullptr)
@@ -117,8 +117,7 @@
         // DELETE should return representation of object that will be removed
         doGet(res, req, params);
 
-        crow::persistent_data::SessionStore::getInstance().removeSession(
-            session);
+        persistent_data::SessionStore::getInstance().removeSession(session);
     }
 
     /**
@@ -133,7 +132,7 @@
 class SessionCollection : public Node
 {
   public:
-    SessionCollection(CrowApp& app) :
+    SessionCollection(App& app) :
         Node(app, "/redfish/v1/SessionService/Sessions/"), memberSession(app)
     {
         entityPrivileges = {
@@ -150,8 +149,8 @@
                const std::vector<std::string>& params) override
     {
         std::vector<const std::string*> sessionIds =
-            crow::persistent_data::SessionStore::getInstance().getUniqueIds(
-                false, crow::persistent_data::PersistenceType::TIMEOUT);
+            persistent_data::SessionStore::getInstance().getUniqueIds(
+                false, persistent_data::PersistenceType::TIMEOUT);
 
         res.jsonValue["Members@odata.count"] = sessionIds.size();
         res.jsonValue["Members"] = nlohmann::json::array();
@@ -236,11 +235,10 @@
 #endif
 
         // User is authenticated - create session
-        std::shared_ptr<crow::persistent_data::UserSession> session =
-            crow::persistent_data::SessionStore::getInstance()
-                .generateUserSession(
-                    username, crow::persistent_data::PersistenceType::TIMEOUT,
-                    isConfigureSelfOnly, clientId, clientIp);
+        std::shared_ptr<persistent_data::UserSession> session =
+            persistent_data::SessionStore::getInstance().generateUserSession(
+                username, persistent_data::PersistenceType::TIMEOUT,
+                isConfigureSelfOnly, clientId, clientIp);
         res.addHeader("X-Auth-Token", session->sessionToken);
         res.addHeader("Location", "/redfish/v1/SessionService/Sessions/" +
                                       session->uniqueId);
@@ -264,7 +262,7 @@
 class SessionService : public Node
 {
   public:
-    SessionService(CrowApp& app) : Node(app, "/redfish/v1/SessionService/")
+    SessionService(App& app) : Node(app, "/redfish/v1/SessionService/")
     {
 
         entityPrivileges = {
@@ -286,8 +284,7 @@
         res.jsonValue["Id"] = "SessionService";
         res.jsonValue["Description"] = "Session Service";
         res.jsonValue["SessionTimeout"] =
-            crow::persistent_data::SessionStore::getInstance()
-                .getTimeoutInSeconds();
+            persistent_data::SessionStore::getInstance().getTimeoutInSeconds();
         res.jsonValue["ServiceEnabled"] = true;
 
         res.jsonValue["Sessions"] = {
diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp
index 7819be8..9c86d4b 100644
--- a/redfish-core/lib/roles.hpp
+++ b/redfish-core/lib/roles.hpp
@@ -73,7 +73,7 @@
 class Roles : public Node
 {
   public:
-    Roles(CrowApp& app) :
+    Roles(App& app) :
         Node(app, "/redfish/v1/AccountService/Roles/<str>/", std::string())
     {
         entityPrivileges = {
@@ -121,8 +121,7 @@
 class RoleCollection : public Node
 {
   public:
-    RoleCollection(CrowApp& app) :
-        Node(app, "/redfish/v1/AccountService/Roles/")
+    RoleCollection(App& app) : Node(app, "/redfish/v1/AccountService/Roles/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index f12bbe0..99a03c9 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2998,7 +2998,7 @@
 class SensorCollection : public Node
 {
   public:
-    SensorCollection(CrowApp& app) :
+    SensorCollection(App& app) :
         Node(app, "/redfish/v1/Chassis/<str>/Sensors/", std::string())
     {
         entityPrivileges = {
@@ -3069,7 +3069,7 @@
 class Sensor : public Node
 {
   public:
-    Sensor(CrowApp& app) :
+    Sensor(App& app) :
         Node(app, "/redfish/v1/Chassis/<str>/Sensors/<str>/", std::string(),
              std::string())
     {
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index b6bd6e0..52e899e 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -25,10 +25,9 @@
 class ServiceRoot : public Node
 {
   public:
-    ServiceRoot(CrowApp& app) : Node(app, "/redfish/v1/")
+    ServiceRoot(App& app) : Node(app, "/redfish/v1/")
     {
-        uuid = app.template getMiddleware<crow::persistent_data::Middleware>()
-                   .systemUuid;
+        uuid = persistent_data::getConfig().systemUuid;
         entityPrivileges = {
             {boost::beast::http::verb::get, {}},
             {boost::beast::http::verb::head, {}},
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 922d323..0114c4e 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -25,7 +25,7 @@
 class StorageCollection : public Node
 {
   public:
-    StorageCollection(CrowApp& app) :
+    StorageCollection(App& app) :
         Node(app, "/redfish/v1/Systems/system/Storage/")
     {
         entityPrivileges = {
@@ -54,7 +54,7 @@
 class Storage : public Node
 {
   public:
-    Storage(CrowApp& app) : Node(app, "/redfish/v1/Systems/system/Storage/1/")
+    Storage(App& app) : Node(app, "/redfish/v1/Systems/system/Storage/1/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -275,7 +275,7 @@
 class Drive : public Node
 {
   public:
-    Drive(CrowApp& app) :
+    Drive(App& app) :
         Node(app, "/redfish/v1/Systems/system/Storage/1/Drives/<str>/",
              std::string())
     {
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 2baeaa7..9ca95d5 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -1647,7 +1647,7 @@
 class SystemsCollection : public Node
 {
   public:
-    SystemsCollection(CrowApp& app) : Node(app, "/redfish/v1/Systems/")
+    SystemsCollection(App& app) : Node(app, "/redfish/v1/Systems/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -1704,7 +1704,7 @@
 class SystemActionsReset : public Node
 {
   public:
-    SystemActionsReset(CrowApp& app) :
+    SystemActionsReset(App& app) :
         Node(app, "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset/")
     {
         entityPrivileges = {
@@ -1867,7 +1867,7 @@
     /*
      * Default Constructor
      */
-    Systems(CrowApp& app) : Node(app, "/redfish/v1/Systems/system/")
+    Systems(App& app) : Node(app, "/redfish/v1/Systems/system/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -2048,7 +2048,7 @@
     /*
      * Default Constructor
      */
-    SystemResetActionInfo(CrowApp& app) :
+    SystemResetActionInfo(App& app) :
         Node(app, "/redfish/v1/Systems/system/ResetActionInfo/")
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index fb2d0be..1b9077d 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -244,7 +244,7 @@
 class TaskMonitor : public Node
 {
   public:
-    TaskMonitor(CrowApp& app) :
+    TaskMonitor(App& app) :
         Node((app), "/redfish/v1/TaskService/Tasks/<str>/Monitor/",
              std::string())
     {
@@ -301,7 +301,7 @@
 class Task : public Node
 {
   public:
-    Task(CrowApp& app) :
+    Task(App& app) :
         Node((app), "/redfish/v1/TaskService/Tasks/<str>/", std::string())
     {
         entityPrivileges = {
@@ -376,7 +376,7 @@
 class TaskCollection : public Node
 {
   public:
-    TaskCollection(CrowApp& app) : Node(app, "/redfish/v1/TaskService/Tasks/")
+    TaskCollection(App& app) : Node(app, "/redfish/v1/TaskService/Tasks/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -416,7 +416,7 @@
 class TaskService : public Node
 {
   public:
-    TaskService(CrowApp& app) : Node(app, "/redfish/v1/TaskService/")
+    TaskService(App& app) : Node(app, "/redfish/v1/TaskService/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 90ad3bb..84cef2b 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -24,7 +24,7 @@
 class Thermal : public Node
 {
   public:
-    Thermal(CrowApp& app) :
+    Thermal(App& app) :
         Node((app), "/redfish/v1/Chassis/<str>/Thermal/", std::string())
     {
         entityPrivileges = {
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 0b151d9..c695a9b 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -376,7 +376,7 @@
 class UpdateServiceActionsSimpleUpdate : public Node
 {
   public:
-    UpdateServiceActionsSimpleUpdate(CrowApp& app) :
+    UpdateServiceActionsSimpleUpdate(App& app) :
         Node(app,
              "/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate/")
     {
@@ -506,7 +506,7 @@
 class UpdateService : public Node
 {
   public:
-    UpdateService(CrowApp& app) : Node(app, "/redfish/v1/UpdateService/")
+    UpdateService(App& app) : Node(app, "/redfish/v1/UpdateService/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -685,8 +685,7 @@
 class SoftwareInventoryCollection : public Node
 {
   public:
-    template <typename CrowApp>
-    SoftwareInventoryCollection(CrowApp& app) :
+    SoftwareInventoryCollection(App& app) :
         Node(app, "/redfish/v1/UpdateService/FirmwareInventory/")
     {
         entityPrivileges = {
@@ -761,8 +760,7 @@
 class SoftwareInventory : public Node
 {
   public:
-    template <typename CrowApp>
-    SoftwareInventory(CrowApp& app) :
+    SoftwareInventory(App& app) :
         Node(app, "/redfish/v1/UpdateService/FirmwareInventory/<str>/",
              std::string())
     {
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index cd81857..dbe29b1 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -248,7 +248,7 @@
 class VirtualMediaActionInsertMedia : public Node
 {
   public:
-    VirtualMediaActionInsertMedia(CrowApp& app) :
+    VirtualMediaActionInsertMedia(App& app) :
         Node(app,
              "/redfish/v1/Managers/<str>/VirtualMedia/<str>/Actions/"
              "VirtualMedia.InsertMedia",
@@ -831,7 +831,7 @@
 class VirtualMediaActionEjectMedia : public Node
 {
   public:
-    VirtualMediaActionEjectMedia(CrowApp& app) :
+    VirtualMediaActionEjectMedia(App& app) :
         Node(app,
              "/redfish/v1/Managers/<str>/VirtualMedia/<str>/Actions/"
              "VirtualMedia.EjectMedia",
@@ -996,7 +996,7 @@
     /*
      * Default Constructor
      */
-    VirtualMediaCollection(CrowApp& app) :
+    VirtualMediaCollection(App& app) :
         Node(app, "/redfish/v1/Managers/<str>/VirtualMedia/", std::string())
     {
         entityPrivileges = {
@@ -1070,7 +1070,7 @@
     /*
      * Default Constructor
      */
-    VirtualMedia(CrowApp& app) :
+    VirtualMedia(App& app) :
         Node(app, "/redfish/v1/Managers/<str>/VirtualMedia/<str>/",
              std::string(), std::string())
     {