mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 11:16:30 +03:00
April 21th 2024 update
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "i_rest_api.h"
|
||||
#include "i_time_get.h"
|
||||
#include "i_encryptor.h"
|
||||
#include "i_shell_cmd.h"
|
||||
#include "maybe_res.h"
|
||||
|
||||
class FogAuthenticator
|
||||
@@ -43,10 +44,13 @@ class FogAuthenticator
|
||||
Singleton::Consume<I_DetailsResolver>,
|
||||
Singleton::Consume<I_OrchestrationStatus>,
|
||||
Singleton::Consume<I_OrchestrationTools>,
|
||||
Singleton::Consume<I_EnvDetails>,
|
||||
Singleton::Consume<I_Encryptor>,
|
||||
Singleton::Consume<I_MainLoop>,
|
||||
Singleton::Consume<I_Messaging>,
|
||||
Singleton::Consume<I_TimeGet>
|
||||
Singleton::Consume<I_TimeGet>,
|
||||
Singleton::Consume<I_ShellCmd>,
|
||||
Singleton::Consume<I_Environment>
|
||||
{
|
||||
class AccessToken
|
||||
{
|
||||
@@ -88,6 +92,8 @@ public:
|
||||
void serialize(cereal::JSONOutputArchive &out_ar) const;
|
||||
void serialize(cereal::JSONInputArchive &in_ar);
|
||||
|
||||
std::string getData() const;
|
||||
|
||||
private:
|
||||
AuthenticationType type;
|
||||
std::string data;
|
||||
@@ -103,6 +109,7 @@ public:
|
||||
Maybe<void> authenticateAgent() override;
|
||||
void setAddressExtenesion(const std::string &extension) override;
|
||||
static std::string getUserEdition();
|
||||
void registerLocalAgentToFog() override;
|
||||
|
||||
protected:
|
||||
class UserCredentials
|
||||
@@ -138,6 +145,7 @@ protected:
|
||||
|
||||
bool saveCredentialsToFile(const UserCredentials &credentials) const;
|
||||
Maybe<UserCredentials> getCredentialsFromFile() const;
|
||||
Maybe<RegistrationData> getRegistrationToken();
|
||||
Maybe<RegistrationData> getRegistrationData();
|
||||
|
||||
std::string base64Encode(const std::string &in) const;
|
||||
|
@@ -37,10 +37,7 @@
|
||||
#include "maybe_res.h"
|
||||
#include "declarative_policy_utils.h"
|
||||
|
||||
class HybridCommunication
|
||||
:
|
||||
public FogAuthenticator,
|
||||
Singleton::Consume<I_EnvDetails>
|
||||
class HybridCommunication : public FogAuthenticator
|
||||
{
|
||||
public:
|
||||
void init() override;
|
||||
|
@@ -29,6 +29,7 @@ public:
|
||||
void init();
|
||||
|
||||
Maybe<void> authenticateAgent() override;
|
||||
void registerLocalAgentToFog() override;
|
||||
Maybe<void> getUpdate(CheckUpdateRequest &request) override;
|
||||
|
||||
Maybe<std::string> downloadAttributeFile(
|
||||
|
@@ -35,6 +35,7 @@ public:
|
||||
MOCK_METHOD0(getPlatform, Maybe<std::string>());
|
||||
MOCK_METHOD0(getArch, Maybe<std::string>());
|
||||
MOCK_METHOD0(getAgentVersion, std::string());
|
||||
MOCK_METHOD0(isCloudStorageEnabled, bool());
|
||||
MOCK_METHOD0(isReverseProxy, bool());
|
||||
MOCK_METHOD0(isKernelVersion3OrHigher, bool());
|
||||
MOCK_METHOD0(isGwNotVsx, bool());
|
||||
|
@@ -24,7 +24,7 @@ class MockDownloader :
|
||||
{
|
||||
public:
|
||||
MOCK_CONST_METHOD3(
|
||||
downloadFileFromFog,
|
||||
downloadFile,
|
||||
Maybe<std::string>(const std::string &, Package::ChecksumTypes, const GetResourceFile &)
|
||||
);
|
||||
|
||||
|
@@ -29,6 +29,7 @@ class MockUpdateCommunication :
|
||||
public:
|
||||
void init() {}
|
||||
MOCK_METHOD0(authenticateAgent, Maybe<void>());
|
||||
MOCK_METHOD0(registerLocalAgentToFog, void());
|
||||
MOCK_METHOD1(getUpdate, Maybe<void>(CheckUpdateRequest &));
|
||||
MOCK_METHOD2(
|
||||
downloadAttributeFile,
|
||||
|
Reference in New Issue
Block a user