Remove proprietary OEMSession support

Per https://gerrit.openbmc.org/c/openbmc/bmcweb/+/56088, this feature
would be supported to the end of 2022, at which point people will have
moved over to the standard Context parameter in the DMTF-published
Session schema.

Tested: Code removal. Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I0ae832bde740b025150242085bf1d2909ed1ec21
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index b3b4e7a..5ae6674 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -41,12 +41,6 @@
     {
         res.jsonValue["Context"] = *session.clientId;
     }
-// The below implementation is deprecated in leiu of Session.Context
-#ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
-    res.jsonValue["Oem"]["OpenBMC"]["@odata.type"] =
-        "#OemSession.v1_0_0.Session";
-    res.jsonValue["Oem"]["OpenBMC"]["ClientID"] = session.clientId.value_or("");
-#endif
 }
 
 inline void
@@ -190,11 +184,9 @@
     }
     std::string username;
     std::string password;
-    std::optional<nlohmann::json> oemObject;
     std::optional<std::string> clientId;
     if (!json_util::readJsonPatch(req, asyncResp->res, "UserName", username,
-                                  "Password", password, "Context", clientId,
-                                  "Oem", oemObject))
+                                  "Password", password, "Context", clientId))
     {
         return;
     }
@@ -223,33 +215,6 @@
                                             "Invalid username or password");
         return;
     }
-#ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
-    if (oemObject)
-    {
-        std::optional<nlohmann::json> bmcOem;
-        if (!json_util::readJson(*oemObject, asyncResp->res, "OpenBMC", bmcOem))
-        {
-            return;
-        }
-
-        std::optional<std::string> oemClientId;
-        if (!json_util::readJson(*bmcOem, asyncResp->res, "ClientID",
-                                 oemClientId))
-        {
-            BMCWEB_LOG_ERROR << "Could not read ClientId";
-            return;
-        }
-        if (oemClientId)
-        {
-            if (clientId)
-            {
-                messages::propertyValueConflict(*oemClientId, *clientId);
-                return;
-            }
-            clientId = *oemClientId;
-        }
-    }
-#endif
 
     // User is authenticated - create session
     std::shared_ptr<persistent_data::UserSession> session =
diff --git a/static/redfish/v1/JsonSchemas/OemSession/index.json b/static/redfish/v1/JsonSchemas/OemSession/index.json
deleted file mode 100644
index 8eefd95..0000000
--- a/static/redfish/v1/JsonSchemas/OemSession/index.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
-    "$id": "http://redfish.dmtf.org/schemas/v1/OemSession.v1_0_0.json",
-    "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema-v1.json",
-    "copyright": "Copyright 2014-2019 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
-    "definitions": {
-        "Session": {
-            "additionalProperties": false,
-            "description": "OEM Extension for Session",
-            "longDescription": "OEM Extension for Session to provide the Client details.",
-            "patternProperties": {
-                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
-                    "description": "This property shall specify a valid odata or Redfish property.",
-                    "type": [
-                        "array",
-                        "boolean",
-                        "integer",
-                        "number",
-                        "null",
-                        "object",
-                        "string"
-                    ]
-                }
-            },
-            "properties": {
-                "ClientID" : {
-                    "description" : "The Id of the client creating this session.",
-                    "longDescription": "This will be the unique identifier set by the client.",
-                    "readonly": true,
-                    "type" : "string"
-                },
-            "type": "object"
-            }
-        }
-    },
-    "owningEntity": "OpenBMC",
-    "release": "1.0",
-    "title": "#OemSession.v1_0_0"
-}
-
diff --git a/static/redfish/v1/schema/OemSession_v1.xml b/static/redfish/v1/schema/OemSession_v1.xml
deleted file mode 100644
index f02f861..0000000
--- a/static/redfish/v1/schema/OemSession_v1.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
-
-  <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml">
-    <edmx:Include Namespace="Org.OData.Core.V1" Alias="OData"/>
-  </edmx:Reference>
-  <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Measures.V1.xml">
-    <edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures"/>
-  </edmx:Reference>
-  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml">
-    <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/>
-  </edmx:Reference>
-  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/Resource_v1.xml">
-    <edmx:Include Namespace="Resource"/>
-    <edmx:Include Namespace="Resource.v1_0_0"/>
-  </edmx:Reference>
-  <edmx:DataServices>
-
-    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemSession">
-      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
-    </Schema>
-
-    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemSession.v1_0_0">
-      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
-      <Annotation Term="Redfish.Release" String="1.0"/>
-
-      <EntityType Name="Session" BaseType="Resource.OemObject" Abstract="true">
-          <Annotation Term="OData.Description" String="OEM Extension for Session"/>
-          <Annotation Term="OData.LongDescription" String="OEM Extension for Session"/>
-
-            <Property Name="ClientID" Type="Edm.String">
-              <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>
-
-      </EntityType>
-    </Schema>
-  </edmx:DataServices>
-</edmx:Edmx>
-