diff options
Diffstat (limited to 'app/controllers/api/agents/files_controller.rb')
| -rw-r--r-- | app/controllers/api/agents/files_controller.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/api/agents/files_controller.rb b/app/controllers/api/agents/files_controller.rb new file mode 100644 index 0000000..c13eac9 --- /dev/null +++ b/app/controllers/api/agents/files_controller.rb @@ -0,0 +1,20 @@ +module Api + module Agents + class FilesController < ApiController + before_action do + request.format = :json + end + + def show + @agent = Agent.find(params[:agent_id]) + @fingerprint = params[:id] + @file = Disposition.find_by(fingerprint: params[:id]) + publish(EventMessage.new( + agent_id: @agent.id, + event_type: :scanned, + data: params[:data] + )) + end + end + end +end |
