Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion app/api/v2/handlers/contact_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ def add_routes(self, app: web.Application):
router = app.router
router.add_get('/contacts/{name}', self.get_contact_report)

@aiohttp_apispec.docs(tags=['contacts'])
@aiohttp_apispec.docs(tags=['contacts'],
summary='Retrieve a List of Beacons made by Agents to the specified Contact',
description='Returns a list of beacons made by agents to the specified contact. The response'
' is formatted as a list of dictionaries. The dictionaries have the keys `paw`,'
' `instructions`, and `date`. `paw` being the paw of the agent that made the'
' beacon. `instructions` being a list of strings (commands) executed by the'
' agent since its last beacon. `date` being a UTC date/time string.',
parameters=[{
'in': 'path',
'name': 'name',
'schema': {'type': 'string'},
'required': 'true',
'description': 'Name of the contact to get beacons for, e.g. HTTP, TCP, et cetera.'
}])
async def get_contact_report(self, request: web.Request):
contact_name = request.match_info['name']
report = self._api_manager.get_contact_report(contact_name)
Expand Down