Skip to content

Commit

Permalink
rev5
Browse files Browse the repository at this point in the history
  • Loading branch information
dr3mro committed Jan 3, 2025
1 parent 7adb653 commit dbce1a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/gatekeeper/dosdetector/dosdetector.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#include "dosdetector.hpp"

#include <fmt/core.h>
#include <fmt/format.h>
#include <xxhash.h>

#include <algorithm>
#include <chrono>
#include <exception>
#include <future>
#include <mutex>
#include <optional>
#include <regex>
#include <string>
#include <thread>
#include <unordered_set>

#include "utils/message/message.hpp"

Expand Down
8 changes: 4 additions & 4 deletions src/gatekeeper/keeprbase/keeprbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool KeeprBase::getLastLogoutTimeIfActive(std::optional<Types::ClientLoginData>&
auto results = databaseController->executeReadQuery(query, isSqlInjection);
if (isSqlInjection)
{
Message::ErrorMessage("A SQL Injection attack was detected. You will be blocked.");
Message::ErrorMessage("A Sql Injection pattern is detected in generated query.");
return false;
}

Expand Down Expand Up @@ -77,7 +77,7 @@ bool KeeprBase::setNowLoginTimeGetLastLogoutTime(std::optional<Types::ClientLogi
auto result = databaseController->executeQuery(query, isSqlInjection);
if (isSqlInjection)
{
Message::ErrorMessage("A SQL Injection attack was detected. You will be blocked.");
Message::ErrorMessage("A Sql Injection pattern is detected in generated query.");
return false;
}

Expand Down Expand Up @@ -119,7 +119,7 @@ void KeeprBase::setNowLogoutTime(uint64_t _id, const std::string& _group)

if (isSqlInjection)
{
Message::ErrorMessage("A SQL Injection attack was detected. You will be blocked.");
Message::ErrorMessage("A Sql Injection pattern is detected in generated query.");
return;
}

Expand All @@ -144,7 +144,7 @@ std::optional<std::string> KeeprBase::getLastLoginTime(uint64_t _id, const std::
std::optional<std::string> result = databaseController->doReadQuery(query, isSqlInjection);
if (isSqlInjection)
{
Message::ErrorMessage("A SQL Injection attack was detected. You will be blocked.");
Message::ErrorMessage("A Sql Injection pattern is detected in generated query.");
return std::nullopt;
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace api::v2

if (isSqlInjection)
{
Message::ErrorMessage("A SQL Injection attack was detected. You will be blocked.");
Message::ErrorMessage("A Sql Injection pattern is detected in generated query.");
return std::nullopt;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gatekeeper/sessionmanager/sessionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool SessionManager::login(const std::optional<Types::Credentials>& credentials,

if (isSqlInjection)
{
message = "A SQL Injection attack was detected. You will be blocked.";
message = "A Sql Injection pattern is detected in generated query.";
return false;
}
if (!client_object.has_value() || client_object.value().empty())
Expand Down

0 comments on commit dbce1a0

Please sign in to comment.