mirror of
https://github.com/openappsec/openappsec.git
synced 2026-01-17 16:00:26 +03:00
Jan 06 2026 dev (#387)
* sync code * update code to support brotli * update code to support brotli * update code to support brotli * sync code * fix findBrotli * sync code * sync code * sync code * sync code --------- Co-authored-by: Ned Wright <nedwright@proton.me> Co-authored-by: Daniel Eisenberg <danielei@checkpoint.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include "i_messaging.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "debug.h"
|
||||
@@ -64,19 +65,37 @@ AgentDetails::init()
|
||||
writeAgentDetails();
|
||||
}
|
||||
|
||||
previous_proxy = proxy;
|
||||
|
||||
registerConfigLoadCb(
|
||||
[&]()
|
||||
{
|
||||
auto proxy_config = getProfileAgentSetting<string>("agent.config.message.proxy");
|
||||
if (proxy_config.ok()) {
|
||||
is_proxy_configured_via_settings = true;
|
||||
setProxy(*proxy_config);
|
||||
writeAgentDetails();
|
||||
} else if (is_proxy_configured_via_settings) {
|
||||
is_proxy_configured_via_settings = false;
|
||||
setProxy(string(""));
|
||||
writeAgentDetails();
|
||||
auto load_env_proxy = loadProxy();
|
||||
auto proxy_config = getProxy();
|
||||
if (proxy != previous_proxy) {
|
||||
dbgInfo(D_ORCHESTRATOR)
|
||||
<< "Proxy configuration changed from '"
|
||||
<< previous_proxy
|
||||
<< "' to '"
|
||||
<< proxy
|
||||
<< "'";
|
||||
auto messaging = Singleton::Consume<I_Messaging>::by<AgentDetails>();
|
||||
messaging->clearConnections();
|
||||
}
|
||||
if (!proxy_config.ok() || proxy_config.unpack() == "none") {
|
||||
auto proxy_config = getProfileAgentSetting<string>("agent.config.message.proxy");
|
||||
if (proxy_config.ok()) {
|
||||
is_proxy_configured_via_settings = true;
|
||||
setProxy(*proxy_config);
|
||||
writeAgentDetails();
|
||||
} else if (is_proxy_configured_via_settings) {
|
||||
is_proxy_configured_via_settings = false;
|
||||
setProxy(string(""));
|
||||
writeAgentDetails();
|
||||
}
|
||||
}
|
||||
|
||||
previous_proxy = proxy;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "mock/mock_encryptor.h"
|
||||
#include "mock/mock_shell_cmd.h"
|
||||
#include "mock/mock_messaging.h"
|
||||
#include "mock/mock_mainloop.h"
|
||||
#include "cptest.h"
|
||||
#include "config.h"
|
||||
@@ -25,6 +26,7 @@ public:
|
||||
|
||||
::Environment env;
|
||||
ConfigComponent conf;
|
||||
StrictMock<MockMessaging> mock_messaging;
|
||||
StrictMock<MockEncryptor> mock_encryptor;
|
||||
StrictMock<MockShellCmd> mock_shell_cmd;
|
||||
Config::I_Config *config = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user