summaryrefslogtreecommitdiff
path: root/app/controllers/api/agents/files_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/agents/files_controller.rb')
-rw-r--r--app/controllers/api/agents/files_controller.rb21
1 files changed, 21 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..fd7410c
--- /dev/null
+++ b/app/controllers/api/agents/files_controller.rb
@@ -0,0 +1,21 @@
+module Api
+ module Agents
+ class FilesController < ApplicationController
+ 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])
+ message = {
+ agent_id: params[:id],
+ type: :lookup,
+ data: params[:data]
+ }
+ Publisher.publish("events.scanned.#{@agent.id}", message)
+ end
+ end
+ end
+end