Add google service root
This commit introduces the following
=> Service root for Google
=> compiler option for the Google Root of Trust specific functionalities
Tested:
curl -vvvv --insecure --user $user_pass https://${bmc}/google/v1
Desing Doc can be found here https://github.com/openbmc/docs/blob/master/designs/oem/google/root_of_trust.md
Change-Id: I941b5cab55179279d0eff18aa29df62c3f226e47
Signed-off-by: Feras Aldahlawi <faldahlawi@gmail.com>
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
new file mode 100644
index 0000000..a80a500
--- /dev/null
+++ b/include/google/google_service_root.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <app.hpp>
+#include <async_resp.hpp>
+#include <nlohmann/json.hpp>
+
+namespace crow
+{
+namespace google_api
+{
+
+inline void requestRoutes(App& app)
+{
+ BMCWEB_ROUTE(app, "/google/v1/")
+ .methods(boost::beast::http::verb::get)(
+ [](const crow::Request&,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+ asyncResp->res.jsonValue["@odata.type"] =
+ "#GoogleServiceRoot.v1_0_0.GoogleServiceRoot";
+ asyncResp->res.jsonValue["@odata.id"] = "/google/v1";
+ asyncResp->res.jsonValue["Id"] = "Google Rest RootService";
+ asyncResp->res.jsonValue["Name"] = "Google Service Root";
+ asyncResp->res.jsonValue["Version"] = "1.0.0";
+ });
+}
+
+} // namespace google_api
+} // namespace crow