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
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
};
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(); });