summaryrefslogtreecommitdiff
path: root/include/google
diff options
context:
space:
mode:
authorFeras Aldahlawi <faldahlawi@gmail.com>2021-03-20 00:01:46 +0300
committerFeras Aldahlawi <faldahlawi@gmail.com>2021-08-10 03:55:32 +0300
commit735ef6d87392d643901ffede8042652b29d8cce7 (patch)
tree0ac8a6a20cf2cd22195f1629c5566013d1791dc2 /include/google
parent885bbf1c82ea9f9cbfbe0065ee46adc8e398c868 (diff)
downloadbmcweb-735ef6d87392d643901ffede8042652b29d8cce7.tar.xz
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>
Diffstat (limited to 'include/google')
-rw-r--r--include/google/google_service_root.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
new file mode 100644
index 0000000000..a80a50071b
--- /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