-
Couldn't load subscription status.
- Fork 810
Closed
Description
Refactor
Component(s) to be refactored
monkey_island.cc.resources.monkey_download.MonkeyDownload
Explanation
There's too much business logic in the MonkeyDownload resource. Additionally, it's not defined according to our REST guidelines. The resource should simply retrieve the binaries from a repository with a simple interface.
Tasks
- Rename
MonkeyDownloadto have a proper collection resource name likeAgentBinaries(0d) - @shreyamalviya - Change the URL for the
AgentBinariesresource to be consistent with our REST guidelines (/api/agent-binaries/<string:os/>) (0d) - @shreyamalviya- Modify Island
- Modify Agent
- Test
- Export
AgentBinariesfrom theresourcespackage (0d) @ilija-lazoroski- Edit
app.pyto use the shorter import
- Edit
- Create an
IAgentBinaryRepositorythat allows the caller to get the Linux or Windows binary. It should have functions likeget_linux_binary() -> typing.BinaryIO. (0d) - Construct a concrete
AgentBinaryRepositorythat utilizes anIFileRepository. (0d) @ilija-lazoroski- Construct an
LocalStorageFileRepositoryjust for theAgentBinaryRepositoryto use. Do not add theLocalStorageFileRepositoryto the DI container - Construct the
AgentBinaryRepositorywith theLocalStorageFileRepositoryin the composition root. - Add the
AgentBinaryRepositoryto the DI container
- Construct an
- Log the executible hashes when the
AgentBinaryRepositoryis constructed. This should be done when the system is initialized, not the resource or repository. (0d) @ilija-lazoroski - Refactor the
AgentBinariesresource to use the concreteAgentBinaryRepository(0d) @ilija-lazoroski