summaryrefslogtreecommitdiff
path: root/app/controllers/agents/files_controller.rb
blob: 1d711e28ef74d667633bb149cabcee93729a0bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Agents
  class FilesController < ApplicationController
    before_action :load_agent
    before_action do
      request.format = :json
    end

    def index
    end

    def show
      @file = Disposition.find_by(fingerprint: params[:id])
      Publisher.publish("queries", {
        fingerprint: params[:id],
        payload: params[:payload]
      })
    end

    private

    def load_agent
      Agent.find(params[:agent_id])
    end
  end
end