Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changes to persist agent_group information and perform file download requests #224

Merged

Conversation

Nicogp
Copy link
Member

@Nicogp Nicogp commented Oct 16, 2024

Related issue
#219

Description

This PR adds the changes to persist the groups to which the agent belongs and also adds the changes to HttpClient to be able to perform file download requests.

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

@jr0me jr0me force-pushed the enhancement/32-agent-centralized-configuration-class-mvp branch from 64cea84 to 0d51b92 Compare October 16, 2024 12:21
@Nicogp Nicogp force-pushed the enhancement/32-agent-centralized-configuration-extra-changes branch from 00fdb62 to 0a0cd06 Compare October 16, 2024 12:31
src/agent/agent_info/include/agent_info.hpp Outdated Show resolved Hide resolved
@@ -75,6 +86,22 @@ void AgentInfoPersistance::CreateAgentInfoTable()
}
}

void AgentInfoPersistance::CreateAgentGroupTable()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a table for the agent group? Can't it be just another column in the agent_info table?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that in the future more information related to the groups could be added, for example the hash of the configuration file of each group to check that it has not been modified. That's why I thought about adding a new table.

src/agent/agent_info/src/agent_info_persistance.cpp Outdated Show resolved Hide resolved
src/agent/agent_info/src/agent_info_persistance.cpp Outdated Show resolved Hide resolved
src/agent/agent_info/src/agent_info_persistance.cpp Outdated Show resolved Hide resolved
src/agent/communicator/src/http_socket.hpp Show resolved Hide resolved
@jr0me
Copy link
Member

jr0me commented Oct 16, 2024

We should add to this PR passing the new functions to the CentralizedConfiguration via its methods:

void SetGroupIdFunction(SetGroupIdFunctionType setGroupIdFunction);
void GetGroupIdFunction(GetGroupIdFunctionType getGroupIdFunction);
void SetDownloadGroupFilesFunction(DownloadGroupFilesFunctionType downloadGroupFilesFunction);

This can be done somewhere in agent.cpp either in its constructor or before adding it to the ModuleManager.

@Nicogp Nicogp changed the base branch from enhancement/32-agent-centralized-configuration-class-mvp to master October 16, 2024 21:23
@Nicogp
Copy link
Member Author

Nicogp commented Oct 16, 2024

In reference to this comment:

We should add to this PR passing the new functions to the CentralizedConfiguration via its methods:

void SetGroupIdFunction(SetGroupIdFunctionType setGroupIdFunction);
void GetGroupIdFunction(GetGroupIdFunctionType getGroupIdFunction);
void SetDownloadGroupFilesFunction(DownloadGroupFilesFunctionType downloadGroupFilesFunction);

This can be done somewhere in agent.cpp either in its constructor or before adding it to the ModuleManager.

These changes will be added in PR #223.

@Nicogp Nicogp force-pushed the enhancement/32-agent-centralized-configuration-extra-changes branch from 1aafdda to dfd0d73 Compare October 16, 2024 21:45
@Nicogp Nicogp linked an issue Oct 17, 2024 that may be closed by this pull request
@Nicogp Nicogp force-pushed the enhancement/32-agent-centralized-configuration-extra-changes branch from dfd0d73 to e6976c1 Compare October 17, 2024 14:09
…cator class to perform group file download requests.
Copy link
Member

@cborla cborla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cborla cborla merged commit 5f72cc2 into master Oct 17, 2024
5 checks passed
@cborla cborla deleted the enhancement/32-agent-centralized-configuration-extra-changes branch October 17, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent centralized: necessary changes to existing modules
4 participants