Revert "Redfish Session : Support ClientOriginIPAddress"

This reverts commit e436008377fbcf287be02c9e9e1b59c6627d7673.

Reason for revert:

This breaks several things.
1. Not all login endpoints are handled, which lead to returning blank ip addresses
2. IP addresses are not persisted.
3. This crashes occasionally on remote_endpoint, and ignores ec.

Change-Id: I58c875721cf48bf02db833c9c57a9eead5e249d5
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 302d19b..ec8e9d5 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -316,10 +316,6 @@
             }
         }
 
-        // Copy the client's IP address
-        req->ipAddress =
-            boost::beast::get_lowest_layer(adaptor).remote_endpoint().address();
-
         BMCWEB_LOG_INFO << "Request: "
                         << " " << this << " HTTP/" << req->version() / 10 << "."
                         << req->version() % 10 << ' ' << req->methodString()
diff --git a/http/http_request.hpp b/http/http_request.hpp
index d9d6cf7..e5c0c9e 100644
--- a/http/http_request.hpp
+++ b/http/http_request.hpp
@@ -4,7 +4,6 @@
 #include "sessions.hpp"
 
 #include <boost/asio/io_context.hpp>
-#include <boost/asio/ip/address.hpp>
 #include <boost/beast/http/message.hpp>
 #include <boost/beast/http/string_body.hpp>
 #include <boost/beast/websocket.hpp>
@@ -25,7 +24,6 @@
     const std::string& body;
 
     boost::asio::io_context* ioService{};
-    boost::asio::ip::address ipAddress;
 
     std::shared_ptr<persistent_data::UserSession> session;
 
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 1797ab9..e325989 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -60,15 +60,15 @@
         res.jsonValue["UserName"] = session->username;
         res.jsonValue["@odata.id"] =
             "/redfish/v1/SessionService/Sessions/" + session->uniqueId;
-        res.jsonValue["@odata.type"] = "#Session.v1_3_0.Session";
+        res.jsonValue["@odata.type"] = "#Session.v1_0_2.Session";
         res.jsonValue["Name"] = "User Session";
         res.jsonValue["Description"] = "Manager User Session";
-        res.jsonValue["ClientOriginIPAddress"] = session->clientIp;
         res.jsonValue["Oem"]["OpenBMC"]["@odata.type"] =
             "#OemSession.v1_0_0.Session";
 #ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
         res.jsonValue["Oem"]["OpenBMC"]["ClientID"] = session->clientId;
 #endif
+        res.jsonValue["Oem"]["OpenBMC"]["ClientOriginIP"] = session->clientIp;
         res.end();
     }
 
@@ -174,6 +174,7 @@
         std::string password;
         std::optional<nlohmann::json> oemObject;
         std::string clientId;
+        std::string clientIp;
         if (!json_util::readJson(req, res, "UserName", username, "Password",
                                  password, "Oem", oemObject))
         {
@@ -225,14 +226,12 @@
             }
         }
 #endif
-        BMCWEB_LOG_DEBUG << "Session created from IPAddress: "
-                         << req.ipAddress.to_string();
 
         // User is authenticated - create session
         std::shared_ptr<persistent_data::UserSession> session =
             persistent_data::SessionStore::getInstance().generateUserSession(
                 username, persistent_data::PersistenceType::TIMEOUT,
-                isConfigureSelfOnly, clientId, req.ipAddress.to_string());
+                isConfigureSelfOnly, clientId, clientIp);
         res.addHeader("X-Auth-Token", session->sessionToken);
         res.addHeader("Location", "/redfish/v1/SessionService/Sessions/" +
                                       session->uniqueId);
diff --git a/static/redfish/v1/JsonSchemas/OemSession/index.json b/static/redfish/v1/JsonSchemas/OemSession/index.json
index 8eefd95..c80e340 100644
--- a/static/redfish/v1/JsonSchemas/OemSession/index.json
+++ b/static/redfish/v1/JsonSchemas/OemSession/index.json
@@ -28,6 +28,12 @@
                     "readonly": true,
                     "type" : "string"
                 },
+                "ClientOriginIP" : {
+                     "description": "The IP address where the Session was created from.",
+                     "longDescription": "This property shall contain the IP address where the client created the session from.",
+                     "readonly": true,
+                     "type": "string"
+                },
             "type": "object"
             }
         }
diff --git a/static/redfish/v1/schema/OemSession_v1.xml b/static/redfish/v1/schema/OemSession_v1.xml
index f02f861..cc74848 100644
--- a/static/redfish/v1/schema/OemSession_v1.xml
+++ b/static/redfish/v1/schema/OemSession_v1.xml
@@ -32,6 +32,10 @@
               <Annotation Term="OData.Description" String="The Id of the client creating this session."/>
               <Annotation Term="OData.LongDescription" String="This will be the unique identifier set by the client."/>
             </Property>
+            <Property Name="ClientOriginIP" Type="Edm.String">
+              <Annotation Term="OData.Description" String="The IP address where the Session was created from."/>
+              <Annotation Term="OData.LongDescription" String="This property shall contain the IP address where the client created the session from."/>
+            </Property>
 
       </EntityType>
     </Schema>