Make bmcweb pass REQ_POST_CREATE_TO_MEMBERS_PROP
The Members property within resources is expected to allow create in the
same way the Collection resource does. From the spec:
Submitting a POST request to a resource collection is equivalent to
submitting the same request to the Members property of that resource
collection. Services that support the addition of Members to a resource
collection shall support both forms.
Related: #192
Tested:
Redfish protocol validator, REQ_POST_CREATE_TO_MEMBERS_PROP now passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5c22325946eab9aec8c690450aa2ea24a6e4e485
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 5e7d3df..3c2247b 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -273,7 +273,7 @@
.privileges(redfish::privileges::getSessionCollection)
.methods(boost::beast::http::verb::get)(handleSessionCollectionGet);
- // Note, the next route technically doesn't match the privilege
+ // Note, the next two routes technically don't match the privilege
// registry given the way login mechanisms work. The base privilege
// registry lists this endpoint as requiring login privilege, but because
// this is the endpoint responsible for giving the login privilege, and it
@@ -282,6 +282,10 @@
.privileges({})
.methods(boost::beast::http::verb::post)(handleSessionCollectionPost);
+ BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/Members/")
+ .privileges({})
+ .methods(boost::beast::http::verb::post)(handleSessionCollectionPost);
+
BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
.privileges(redfish::privileges::getSessionService)
.methods(boost::beast::http::verb::get)(handleSessionServiceGet);