-
Notifications
You must be signed in to change notification settings - Fork 807
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
MonkeyDownload
to have a proper collection resource name likeAgentBinaries
(0d) - @shreyamalviya - Change the URL for the
AgentBinaries
resource to be consistent with our REST guidelines (/api/agent-binaries/<string:os/>
) (0d) - @shreyamalviya- Modify Island
- Modify Agent
- Test
- Export
AgentBinaries
from theresources
package (0d) @ilija-lazoroski- Edit
app.py
to use the shorter import
- Edit
- Create an
IAgentBinaryRepository
that allows the caller to get the Linux or Windows binary. It should have functions likeget_linux_binary() -> typing.BinaryIO
. (0d) - Construct a concrete
AgentBinaryRepository
that utilizes anIFileRepository
. (0d) @ilija-lazoroski- Construct an
LocalStorageFileRepository
just for theAgentBinaryRepository
to use. Do not add theLocalStorageFileRepository
to the DI container - Construct the
AgentBinaryRepository
with theLocalStorageFileRepository
in the composition root. - Add the
AgentBinaryRepository
to the DI container
- Construct an
- Log the executible hashes when the
AgentBinaryRepository
is constructed. This should be done when the system is initialized, not the resource or repository. (0d) @ilija-lazoroski - Refactor the
AgentBinaries
resource to use the concreteAgentBinaryRepository
(0d) @ilija-lazoroski