History log of /openbmc/bmcweb/http/routing/websocketrule.hpp (Results 1 – 6 of 6)
Revision Date Author Comments
# a3b9eb98 03-Jun-2024 Ed Tanous <ed@tanous.net>

Make SSE pass

Redfish protocol validator is failing SSE. This is due to a clause in
the Redfish specification that requires a "json" error to be returned
when the SSE URI is hit with a standard req

Make SSE pass

Redfish protocol validator is failing SSE. This is due to a clause in
the Redfish specification that requires a "json" error to be returned
when the SSE URI is hit with a standard request.

In what exists today, we return 4XX (method not allowed) but because
this is handled by the HTTP layer, it's not possible to return the
correct Redfish payloads for when that 4XX happens within the Redfish
tree, because there is in fact a route that matches, that route just
doesn't support the type that we need.

This commit rearranges the router such that there are now 4 classes of
rules.

1. "verb" rules. These are GET/POST/PATCH type, and they are stored
using the existing PerMethod array index.
2. "upgrade" rules. These are for websocket or SSE routes that we
expect to upgrade to another route
3. 404 routes. These are called in the case where no route exists with
that given URI pattern, and no routes exist in the table for any
verb.
4. 405 method not allowed. These are called in the case where routes
exist in the tree for some method, but not for the method the user
requested.

To accomplish this, some minor refactors are implemented to separate out
the 4xx handlers to be their own variables, rather than just existing at
an index at the end of the verb table. This in turn means that
getRouteByIndex now changes to allow getting the route by PerMethod
instance, rather than index.

Tested:
unit tests pass (okish coverage)
Redfish protocol validator passes (with the exception of #277, which
fails identically before and after). SSE tests now pass.
Redfish service validator passes.

Change-Id: I555c50f392cb12ecbc39fbadbae6a3d50f4d1b23
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# 003301a2 16-Apr-2024 Ed Tanous <ed@tanous.net>

Change ssl stream implementations

Boost beast ssl_stream is just a wrapper around asio ssl_stream, and
aims to optimize the case where we're writing small payloads (one or two
bytes.) which needs to

Change ssl stream implementations

Boost beast ssl_stream is just a wrapper around asio ssl_stream, and
aims to optimize the case where we're writing small payloads (one or two
bytes.) which needs to be optimized in SSL.

bmcweb never writes one or two bytes, we almost always write the full
payload of what we received, so there's no reason to take the binary
size overhead, and additional boost headers that this implementation
requires.

Tested:
This drops the on-target binary size by 2.6%

Redfish service validator passes.

Change-Id: Ie1ae6f197f8e5ed70cf4abc6be9b1b382c42d64d
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 8db83747 13-Apr-2024 Ed Tanous <ed@tanous.net>

Clean up BMCWEB_ENABLE_SSL

This macro came originally from CROW_ENABLE_SSL, and was used as a macro
to optionally compile without openssl being required.

OpenSSL has been pulled into many other dep

Clean up BMCWEB_ENABLE_SSL

This macro came originally from CROW_ENABLE_SSL, and was used as a macro
to optionally compile without openssl being required.

OpenSSL has been pulled into many other dependencies, and has been
functionally required to be included for a long time, so there's no
reason to hold onto this macro.

Remove most uses of the macro, and for the couple functional places the
macro is used, transition to a constexpr if to enable the TLS paths.

This allows a large simplification of code in some places.

Tested: Redfish service validator passes.

Change-Id: Iebd46a68e5e417b6031479e24be3c21bef782f4c
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 5ebb9d33 27-Feb-2023 Ed Tanous <edtanous@google.com>

Remove extra variables in websockets

These variables don't need propagated to handlers. Any usage of them is
incorrect.

This makes Websocket once again a pure virtual class, which is desired.

Sig

Remove extra variables in websockets

These variables don't need propagated to handlers. Any usage of them is
incorrect.

This makes Websocket once again a pure virtual class, which is desired.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Id1ecc3911fc502d436a3e6aa29024628fc51aff4

show more ...


# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# 08bbe119 06-Apr-2023 Ed Tanous <edtanous@google.com>

Break up router into separate files

The router is a giant behemoth. Start breaking it down into pieces.

Tested: Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Ch

Break up router into separate files

The router is a giant behemoth. Start breaking it down into pieces.

Tested: Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9d04f53a58ffce3ecbd88dded1aa6e9648d2a762

show more ...