summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2017-10-11 16:40:35 -0700
committerEd Tanous <ed.tanous@intel.com>2017-10-24 14:19:43 -0700
commitba9f9a6cebfbb7a12ecf869afa0cdc5aef9c8372 (patch)
tree67345df8b98aecb87480b827b10e1ca2ece5876a /src
parent911ac31759cb7b77a856af8806b4e064d50d7422 (diff)
downloadbmcweb-ba9f9a6cebfbb7a12ecf869afa0cdc5aef9c8372.tar.gz
bmcweb-ba9f9a6cebfbb7a12ecf869afa0cdc5aef9c8372.zip
Update Webserver
Upate get_routes to use the correct constness for its use case crow to set json_mode if json value is populated Delete std::array bytes API due to major efficiency issues. To be replaced with span API in near future Implement a catch block for handlers that can throw exceptions Implement direct handling of routes that end with / to better support redfish. /foo and /foo/ now invoke the same handler insead of issuing a 301 redirect Update nlohmann to latest version Implement one nlohmann endpoint with exceptions disabled Implement first pass at a IBM style rest-dbus interface Fix pam authentication to call dropbear auth methods Implements first pass at redfish interface. Shemas avaialble pass redfish validation 100% Use response json object rather than request json object. Update authorization middleware to be redfish compliant UPdate random token generation to be more efficient, and not base64 bytes, generate bytes directly Change-Id: I63cc2005c1a21f5c2f5168777a4e09f3c965a34f
Diffstat (limited to 'src')
-rw-r--r--src/token_authorization_middleware_test.cpp15
-rw-r--r--src/webserver_main.cpp4
2 files changed, 13 insertions, 6 deletions
diff --git a/src/token_authorization_middleware_test.cpp b/src/token_authorization_middleware_test.cpp
index 004fddb..5857d2e 100644
--- a/src/token_authorization_middleware_test.cpp
+++ b/src/token_authorization_middleware_test.cpp
@@ -8,7 +8,8 @@ using namespace std;
// Tests that static urls are correctly passed
TEST(TokenAuthentication, TestBasicReject) {
- App<crow::TokenAuthorization::Middleware> app;
+ App<crow::PersistentData::Middleware, crow::TokenAuthorization::Middleware>
+ app;
decltype(app)::server_t server(&app, "127.0.0.1", 45451);
CROW_ROUTE(app, "/")([]() { return 200; });
auto _ = async(launch::async, [&] { server.run(); });
@@ -46,7 +47,8 @@ TEST(TokenAuthentication, TestBasicReject) {
// Tests that Base64 basic strings work
TEST(TokenAuthentication, TestRejectedResource) {
- App<crow::TokenAuthorization::Middleware> app;
+ App<crow::PersistentData::Middleware, crow::TokenAuthorization::Middleware>
+ app;
app.bindaddr("127.0.0.1").port(45451);
CROW_ROUTE(app, "/")([]() { return 200; });
auto _ = async(launch::async, [&] { app.run(); });
@@ -75,7 +77,8 @@ TEST(TokenAuthentication, TestRejectedResource) {
// Tests that Base64 basic strings work
TEST(TokenAuthentication, TestGetLoginUrl) {
- App<crow::TokenAuthorization::Middleware> app;
+ App<crow::PersistentData::Middleware, crow::TokenAuthorization::Middleware>
+ app;
app.bindaddr("127.0.0.1").port(45451);
CROW_ROUTE(app, "/")([]() { return 200; });
auto _ = async(launch::async, [&] { app.run(); });
@@ -104,7 +107,8 @@ TEST(TokenAuthentication, TestGetLoginUrl) {
// Tests boundary conditions on login
TEST(TokenAuthentication, TestPostBadLoginUrl) {
- App<crow::TokenAuthorization::Middleware> app;
+ App<crow::PersistentData::Middleware, crow::TokenAuthorization::Middleware>
+ app;
app.bindaddr("127.0.0.1").port(45451);
CROW_ROUTE(app, "/")([]() { return 200; });
auto _ = async(launch::async, [&] { app.run(); });
@@ -187,7 +191,8 @@ class KnownLoginAuthenticator {
};
TEST(TokenAuthentication, TestSuccessfulLogin) {
- App<crow::TokenAuthorization::Middleware> app;
+ App<crow::PersistentData::Middleware, crow::TokenAuthorization::Middleware>
+ app;
app.bindaddr("127.0.0.1").port(45451);
CROW_ROUTE(app, "/")([]() { return 200; });
auto _ = async(launch::async, [&] { app.run(); });
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index 7ae22b5..9640ac3 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -3,6 +3,7 @@
#include <dbus_singleton.hpp>
#include <intel_oem.hpp>
#include <openbmc_dbus_rest.hpp>
+#include <persistent_data_middleware.hpp>
#include <redfish_v1.hpp>
#include <security_headers_middleware.hpp>
#include <ssl_key_handler.hpp>
@@ -16,7 +17,8 @@
int main(int argc, char** argv) {
auto io = std::make_shared<boost::asio::io_service>();
- crow::App<crow::TokenAuthorization::Middleware,
+ crow::App<crow::PersistentData::Middleware,
+ crow::TokenAuthorization::Middleware,
crow::SecurityHeadersMiddleware>
app(io);
OpenPOWER on IntegriCloud