#pragma once
#include "app.hpp"
#include "async_resp.hpp"
#include "dbus_singleton.hpp"
#include "openbmc_dbus_rest.hpp"
#include "websocket.hpp"

#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <sdbusplus/bus/match.hpp>
#include <sdbusplus/message/types.hpp>

#include <variant>

namespace crow
{
namespace dbus_monitor
{

struct DbusWebsocketSession
{
    std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches;
    boost::container::flat_set<std::string, std::less<>,
                               std::vector<std::string>>
        interfaces;
};

using SessionMap = boost::container::flat_map<crow::websocket::Connection*,
                                              DbusWebsocketSession>;

// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static SessionMap sessions;

inline int onPropertyUpdate(sd_bus_message* m, void* userdata,
                            sd_bus_error* retError)
{
    if (retError == nullptr || (sd_bus_error_is_set(retError) != 0))
    {
        BMCWEB_LOG_ERROR("Got sdbus error on match");
        return 0;
    }
    crow::websocket::Connection* connection =
        static_cast<crow::websocket::Connection*>(userdata);
    auto thisSession = sessions.find(connection);
    if (thisSession == sessions.end())
    {
        BMCWEB_LOG_ERROR("Couldn't find dbus connection {}",
                         logPtr(connection));
        return 0;
    }
    sdbusplus::message_t message(m);
    nlohmann::json json;
    json["event"] = message.get_member();
    json["path"] = message.get_path();
    if (strcmp(message.get_member(), "PropertiesChanged") == 0)
    {
        nlohmann::json data;
        int r = openbmc_mapper::convertDBusToJSON("sa{sv}as", message, data);
        if (r < 0)
        {
            BMCWEB_LOG_ERROR("convertDBusToJSON failed with {}", r);
            return 0;
        }
        if (!data.is_array())
        {
            BMCWEB_LOG_ERROR("No data in PropertiesChanged signal");
            return 0;
        }

        // data is type sa{sv}as and is an array[3] of string, object, array
        json["interface"] = data[0];
        json["properties"] = data[1];
    }
    else if (strcmp(message.get_member(), "InterfacesAdded") == 0)
    {
        nlohmann::json data;
        int r = openbmc_mapper::convertDBusToJSON("oa{sa{sv}}", message, data);
        if (r < 0)
        {
            BMCWEB_LOG_ERROR("convertDBusToJSON failed with {}", r);
            return 0;
        }

        if (!data.is_array())
        {
            BMCWEB_LOG_ERROR("No data in InterfacesAdded signal");
            return 0;
        }

        // data is type oa{sa{sv}} which is an array[2] of string, object
        for (const auto& entry : data[1].items())
        {
            auto it = thisSession->second.interfaces.find(entry.key());
            if (it != thisSession->second.interfaces.end())
            {
                json["interfaces"][entry.key()] = entry.value();
            }
        }
    }
    else
    {
        BMCWEB_LOG_CRITICAL("message {} was unexpected", message.get_member());
        return 0;
    }

    connection->sendText(
        json.dump(2, ' ', true, nlohmann::json::error_handler_t::replace));
    return 0;
}

inline void requestRoutes(App& app)
{
    BMCWEB_ROUTE(app, "/subscribe")
        .privileges({{"Login"}})
        .websocket()
        .onopen([&](crow::websocket::Connection& conn) {
        BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
        sessions.try_emplace(&conn);
    })
        .onclose([&](crow::websocket::Connection& conn, const std::string&) {
        sessions.erase(&conn);
    })
        .onmessage([&](crow::websocket::Connection& conn,
                       const std::string& data, bool) {
        const auto sessionPair = sessions.find(&conn);
        if (sessionPair == sessions.end())
        {
            conn.close("Internal error");
        }
        DbusWebsocketSession& thisSession = sessionPair->second;
        BMCWEB_LOG_DEBUG("Connection {} received {}", logPtr(&conn), data);
        nlohmann::json j = nlohmann::json::parse(data, nullptr, false);
        if (j.is_discarded())
        {
            BMCWEB_LOG_ERROR("Unable to parse json data for monitor");
            conn.close("Unable to parse json request");
            return;
        }
        nlohmann::json::iterator interfaces = j.find("interfaces");
        if (interfaces != j.end())
        {
            thisSession.interfaces.reserve(interfaces->size());
            for (auto& interface : *interfaces)
            {
                const std::string* str =
                    interface.get_ptr<const std::string*>();
                if (str != nullptr)
                {
                    thisSession.interfaces.insert(*str);
                }
            }
        }

        nlohmann::json::iterator paths = j.find("paths");
        if (paths == j.end())
        {
            BMCWEB_LOG_ERROR("Unable to find paths in json data");
            conn.close("Unable to find paths in json data");
            return;
        }

        size_t interfaceCount = thisSession.interfaces.size();
        if (interfaceCount == 0)
        {
            interfaceCount = 1;
        }
        // Reserve our matches upfront.  For each path there is 1 for
        // interfacesAdded, and InterfaceCount number for
        // PropertiesChanged
        thisSession.matches.reserve(thisSession.matches.size() +
                                    paths->size() * (1U + interfaceCount));

        // These regexes derived on the rules here:
        // https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
        static std::regex validPath("^/([A-Za-z0-9_]+/?)*$");
        static std::regex validInterface(
            "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)+$");

        for (const auto& thisPath : *paths)
        {
            const std::string* thisPathString =
                thisPath.get_ptr<const std::string*>();
            if (thisPathString == nullptr)
            {
                BMCWEB_LOG_ERROR("subscribe path isn't a string?");
                conn.close();
                return;
            }
            if (!std::regex_match(*thisPathString, validPath))
            {
                BMCWEB_LOG_ERROR("Invalid path name {}", *thisPathString);
                conn.close();
                return;
            }
            std::string propertiesMatchString =
                ("type='signal',"
                 "interface='org.freedesktop.DBus.Properties',"
                 "path_namespace='" +
                 *thisPathString +
                 "',"
                 "member='PropertiesChanged'");
            // If interfaces weren't specified, add a single match for all
            // interfaces
            if (thisSession.interfaces.empty())
            {
                BMCWEB_LOG_DEBUG("Creating match {}", propertiesMatchString);

                thisSession.matches.emplace_back(
                    std::make_unique<sdbusplus::bus::match_t>(
                        *crow::connections::systemBus, propertiesMatchString,
                        onPropertyUpdate, &conn));
            }
            else
            {
                // If interfaces were specified, add a match for each
                // interface
                for (const std::string& interface : thisSession.interfaces)
                {
                    if (!std::regex_match(interface, validInterface))
                    {
                        BMCWEB_LOG_ERROR("Invalid interface name {}",
                                         interface);
                        conn.close();
                        return;
                    }
                    std::string ifaceMatchString = propertiesMatchString;
                    ifaceMatchString += ",arg0='";
                    ifaceMatchString += interface;
                    ifaceMatchString += "'";
                    BMCWEB_LOG_DEBUG("Creating match {}", ifaceMatchString);
                    thisSession.matches.emplace_back(
                        std::make_unique<sdbusplus::bus::match_t>(
                            *crow::connections::systemBus, ifaceMatchString,
                            onPropertyUpdate, &conn));
                }
            }
            std::string objectManagerMatchString =
                ("type='signal',"
                 "interface='org.freedesktop.DBus.ObjectManager',"
                 "path_namespace='" +
                 *thisPathString +
                 "',"
                 "member='InterfacesAdded'");
            BMCWEB_LOG_DEBUG("Creating match {}", objectManagerMatchString);
            thisSession.matches.emplace_back(
                std::make_unique<sdbusplus::bus::match_t>(
                    *crow::connections::systemBus, objectManagerMatchString,
                    onPropertyUpdate, &conn));
        }
    });
}
} // namespace dbus_monitor
} // namespace crow
