summaryrefslogtreecommitdiff
path: root/app/controllers/api/agents/files_controller.rb
blob: c13eac9e23397121636dbf8a9d44643a95f35d0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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