Redfish Session : Support ClientOriginIPAddress
This commit implements the ClientOriginIPAddress property on
the session resource
Tested by:
1. Create session
POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":<>, "Password":<>}'
2. Check the session gets updated with the ClientOriginIPAddress
GET https://${bmc}/redfish/v1/SessionService/Sessions/<id>
3. Redfish validator passed
Signed-off-by: Sunitha Harish <sunharis@in.ibm.com>
Change-Id: I4c5c6f651bb6faec0cb1b1b78d9da593ecb85ff0
diff --git a/http/http_connection.h b/http/http_connection.h
index ddedaea..ca3314b 100644
--- a/http/http_connection.h
+++ b/http/http_connection.h
@@ -317,6 +317,10 @@
}
}
+ // 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()