summaryrefslogtreecommitdiff
path: root/app/controllers/agents
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-02-03 22:14:00 -0700
committermo khan <mo@mokhan.ca>2015-02-03 22:14:00 -0700
commit3371919560ef37fac3f59c95ad4cf2f6a472ef57 (patch)
treef158207e234353b33298e640bac0510a9782a3bd /app/controllers/agents
parent4827894034d47962bfc6c51472c9ed2617ebf3a9 (diff)
add endpoint for cloud lookup.
Diffstat (limited to 'app/controllers/agents')
-rw-r--r--app/controllers/agents/files_controller.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/controllers/agents/files_controller.rb b/app/controllers/agents/files_controller.rb
new file mode 100644
index 0000000..9afd766
--- /dev/null
+++ b/app/controllers/agents/files_controller.rb
@@ -0,0 +1,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],
+ data: params
+ })
+ end
+
+ private
+
+ def load_agent
+ Agent.find(params[:agent_id])
+ end
+ end
+end