Remove readSSEQueryParams method
This method is currently unused, and as-written, only implements a
portion of the filter specification. It has things that are incorrect
to the standard, like completely removing slashes (which are supposed to
represent json pointers) and parens (which are supposed to represent
precedence of operators).
Given the prior commits which implement a full parser for filter
expressions, including a proper AST with unit testing, this seems
reasonable to remove.
This block of code was originally checked in here:
07941a88 Support the $filter query params for SSE stream
then almost immediately reverted in part, keeping this block of code
so we could reuse it once the SSE problems were fixed.
d206b437 Revert http::Request::socket() callback
There has been no input since, so it should be safe to delete this
block.
Tested: Dead code, not used. Code compiles.
Change-Id: I95bcac6984aeb569a38c8c2e1e083119c5c97aa4
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index ba2450d..6ad8de3 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -258,95 +258,6 @@
} // namespace event_log
-inline bool isFilterQuerySpecialChar(char c)
-{
- switch (c)
- {
- case '(':
- case ')':
- case '\'':
- return true;
- default:
- return false;
- }
-}
-
-inline bool
- readSSEQueryParams(std::string sseFilter, std::string& formatType,
- std::vector<std::string>& messageIds,
- std::vector<std::string>& registryPrefixes,
- std::vector<std::string>& metricReportDefinitions)
-{
- auto remove = std::ranges::remove_if(sseFilter, isFilterQuerySpecialChar);
- sseFilter.erase(std::ranges::begin(remove), sseFilter.end());
-
- std::vector<std::string> result;
-
- // NOLINTNEXTLINE
- bmcweb::split(result, sseFilter, ' ');
-
- BMCWEB_LOG_DEBUG("No of tokens in SEE query: {}", result.size());
-
- constexpr uint8_t divisor = 4;
- constexpr uint8_t minTokenSize = 3;
- if (result.size() % divisor != minTokenSize)
- {
- BMCWEB_LOG_ERROR("Invalid SSE filter specified.");
- return false;
- }
-
- for (std::size_t i = 0; i < result.size(); i += divisor)
- {
- const std::string& key = result[i];
- const std::string& op = result[i + 1];
- const std::string& value = result[i + 2];
-
- if ((i + minTokenSize) < result.size())
- {
- const std::string& separator = result[i + minTokenSize];
- // SSE supports only "or" and "and" in query params.
- if ((separator != "or") && (separator != "and"))
- {
- BMCWEB_LOG_ERROR(
- "Invalid group operator in SSE query parameters");
- return false;
- }
- }
-
- // SSE supports only "eq" as per spec.
- if (op != "eq")
- {
- BMCWEB_LOG_ERROR(
- "Invalid assignment operator in SSE query parameters");
- return false;
- }
-
- BMCWEB_LOG_DEBUG("{} : {}", key, value);
- if (key == "EventFormatType")
- {
- formatType = value;
- }
- else if (key == "MessageId")
- {
- messageIds.push_back(value);
- }
- else if (key == "RegistryPrefix")
- {
- registryPrefixes.push_back(value);
- }
- else if (key == "MetricReportDefinition")
- {
- metricReportDefinitions.push_back(value);
- }
- else
- {
- BMCWEB_LOG_ERROR("Invalid property({})in SSE filter query.", key);
- return false;
- }
- }
- return true;
-}
-
class Subscription : public persistent_data::UserSubscription
{
public: